/* Quoda component + layout styles. Token-only — zero raw hex.
   Exception: the QR preview surface forces #FFFFFF / dark modules for
   scannability (mandated by the design guideline, T6). Motion is opt-in:
   every transition is wrapped in @media (prefers-reduced-motion: no-preference).
   The focus ring lives in base.css (:focus-visible) and is never overridden. */

/* ============================================================ Layout shell */

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding: var(--space-32) var(--space-24);
}

.stack > * + * {
  margin-top: var(--space-16);
}

.dash-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
}

/* ================================================================= Button */

.btn {
  /* layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: 44px; /* touch target */
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  /* type */
  font-size: var(--fs-ui-label);
  font-weight: var(--fw-ui-label);
  line-height: var(--lh-ui-label);
  letter-spacing: var(--ls-ui-label);
  /* behaviour */
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  color: var(--color-text-primary);
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-16) var(--space-32);
  font-size: var(--fs-body);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.btn-label {
  display: inline-flex;
  align-items: center;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* primary — the single accent control of a viewport */
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-color: var(--color-accent);
}

/* secondary — surface-2 + border */
.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

/* ghost — text only */
.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  border-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition:
      background-color var(--dur-micro-in) var(--ease-enter),
      border-color var(--dur-micro-in) var(--ease-enter),
      transform 80ms linear;
  }
  /* press: translateY(1px) 80ms linear */
  .btn:active {
    transform: translateY(1px);
  }
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}
.btn-secondary:hover {
  background: var(--color-surface-3);
}
.btn-ghost:hover {
  background: var(--color-surface-2);
}

/* ============================================================ Form fields */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.field-label {
  font-size: var(--fs-body);
  font-weight: var(--fw-ui-label);
  letter-spacing: var(--ls-body);
  color: var(--color-text-primary);
}

.field-required {
  color: var(--color-accent);
}

.field-hint {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--color-text-secondary);
}

.field-error {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  /* accent-derived danger: deeper, no second hue */
  color: var(--color-accent-hover);
  font-weight: var(--fw-ui-label);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px; /* touch target */
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
}

.textarea {
  min-height: 96px;
  resize: vertical;
  padding-block: var(--space-12);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-tertiary);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-error,
.select-error,
.textarea-error {
  border-color: var(--color-accent-hover);
}

@media (prefers-reduced-motion: no-preference) {
  .input,
  .select,
  .textarea {
    transition: border-color var(--dur-micro-in) var(--ease-enter);
  }
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--color-text-tertiary);
}

/* Select chevron affordance */
.select-wrap {
  position: relative;
  display: flex;
}

.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: var(--space-48);
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: var(--space-16);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  pointer-events: none;
  color: var(--color-text-secondary);
}

/* =================================================================== Card */

.card {
  display: block;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-24);
  color: inherit;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-16);
}

.card-header + .card-body {
  margin-top: var(--space-16);
}

.card-title {
  color: var(--color-text-primary);
}

.card-subtitle {
  margin-top: var(--space-4);
}

.card-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.card-interactive {
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .card-interactive {
    transition:
      box-shadow var(--dur-micro-in) var(--ease-enter),
      transform var(--dur-micro-in) var(--ease-enter),
      border-color var(--dur-micro-in) var(--ease-enter);
  }
  .card-interactive:hover {
    transform: translateY(-2px);
  }
}

.card-interactive:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-text-tertiary);
}

/* ================================================================== Badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  font-size: var(--fs-caption);
  font-weight: var(--fw-ui-label);
  letter-spacing: var(--ls-ui-label);
  line-height: 1;
  white-space: nowrap;
}

.badge-icon {
  display: inline-flex;
  align-items: center;
}

.badge-dot {
  width: var(--space-8);
  height: var(--space-8);
  border-radius: var(--radius-full);
  background: currentColor;
  flex: 0 0 auto;
}

.badge-neutral {
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.badge-accent {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-color: var(--color-accent);
}

/* single-accent: status tones are accent-subtle fills / accent text, no 2nd hue */
.badge-success {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-color: transparent;
}

.badge-warning {
  background: var(--color-surface-3);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.badge-danger {
  background: var(--color-accent-subtle);
  color: var(--color-accent-hover);
  border-color: transparent;
}

/* ================================================================== Modal */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-24);
}

.modal-root[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  /* token-derived scrim: text-primary at 48% over transparent (no raw hex) */
  background: color-mix(in srgb, var(--color-text-primary) 48%, transparent);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - var(--space-48));
  overflow-y: auto;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-32);
}

.modal-sm {
  max-width: 380px;
}
.modal-md {
  max-width: 480px;
}
.modal-lg {
  max-width: 640px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-16);
}

.modal-title {
  color: var(--color-text-primary);
}

.modal-desc {
  margin-top: var(--space-8);
}

.modal-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; /* touch target */
  height: 44px;
  margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-8)) 0 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .modal-close {
    transition: background-color var(--dur-micro-in) var(--ease-enter);
  }
}

.modal-close:hover {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}

.modal-body {
  margin-top: var(--space-24);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-12);
  margin-top: var(--space-32);
}

@media (prefers-reduced-motion: no-preference) {
  .modal-root:not([hidden]) .modal {
    animation: modal-in var(--dur-reveal-in) var(--ease-enter) both;
  }
  .modal-root:not([hidden]) .modal-backdrop {
    animation: fade-in var(--dur-micro-in) var(--ease-enter) both;
  }
  @keyframes modal-in {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

/* ================================================================== Toast */

.toast-stack {
  position: fixed;
  inset-block-end: var(--space-24);
  inset-inline-end: var(--space-24);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  width: min(360px, calc(100vw - var(--space-48)));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-primary);
}

.toast-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  color: var(--color-text-secondary);
}

.toast-content {
  flex: 1 1 auto;
  min-width: 0;
}

.toast-title {
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.toast-message {
  color: var(--color-text-secondary);
}

.toast-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; /* touch target */
  height: 44px;
  margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-8)) 0 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}

.toast-close:hover {
  color: var(--color-text-primary);
}

/* accent-derived tones — icon color only, no second hue */
.toast-success .toast-icon {
  color: var(--color-accent);
}
.toast-danger .toast-icon {
  color: var(--color-accent-hover);
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in var(--dur-reveal-in) var(--ease-enter) both;
    transition: background-color var(--dur-micro-in) var(--ease-enter);
  }
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ==================================================================== Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: color-mix(in srgb, var(--color-surface-0) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding: var(--space-12) var(--space-24);
  min-height: 64px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--color-text-primary);
}

.nav-brandmark {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
}

/* wordmark: Inter 300, lowercase, tracking -0.02em — the brand signal */
.nav-wordmark {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--fs-heading-sm);
  letter-spacing: -0.02em;
  text-transform: lowercase;
  line-height: 1;
  color: var(--color-text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-inline-start: var(--space-16);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* touch target */
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-md);
  font-size: var(--fs-body);
  letter-spacing: var(--ls-body);
  color: var(--color-text-secondary);
}

.nav-link[aria-current="page"] {
  color: var(--color-text-primary);
}

@media (prefers-reduced-motion: no-preference) {
  .nav-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}

.nav-link:hover {
  color: var(--color-text-primary);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-inline-start: auto;
}

.nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; /* touch target */
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  color: var(--color-text-secondary);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-theme-toggle {
    transition:
      background-color var(--dur-micro-in) var(--ease-enter),
      color var(--dur-micro-in) var(--ease-enter);
  }
}

.nav-theme-toggle:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
}

.nav-theme-icon {
  display: none;
  align-items: center;
}

/* show moon in light (action = go dark), sun in dark (action = go light) */
:root:not([data-theme="dark"]) .nav-theme-icon-moon {
  display: inline-flex;
}
:root[data-theme="dark"] .nav-theme-icon-sun {
  display: inline-flex;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-theme-icon-moon {
    display: none;
  }
  :root:not([data-theme="light"]) .nav-theme-icon-sun {
    display: inline-flex;
  }
}

/* ================================================================= Footer */

.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-surface-0);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-48);
  justify-content: space-between;
  max-width: 1120px;
  margin-inline: auto;
  padding: var(--space-64) var(--space-24) var(--space-32);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 280px;
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-48);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  min-width: 120px;
}

.footer-col-heading {
  text-transform: uppercase;
}

.footer-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--fs-body-sm);
}

@media (prefers-reduced-motion: no-preference) {
  .footer-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}

.footer-link:hover {
  color: var(--color-text-primary);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  max-width: 1120px;
  margin-inline: auto;
  padding: var(--space-24);
  border-top: 1px solid var(--color-border-subtle);
}

.footer-meta-icon {
  display: inline-flex;
  align-items: center;
}

/* =================================================================== Stat */

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.stat-head {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-secondary);
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
}

.stat-value {
  font-size: var(--fs-display-md);
  font-weight: var(--fw-display-md);
  line-height: var(--lh-display-md);
  letter-spacing: var(--ls-display-md);
  color: var(--color-text-primary);
}

.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-ui-label);
  color: var(--color-text-secondary);
}

.stat-delta-arrow {
  font-size: var(--fs-body-sm);
}

/* trend tones: accent for positive, deeper accent for negative, muted for flat */
.stat-delta-up {
  color: var(--color-accent);
}
.stat-delta-down {
  color: var(--color-accent-hover);
}
.stat-delta-flat {
  color: var(--color-text-tertiary);
}

/* ============================================================= QR preview */

.qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  margin: 0;
}

/* QR scannability absolute: dark modules on white always — do not remove for theme consistency. See design-system docs. */
.qr-preview-surface {
  color-scheme: light;
  background: var(--color-qr-background); /* invariant #FFFFFF in both themes */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

/* dark modules forced on white: injected svg inherits the invariant module
   color via currentColor; the engine emits modules with fill="currentColor". */
.qr-preview-surface svg {
  display: block;
  width: 220px;
  height: 220px;
  color: var(--color-qr-module);
}

.qr-preview-caption {
  text-align: center;
  max-width: 280px;
  overflow-wrap: anywhere;
}

.qr-preview-hero .qr-preview-surface {
  padding: var(--space-32);
}

@media (prefers-reduced-motion: no-preference) {
  .qr-preview-hero .qr-preview-surface {
    transition:
      box-shadow var(--dur-micro-in) var(--ease-enter),
      transform var(--dur-micro-in) var(--ease-enter);
  }
  .qr-preview-hero .qr-preview-surface:hover {
    transform: scale(1.02);
  }
}

.qr-preview-hero .qr-preview-surface:hover {
  box-shadow: var(--shadow-qr-hover);
}

/* ============================================== Hosted landing pages (/p) */

.lp {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-32) var(--space-24) var(--space-24);
  background: var(--color-surface-0);
}

.lp-inner {
  width: 100%;
  max-width: 480px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.lp-footer {
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  text-align: center;
}

.lp-footer-brand {
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--color-text-secondary);
}

.lp-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.lp-head-center {
  align-items: center;
  text-align: center;
}

.lp-title {
  color: var(--color-text-primary);
}

.lp-subtitle,
.lp-bio {
  max-width: 40ch;
}

.lp-bio {
  margin-top: var(--space-8);
}

.lp-empty {
  padding: var(--space-32) 0;
  text-align: center;
}

/* avatar / app icon */
.lp-avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.lp-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-display-md);
  font-weight: var(--fw-display-md);
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border-color: transparent;
}

.lp-app-icon {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-2xl);
  object-fit: cover;
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
}

.lp-app-icon-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

/* action button stacks */
.lp-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.lp-actions-stacked {
  width: 100%;
}

.lp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: 52px;
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-ui-label);
  letter-spacing: var(--ls-ui-label);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.lp-btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-color: var(--color-accent);
}

.lp-btn-icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.lp-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .lp-btn {
    transition:
      background-color var(--dur-micro-in) var(--ease-enter),
      border-color var(--dur-micro-in) var(--ease-enter),
      transform 80ms linear;
  }
  .lp-btn:active {
    transform: translateY(1px);
  }
}

.lp-btn:hover {
  border-color: var(--color-text-tertiary);
}
.lp-btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* menu */
.lp-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.lp-menu-section-title {
  color: var(--color-text-primary);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-16);
}

.lp-menu-items {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.lp-menu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
}

.lp-menu-item-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.lp-menu-item-name {
  color: var(--color-text-primary);
}

.lp-menu-item-price {
  flex: 0 0 auto;
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
}

/* pdf */
.lp-pdf-frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface-1);
  box-shadow: var(--shadow-sm);
}

.lp-pdf-viewer {
  display: block;
  width: 100%;
  height: 70vh;
  border: 0;
  background: var(--color-surface-1);
}

/* ===================================================== Onboarding (/onboarding) */

.ob {
  max-width: 880px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.ob-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.ob-title {
  color: var(--color-text-primary);
}

.ob-lede {
  max-width: 52ch;
}

/* stepper */
.ob-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
  list-style: none;
  padding: 0;
}

.ob-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--color-text-tertiary);
}

.ob-step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-ui-label);
  color: var(--color-text-secondary);
  flex: 0 0 auto;
}

.ob-step-current {
  color: var(--color-text-primary);
}
.ob-step-current .ob-step-dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-text);
}
.ob-step-done {
  color: var(--color-text-secondary);
}
.ob-step-done .ob-step-dot {
  background: var(--color-accent-subtle);
  border-color: transparent;
  color: var(--color-accent);
}

/* panels */
.ob-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.ob-panel-title {
  color: var(--color-text-primary);
}

.ob-grid {
  display: grid;
  gap: var(--space-32);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 720px) {
  .ob-grid {
    grid-template-columns: 1fr minmax(240px, 320px);
  }
}

.ob-grid-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.ob-grid-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  position: sticky;
  top: var(--space-32);
}

.ob-preview-note {
  text-align: center;
}

.ob-hint {
  max-width: 48ch;
}

.ob-body {
  max-width: 56ch;
}

/* type picker cards */
.ob-types {
  display: grid;
  gap: var(--space-12);
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .ob-types {
    grid-template-columns: 1fr 1fr;
  }
}

.ob-type {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  text-align: left;
  padding: var(--space-16);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
  cursor: pointer;
  min-height: 44px;
}

.ob-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  flex: 0 0 auto;
}

.ob-type-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.ob-type-label {
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
}

@media (prefers-reduced-motion: no-preference) {
  .ob-type {
    transition:
      border-color var(--dur-micro-in) var(--ease-enter),
      box-shadow var(--dur-micro-in) var(--ease-enter),
      transform var(--dur-micro-in) var(--ease-enter);
  }
  .ob-type:hover {
    transform: translateY(-2px);
  }
}

.ob-type:hover {
  border-color: var(--color-text-tertiary);
  box-shadow: var(--shadow-md);
}

.ob-type-selected {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

/* summary */
.ob-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-1);
  margin: 0;
}

.ob-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
}

.ob-summary-row dd {
  margin: 0;
  color: var(--color-text-primary);
}

/* footer nav */
.ob-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border-subtle);
}

.ob-nav-btns {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  margin-inline-start: auto;
}

.ob-skip {
  color: var(--color-text-secondary);
}

@media (prefers-reduced-motion: no-preference) {
  .ob-skip {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}

.ob-skip:hover {
  color: var(--color-text-primary);
}
/* Skip is a POST button (signing a user out, or completing onboarding, must not
   be reachable from a cross-site GET), and a <button> carries UA chrome the
   surrounding text links do not. Reset it so it still reads as quiet text. */
.ob-skip-form {
  display: inline;
}
.ob-skip {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Same for the account menu's log-out button, which replaced an <a>. */
.acct-logout-form {
  margin: 0;
}
.acct-links .dropdown-item {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

/* =========================================================== Styleguide aux */

.sg-section {
  padding-block: var(--space-48);
  border-bottom: 1px solid var(--color-border-subtle);
}

.sg-section:last-child {
  border-bottom: none;
}

.sg-section-title {
  margin-bottom: var(--space-8);
  color: var(--color-text-primary);
}

.sg-section-note {
  margin-bottom: var(--space-24);
  max-width: 60ch;
}

.sg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-16);
}

.sg-grid {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.sg-swatches {
  display: grid;
  gap: var(--space-12);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.sg-swatch {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.sg-swatch-chip {
  height: 56px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.sg-icons {
  display: grid;
  gap: var(--space-16);
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

.sg-icon-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}

.sg-icon-name {
  color: var(--color-text-secondary);
}

/* ============================================================== Marketing */

/* Generous, calm spacing is the brand signal — hero is whitespace-led. */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-48);
  align-items: center;
  padding-block: var(--space-96) var(--space-64);
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1fr minmax(360px, 0.85fr);
    gap: var(--space-64);
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.hero-title {
  color: var(--color-text-primary);
  margin: 0;
  /* Calm, confident scale: 40px on phones → 64px (the display-hero token) on
     desktop. Balanced wrapping so it never stacks one word per line. */
  font-size: clamp(2.5rem, 6vw, 4rem);
  text-wrap: balance;
  max-width: 16ch;
}

.hero-lead {
  max-width: 42ch;
  margin: 0;
}

/* The live generator — the hero's centerpiece. A calm vertical card: the
   perfect scannable QR on top, a full-width URL field below. */
.generator {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-32);
}

.generator-input {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: 100%;
  min-width: 0;
  order: 2;
}

.generator-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
  order: 1;
}

/* CTA reveal: opacity-only, honoring the 80ms reduced-motion exception. */
.generator-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.generator-cta[hidden] {
  display: none;
}

.generator-cta-note {
  margin: 0;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .generator-cta:not([hidden]) {
    animation: gen-cta-in var(--dur-reveal-in) var(--ease-enter) both;
  }
  @keyframes gen-cta-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .generator-cta:not([hidden]) {
    animation: gen-cta-fade var(--dur-opacity-exception) linear both;
  }
  @keyframes gen-cta-fade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

.generator-status {
  margin: 0;
  min-height: 1.4em;
  text-align: center;
}

/* Brand Match action under the URL field. */
.generator-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.generator-brand[hidden] {
  display: none;
}
.generator-brand-note {
  margin: 0;
  min-height: 1.2em;
  text-align: center;
}

/* ----------------------------------------------------- Marketing sections */

.section {
  padding-block: var(--space-96);
  border-top: 1px solid var(--color-border-subtle);
}

.section-quiet {
  background: var(--color-surface-0);
}

@media (max-width: 640px) {
  .section {
    padding-block: var(--space-64);
  }
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 60ch;
  margin-bottom: var(--space-48);
}

.section-eyebrow {
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0;
}

.section-title {
  color: var(--color-text-primary);
  margin: 0;
}

.section-lead {
  margin: 0;
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-48);
}

.inline-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .inline-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}

.inline-link:hover {
  color: var(--color-accent-hover);
}

/* -------------------------------------------------------------- Features */

.feature-grid {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.feature-title {
  color: var(--color-text-primary);
  margin: 0;
}

.feature-body {
  margin: 0;
}

/* Feature detail (features page) */
.feature-detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.feature-detail {
  display: flex;
  gap: var(--space-24);
  align-items: flex-start;
}

@media (max-width: 560px) {
  .feature-detail {
    flex-direction: column;
    gap: var(--space-16);
  }
}

.feature-detail-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  min-width: 0;
}

.feature-detail-copy h2 {
  color: var(--color-text-primary);
  margin: 0;
}

.feature-detail-copy > p {
  margin: 0;
  max-width: 60ch;
}

.feature-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.feature-point {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
}

.feature-point-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--color-accent);
}

/* ------------------------------------------------------------- Use cases */

.usecase-strip {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
}

.usecase-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}

.usecase-chip-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
}

.usecase-grid {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.usecase {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.usecase-example {
  margin: 0;
  color: var(--color-text-secondary);
}

.usecase-example-label {
  color: var(--color-accent);
  text-transform: uppercase;
}

/* --------------------------------------------------- Home: hero actions */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-12);
  margin-top: var(--space-24);
}

.hero-fineprint {
  margin-top: var(--space-16);
}

/*
 * Wrapped rather than stacked on narrow screens: two side-by-side buttons that
 * overflow the viewport is the single most common responsive break, and
 * flex-wrap collapses them without a media query.
 */

/* ------------------------------------------------------ Home: how it works */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-24);
  /* Four columns on desktop, fewer as the viewport narrows. The 220px floor is
     what keeps this from collapsing to two cramped columns on a tablet. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  counter-reset: step;
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-top: var(--space-16);
  border-top: 1px solid var(--color-border);
}

.step-num {
  margin: 0;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.step-title,
.step-body {
  margin: 0;
}

/* ------------------------------------------------------- Home: the range */

/*
 * The products are NOT cards with icons and buttons. They are a list of three
 * things that do not exist yet, and a card with a call-to-action implies the
 * action exists. A bordered panel with no button is the honest shape.
 */
.product-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-16);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.product {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-24);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}

.product-name,
.product-body {
  margin: 0;
}

.product-status {
  margin-top: auto;
  padding-top: var(--space-8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-note {
  margin-top: var(--space-16);
}

/* -------------------------------------------------------------- Home: FAQ */

/*
 * Native <details>: no JS, works without it, and the disclosure is keyboard
 * operable and screen-reader labelled without us reimplementing ARIA.
 */
.faq {
  display: flex;
  flex-direction: column;
  max-width: 68ch;
  border-top: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-q {
  margin: 0;
  padding: var(--space-16) 0;
  cursor: pointer;
  color: var(--color-text-primary);
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
}

.faq-q::-webkit-details-marker {
  display: none;
}

/* A drawn chevron, so the affordance is visible in both themes without an
   extra DOM node per question. */
.faq-q::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--color-accent);
  font-weight: 400;
}

.faq-item[open] .faq-q::after {
  content: "\2212";
}

.faq-a {
  margin: 0;
  padding: 0 0 var(--space-16);
}

/* Visible focus on the summary: removing the default marker removed the only
   focus ring a keyboard user had on this control. */
.faq-q:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------- Home: final CTA */

.cta-band {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-1);
  text-align: center;
  /* The other sections get their rhythm from .section-header's flex gap. This
     one lays its children out directly, and .section-title/.section-lead both
     reset their margins to 0 - so without a gap the lead renders flush against
     the heading. */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
}

.cta-band .section-title,
.cta-band .section-lead {
  max-width: 52ch;
}

.cta-band .section-cta {
  margin-top: var(--space-16);
}

@media (max-width: 600px) {
  /* Stacked and full-width: two buttons at this width leave each one too narrow
     to hit comfortably. */
  .hero-actions .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------- Pricing */

/*
 * Three tiers, so the grid must be able to hold three. `auto-fit` with a 280px
 * floor resolved to two columns inside the 760px cap and orphaned Pro onto a
 * second row, which read as "Pro is a lesser add-on". The cap is raised and the
 * floor lowered so all three sit side by side and wrap to 2 then 1.
 */
.plan-grid {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 1120px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-32);
}

.plan-card-featured {
  border-color: var(--color-accent);
}

.plan-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.plan-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.plan-name-row h2 {
  color: var(--color-text-primary);
  margin: 0;
}

.plan-tagline {
  margin: 0;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
  margin: 0;
}

.plan-price-amount {
  color: var(--color-text-primary);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  flex: 1 1 auto;
}

.plan-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
}

.plan-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--color-accent);
}

.plan-cta {
  margin-top: auto;
}

.pricing-note {
  margin-top: var(--space-32);
  max-width: 60ch;
}

/* ------------------------------------------------------------------ Docs */

.docs {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-48);
}

@media (min-width: 880px) {
  .docs {
    grid-template-columns: 220px 1fr;
    gap: var(--space-64);
    align-items: start;
  }
}

.docs-toc {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

@media (min-width: 880px) {
  .docs-toc {
    position: sticky;
    top: var(--space-96);
  }
}

.docs-toc-heading {
  text-transform: uppercase;
  margin: 0;
}

.docs-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.docs-toc-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-text-secondary);
  font-size: var(--fs-body-sm);
}

@media (prefers-reduced-motion: no-preference) {
  .docs-toc-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}

.docs-toc-link:hover {
  color: var(--color-text-primary);
}

.docs-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
  min-width: 0;
}

.docs-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  scroll-margin-top: var(--space-96);
}

.docs-section h2 {
  color: var(--color-text-primary);
  margin: 0;
}

.docs-section p {
  margin: 0;
  max-width: 68ch;
}

.code-block {
  margin: 0;
  padding: var(--space-16);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body-sm);
  line-height: 1.6;
}

.code-block code {
  font-family: inherit;
  white-space: pre;
}

.code-inline {
  padding: 2px var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--color-text-primary);
}

/* =================================================================== Auth */

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* `center` with a large void: on a 900px-tall viewport the card floated with
     ~200px of nothing above and below it, so the screen read as unfinished
     rather than calm. `safe center` clamps the free space into a band, keeping
     the card optically centred without letting it drift into emptiness. */
  justify-content: safe center;
  gap: var(--space-32);
  padding: var(--space-64) var(--space-24);
}

/* Wordmark, tagline and card read as one masthead, not three stacked bits. */
.auth-brand,
.auth-tagline {
  margin: 0;
}

.auth-tagline {
  /* The gap above already separates these, so the tagline is pulled back up
     and only separated from the card below it. */
  margin-top: calc(var(--space-24) * -1 + var(--space-8));
  color: var(--color-text-secondary);
  font-size: var(--fs-body-sm);
  letter-spacing: 0.01em;
  text-align: center;
  max-width: 34ch;
  text-wrap: balance;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--color-text-primary);
}

.auth-brandmark {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
}

/* wordmark: Inter 300, lowercase, tracking -0.02em — the brand signal */
.auth-wordmark {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--fs-heading-sm);
  letter-spacing: -0.02em;
  text-transform: lowercase;
  line-height: 1;
  color: var(--color-text-primary);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-32);
}

.auth-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.auth-title {
  color: var(--color-text-primary);
}

.auth-lead {
  margin: 0;
}

.auth-email {
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
  overflow-wrap: anywhere;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-block: var(--space-8);
}

/*
 * The resend control. It is a real second attempt at the same address, so it is
 * a POST form rather than a link - but it is a tertiary action sitting below two
 * primary buttons, so it is stripped of the card's form rhythm and reads as the
 * quiet footnote it should be. The negative top margin cancels the form's own
 * block margin so it does not float away from the button above it.
 */
.auth-form-inline {
  margin-block: calc(var(--space-8) * -1) 0;
}

.auth-fineprint {
  margin: 0;
}

.auth-devnote {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  padding: var(--space-16);
  color: var(--color-text-secondary);
}

.auth-devnote p {
  margin: 0;
}

.auth-code,
.auth-devnote code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-caption);
  background: var(--color-surface-3);
  color: var(--color-text-primary);
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
}

/* ============================================================== Dashboard */

.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
}

.dash-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.dash-sub {
  margin: 0;
}

.dash-toolbar {
  margin-bottom: var(--space-24);
}

.dash-search {
  max-width: 360px;
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.dash-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.dash-section-title {
  text-transform: uppercase;
  letter-spacing: var(--ls-ui-label);
  margin: 0;
}

.dash-section-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.dash-empty-search {
  text-align: center;
  padding: var(--space-32);
}

/* QR list item (a Card variant) */
.qr-item {
  padding: var(--space-16) var(--space-24);
}

/* The dashboard's QR list: Cards are block-level, so without this they butt
   against each other with no separation at all. */
.qr-item-wrap > * + * {
  margin-top: var(--space-12);
}

.qr-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.qr-item-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

.qr-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.qr-item-title {
  margin: 0;
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-item-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
}

.qr-item-scans {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 64px;
}

.qr-item-scans-value {
  color: var(--color-text-primary);
}

.qr-item-scans-label {
  margin: 0;
}

.qr-item-meta {
  flex: 0 0 auto;
  min-width: 96px;
  text-align: right;
}

.qr-item-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

/* Empty state */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-16);
  max-width: 440px;
  margin: var(--space-64) auto;
  padding: var(--space-48) var(--space-32);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  box-shadow: var(--shadow-sm);
}

.dash-empty-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.dash-empty-title {
  margin: 0;
  color: var(--color-text-primary);
}

.dash-empty-text {
  margin: 0;
}

@media (max-width: 720px) {
  .qr-item-row {
    flex-wrap: wrap;
  }
  .qr-item-meta {
    text-align: left;
  }
  .qr-item-actions {
    width: 100%;
  }
  .qr-item-actions .qr-item-action {
    flex: 1 1 auto;
  }
}

/* =============================================================== Settings */

.settings-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-32);
}

.settings-sub {
  margin: 0;
}

.settings-grid {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.settings-defs {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin: 0;
}

.settings-def {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-def-label {
  margin: 0;
}

.settings-def-value {
  margin: 0;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.settings-upgrade {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border-subtle);
}

.settings-upgrade-note {
  margin: 0;
}

.settings-theme-hint {
  margin: 0;
}

.settings-theme-glyph {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  margin-inline: var(--space-8);
  vertical-align: middle;
  color: var(--color-text-secondary);
}

.settings-signout-text {
  margin: 0 0 var(--space-16);
}


/* ===========================================================================
   QR Studio + QR detail + analytics charts (token-only).
   Every transition is wrapped in @media (prefers-reduced-motion: no-preference).
   =========================================================================== */

/* Shared empty state (not-found / no-content) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
  text-align: center;
  padding: var(--space-96) var(--space-24);
}

/* ---- Studio --------------------------------------------------------------- */
.studio-head {
  margin-bottom: var(--space-32);
}
.studio-sub {
  margin: var(--space-8) 0 0;
  max-width: 52ch;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-32);
  align-items: start;
}
@media (max-width: 900px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.studio-panel {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
}
.studio-panel-title {
  margin: 0 0 var(--space-16);
}

/* Type picker grid */
.studio-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-12);
}
.studio-type {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
  padding: var(--space-12);
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-0);
  color: var(--color-text-primary);
  cursor: pointer;
  appearance: none;
}
@media (prefers-reduced-motion: no-preference) {
  .studio-type {
    transition: border-color var(--dur-micro-in) var(--ease-enter),
      background var(--dur-micro-in) var(--ease-enter);
  }
}
.studio-type:hover {
  border-color: var(--color-text-tertiary);
}
.studio-type[aria-checked="true"] {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.studio-type-icon {
  color: var(--color-accent);
}
.studio-type-label {
  display: block;
}
.studio-type-blurb {
  display: block;
}

/* Content fields */
.studio-fields {
  display: grid;
  gap: var(--space-16);
}
.studio-fields[hidden] {
  display: none;
}
.studio-rich-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  margin: 0;
  padding: var(--space-12);
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-text-secondary);
}

/* Checkbox row */
.studio-check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  cursor: pointer;
}
.studio-check-row input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}
.studio-toggle-help {
  display: block;
  margin-top: var(--space-4);
}

/* Customization grid */
.studio-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-24);
}
.studio-brand-note {
  margin: 0;
  text-align: center;
}
.studio-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-16);
}
.studio-color {
  width: 100%;
  height: 44px;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-0);
  cursor: pointer;
}
.studio-logo-field {
  margin-top: var(--space-16);
}

/* Preview column (sticky on desktop) */
.studio-preview-col {
  position: relative;
}
.studio-preview-sticky {
  position: sticky;
  top: var(--space-24);
}
.studio-actions {
  width: 100%;
}
.studio-export {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
.studio-export .btn {
  width: 100%;
}

.studio-warn {
  margin: 0;
  padding: var(--space-12);
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  background: var(--color-accent-subtle);
  color: var(--color-text-primary);
  border: 1px solid var(--color-accent);
}
.studio-warn[data-tone="danger"] {
  border-color: var(--color-text-secondary);
}
.studio-error {
  margin: 0;
  color: var(--color-text-primary);
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-12);
  font-size: var(--fs-body-sm);
}

/* ---- QR detail ------------------------------------------------------------ */
.qr-detail-breadcrumb {
  margin-bottom: var(--space-16);
}
.qr-detail-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--fs-body-sm);
}
.qr-detail-back-icon {
  transform: rotate(90deg);
}

.qr-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  margin-bottom: var(--space-32);
}
.qr-detail-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
}
.qr-detail-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  flex: none;
}
.qr-detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-top: var(--space-8);
}
.qr-detail-actions {
  display: flex;
  gap: var(--space-8);
}

.qr-detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--space-32);
  align-items: start;
}
@media (max-width: 900px) {
  .qr-detail-grid {
    grid-template-columns: 1fr;
  }
}

.qr-detail-code-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  align-items: center;
}
.qr-detail-downloads {
  width: 100%;
}
.qr-detail-downloads .btn {
  width: 100%;
}

.qr-detail-dest h2 {
  margin: 0 0 var(--space-12);
}
.qr-detail-printed {
  margin: 0 0 var(--space-12);
}
.qr-detail-mono {
  font-feature-settings: "tnum" 1;
  color: var(--color-text-primary);
  word-break: break-all;
}
.qr-detail-dest-row {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-8);
}
.qr-detail-dest-row .input {
  flex: 1;
}

/* Analytics */
.qr-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-16);
}
.qr-detail-chart-card,
.qr-detail-breakdowns .card {
  padding: var(--space-24);
}
.qr-detail-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-16);
}
.qr-detail-chart-head h3 {
  margin: 0;
}
.qr-detail-breakdowns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-24);
}
@media (max-width: 640px) {
  .qr-detail-breakdowns {
    grid-template-columns: 1fr;
  }
}
.qr-detail-breakdowns h3 {
  margin: 0 0 var(--space-16);
}

/* ---- Charts --------------------------------------------------------------- */
.qr-chart {
  width: 100%;
  color: var(--color-accent);
}
.qr-chart-svg {
  width: 100%;
  height: 200px;
  display: block;
}
.qr-chart-axis {
  stroke: var(--color-border);
  stroke-width: 1;
}
.qr-chart-area {
  fill: var(--color-accent-subtle);
  stroke: none;
}
.qr-chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.qr-chart-dot {
  fill: currentColor;
}
.qr-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-8);
}
.qr-chart-empty {
  margin: var(--space-24) 0;
  text-align: center;
}

.qr-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.qr-bar-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: var(--space-12);
}
.qr-bar-label {
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-bar-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  overflow: hidden;
}
.qr-bar-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .qr-bar-fill {
    transition: width var(--dur-reveal-in) var(--ease-enter);
  }
}
.qr-bar-value {
  color: var(--color-text-secondary);
  text-align: right;
}

/* ============================================================ AI Wallpaper */

.wp { max-width: 1080px; }
.wp-head { max-width: 56ch; margin-bottom: var(--space-48); }
.wp-sub { margin-top: var(--space-12); }

.wp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-48);
  align-items: start;
}
@media (min-width: 860px) {
  .wp-grid { grid-template-columns: 1fr 0.9fr; gap: var(--space-64); }
}

.wp-controls { max-width: 460px; }
.wp-field { display: flex; flex-direction: column; gap: var(--space-12); }
.wp-chips { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.wp-chip {
  appearance: none;
  cursor: pointer;
  min-height: 40px;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  color: var(--color-text-secondary);
  font-size: var(--fs-ui-label);
  font-weight: var(--fw-ui-label);
}
@media (prefers-reduced-motion: no-preference) {
  .wp-chip { transition: border-color var(--dur-micro-in) var(--ease-enter), color var(--dur-micro-in) var(--ease-enter); }
}
.wp-chip:hover { border-color: var(--color-text-tertiary); }
.wp-chip-on {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.wp-status { margin: 0; min-height: 1.4em; }
.wp-actions { display: flex; gap: var(--space-12); flex-wrap: wrap; }
.wp-actions[hidden] { display: none; }

/* Phone frame */
.wp-preview { display: flex; justify-content: center; }
.wp-phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 5;
  border-radius: 44px;
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: 10px;
  overflow: hidden;
}
.wp-phone-notch {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 36%; height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-surface-0);
  z-index: 2;
}
.wp-canvas {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  object-fit: cover;
}
.wp-phone-empty {
  position: absolute;
  inset: 10px;
  border-radius: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  text-align: center;
  background: var(--color-surface-1);
}
.wp-phone-empty[hidden] { display: none; }
.wp-phone-empty-icon { color: var(--color-text-tertiary); }

/* --- Raw scan log (QR detail) --------------------------------------------
   A dense, horizontally scrollable data table. Sized off the shared tokens so
   it tracks the type scale rather than inventing px values. */
.qr-scanlog {
  margin-top: var(--space-8);
}
.qr-scanlog-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}
.qr-scanlog-wrap:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.qr-scanlog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
  white-space: nowrap;
}
.qr-scanlog-table th,
.qr-scanlog-table td {
  padding: var(--space-8) var(--space-12);
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}
.qr-scanlog-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: var(--fs-caption);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.qr-scanlog-table tbody tr:last-child td {
  border-bottom: 0;
}
.qr-scanlog-table tbody tr:hover td {
  background: var(--color-surface-1);
}
/* Addresses, hashes and referers are monospaced so digits align down the
   column and a long value can be scanned vertically without losing your place. */
.qr-scanlog-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-caption);
  color: var(--color-text-secondary);
}
.qr-scanlog-when {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
}

/* --- Deferred destination claim page (/r/<code> with no destination set) ----
   Reuses the .auth single-column rhythm: this is a focused, one-decision page
   that a stranger may be looking at on a phone, often in a queue. */
.claim {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-48) var(--space-24);
}
.claim-card {
  width: 100%;
  max-width: 460px;
  text-align: center;
}
.claim-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-16);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}
.claim-title { margin-bottom: var(--space-8); }
.claim-lead { margin-bottom: var(--space-24); }
.claim-form { display: flex; flex-direction: column; gap: var(--space-16); text-align: left; }
.claim-cta { display: flex; flex-direction: column; gap: var(--space-12); }
.claim-note { text-align: center; }
.claim-error {
  margin: 0 0 var(--space-16);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  text-align: left;
}

/* --- Printed-code clarity -------------------------------------------------
   The owner must always be able to tell, at a glance, which code they are
   holding and whether it is live yet. */

/* Dashboard list: the short code is the only thing that distinguishes two
   codes sharing a title, so it is monospaced and sits above the date. */
.qr-item-code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

/* Studio: caption under the live preview stating whether the image shown is
   the image that gets printed. */
.studio-preview-caption {
  margin: 0;
  text-align: center;
}
.qr-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: var(--space-24);
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-align: center;
  font-size: var(--fs-body-sm);
}

/* Detail page: the permanent printed URL, promoted out of a paragraph so it
   can be copied rather than transcribed. */
.qr-detail-printed {
  margin-bottom: var(--space-16);
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}
.qr-detail-printed-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin: var(--space-4) 0 var(--space-8);
}
.qr-detail-printed-row .qr-detail-mono {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Unclaimed callout. Uses the warning surface rather than a new hue, so it
   reads as the same status language as the dashboard badge. */
.qr-detail-unclaimed {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  font-size: var(--fs-body-sm);
}
.qr-detail-unclaimed > svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--color-text-secondary);
}

/* ===========================================================================
   Account context + profile + businesses (token-only).

   Four systems live here, in the order they stack down the page:
     1. Page primitives (narrow column, header, breadcrumbs)
     2. Dropdowns (the shared panel used by both the account menu and the
        business switcher) + avatars, which appear inside them
     3. Forms: sections, grids, the image picker, hours
     4. The business list/detail/profile surfaces built on top

   Every transition is wrapped in @media (prefers-reduced-motion: no-preference).
   =========================================================================== */

/* ---- 1. Page primitives --------------------------------------------------- */
.page-narrow {
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
}

.page-head {
  margin-bottom: var(--space-32);
}
.page-head-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-24);
  flex-wrap: wrap;
}
.page-head-text {
  min-width: 0;
}
.page-lede {
  margin-top: var(--space-8);
  max-width: 56ch;
}

/* An h1 after the breadcrumbs needs the space the crumbs would have had. */
.page-head .breadcrumbs + .t-display-md {
  margin-top: var(--space-8);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
  min-width: 0;
}
.breadcrumb-link {
  color: var(--color-text-secondary);
}
@media (prefers-reduced-motion: no-preference) {
  .breadcrumb-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}
.breadcrumb-link:hover {
  color: var(--color-text-primary);
}
.breadcrumb-sep {
  color: var(--color-text-tertiary);
}
.breadcrumb-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- 2. Dropdown panel (shared by account menu + business switcher) -------- */
/* The panel is positioned by the island: the trigger keeps `position: relative`
   and the panel is absolutely placed under it. `hidden` is the no-JS state, so
   [hidden] must win over the display value below or the panel would flash. */
.dropdown-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + var(--space-8));
  inset-inline-end: 0;
  min-width: 260px;
  padding: var(--space-8);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: start;
}
.dropdown-panel[hidden] {
  display: none;
}
/* The switcher sits at the start of the bar and opens downwards from there. */
.biz-switch-panel {
  inset-inline-end: auto;
  inset-inline-start: 0;
  min-width: 300px;
}

@media (prefers-reduced-motion: no-preference) {
  .dropdown-panel {
    animation: dropdown-in var(--dur-micro-in) var(--ease-enter);
    transform-origin: top center;
  }
  @keyframes dropdown-in {
    from {
      opacity: 0;
      transform: translateY(-4px) scale(0.98);
    }
  }
}

.dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  width: 100%;
  padding: var(--space-8) var(--space-12);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: start;
  cursor: pointer;
  min-height: 44px; /* touch target */
}
@media (prefers-reduced-motion: no-preference) {
  .dropdown-item {
    transition: background-color var(--dur-micro-in) var(--ease-enter);
  }
}
.dropdown-item:hover {
  background: var(--color-surface-2);
}
.dropdown-item-current {
  background: var(--color-accent-subtle);
}

.dropdown-item-glyph,
.biz-switch-all-glyph {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
}
.dropdown-item-current .dropdown-item-glyph {
  color: var(--color-accent);
}

.dropdown-item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropdown-item-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item-check {
  flex: 0 0 auto;
  color: var(--color-accent);
}

/* Destructive rows use the same accent, inverted: the only real red in the app
   is a logout, and it should not look like the primary action. */
.dropdown-item-danger .dropdown-item-label {
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
}
.dropdown-item-danger:hover {
  background: var(--color-surface-2);
}
.dropdown-item-danger .dropdown-item-glyph {
  color: var(--color-text-primary);
}

.dropdown-sep {
  height: 1px;
  margin: var(--space-8) 0;
  background: var(--color-border-subtle);
}

.dropdown-empty {
  padding: var(--space-12);
}

/* ---- 2b. Avatars ----------------------------------------------------------- */
.avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  font-size: var(--fs-caption);
  font-weight: var(--fw-ui-label);
  letter-spacing: 0.01em;
  user-select: none;
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 64px; height: 64px; font-size: var(--fs-body-lg); }
.avatar-xl { width: 96px; height: 96px; font-size: var(--fs-display-md); }

.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- 2c. Account menu ----------------------------------------------------- */
.acct {
  position: relative;
}
.acct-trigger,
.biz-switch-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 44px; /* touch target */
  padding: var(--space-4) var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
  font: inherit;
  text-align: start;
  cursor: pointer;
  max-width: 220px;
}
@media (prefers-reduced-motion: no-preference) {
  .acct-trigger,
  .biz-switch-trigger {
    transition:
      background-color var(--dur-micro-in) var(--ease-enter),
      border-color var(--dur-micro-in) var(--ease-enter);
  }
}
.acct-trigger:hover,
.biz-switch-trigger:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-tertiary);
}
.acct-trigger[aria-expanded="true"],
.biz-switch-trigger[aria-expanded="true"] {
  border-color: var(--color-accent);
}

.acct-trigger-text,
.biz-switch-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.acct-trigger-name,
.biz-switch-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--fw-ui-label);
}
.acct-trigger-sub,
.biz-switch-eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-caret,
.biz-switch-caret {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--color-text-tertiary);
}
@media (prefers-reduced-motion: no-preference) {
  .acct-caret,
  .biz-switch-caret {
    transition: transform var(--dur-micro-in) var(--ease-enter);
  }
  .acct-trigger[aria-expanded="true"] .acct-caret,
  .biz-switch-trigger[aria-expanded="true"] .biz-switch-caret {
    transform: rotate(180deg);
  }
}

.acct-panel {
  min-width: 280px;
}

.acct-head {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
}
.acct-head-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acct-head-name,
.acct-head-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-links {
  display: flex;
  flex-direction: column;
}

/* Narrow viewports: the trigger keeps the avatar only. The name is still in the
   panel, and the aria-label always names the account, so nothing is lost. */
@media (max-width: 860px) {
  .acct-trigger-text {
    display: none;
  }
  .acct-trigger {
    padding: var(--space-4);
  }
}

/* ---- 2d. Business context bar --------------------------------------------- */
.context-bar {
  position: sticky;
  top: 64px; /* the nav is sticky at 64px; the bar stacks directly under it */
  z-index: 40;
  width: 100%;
  background: color-mix(in srgb, var(--color-surface-0) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.context-bar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding: var(--space-8) var(--space-24);
}
.biz-switch {
  position: relative;
  max-width: 100%;
}
.biz-switch-trigger {
  max-width: 320px;
}
.biz-switch-all {
  background: var(--color-accent-subtle);
}
.biz-switch-all:hover {
  background: var(--color-accent-subtle);
  filter: brightness(0.97);
}

/* ---- 3. Flash notice ------------------------------------------------------ */
/* Server-rendered, so this must read as a confirmation without a dismiss click.
   It sits at the top of the main column and scrolls away with the page. */
.flash-region:not(:empty) {
  margin-bottom: var(--space-24);
}
.flash {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  border-inline-start: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  box-shadow: var(--shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .flash {
    animation: flash-in var(--dur-reveal-in) var(--ease-enter);
  }
  @keyframes flash-in {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
  }
}
.flash-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--color-accent);
}
.flash-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.flash-title {
  font-weight: var(--fw-ui-label);
}
.flash-message {
  color: var(--color-text-secondary);
}
.flash-dismiss {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.flash-dismiss:hover {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}

/* A failed save is stated, not styled as a scolding: same language, the
   inverse emphasis. */
.flash-danger {
  border-inline-start-color: var(--color-text-primary);
}
.flash-danger .flash-icon {
  color: var(--color-text-primary);
}

/* ---- 4. Inline notice (persistent, not dismissible) ----------------------- */
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  margin-bottom: var(--space-24);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}
.notice-text {
  min-width: 0;
  flex: 1 1 320px;
}
.notice-warning {
  border-inline-start: 3px solid var(--color-text-primary);
  background: var(--color-surface-2);
}

/* ---- 5. Forms ------------------------------------------------------------- */
.form-section {
  padding-block: var(--space-24);
  border-top: 1px solid var(--color-border-subtle);
}
.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}
.form-section-head {
  margin-bottom: var(--space-16);
}
.form-section-title {
  margin: 0;
}
.form-section-note {
  margin-top: var(--space-4);
  max-width: 56ch;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-16);
}
.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.form-conditional[hidden] {
  display: none;
}
.form-conditional {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border-subtle);
}

.profileform-note {
  margin-top: var(--space-16);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}

.btn-sm {
  min-height: 36px;
  padding: var(--space-4) var(--space-12);
  font-size: var(--fs-body-sm);
}

/* ---- 5b. Image picker ----------------------------------------------------- */
.picker {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  flex-wrap: wrap;
}
.picker-stage {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  color: var(--color-text-tertiary);
  font-size: var(--fs-display-md);
  font-weight: var(--fw-display-md);
  letter-spacing: -0.02em;
  user-select: none;
}
.picker-stage-has-image {
  border-style: solid;
}
.picker-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-controls {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  min-width: 0;
}

/* The real file input is the accessible control; the label above is the
   picture. Not `display: none` — a hidden input can't be focused, and the
   remove/upload buttons are useless without a way to pick a file. */
.picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.picker-input:focus-visible + .picker-status,
.picker-file:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.picker-status {
  flex: 1 1 100%;
  min-height: 1.2em;
  color: var(--color-text-tertiary);
}
.picker-status-ok {
  color: var(--color-text-secondary);
}
.picker-status-err {
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
}
.picker-status-busy {
  color: var(--color-text-secondary);
}
.picker-busy {
  opacity: 0.6;
  pointer-events: none;
}
.picker .field-error {
  flex: 1 1 100%;
}

/* ---- 5c. Business hours --------------------------------------------------- */
.hours {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-md);
  min-height: 44px; /* touch target */
}
.hours-row:nth-child(odd) {
  background: var(--color-surface-1);
}
/* The island adds .hours-closed to the row, and dims the times it is holding
   in place, rather than disabling them: a disabled input is not submitted, so a
   closed day would lose the times it had stored. */
.hours-closed .hours-time {
  opacity: 0.45;
}
.hours-day {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  cursor: pointer;
  min-width: 120px;
}
.hours-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.hours-times {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.hours-time {
  width: 120px;
}
.hours-dash {
  color: var(--color-text-tertiary);
}
.input-muted {
  color: var(--color-text-tertiary);
}
@media (max-width: 560px) {
  .hours-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .hours-times {
    padding-inline-start: var(--space-24);
  }
}

/* ---- 6. Business list + detail ------------------------------------------- */
.biz-section + .biz-section {
  margin-top: var(--space-32);
}
.biz-section-title {
  margin: 0 0 var(--space-12);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.biz-section-empty {
  padding: var(--space-24);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.biz-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.biz-list .card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  padding: var(--space-16);
}
.biz-row-main {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
  flex: 1 1 320px;
}
.biz-row-body {
  min-width: 0;
}
.biz-row-titleline {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.biz-row-title {
  margin: 0;
  font-weight: var(--fw-ui-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biz-row-meta {
  margin-top: 2px;
}
.biz-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex: 0 0 auto;
}
/* An archived business stays legible but recedes: it is history, not context. */
.biz-row-archived {
  background: var(--color-surface-0);
  box-shadow: none;
}
.biz-row-archived .biz-row-title {
  color: var(--color-text-secondary);
  font-weight: var(--fw-body);
}

.biz-hero {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  flex-wrap: wrap;
  margin-top: var(--space-16);
}
.biz-hero-text {
  flex: 1 1 260px;
  min-width: 0;
}
.biz-hero-text h1 {
  overflow-wrap: anywhere;
}
.biz-hero-meta {
  margin-top: var(--space-4);
}
.biz-hero-badges {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  margin-top: var(--space-12);
}
.biz-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex: 0 0 auto;
}

.biz-facts-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-16);
}
.biz-qr-row .qr-item-glyph {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
}

/* ---- 6b. Danger zone (archive, never delete) ----------------------------- */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-24);
  flex-wrap: wrap;
  margin-top: var(--space-48);
  padding: var(--space-24);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.danger-zone-text {
  flex: 1 1 320px;
  min-width: 0;
}
.danger-zone-title {
  margin: 0;
}
.danger-zone-note {
  margin-top: var(--space-8);
  max-width: 56ch;
}

/* ---- 7. Profile ----------------------------------------------------------- */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-24);
  align-items: start;
}
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
.profile-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  min-width: 0;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-8);
}
.progress-value {
  color: var(--color-text-secondary);
  font-weight: var(--fw-ui-label);
}
.progress-track {
  position: relative;
  height: 8px;
  margin-top: var(--space-8);
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .progress-fill {
    transition: width var(--dur-layout) var(--ease-enter);
  }
}

.progress-list {
  list-style: none;
  padding: 0;
  margin: var(--space-16) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.progress-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--color-text-secondary);
}
.progress-item-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
}
.progress-item-done {
  color: var(--color-text-primary);
}
.progress-item-done .progress-item-mark {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.profile-score-done {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.profile-score-done svg {
  color: var(--color-accent);
}

.profile-biz-empty {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}
.profile-biz-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.profile-biz-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8);
  border-radius: var(--radius-md);
  min-height: 44px; /* touch target */
}
@media (prefers-reduced-motion: no-preference) {
  .profile-biz-item {
    transition: background-color var(--dur-micro-in) var(--ease-enter);
  }
}
.profile-biz-item:hover {
  background: var(--color-surface-2);
}
.profile-biz-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.profile-biz-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--fw-ui-label);
}
/* The account card's meta lines (email, business count) sit one step below the
   value they belong to; without an explicit colour they inherit the value's
   weight and the card reads as one undifferentiated block. */
.profile-biz-meta,
.acct-head-meta {
  color: var(--color-text-tertiary);
}
/* `.profile-main` is the form column of the two-column grid. It needs a min-width
   of 0 or a long business name inside it can force the grid track wider than the
   viewport and cause a horizontal scroll on a phone. */
.profile-main {
  min-width: 0;
}
.profileform .form-actions {
  margin-top: var(--space-24);
}

/* ---- 8. Empty state ------------------------------------------------------- */
/* The panel, not the centred text block the QR pages already use: this one can
   carry actions, so it stays left-aligned and reads as a panel. */
.empty-state-panel {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  padding: var(--space-24);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.empty-state-inline {
  border-style: dashed;
  background: transparent;
}
.empty-state-glyph {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}
.empty-state-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.empty-state-title {
  margin: 0;
}
.empty-state-text {
  max-width: 52ch;
}
.empty-state-actions {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}
@media (max-width: 560px) {
  .empty-state-panel {
    flex-direction: column;
  }
}

/* ---- 9. Studio: business assignment -------------------------------------- */
.studio-biz-field {
  margin-top: var(--space-16);
}
.studio-biz-help {
  margin-top: var(--space-4);
}
.studio-biz-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  color: var(--color-accent);
  font-weight: var(--fw-ui-label);
}
@media (prefers-reduced-motion: no-preference) {
  .studio-biz-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}
.studio-biz-link:hover {
  color: var(--color-accent-hover);
}

/* ---- 10. Dashboard empty-state actions ----------------------------------- */
.dash-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

/* ---- 11. Studio save/export rows (pre-existing, unstyled until now) ------ */
.studio-save {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  margin-top: var(--space-16);
}
.studio-export-btn {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border-subtle);
}
.studio-check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  cursor: pointer;
}
.studio-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-accent);
  flex: 0 0 auto;
  cursor: pointer;
}
.studio-check-row > span {
  min-width: 0;
}
.studio-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  flex-wrap: wrap;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}
.studio-toggle-help {
  display: block;
  margin-top: 2px;
  max-width: 56ch;
}
.studio-deferred {
  margin-top: var(--space-16);
}

/* ===========================================================================
   Onboarding: four URL-driven steps.

   The existing .ob-* shell (stepper, panels, nav) predates this flow and is
   reused as-is. What follows is only what the progressive flow adds. The layout
   rule throughout is that nothing here depends on JavaScript: no step hides
   another, so a scripting-blocked visitor sees the same four screens.
   =========================================================================== */

.ob {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
}

.ob-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-32);
}
.ob-step-label {
  white-space: nowrap;
}
@media (max-width: 560px) {
  .ob-stepper {
    gap: var(--space-12);
  }
  .ob-step-label {
    display: none;
  }
  .ob-stepper {
    justify-content: space-between;
  }
  .ob-step-current .ob-step-label {
    display: inline;
  }
}

.ob-head {
  margin-bottom: var(--space-24);
}
.ob-title {
  margin: 0;
}
.ob-lede {
  margin-top: var(--space-12);
  max-width: 52ch;
}

/* Step 1: what the next two minutes are for. */
.ob-promises {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.ob-promises li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
}
.ob-promise-glyph {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* Step 4: the "you're set" mark. */
.ob-done-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-16);
  border-radius: var(--radius-full);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* Step 4: what actually got set up, each row editable in place. */
.ob-recap {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ob-recap-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
}
.ob-recap-row + .ob-recap-row {
  border-top: 1px solid var(--color-border-subtle);
}
.ob-recap-glyph {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--color-text-tertiary);
}
.ob-recap-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ob-recap-value {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  overflow-wrap: anywhere;
}
.ob-recap-link {
  flex: 0 0 auto;
  color: var(--color-accent);
  font-weight: var(--fw-ui-label);
}
@media (prefers-reduced-motion: no-preference) {
  .ob-recap-link {
    transition: color var(--dur-micro-in) var(--ease-enter);
  }
}
.ob-recap-link:hover {
  color: var(--color-accent-hover);
}

/* "I'll do this later" sits beside Save, so it needs to read as a peer action
   in the actions row. It is a submit button with a `formaction` override rather
   than its own <form>, which keeps it native (no JS) and keeps BusinessForm's
   single form valid. */
.ob-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}
.ob-form .form-actions {
  border-top: 0;
  padding-top: 0;
}

.ob-hint {
  margin: 0;
}

/* ================================================= QR claim wizard (4 steps) */
/* Added with /qrs/claim*. Distinct from the older .claim-* rules above, which
   belong to the public "set a destination" page and are centred on one column. */

.claim-serial {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}
.claim-serial-label {
  text-transform: uppercase;
  letter-spacing: var(--ls-ui-label);
}
.claim-serial-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-8);
  letter-spacing: 0.04em;
}

.claim-context {
  margin-bottom: var(--space-16);
  padding: var(--space-8) var(--space-12);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}
.claim-context a {
  color: var(--color-accent-text);
}

/* --- camera viewport ------------------------------------------------------ */
/* Sized in 4:3 so a phone camera has a predictable crop, and never collapsed:
   a zero-height box makes the "start camera" button jump on the first click. */
.claim-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-2);
}
.claim-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The video is decorative until the camera is actually running: without this it
   shows as a black rectangle, which reads as "broken" rather than "not yet on". */
.claim-video:not([src]) {
  display: none;
}
.claim-viewport-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-24);
  text-align: center;
}
/* Once a stream is attached, the empty-state art would sit on top of the feed. */
.claim-viewport[data-scanner-state="scanning"] .claim-viewport-empty,
.claim-viewport[data-scanner-state="initializing"] .claim-viewport-empty,
.claim-viewport[data-scanner-state="success"] .claim-viewport-empty {
  background: color-mix(in srgb, var(--color-surface-0) 78%, transparent);
}
.claim-viewport-glyph {
  color: var(--color-text-tertiary);
}
.claim-scan-title {
  font-weight: var(--fw-ui-label);
}
.claim-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin: var(--space-16) 0;
}
.claim-manual {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* --- business radio list -------------------------------------------------- */
.claim-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-16);
}
.claim-legend {
  margin-bottom: var(--space-8);
}
.claim-biz-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.claim-biz {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
/* Selection is driven off the native radio rather than a server-rendered or
   script-set attribute, so picking a different business highlights at once and
   a no-JS re-render still shows the restored choice. */
.claim-biz:has(.claim-biz-input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.claim-biz:has(.claim-biz-input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.claim-biz-input {
  margin-top: 2px;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--color-accent);
}
/* Whole-card target: a 20px radio alone is a poor touch target on a phone. */
.claim-biz:hover {
  border-color: var(--color-accent);
}


.claim-biz-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.claim-biz-name {
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
  overflow-wrap: anywhere;
}
/* The category · locality line under a business name in the picker. Without a
   width cap a long locality can push the check glyph off the card on a phone. */
.claim-biz-meta {
  overflow-wrap: anywhere;
}
/* The check is a decorative duplicate of the radio's own state, so it is
   absolutely placed: in the flex row it would compete with the label width. */
.claim-biz-check {
  margin-left: auto;
  align-self: center;
  color: var(--color-accent);
}

.claim-scan-hint {
  max-width: 34ch;
}

/* --- wizard header + progress ------------------------------------------------
 * The stepper answers "where am I?" on every one of the four steps. It was
 * rendered with classes that had no rules at all, so "Step 2 of 4 · Select
 * Business" appeared as unstyled body text above an invisible bar — the one
 * question a multi-step flow exists to answer was the one it did not answer. */

.claim-head {
  margin-bottom: var(--space-24);
}
.claim-title {
  margin-bottom: var(--space-8);
}
.claim-sub {
  max-width: 60ch;
}

.claim-progress {
  margin-bottom: var(--space-24);
}
.claim-progress-text {
  margin-bottom: var(--space-8);
}
.claim-progress-step {
  color: var(--color-text-primary);
  font-weight: var(--fw-ui-label);
}
.claim-progress-track {
  display: block;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  overflow: hidden;
}
.claim-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
}

/* The optional aside beside the work (instructions next to the form). Only
   rendered when a step passes one, but the split has to exist before it does. */
.claim-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-24);
}
@media (min-width: 900px) {
  .claim-split {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}
.claim-split-aside {
  min-width: 0;
}
.claim-split-main {
  min-width: 0;
}

/* --- paired fields ---------------------------------------------------------
 * Step 3 puts Category and Custom category side by side, and the stand editor
 * puts the same pair side by side. One row, collapsing to one column on a
 * narrow screen rather than squeezing two selects into ~160px each. */
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-16);
}
@media (min-width: 560px) {
  .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.field-row > .field {
  min-width: 0;
}

/* The required marker on a claim/step-3 label. Named `.field-req` there and
   `.field-required` in the studio — two names for one thing, so only the studio
   one had a rule and the claim form's asterisk rendered at body size. Aliased
   rather than renamed so both callers are correct and there is one style. */
.field-req,
.field-required {
  color: var(--color-accent);
  margin-left: var(--space-2);
}

/* --- review recap --------------------------------------------------------- */

.claim-review-lead {
  margin-bottom: var(--space-16);
}
.claim-recap {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin: 0 0 var(--space-24);
  padding: var(--space-16);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}
.claim-recap-row {
  display: grid;
  grid-template-columns: minmax(96px, 28%) 1fr;
  gap: var(--space-12);
  align-items: baseline;
}
.claim-recap-row dt {
  margin: 0;
}
.claim-recap-row dd {
  margin: 0;
  color: var(--color-text-primary);
  /* A long URL must not push the row wider than the card on a phone. */
  overflow-wrap: anywhere;
}
.claim-recap-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body-sm);
}

/* --- success -------------------------------------------------------------- */
.claim-success {
  text-align: center;
}
.claim-success-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  color: var(--color-surface-0);
  margin-bottom: var(--space-16);
}
.claim-success-lead {
  margin: var(--space-8) 0 var(--space-16);
}
.claim-success .form-actions {
  justify-content: center;
}

@media (max-width: 560px) {
  .claim-recap-row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .claim-success .form-actions .btn,
  .claim-scan-actions .btn {
    width: 100%;
  }
}

/* ================================== Sqanny stand management (/qrs, /qrs/:id) */

.qrs-crumbs a {
  color: var(--color-accent-text);
}

.qrs-why {
  max-width: 62ch;
  margin-bottom: var(--space-16);
}

/* Sits above the stand's edit form when a save is rejected. One sentence that
   answers "what happened, and what now" before the user starts scanning for the
   red text — and, crucially, tells them the fields they did NOT get wrong are
   still filled in, which is the reassurance the old bare error list lacked. */
.qrs-form-error-summary {
  margin-bottom: var(--space-16);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-secondary);
}

/* --- filter bar ----------------------------------------------------------- */
.qrs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
  padding: var(--space-16);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}
.qrs-filters .field {
  margin: 0;
  min-width: 180px;
}
/* Search gets the extra room: it is the one filter people type a long value
   into, and truncating the value is worse than widening the control. */
.qrs-filter-search {
  flex: 1 1 260px;
}
.qrs-filter-actions {
  display: flex;
  gap: var(--space-8);
}

/* --- list ----------------------------------------------------------------- */
.qrs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.qrs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}
.qrs-row-main {
  min-width: 0;
}
.qrs-row-name {
  font-weight: var(--fw-ui-label);
  color: var(--color-text-primary);
  text-decoration: none;
}
.qrs-row-name:hover {
  text-decoration: underline;
}
.qrs-row-meta {
  margin: var(--space-4) 0 0;
  overflow-wrap: anywhere;
}
.qrs-row-serial {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}
.qrs-row-side {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex: 0 0 auto;
}

/* --- destructive confirm -------------------------------------------------- */
/* A <details> rather than window.confirm: it is keyboard reachable, it works
   with scripting off, and it cannot be dismissed by a stray click. The summary
   is the trigger, so it must not inherit the button's own hover pointer. */
.qrs-danger summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.qrs-danger summary::-webkit-details-marker {
  display: none;
}
.qrs-danger > form {
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid var(--color-border-subtle);
}

.qrs h1 .badge {
  vertical-align: middle;
  margin-left: var(--space-8);
}

@media (max-width: 560px) {
  .qrs-filters .field {
    flex: 1 1 100%;
  }
  .qrs-row-side {
    width: 100%;
    justify-content: space-between;
  }
}

/* ================================== Batch QR generation (/qrs/batches*) =========
 * Functional layout only: the generator is a two-column form + preview on a wide
 * screen and a single column on a phone, and the metadata rows stack. No
 * attempt is made to restyle anything that already exists. */

/* Metadata rows: name + value + remove, collapsing to one column on narrow
   screens so a phone user is not typing two inputs side by side at 160px. */
.batch-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: var(--space-12);
  align-items: end;
  padding: var(--space-12);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-12);
}
.batch-meta-row > .field {
  min-width: 0;
}
.batch-meta-remove {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.batch-meta-heading {
  margin-top: var(--space-16);
  margin-bottom: var(--space-8);
}

/* The preview card sits beside the form on a wide screen. min-width: 0 on the
   grid children is load-bearing: a long serial in the recap would otherwise
   force the track wider than the viewport and scroll the page sideways. */
.batch-preview-card {
  margin-top: var(--space-16);
}
.batch-preview-sample {
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.batch-preview-sample li {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
}
.batch-preview-note {
  margin-top: var(--space-12);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

/* Actions inside a batch QR table row. Kept on one line so a row does not grow
   to two heights when a screen reader or a long destination widens it. */
.batch-row-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: nowrap;
}

/* The busy state the download island applies to an <a> (anchors cannot be
   `disabled`, so the visual affordance has to come from the class). */
.btn.is-busy,
.dropdown-item.is-busy {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
}

@media (min-width: 900px) {
  [data-batch-generator] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: var(--space-24);
    align-items: start;
  }
  [data-batch-generator] > form {
    min-width: 0;
  }
  .batch-preview-card {
    margin-top: 0;
    position: sticky;
    top: var(--space-16);
  }
}

@media (max-width: 640px) {
  .batch-meta-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .batch-meta-remove {
    align-items: flex-start;
  }
  .batch-meta-remove .btn {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
   Auth brand mark � Luminous Moss square, shared with the app shell.
   Replaces the old QR glyph on the sign-in screen so the identity matches the
   dashboard. The glow is the same one the shell uses, kept subtle here because
   this is the first paint and a bright halo reads as decoration.
   --------------------------------------------------------------------------- */
.auth-brandmark-fill {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-md, 6px);
  background: var(--color-accent, #2bee34);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-accent, #2bee34) 55%, transparent),
    0 0 20px -6px var(--color-accent, #2bee34);
}

/* The wordmark is now a proper noun, so it is set as one - not lowercased by a
   text-transform that existed for "quoda". */
.auth-wordmark {
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: 0.14em;
  text-transform: none;
  color: var(--color-text-primary);
}

/* ---------------------------------------------------------------------------
   Dev magic-link panel.
   Rendered ONLY when no email provider is configured, so it cannot appear in
   production. The link is a real button rather than a copyable string because the
   local flow previously required copying console output and hand-editing its host.
   --------------------------------------------------------------------------- */
.auth-devlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-3, 12px);
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--color-accent, #2bee34);
  color: #0a1a0c;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-devlink:hover {
  background: color-mix(in srgb, var(--color-accent, #2bee34) 86%, white);
}
.auth-devlink:active {
  transform: translateY(1px);
}

/* ---------------------------------------------------------------------------
   MARKETING NAV AT PHONE WIDTHS
   ---------------------------------------------------------------------------
   The nav is a single flex row: brand, three links, a theme toggle and a CTA whose
   label wraps to two lines at 390px. Measured at 193px of horizontal overflow, which
   is invisible until you actually look at the page on a phone - and an overflowing
   document still returns 200, so nothing caught it.

   Fixed by wrapping rather than hiding. The links and the CTA both matter to
   someone deciding whether to sign up, so neither is collapsed behind a menu button
   that would need its own focus handling, labelling and test.
   --------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .nav-inner {
    flex-wrap: wrap;
    row-gap: var(--space-12);
    /* A narrower gutter, not none: the brand should still feel inset from the
       screen edge on a phone. */
    padding-inline: var(--space-16);
    column-gap: var(--space-12);
  }

  /* `margin-inline-start: auto` on .nav-end is what pins the CTA to the far right on
     desktop. Once the row wraps, that auto margin fights the wrap and is part of
     what pushed the document wide. */
  .nav-end {
    margin-inline-start: 0;
  }

  .nav-links {
    /* Order on wrap: brand, links, then the end cluster on its own row. */
    margin-inline-start: 0;
    flex-wrap: wrap;
  }

  /* The CTA label is the widest thing in the bar; letting it shrink to its content
     rather than forcing the row to one line is what actually stops the overflow. */
  .nav-cta {
    white-space: nowrap;
  }

  .page-main {
    /* The hero and feature cards were laid out against a desktop grid assumption,
       which is the other half of the 193px. */
    padding-inline: var(--space-16);
  }
}


/* Landing-page live numbers. */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-24);
  margin: 0;
  padding: var(--space-24) 0;
  border-block: 1px solid var(--color-border);
}
.stats-tile {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-4, 4px);
}
.stats-tile dd,
.stats-tile dt { margin: 0; }
.stats-value {
  font-size: var(--fs-display-md, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}

/* Marketing promo bar above the nav. */
.promo-bar {
  display: block;
  padding: var(--space-8, 8px) var(--space-16, 16px);
  text-align: center;
  font-size: var(--fs-body-sm, 14px);
  color: var(--color-text-primary);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.promo-bar:hover { background: var(--color-surface-3); }

/* Sign-in extras: Continue with Google, the "or" divider, the claim page's serial, a sign-in error. */
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; margin-top: var(--space-16); border: 1px solid #dadce0; border-radius: var(--radius-md); background: #fff; color: #1f1f1f; font: 500 15px/1 var(--font-sans); text-decoration: none; transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.auth-google:hover { background: #f7f8f8; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.auth-google:active { transform: scale(.98); }
.auth-google:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.auth-or { display: flex; align-items: center; gap: var(--space-12); margin: var(--space-16) 0 0; color: var(--color-text-tertiary); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--color-border-subtle); }
.auth-serial { display: inline-block; margin: var(--space-8) 0 0; padding: 4px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-full); font: 500 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--color-text-secondary); }
.auth-error { margin: var(--space-12) 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--color-danger, #ef4444) 45%, transparent); border-radius: var(--radius-md); font-size: 13px; color: var(--color-text-primary); }

/* ==========================================================================
   Sign-in screen (2026-11): one centred card, a Sign up / Sign in switch, a plain line-art backdrop.
   No glass, no glow, no gradient: the brand is dark and moss.
   ========================================================================== */
.auth { position: relative; isolation: isolate; overflow: hidden; background: var(--color-surface-0); gap: var(--space-24); }
.auth-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; color: var(--color-text-primary); }
.auth-art svg { width: 100%; height: 100%; display: block; }
.auth-art-a, .auth-art-b { opacity: .07; }
.auth-art-scan { color: var(--color-accent); opacity: .22; stroke-dasharray: 2 10; }
.auth-card { position: relative; max-width: 392px; gap: var(--space-16); padding: var(--space-24) var(--space-24) var(--space-20, 20px); border-radius: var(--radius-2xl); box-shadow: 0 24px 64px rgba(0, 0, 0, .5); animation: auth-rise .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.auth-close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-surface-2); color: var(--color-text-secondary); transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.auth-close:hover { background: var(--color-surface-3); color: var(--color-text-primary); }
.auth-close:active { transform: scale(.94); }
.auth-close:focus-visible, .auth-tab:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.auth-login { display: flex; flex-direction: column; gap: var(--space-16); }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 176px; padding: 4px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface-0); }
.auth-tab { position: relative; z-index: 1; padding: 8px 0; text-align: center; font-size: 13px; font-weight: 500; color: var(--color-text-secondary); text-decoration: none; border-radius: 999px; transition: color .2s ease; }
.auth-tab[aria-selected="true"] { color: var(--color-text-primary); }
.auth-tab-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--color-surface-3); transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.auth-login[data-mode="signin"] .auth-tab-pill { transform: translateX(100%); }
.auth-login .auth-title { margin: var(--space-8) 0 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.auth-login .auth-lead { margin-top: calc(var(--space-8) * -1); font-size: 14px; }
.auth-login[data-mode="signin"] .auth-only-signup, .auth-login[data-mode="signup"] .auth-only-signin { display: none; }
.auth-login .auth-form { gap: var(--space-12); margin-block: 0; }
.auth-names { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); }
.auth-login .input { min-height: 48px; border-radius: 12px; background: var(--color-surface-2); border-color: var(--color-border); transition: border-color .15s ease, background-color .15s ease; }
.auth-login .input:hover { border-color: var(--color-text-tertiary); }
.auth-login .input:focus-visible { outline: none; border-color: var(--color-accent); background: var(--color-surface-1); }
.auth-field { position: relative; }
.auth-field .input { padding-left: 44px; }
.auth-field-icon { position: absolute; left: 16px; top: 24px; transform: translateY(-50%); display: grid; color: var(--color-text-tertiary); pointer-events: none; z-index: 1; }
.auth-field:focus-within .auth-field-icon { color: var(--color-accent); }
.auth-login .btn { min-height: 48px; border-radius: 12px; font-weight: 600; }
.auth-login .btn-label { display: inline-grid; }
.auth-login .auth-or { margin: 0; }
.auth-google-flat { margin-top: 0; border-radius: 12px; min-height: 48px; }
.auth-login .auth-fineprint { text-align: center; text-wrap: balance; }
.auth-login .auth-fineprint a { color: var(--color-text-secondary); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 480px) { .auth { padding: var(--space-48, 48px) var(--space-16); } .auth-card { padding: var(--space-20, 20px); } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } .auth-tab-pill { transition: none; } }
