:root {
  --bg: #fbf6ec;
  --bg-soft: #fffaf1;
  --paper: rgba(255, 253, 248, 0.92);
  --panel: #fffdf8;
  --ink: #151a20;
  --ink-soft: #27313b;
  --muted: #65717f;
  --line: rgba(21, 26, 32, 0.13);
  --line-strong: rgba(21, 26, 32, 0.2);
  --accent: #ff642e;
  --accent-2: #ff8a52;
  --green: #12a35a;
  --blue: #2e8cff;
  --nav: #15191e;
  --nav-line: rgba(255, 255, 255, 0.14);
  --shadow: 0 22px 70px rgba(27, 24, 18, 0.12);
  --tight-shadow: 0 12px 34px rgba(27, 24, 18, 0.1);
  --tooltip-bg: #161b21;
  --tooltip-ink: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #101419;
  --bg-soft: #171c22;
  --paper: rgba(24, 29, 35, 0.94);
  --panel: #1b2128;
  --ink: #fff7ec;
  --ink-soft: #f2e8dc;
  --muted: #b7c0ca;
  --line: rgba(255, 247, 236, 0.14);
  --line-strong: rgba(255, 247, 236, 0.22);
  --nav: #090c10;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --tight-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  --tooltip-bg: #fff7ec;
  --tooltip-ink: #151a20;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 100, 46, 0.14), transparent 25rem),
    radial-gradient(circle at 86% 18%, rgba(255, 225, 180, 0.52), transparent 22rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-soft) 62%, #f8efe2 100%);
  font-family: "Space Grotesk", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  min-height: 70px;
  padding: 0 3rem;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 100, 46, 0.12), transparent 24rem),
    linear-gradient(180deg, #191e24 0%, var(--nav) 100%);
  border-bottom: 1px solid rgba(255, 100, 46, 0.32);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
}

.brand-mark {
  color: #fff;
  text-decoration: none;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.brand-mark strong,
.powered-by strong span {
  color: var(--accent);
}

.product-nav {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  height: 70px;
}

.product-nav a,
.upgrade-button,
.account-button,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-weight: 800;
}

.product-nav a {
  position: relative;
  padding: 0 0.35rem;
}

.product-nav a.active,
.product-nav a:hover {
  color: #fff;
}

.product-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
}

.ui-icon {
  width: 1.12rem;
  height: 1.12rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ui-icon [fill="currentColor"] {
  fill: currentColor;
  stroke: none;
}

.product-nav .ui-icon {
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.upgrade-button,
.account-button,
.theme-toggle {
  min-height: 40px;
  padding: 0.62rem 0.9rem;
  border: 1px solid var(--nav-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.upgrade-button:hover,
.account-button:hover,
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.upgrade-button[disabled] {
  cursor: progress;
  opacity: 0.65;
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1rem;
}

.chevron-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.page-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 1.35rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 660px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3.4rem, 5.2vw, 4.55rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.085em;
}

.lede {
  max-width: 660px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  font-weight: 650;
  line-height: 1.45;
}

.hero-art {
  position: relative;
  height: clamp(13.5rem, 19vw, 15.75rem);
  min-height: 0;
  overflow: visible;
}

.truck-illustration {
  width: min(620px, 100%);
  height: auto;
  display: block;
  margin-left: auto;
  object-fit: contain;
}

/* v21.2: crop the transparent PNG box so hero spacing follows the visible truck art. */
.hero-art .truck-illustration {
  transform: translateY(clamp(-2.55rem, -3vw, -1.65rem));
}

.truck-illustration path,
.truck-illustration rect,
.truck-illustration circle {
  vector-effect: non-scaling-stroke;
}

.grass-line,
.sign-post {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.sign-shadow {
  fill: rgba(255, 100, 46, 0.18);
}

.sign-face {
  fill: #fffdf8;
  stroke: var(--ink);
  stroke-width: 2;
}

.call-sign text {
  fill: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 900;
}

.call-sign rect {
  fill: var(--ink);
}

.qr-mark {
  fill: #fffdf8;
}

.ladder,
.van-body-art,
.van-window-art {
  fill: #fffdf8;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.van-body-art {
  fill: rgba(255, 253, 248, 0.76);
  stroke-width: 3.5;
}

.van-stripe-art {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
}

.wheel-art {
  fill: #fffdf8;
  stroke: var(--ink);
  stroke-width: 8;
}

.app-card,
.manage-card,
.lead-band,
.stats-strip {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.7);
  box-shadow: var(--tight-shadow);
}

.app-card {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
  gap: 1.35rem;
  align-items: stretch;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.qr-form,
.preview-panel,
.redirect-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--tight-shadow);
}

.qr-form {
  display: grid;
  gap: 0.86rem;
  padding: 1.35rem;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.3rem;
}

.card-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: white;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 18px rgba(255, 100, 46, 0.25);
}

.card-icon .ui-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.card-icon-muted {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

/* v20.3: keep builder/preview headings aligned and dark-mode muted icons visible. */
:root[data-theme="dark"] .card-icon-muted {
  color: var(--accent);
  background: rgba(255, 100, 46, 0.12);
  border-color: rgba(255, 100, 46, 0.36);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.label-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: max-content;
  max-width: 100%;
}

.field span,
.preview-label {
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.field sup,
.consent-row sup {
  color: var(--accent);
  font-size: 1.1em;
  line-height: 0;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0.76rem 0.88rem;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fffefa;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select {
  background: rgba(255, 255, 255, 0.06);
}

.field input::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 18%);
}

.help-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  cursor: help;
  font: 900 0.74rem / 1 "Space Grotesk", sans-serif;
}

.help-dot::after {
  content: attr(data-help);
  position: absolute;
  z-index: 15;
  left: calc(100% + 0.8rem);
  top: 50%;
  width: min(260px, 72vw);
  padding: 0.85rem 0.95rem;
  color: var(--tooltip-ink);
  background: var(--tooltip-bg);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.42;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.help-dot::before {
  content: "";
  position: absolute;
  z-index: 16;
  left: calc(100% + 0.45rem);
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--tooltip-bg);
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%) rotate(45deg);
  transition: opacity 140ms ease, transform 140ms ease;
}

.help-dot.is-open::after,
.help-dot:focus-visible::after,
.help-dot.is-open::before,
.help-dot:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.help-dot.is-open::before,
.help-dot:focus-visible::before {
  transform: translate(0, -50%) rotate(45deg);
}

.optional-panel {
  padding: 1rem 1rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 249, 239, 0.72));
}

:root[data-theme="dark"] .optional-panel {
  background: rgba(255, 255, 255, 0.04);
}

.optional-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.optional-grid {
  display: grid;
  gap: 0.78rem;
  grid-template-columns: 1fr;
  margin-top: 0.8rem;
}

.optional-grid > .field {
  max-width: none;
}

.button-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.feature-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.68rem 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.44);
}

.feature-check input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0.15rem 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fffefa;
}

.feature-check input:checked {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2));
}

.feature-check input:checked::after {
  content: "✓";
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.feature-check strong {
  display: block;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.feature-check small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.85rem;
  font-weight: 650;
}

.field-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 700;
}

.captcha-slot {
  display: grid;
  justify-self: start;
  min-height: 78px;
  width: min(304px, 100%);
  overflow: hidden;
  transform: scale(0.82);
  transform-origin: left top;
  margin-bottom: -14px;
}

.captcha-slot:empty {
  min-height: 0;
  margin: 0;
}

.microcopy,
.requirement-note,
.status-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.actions,
.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.primary-button,
.ghost-button,
.text-button,
.download-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.1rem;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 900;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.primary-button,
.ghost-button,
.text-button {
  cursor: pointer;
}

.primary-button {
  color: white;
  border: 0;
  background: linear-gradient(135deg, var(--accent), #ff7c3d);
  box-shadow: 0 12px 22px rgba(255, 100, 46, 0.25);
}

.ghost-button,
.text-button,
.download-link {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.58);
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover,
.download-link:hover,
.preview-pill:hover {
  transform: translateY(-1px);
}

.preview-panel {
  display: grid;
  gap: 0.86rem;
  align-content: start;
  padding: 1.35rem;
  overflow: hidden;
}

.preview-stage {
  display: grid;
  grid-template-columns: minmax(238px, 0.86fr) minmax(190px, 0.64fr);
  gap: 1.25rem;
  align-items: center;
}

.phone-shell {
  position: relative;
  width: min(278px, 100%);
  min-height: 430px;
  justify-self: center;
  padding: 16px;
  border: 8px solid #0c0f12;
  border-radius: 44px;
  background: #0c0f12;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.2);
}

.phone-notch {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 50%;
  width: 104px;
  height: 24px;
  border-radius: 0 0 16px 16px;
  background: #0c0f12;
  transform: translateX(-50%);
}

.customer-preview {
  min-height: 392px;
  display: grid;
  align-content: center;
  padding: 2.2rem 1.35rem;
  border-radius: 31px;
  background:
    radial-gradient(circle at top, rgba(255, 100, 46, 0.07), transparent 45%),
    #fffdf8;
  color: #151a20;
}

.customer-preview h2 {
  margin: 0 0 0.4rem;
  color: #151a20;
  font-size: 1.04rem;
  font-weight: 800;
  text-align: center;
}

.customer-preview p {
  margin: 0;
  color: #616b75;
  text-align: center;
}

.customer-actions {
  display: grid;
  gap: 0.8rem;
  margin: 1.65rem 0;
}

.customer-action {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.85rem 1rem;
  color: #151a20;
  text-decoration: none;
  border-radius: 13px;
  background: #f0e8dc;
  font-weight: 900;
}

.customer-action-primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff7c3d);
}

.customer-action .action-icon {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  color: currentColor;
  font-size: 1rem;
  font-weight: 950;
  text-align: center;
}

.customer-action .action-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.google-icon {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.08em;
}

.powered-by {
  align-self: end;
  font-size: 0.76rem;
}

.qr-side {
  display: grid;
  gap: 0.62rem;
  align-content: center;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 164px;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffdf8;
}

.qr-stack {
  display: grid;
  place-items: center;
  width: 100%;
}

#qr-image {
  width: min(100%, 180px);
  height: auto;
  border-radius: 8px;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  width: min(100%, 150px);
  color: #151a20;
  text-align: center;
}

.qr-placeholder-art {
  width: 132px;
  height: 132px;
  display: block;
  border-radius: 12px;
}

.qr-placeholder strong {
  padding: 0.26rem 0.55rem;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 999px;
  font-size: 0.76rem;
}

.compact-size {
  margin: 0;
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.preview-pill-icon {
  color: var(--accent);
}

.preview-copy {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.52);
}

.preview-copy.is-compact {
  margin-top: 0.2rem;
}

.preview-copy.is-compact + .secondary-actions {
  display: none;
}

:root[data-theme="dark"] .preview-copy,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .text-button,
:root[data-theme="dark"] .download-link {
  background: rgba(255, 255, 255, 0.05);
}

.result-link {
  margin: 0.3rem 0 0.7rem;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
  word-break: break-word;
}

.edit-key-panel {
  margin-top: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent), transparent 92%);
}

.disabled {
  opacity: 0.48;
  pointer-events: none;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: 1.15rem;
  padding: 0.9rem;
  background: var(--paper);
}

.stats-strip article {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.9rem;
  align-items: center;
  min-height: 78px;
  padding: 0.62rem 0.9rem;
  border-right: 1px solid var(--line);
}

.stats-strip article:last-child {
  border-right: 0;
}

.stat-icon {
  grid-row: span 3;
  display: grid !important;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(255, 100, 46, 0.1);
}

.stat-icon .ui-icon {
  width: 1.72rem;
  height: 1.72rem;
}

.stat-icon-orange {
  color: var(--accent);
  background: rgba(255, 100, 46, 0.12);
}

.stat-icon-green {
  color: #15ad4a;
  background: rgba(21, 173, 74, 0.11);
}

.stat-icon-blue {
  color: #1f75ff;
  background: rgba(31, 117, 255, 0.11);
}

.stat-icon-ink {
  color: var(--ink);
  background: rgba(21, 26, 32, 0.08);
}

.stats-strip span:not(.stat-icon) {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.stats-strip strong {
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1;
}

.stats-strip em {
  color: var(--green);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 850;
}

.manage-card,
.lead-band {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(360px, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--paper);
}

.manage-copy h2,
.lead-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.manage-copy p:last-child,
.lead-copy p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.manage-form,
.lead-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.manage-form .field:first-child,
.manage-form .primary-button,
.manage-form .status-message,
.lead-form .primary-button,
.lead-form .status-message,
.lead-form .captcha-slot,
.lead-form .consent-row,
.requirement-note {
  grid-column: 1 / -1;
}

.consent-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.consent-row strong {
  display: block;
  color: var(--ink);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a,
.site-footer span {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.help-bubble {
  position: fixed;
  right: 1.7rem;
  bottom: 1.4rem;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 1.2rem;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  background: var(--nav);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  font-weight: 900;
}

.help-bubble span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.policy-shell,
.analytics-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.policy-shell {
  width: min(820px, calc(100% - 2rem));
}

.policy-shell h1,
.analytics-shell h1 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.075em;
}

.policy-shell h2 {
  margin: 2rem 0 0.5rem;
}

.policy-shell p,
.policy-shell li {
  color: var(--muted);
  line-height: 1.7;
}

.policy-shell a {
  color: var(--accent);
  font-weight: 900;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0;
}

.analytics-stat,
.analytics-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--tight-shadow);
}

.analytics-stat {
  padding: 1rem;
}

.analytics-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-stat strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: 2rem;
}

.analytics-section {
  margin-top: 1rem;
  padding: 1rem;
  overflow-x: auto;
}

.analytics-section h2 {
  margin: 0 0 0.8rem;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.analytics-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-shell {
  width: min(1080px, calc(100% - 2rem));
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.profile-card {
  min-height: 210px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--tight-shadow);
}

.profile-card h2 {
  margin: 1rem 0 0.5rem;
}

.auth-body,
.portal-body {
  background: #f4f6fb;
}

.auth-shell {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(420px, 1fr);
  gap: 1.4rem;
  align-items: center;
  margin: 0 auto;
  padding: 2rem 0;
}

.auth-card,
.auth-preview,
.portal-link-card,
.portal-empty {
  border: 1px solid #dde4ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(24, 36, 56, 0.08);
}

.auth-card {
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.3rem;
  color: #1f2a3c;
  text-decoration: none;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.auth-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.auth-logo span span {
  color: var(--accent);
}

.auth-card h1,
.auth-preview h2 {
  margin: 0 0 1rem;
  color: #1f2a3c;
  font-size: clamp(2.2rem, 4.2vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.075em;
}

.auth-card p,
.auth-preview p {
  color: #657187;
  line-height: 1.65;
}

.google-signin {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.2rem 0;
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  background: #fff;
  color: #1f2a3c;
  text-decoration: none;
  font-weight: 900;
}

.google-signin span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #1f6feb;
  font-weight: 900;
}

.google-signin:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: #8c98aa;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #dce3ee;
}

.auth-form {
  margin-top: 1rem;
}

.auth-form .primary-button {
  width: 100%;
}

.auth-form .field {
  margin-bottom: 0.65rem;
}

.auth-status {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: #657187;
  font-weight: 800;
}

.auth-status[data-tone="success"] {
  color: var(--green);
}

.auth-status[data-tone="warning"] {
  color: #a86400;
}

.auth-status[data-tone="error"] {
  color: #cf2d22;
}

.email-confirm-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.58);
}

.email-confirm-card {
  width: min(460px, 100%);
  padding: 1.25rem;
  border: 1px solid #d8e0ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.email-confirm-card h2 {
  margin: 0 0 0.55rem;
  color: #1f2a3c;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: -0.06em;
}

.email-confirm-card p:not(.eyebrow) {
  color: #657187;
  line-height: 1.55;
}

.email-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}

.auth-preview {
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.6rem);
  background:
    radial-gradient(circle at 70% 10%, rgba(255, 100, 46, 0.14), transparent 20rem),
    linear-gradient(145deg, #ffffff 0%, #f7f9fd 100%);
}

.auth-preview-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1.2rem 0;
}

.auth-preview-list span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  color: #263247;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 850;
}

.portal-body {
  display: block;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 100, 46, 0.14), transparent 25rem),
    radial-gradient(circle at 86% 18%, rgba(255, 225, 180, 0.52), transparent 22rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-soft) 62%, #f8efe2 100%);
  min-height: 100vh;
}

.portal-controls .ui-icon,
.portal-link-actions .ui-icon,
.portal-user .ui-icon,
.portal-toolbar-action .ui-icon {
  width: 1rem;
  height: 1rem;
}

.portal-main {
  min-width: 0;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.4rem clamp(1rem, 4vw, 4rem);
}

.portal-header,
.portal-controls,
.portal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.portal-header {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.portal-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.06em;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-weight: 850;
}

.portal-user a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
}

.portal-controls {
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid #d8e0ec;
}

.portal-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.portal-search input,
.portal-controls button,
.portal-toolbar select {
  min-height: 40px;
  border: 1px solid #ccd6e6;
  border-radius: 4px;
  background: #fff;
  color: #263247;
  font-weight: 750;
}

.portal-controls button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-search input {
  width: min(280px, 70vw);
  padding: 0 0.9rem;
}

.portal-controls button,
.portal-toolbar select {
  padding: 0 0.9rem;
}

.portal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  margin-left: auto;
  padding: 0 1rem;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(255, 100, 46, 0.28);
}

.portal-primary:hover {
  background: var(--accent-2);
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 1.1rem 0;
  overflow: hidden;
  border: 1px solid #dce3ee;
  border-radius: 14px;
  background: #dce3ee;
}

.portal-stats article {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.8rem;
  align-items: center;
  min-height: 88px;
  padding: 0.9rem;
  background: #fff;
}

.portal-stats .stat-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
}

.portal-stats span {
  color: #5b6880;
  font-size: 0.82rem;
  font-weight: 900;
}

.portal-stats strong {
  color: #111827;
  font-size: 1.8rem;
  line-height: 1;
}

.portal-toolbar {
  margin: 0.8rem 0;
  color: #5b6880;
  font-weight: 850;
}

.portal-toolbar select {
  margin-left: auto;
}

.locked-action {
  color: #92a0b7;
}

.portal-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 100, 46, 0.22);
  color: #7a3417;
  background: rgba(255, 100, 46, 0.08);
  font-weight: 700;
}

.portal-notice strong {
  color: var(--accent);
}

.portal-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(420px, 1fr);
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #dce3ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(24, 36, 56, 0.06);
}

.portal-workbench-copy h2 {
  margin: 0;
  color: #263247;
  font-size: clamp(1.8rem, 3vw, 2.9rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.portal-workbench-copy p:last-child {
  color: #5b6880;
  line-height: 1.55;
}

.portal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.portal-form .field-wide,
.portal-form .primary-button,
.portal-form .status-message {
  grid-column: 1 / -1;
}

.portal-form .field span {
  color: #263247;
}

.portal-form .field input,
.portal-form .field select {
  background: #fff;
}

.status-message[data-tone="success"] {
  color: var(--green);
  font-weight: 850;
}

.status-message[data-tone="error"] {
  color: #cf2d22;
  font-weight: 850;
}

.portal-list {
  display: grid;
  gap: 0.85rem;
}

.portal-link-card {
  display: block;
  padding: 1rem;
}

.portal-link-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
}

.portal-link-card.compact {
  display: grid;
  grid-template-columns: auto 1fr;
  margin-top: 1rem;
}

.portal-link-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--accent);
  background: #fff0e9;
  font-size: 0.8rem;
  font-weight: 900;
}

.portal-link-content h2 {
  margin: 0 0 0.35rem;
  color: #263247;
  font-size: 1.2rem;
}

.portal-link-content a,
.portal-link-card.compact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 900;
}

.portal-link-content a:hover,
.portal-link-card.compact a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.portal-link-content p,
.portal-link-card.compact small {
  margin: 0.5rem 0;
  color: #4d5c73;
}

.portal-link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #5b6880;
  font-size: 0.85rem;
  font-weight: 750;
}

.portal-link-actions {
  display: flex;
  gap: 0.55rem;
}

.portal-link-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: #263247;
  text-decoration: none;
  font-weight: 900;
}

.portal-edit-panel {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid #dce3ee;
}

.portal-edit-panel summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
}

.portal-edit-panel summary:hover {
  color: var(--accent-2);
}

.portal-edit-form {
  margin-top: 0.85rem;
}

.portal-empty {
  padding: 2rem;
}

.portal-empty h2 {
  margin: 0 0 0.6rem;
  color: #263247;
}

.portal-empty p {
  color: #5b6880;
  line-height: 1.6;
}

.dashboard-main {
  max-width: 1180px;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.dashboard-action-card,
.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(24, 36, 56, 0.06);
}

.dashboard-action-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.85rem;
  align-items: center;
  min-height: 118px;
  padding: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.dashboard-action-card .stat-icon {
  grid-row: span 2;
}

.dashboard-action-card strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.dashboard-action-card span:last-child {
  color: var(--ink-soft);
  line-height: 1.45;
}

.dashboard-action-card:hover {
  border-color: rgba(255, 100, 46, 0.55);
  transform: translateY(-1px);
}

.dashboard-action-primary {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 100, 46, 0.16), transparent 15rem),
    var(--panel);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.dashboard-panel {
  padding: 1rem;
}

.dashboard-empty {
  margin-top: 1rem;
  padding: 1.2rem;
}

.dashboard-empty h3 {
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.dashboard-activity-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.dashboard-activity-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.dashboard-activity-list strong {
  color: var(--accent);
}

.dashboard-activity-list span {
  color: var(--ink);
  font-weight: 800;
}

.dashboard-activity-list small {
  color: var(--ink-soft);
  font-weight: 800;
}

@media (max-width: 860px) {
  .dashboard-actions,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.portal-backend-table {
  margin-top: 1.4rem;
}

.redirect-body {
  min-height: 100svh;
}

.redirect-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 100, 46, 0.16), transparent 32rem),
    linear-gradient(180deg, #fff4e8 0%, #fffdf8 72%);
}

.redirect-phone-card {
  width: min(430px, calc(100vw - 2rem));
  padding: 1.3rem;
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.86);
}

.scan-phone-shell {
  position: relative;
  width: min(318px, 100%);
  min-height: 520px;
  margin: 0 auto;
  padding: 18px;
  border: 8px solid #0c0f12;
  border-radius: 46px;
  background: #0c0f12;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    0 22px 44px rgba(0, 0, 0, 0.22);
}

.redirect-customer-preview {
  min-height: 468px;
  padding: 3.3rem 1.35rem 1.45rem;
}

.redirect-customer-preview .eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-align: center;
}

.redirect-business-name {
  margin: 0 0 0.55rem;
  color: #151a20;
  font-size: 1.08rem;
  line-height: 1.1;
  text-align: center;
}

.redirect-customer-preview .customer-action-primary strong {
  color: #fff;
}

.redirect-small-note {
  margin: 1rem auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 750;
}

@media (max-width: 1120px) {
  .app-topbar {
    grid-template-columns: 1fr auto;
    padding: 0.9rem 1rem;
  }

  .product-nav {
    grid-column: 1 / -1;
    order: 3;
    height: auto;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .hero,
  .app-card,
  .manage-card,
  .lead-band {
    grid-template-columns: 1fr;
  }

  .account-button {
    display: none;
  }

  .hero-art {
    min-height: 190px;
  }

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

  .stats-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 980px) {
  .auth-shell,
  .portal-body {
    display: block;
  }

  .auth-preview {
    min-height: auto;
    margin-top: 1rem;
  }

  .portal-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #d8e0ec;
  }

  .portal-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .auth-shell {
    width: min(100% - 1rem, 560px);
    padding: 0.5rem 0;
  }

  .auth-preview-list,
  .portal-nav,
  .portal-stats,
  .portal-workbench,
  .portal-link-row,
  .portal-form {
    grid-template-columns: 1fr;
  }

  .email-confirm-actions {
    grid-template-columns: 1fr;
  }

  .portal-main {
    padding: 1rem;
  }

  .portal-header,
  .portal-controls,
  .portal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-primary,
  .portal-toolbar select {
    width: 100%;
    margin-left: 0;
  }

  .portal-link-actions {
    justify-content: flex-start;
  }

  .redirect-body {
    overflow: hidden;
  }

  .redirect-shell {
    height: 100svh;
    min-height: 100svh;
    padding: 0.45rem;
    overflow: hidden;
  }

  .redirect-phone-card {
    width: min(100%, 390px);
    max-height: calc(100svh - 0.9rem);
    padding: 0.65rem;
    border-radius: 24px;
    overflow: hidden;
  }

  .scan-phone-shell {
    width: min(100%, 310px);
    min-height: auto;
    padding: 10px;
    border-width: 6px;
    border-radius: 36px;
  }

  .redirect-customer-preview {
    min-height: auto;
    padding: 2.35rem 0.86rem 0.85rem;
    border-radius: 27px;
  }

  .redirect-customer-preview .eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
  }

  .redirect-business-name {
    margin-bottom: 0.35rem;
    font-size: 1rem;
  }

  .redirect-customer-preview p {
    font-size: 0.86rem;
    line-height: 1.3;
  }

  .redirect-customer-preview .customer-actions {
    gap: 0.45rem;
    margin: 0.75rem 0;
  }

  .redirect-customer-preview .customer-action {
    grid-template-columns: 22px 1fr;
    min-height: 42px;
    padding: 0.5rem 0.72rem;
    border-radius: 12px;
  }

  .redirect-customer-preview .customer-action strong {
    font-size: 0.9rem;
    line-height: 1.08;
  }

  .redirect-customer-preview .action-icon svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .redirect-customer-preview .powered-by {
    font-size: 0.68rem;
  }

  .redirect-small-note {
    margin-top: 0.45rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    position: relative;
    grid-template-columns: auto auto;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.65rem;
  }

  .brand-mark {
    font-size: 1.65rem;
  }

  .product-nav {
    width: 100%;
    gap: 0.35rem;
    justify-content: space-between;
    overflow: visible;
    padding: 0.25rem 0 0;
  }

  .product-nav a {
    flex: 1 1 0;
    justify-content: center;
    min-height: 42px;
    padding: 0.35rem 0.2rem;
    gap: 0.28rem;
    font-size: 0.86rem;
    line-height: 1;
    white-space: nowrap;
  }

  .product-nav a[href="#settings"] {
    display: none;
  }

  .topbar-actions {
    gap: 0.45rem;
    justify-self: end;
  }

  .upgrade-button,
  .account-button,
  .theme-toggle {
    padding: 0.55rem 0.65rem;
  }

  #theme-toggle-text {
    display: none;
  }

  .theme-toggle {
    min-width: 42px;
    justify-content: center;
  }

  .page-shell {
    width: min(100% - 1rem, 1280px);
    padding-top: 1.4rem;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 4rem);
  }

  .hero-art {
    display: none;
  }

  .qr-form,
  .preview-panel,
  .manage-card,
  .lead-band,
  .stats-strip {
    padding: 1rem;
  }

  .optional-grid,
  .button-options,
  .preview-stage,
  .manage-form,
  .lead-form,
  .stats-strip {
    grid-template-columns: 1fr;
  }

  .optional-grid > .field {
    max-width: none;
  }

  .phone-shell {
    min-height: auto;
  }

  .customer-preview {
    min-height: 360px;
  }

  .stats-strip article {
    border-bottom: 1px solid var(--line);
  }

  .help-dot::after {
    left: 50%;
    top: auto;
    bottom: calc(100% + 0.65rem);
    transform: translate(-50%, 8px);
  }

  .help-dot::before {
    left: 50%;
    top: auto;
    bottom: calc(100% + 0.38rem);
    transform: translate(-50%, 8px) rotate(45deg);
  }

  .help-dot.is-open::after,
  .help-dot:focus-visible::after {
    transform: translate(-50%, 0);
  }

  .help-dot.is-open::before,
  .help-dot:focus-visible::before {
    transform: translate(-50%, 0) rotate(45deg);
  }

  .help-bubble {
    right: 1rem;
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    width: 48px;
    min-height: 48px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .help-bubble span {
    width: 24px;
    height: 24px;
    font-size: 0.95rem;
  }

  .feature-check input,
  .consent-row input[type="checkbox"] {
    width: 1.45rem;
    height: 1.45rem;
    min-width: 1.45rem;
  }
}

/* ============================================================
   v17 portal nav unification + brand color cleanup
   ============================================================ */

/* Show the active email in the top-bar account button */
.account-button .account-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.account-menu {
  position: relative;
}

.account-menu .account-button {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.62rem 0.9rem;
  min-height: 40px;
  border-radius: 9px;
  color: #fff;
}

.account-menu .account-button:hover,
.account-menu .account-button[aria-expanded="true"] {
  background: rgba(255, 100, 46, 0.18);
  border-color: rgba(255, 100, 46, 0.55);
}

.account-menu .chevron-icon {
  transition: transform 160ms ease;
}

.account-menu .account-button[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 248px;
  padding: 0.5rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 50;
}

.account-dropdown-head {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.3rem;
}

.account-dropdown-head strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.account-dropdown-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.account-dropdown-head small {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  text-align: left;
}

.account-dropdown-item:hover {
  background: rgba(255, 100, 46, 0.1);
  color: var(--accent);
}

.account-dropdown-item .ui-icon {
  width: 1rem;
  height: 1rem;
}

.dropdown-tag {
  margin-left: auto;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(46, 140, 255, 0.14);
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.account-dropdown-soon {
  opacity: 0.78;
}

/* "Coming soon" treatment for nav items not yet built */
.product-nav a.nav-soon {
  position: relative;
  opacity: 0.65;
}

.product-nav a.nav-soon::after {
  content: attr(data-soon);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 0.32rem 0.6rem;
  border-radius: 6px;
  background: var(--tooltip-bg);
  color: var(--tooltip-ink);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.product-nav a.nav-soon:hover::after,
.product-nav a.nav-soon:focus-visible::after {
  opacity: 1;
}

/* Portal toolbar: Export CSV + counter */
.portal-toolbar-count {
  color: var(--muted);
  font-weight: 800;
}

.portal-toolbar-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 850;
}

.portal-toolbar-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* vCard button on portal cards */
.portal-link-actions a {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.portal-link-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* QR preview: reserve space so generating the QR doesn't shift layout (+20px padding) */
.qr-frame {
  min-height: 200px;
  padding: 1.05rem;
}

.qr-stack {
  min-height: 168px;
}

.qr-side {
  padding-bottom: 1.25rem;
  scroll-margin-top: 90px;
}

#qr-form,
#dashboard,
#portal-create,
#portal-list {
  scroll-margin-top: 90px;
}

/* Portal header gets some breathing room under the top bar */
.portal-body .portal-header {
  padding-top: 0.4rem;
}

/* Portal cards sit on the cream background, brighten their surface */
.portal-link-card,
.portal-empty {
  background: var(--panel);
  border-color: var(--line);
}

.portal-workbench {
  background: var(--panel);
  border-color: var(--line);
}

/* Portal stats: white tiles with subtle border on cream */
.portal-stats {
  border-color: var(--line);
  background: var(--line);
}

.portal-stats article {
  background: var(--panel);
}

/* Portal search/controls inputs blend onto cream */
.portal-search input,
.portal-controls button,
.portal-toolbar select {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink-soft);
}

/* === v20: Plan badges + Settings page === */

.plan-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-badge-paid {
  background: rgba(255, 100, 46, 0.14);
  color: var(--accent);
}

.plan-badge-free {
  background: rgba(116, 129, 148, 0.16);
  color: #5f6d7e;
}

.settings-main {
  max-width: 880px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.settings-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.8rem;
  margin-top: 1.4rem;
  box-shadow: 0 6px 24px rgba(23, 29, 35, 0.04);
}

.settings-section-head {
  margin-bottom: 1.2rem;
}

.settings-section-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.settings-section-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.settings-plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.settings-plan-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.settings-invite-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem 1rem;
  align-items: end;
}

.settings-invite-form .field-wide {
  grid-column: 1 / 2;
}

.settings-invite-form button {
  align-self: end;
  justify-self: start;
}

.settings-invite-form .status-message {
  grid-column: 1 / -1;
}

.settings-list-heading {
  margin: 1.6rem 0 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.settings-member-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.settings-member > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-member strong {
  font-size: 0.98rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-member span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.settings-member .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.settings-member .ghost-button:hover {
  background: rgba(255, 100, 46, 0.07);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .settings-section {
    padding: 1.2rem 1rem;
  }
  .settings-invite-form {
    grid-template-columns: 1fr;
  }
  .settings-invite-form button {
    width: 100%;
    justify-content: center;
  }
}

/* === v20.5: Branded truck image (wordmark + QR baked into PNG) === */
/* Old CSS overlay (.van-brand, .van-wordmark, .van-tagline, .van-qr) removed —
   branding is now part of the qr2calltruck.png asset. Keeping just the
   illustration sizing for compatibility. */

/* === v20.2: Strip nested phone frame on mobile call/redirect page === */
@media (max-width: 640px) {
  .redirect-shell {
    padding: 0;
    background:
      radial-gradient(circle at 50% -10%, rgba(255, 100, 46, 0.18), transparent 28rem),
      linear-gradient(180deg, #fff4e8 0%, #fffdf8 65%);
  }

  .redirect-phone-card {
    width: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    box-shadow: none;
    border: 0;
  }

  .scan-phone-shell {
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 1.4rem 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone-notch {
    display: none;
  }

  .redirect-customer-preview {
    min-height: auto;
    padding: 1rem 0.25rem 1.25rem;
    border-radius: 0;
    background: transparent;
  }

  .redirect-customer-preview .eyebrow {
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
    letter-spacing: 0.16em;
  }

  .redirect-business-name {
    margin-bottom: 0.7rem;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.02em;
  }

  .redirect-customer-preview > p {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--muted);
  }

  .redirect-customer-preview .customer-actions {
    gap: 0.7rem;
    margin: 1.1rem 0 0.85rem;
  }

  .redirect-customer-preview .customer-action {
    grid-template-columns: 28px 1fr;
    min-height: 60px;
    padding: 0.9rem 1.1rem;
    border-radius: 16px;
  }

  .redirect-customer-preview .customer-action strong {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .redirect-customer-preview .customer-action-primary strong {
    font-size: 1.05rem;
  }

  .redirect-customer-preview .action-icon svg {
    width: 1.3rem;
    height: 1.3rem;
  }

  .redirect-customer-preview .powered-by {
    margin-top: 1rem;
    font-size: 0.78rem;
  }

  .redirect-small-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    padding: 0 1rem;
  }
}

/* === v21: Tracked Calls page === */

.calls-main {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.calls-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.4rem 0 0.6rem;
}

.calls-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.calls-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.calls-filter span {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.calls-filter input,
.calls-filter select {
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.92rem;
}

.calls-filter-apply {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
}

.calls-filter-apply:hover {
  filter: brightness(1.05);
}

.calls-filter-clear {
  align-self: center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}

.calls-filter-clear:hover {
  text-decoration: underline;
}

.calls-filter-summary {
  margin: 0.4rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.calls-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(23, 29, 35, 0.04);
}

.calls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.calls-table thead {
  background: var(--panel);
}

.calls-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.calls-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

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

.calls-table tbody tr:hover {
  background: rgba(255, 100, 46, 0.05);
}

.calls-table a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.calls-table a:hover {
  text-decoration: underline;
}

.calls-status {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(116, 129, 148, 0.16);
  color: #5f6d7e;
}

.calls-status-completed,
.calls-status-received,
.calls-status-answered {
  background: rgba(18, 163, 90, 0.16);
  color: #0c7c43;
}

.calls-status-missed,
.calls-status-no-answer,
.calls-status-failed {
  background: rgba(255, 100, 46, 0.16);
  color: var(--accent);
}

.calls-empty {
  margin-top: 1.4rem;
  padding: 2rem 1.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--ink-soft);
}

.calls-empty h2 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 1.25rem;
}

.calls-empty p {
  margin: 0;
}

.calls-setup-card {
  text-align: left;
}

.calls-empty-head {
  text-align: left;
  margin-bottom: 1.4rem;
}

.calls-empty-head p {
  color: var(--ink-soft);
  max-width: 720px;
}

.calls-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.calls-setup-step {
  position: relative;
  padding: 1.1rem 1.1rem 1.1rem 3.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.calls-setup-num {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.95rem;
}

.calls-setup-step h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  color: var(--ink);
}

.calls-setup-step p {
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.calls-setup-step p:last-child {
  margin-bottom: 0;
}

.calls-setup-code {
  display: block;
  padding: 0.55rem 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  margin: 0.45rem 0;
}

.calls-setup-note {
  font-size: 0.85rem !important;
}

.calls-setup-foot {
  margin-top: 0.6rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.calls-setup-foot a {
  color: var(--accent);
  font-weight: 700;
}

.calls-setup-collapsed {
  margin-top: 1.6rem;
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.calls-setup-collapsed summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
  list-style: none;
}

.calls-setup-collapsed summary::-webkit-details-marker {
  display: none;
}

.calls-setup-collapsed[open] summary {
  margin-bottom: 0.9rem;
}

@media (max-width: 720px) {
  .calls-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .calls-filters {
    width: 100%;
  }

  .calls-filter {
    flex: 1 1 calc(50% - 0.4rem);
  }

  .calls-table {
    font-size: 0.82rem;
  }

  .calls-table th,
  .calls-table td {
    padding: 0.6rem 0.7rem;
  }
}
