/* ─────────────────────────────────────────────────────────────
   Scoby Pay - Component styles
   Based on docs/design_system/ui_kits/ + preview/
   ───────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ═════════════════════════════════════════════════════════════
   APP LAYOUT (light header, authenticated pages)
   ═════════════════════════════════════════════════════════════ */

.scoby-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.scoby-header-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-4) var(--s-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Logo (shared across layouts) ─────────────────────────── */

.scoby-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.scoby-logo:hover { color: inherit; }

.scoby-logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-self: center;
  filter: drop-shadow(0 0 8px rgba(23, 196, 163, 0.35));
}
.scoby-logo-name {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}
.scoby-logo-product {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: 12px;
  color: var(--living-teal);
  letter-spacing: -0.015em;
  line-height: 1;
  margin-left: -3px;
}

.scoby-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.scoby-header-email {
  font-size: var(--t-body-sm);
  color: var(--text-secondary);
  font-weight: var(--w-medium);
}
.scoby-header-link {
  font-size: var(--t-body-sm);
  font-weight: var(--w-medium);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  transition: color var(--t-fast) var(--ease-out);
}
.scoby-header-link:hover { color: var(--text-primary); }

/* ── Project switcher ────────────────────────────────────── */

.scoby-project-switcher {
  position: relative;
}
.scoby-project-current {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-body-sm);
  font-weight: var(--w-semibold);
  color: var(--text-primary);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--white);
  transition: border-color var(--t-fast) var(--ease-out);
}
.scoby-project-current::after {
  content: "";
  border: 4px solid transparent;
  border-top-color: var(--text-secondary);
  margin-top: 2px;
}
.scoby-project-current:hover {
  border-color: var(--living-teal);
}
.scoby-project-none {
  color: var(--text-secondary);
  font-weight: var(--w-medium);
}
.scoby-project-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  z-index: 100;
  padding: var(--s-1) 0;
}
.scoby-project-dropdown.open {
  display: block;
}
.scoby-project-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: var(--t-body-sm);
  font-weight: var(--w-medium);
  color: var(--text-primary);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-out);
}
.scoby-project-option:hover {
  background: var(--surface-mist);
}
.scoby-project-option.active {
  color: var(--living-teal);
  font-weight: var(--w-semibold);
}
.scoby-project-new {
  border-top: 1px solid var(--border);
  margin-top: var(--s-1);
  padding-top: 10px;
  color: var(--living-teal);
}

.scoby-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-8);
  min-height: calc(100vh - 68px);
}

/* ── Buttons (from preview/components-buttons.html) ───────── */

button,
a.btn,
.btn,
.scoby-btn,
.scoby-btn-primary,
.scoby-btn-secondary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 120ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

a.btn-primary,
.btn-primary,
.scoby-btn-primary {
  background: var(--living-teal);
  color: #fff;
  border-color: var(--living-teal);
}
a.btn-primary:hover,
.btn-primary:hover,
.scoby-btn-primary:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
  color: #fff;
}

a.btn-secondary,
.btn-secondary,
.scoby-btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--border);
}
a.btn-secondary:hover,
.btn-secondary:hover,
.scoby-btn-secondary:hover {
  background: var(--surface-mist);
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

a.btn-danger,
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
a.btn-danger:hover,
.btn-danger:hover { color: #fff; }

a.btn-ghost,
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: transparent;
}
a.btn-ghost:hover,
.btn-ghost:hover { background: var(--surface-mist); color: var(--text-primary); }

a.btn-navy,
.btn-navy {
  background: var(--deep-core-navy);
  color: #fff;
  border-color: var(--deep-core-navy);
}
a.btn-navy:hover,
.btn-navy:hover { color: #fff; }

.btn-small { font-size: 13px; padding: 7px 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Flash messages ───────────────────────────────────────── */

.scoby-flash {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  font-size: var(--t-body-sm);
  font-weight: var(--w-medium);
  margin-bottom: var(--s-5);
}
.scoby-flash-notice {
  background: var(--success-soft);
  color: var(--success-dark);
  border: 1px solid rgba(23, 196, 163, 0.25);
}
.scoby-flash-alert {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(224, 77, 85, 0.25);
}

/* ═════════════════════════════════════════════════════════════
   FORM INPUTS (from preview/components-inputs.html)
   Bare-element styling — no classes needed on inputs
   ═════════════════════════════════════════════════════════════ */

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-sizing: border-box;
  transition: all 120ms;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--living-teal);
  box-shadow: 0 0 0 3px rgba(23, 196, 163, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/* Checkbox & radio — override the global input rule completely */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  accent-color: var(--living-teal);
  cursor: pointer;
  flex-shrink: 0;
}
input[type="radio"] { border-radius: 999px; }

/* Submit — behaves as a button, not a text field */
input[type="submit"] {
  width: auto;
  border: 1px solid var(--living-teal);
  background: var(--living-teal);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
input[type="submit"]:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
}
input[type="submit"]:focus {
  box-shadow: 0 0 0 3px rgba(23, 196, 163, 0.18);
}

/* Hidden fields should not show */
input[type="hidden"] {
  display: none;
}

/* ── Input with prefix (e.g. currency) ────────────────────── */

.with-prefix {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 4px 0 12px;
}
.with-prefix span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 13px;
}
.with-prefix input {
  border: 0;
  background: transparent;
  padding-left: 6px;
  box-shadow: none !important;
}

/* ── Toggle switch ────────────────────────────────────────── */

.toggle {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--living-teal);
  position: relative;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 18px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
}
.toggle.off { background: var(--border); }
.toggle.off::after { left: 2px; }

/* ── Custom checkbox icon (CSS-only, for non-native) ──────── */

.check-input {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--living-teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Custom radio (CSS-only, for non-native) ──────────────── */

.radio {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1.5px solid var(--text-tertiary);
  position: relative;
}
.radio.on { border-color: var(--living-teal); }
.radio.on::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--living-teal);
}

/* ── Check row (checkbox/radio + label inline) ────────────── */

.check,
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.check label,
.form-check label {
  display: inline;
  margin-bottom: 0;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ── Form group (label + input stack) ─────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label { margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea { margin: 0; }

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

/* ═════════════════════════════════════════════════════════════
   BADGES (from preview/components-badges.html)
   ═════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}
.badge-succeeded,
.badge-success { background: var(--success-soft); color: var(--success-dark); }
.badge-processing { background: var(--processing-soft); color: var(--processing); }
.badge-failed,
.badge-danger { background: var(--danger-soft); color: #8B2A30; }
.badge-warning { background: var(--warning-soft); color: #8B5E1F; }
.badge-neutral { background: var(--border); color: var(--text-secondary); }
.badge-teal {
  background: rgba(23, 196, 163, 0.10);
  color: var(--success-dark);
  border: 1px solid rgba(23, 196, 163, 0.30);
}

/* ═════════════════════════════════════════════════════════════
   TABLES (from preview/components-table.html)
   ═════════════════════════════════════════════════════════════ */

.tbl-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-mist);
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-mist); cursor: pointer; }

.num {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  text-align: right;
  color: var(--text-primary);
}
.proc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.tbl-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.tbl-action:hover {
  color: var(--living-teal);
  background: var(--surface-mist);
}
.tbl-action-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
.tbl-action-success:hover {
  color: var(--success-dark);
  background: var(--success-soft);
}

/* ═════════════════════════════════════════════════════════════
   CARDS (from preview/components-cards.html)
   ═════════════════════════════════════════════════════════════ */

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.card-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 8px;
  font-feature-settings: 'tnum';
  color: var(--text-primary);
}
.card-delta {
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-delta.up { color: var(--success-dark); }
.card-delta.down { color: var(--danger); }

/* ═════════════════════════════════════════════════════════════
   AUTH LAYOUT (sign in, sign up — no header)
   Card on surface-mist, centered vertically
   ═════════════════════════════════════════════════════════════ */

.auth-body {
  background: var(--surface-mist);
  font-family: var(--font-sans);
  min-height: 100vh;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow-2);
}

/* ── Brand lockup inside card ─────────────────────────────── */

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.auth-logo:hover { color: inherit; }

.auth-logo-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-self: center;
  filter: drop-shadow(0 0 8px rgba(23, 196, 163, 0.35));
}
.auth-logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}
.auth-logo-product {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--living-teal);
  letter-spacing: -0.015em;
  line-height: 1;
  margin-left: -3px;
}

/* ── Title block ──────────────────────────────────────────── */

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 20px;
}

/* ── Form stack ───────────────────────────────────────────── */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Links below form ─────────────────────────────────────── */

.auth-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.auth-links p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 20px;
}
.auth-links p + p { margin-top: 8px; }

/* ── Errors ───────────────────────────────────────────────── */

.auth-errors {
  background: var(--danger-soft);
  border: 1px solid rgba(224, 77, 85, 0.25);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.auth-errors-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 8px;
}
.auth-errors ul { margin: 0; padding-left: 20px; }
.auth-errors li { font-size: 14px; color: var(--danger); line-height: 1.5; }

/* ── Hosted billing portal ───────────────────────────────── */

.billing-portal-shell { max-width: 760px; }
.billing-portal-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.billing-portal-section-heading,
.billing-portal-method-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.billing-portal-section-heading { margin-bottom: 18px; }
.billing-portal-section-heading h2,
.billing-portal-card-form h2 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 28px;
  color: var(--text-primary);
}
.billing-portal-method-grid {
  display: grid;
  gap: 12px;
}
.billing-portal-method-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.billing-portal-method-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.billing-portal-method-option p,
.billing-portal-section-copy {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
  margin-top: 4px;
}
.billing-portal-methods button,
.billing-portal-card-form button { min-height: 44px; }
.billing-portal-replace-card { margin-top: 16px; font-size: 14px; }
.billing-portal-card-form .card-label { margin-bottom: 2px; }
.billing-portal-card-form .billing-portal-section-copy { margin-bottom: 18px; }
.billing-portal-holder-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 0;
  padding: 20px 0 0;
  margin: 0;
  border-top: 1px solid var(--border);
}
.billing-portal-holder-fields legend {
  padding: 0 8px 0 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: var(--w-semibold);
}
.billing-portal-consent { align-items: flex-start; }
.billing-portal-consent input { margin-top: 3px; }
.billing-portal-consent label { line-height: 20px; }
.billing-portal-invoice { min-width: 0; overflow: hidden; }
.billing-portal-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--w-semibold);
  margin-bottom: 18px;
}
.billing-portal-status-dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: currentColor; }
.billing-portal-status-paid { color: var(--success-dark); background: var(--success-soft); }
.billing-portal-status-pending { color: #8A621E; background: rgba(219, 162, 76, 0.16); }
.billing-portal-status-failed { color: var(--danger); background: var(--danger-soft); }
.billing-portal-status-void { color: var(--text-secondary); background: var(--surface-mist); }
.billing-portal-invoice-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}
.billing-portal-invoice-summary h2 {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 17px;
  overflow-wrap: anywhere;
  margin-top: 4px;
}
.billing-portal-plan { color: var(--text-secondary); font-size: 14px; margin-top: 5px; }
.billing-portal-invoice-amounts { display: grid; gap: 8px; min-width: 190px; }
.billing-portal-invoice-amounts p { display: flex; justify-content: space-between; gap: 16px; }
.billing-portal-invoice-amounts span { color: var(--text-secondary); font-size: 12px; }
.billing-portal-invoice-amounts strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  font-size: 13px;
  text-align: right;
}
.billing-portal-line-items { margin: 20px 0 0; border-top: 1px solid var(--border); }
.billing-portal-line-items > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.billing-portal-line-items dt { color: var(--text-primary); font-size: 14px; }
.billing-portal-line-items dt span { display: block; font-weight: var(--w-semibold); }
.billing-portal-line-items dt small { display: block; color: var(--text-secondary); margin-top: 3px; }
.billing-portal-line-items dd {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  font-size: 14px;
}
.billing-portal-invoice > .billing-portal-methods,
.billing-portal-invoice > .billing-portal-card-form,
.billing-portal-pix,
.billing-portal-attempts {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.billing-portal-invoice > .billing-portal-methods,
.billing-portal-invoice > .billing-portal-card-form { border-radius: 0; border-right: 0; border-bottom: 0; border-left: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; }
.billing-portal-pix h3,
.billing-portal-attempts h3,
.billing-portal-empty h2 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 24px;
  margin-bottom: 12px;
}
.billing-portal-pix form button,
.billing-portal-pix-copy button { min-height: 44px; }
.billing-portal-pix-details { display: grid; gap: 14px; }
.billing-portal-pix-qr { width: 220px; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.billing-portal-pix-copy { display: grid; gap: 8px; min-width: 0; }
.billing-portal-pix-copy label { color: var(--text-primary); font-size: 13px; font-weight: var(--w-semibold); }
.billing-portal-pix-copy textarea {
  width: 100%;
  max-width: 100%;
  min-height: 96px;
  resize: vertical;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-mist);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
}
.billing-portal-pix-copy textarea:focus,
.billing-portal-pix-copy button:focus-visible,
.billing-portal-pix form button:focus-visible {
  outline: 3px solid rgba(23, 196, 163, 0.22);
  outline-offset: 2px;
}
.billing-portal-copy-feedback { min-height: 20px; color: var(--success-dark); font-size: 13px; }
.billing-portal-pix-expiration,
.billing-portal-muted,
.billing-portal-empty p { color: var(--text-secondary); font-size: 13px; line-height: 20px; }
.billing-portal-pix-support { color: var(--danger); font-size: 13px; line-height: 20px; }
.billing-portal-attempts ol { list-style: none; padding: 0; display: grid; gap: 10px; }
.billing-portal-attempt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.billing-portal-attempt > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.billing-portal-attempt strong { color: var(--text-primary); font-size: 13px; overflow-wrap: anywhere; }
.billing-portal-attempt-status { color: var(--text-secondary); font-size: 12px; }
.billing-portal-attempt time { color: var(--text-secondary); font-family: var(--font-mono); font-size: 11px; text-align: right; }

@media (max-width: 640px) {
  .billing-portal-body .auth-page { align-items: flex-start; padding: 16px; }
  .billing-portal-shell { padding: 24px 18px; }
  .billing-portal-section-heading,
  .billing-portal-method-option { align-items: stretch; flex-direction: column; }
  .billing-portal-method-option form,
  .billing-portal-method-option button,
  .billing-portal-card-form button { width: 100%; }
  .billing-portal-invoice-summary { grid-template-columns: 1fr; gap: 14px; }
  .billing-portal-invoice-amounts { min-width: 0; }
  .billing-portal-pix form button,
  .billing-portal-pix-copy button { width: 100%; }
  .billing-portal-attempt { align-items: flex-start; flex-direction: column; }
  .billing-portal-attempt time { text-align: left; }
}

/* ═════════════════════════════════════════════════════════════
   MARKETING LAYOUT (landing page)
   From docs/design_system/ui_kits/marketing/
   ═════════════════════════════════════════════════════════════ */

.mkt-body {
  margin: 0;
  background: var(--surface-mist);
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.mkt-body a { color: inherit; text-decoration: none; }

/* ── Marketing header ─────────────────────────────────────── */

.mkt-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 0;
  background: rgba(8, 26, 34, 0.65);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mkt-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.mkt-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mkt-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.mkt-logo:hover { color: inherit; }
.mkt-logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-self: center;
  filter: drop-shadow(0 0 8px rgba(23, 196, 163, 0.35));
}
.mkt-logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
}
.mkt-logo-product {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--living-teal);
  letter-spacing: -0.015em;
  line-height: 1;
  margin-left: -3px;
}

/* ── Marketing buttons ────────────────────────────────────── */

.mbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--living-teal);
  color: #fff;
  transition: all var(--t-fast) var(--ease-out);
  line-height: 1;
  font-family: var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.mbtn:hover { background: var(--success-dark); color: #fff; }
.mbtn.outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.20); }
.mbtn.outline:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.40); }
.mbtn.ghost { background: transparent; color: var(--on-dark-2); padding: 10px 14px; }
.mbtn.ghost:hover { color: #fff; }
.mbtn.lg { font-size: 15px; padding: 14px 26px; }

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: 88px 0 120px;
  overflow: hidden;
  background: var(--dark-2);
  color: #fff;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(23, 196, 163, 0.12) 0%, transparent 60%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
}
.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint-layer);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(23, 196, 163, 0.10);
  border: 1px solid rgba(23, 196, 163, 0.25);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
  color: #fff;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--living-teal);
}
.hero-lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--on-dark-2);
  max-width: 640px;
  margin: 28px 0 36px;
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-note {
  font-size: 12.5px;
  color: var(--on-dark-3);
  margin-left: 4px;
}

/* ── Processor strip ──────────────────────────────────────── */

.proc-strip {
  background: var(--dark-2);
  padding: 32px 0 56px;
  position: relative;
  z-index: 2;
}
.proc-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.proc-strip-label {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-3);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.proc-strip-names {
  display: flex;
  align-items: center;
  gap: 56px;
}
.proc-strip-names span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.02em;
}

/* ── Marketing sections ───────────────────────────────────── */

.mkt-section {
  padding: 112px 0;
  position: relative;
  background: var(--surface-mist);
}
.mkt-section + .mkt-section { border-top: 1px solid var(--border); }
.mkt-section-dark {
  background: var(--dark-2);
  color: #fff;
  border-color: var(--dark-4);
}
.mkt-section-dark + .mkt-section { border-top: 0; }

.mkt-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.mkt-section-dark .mkt-eyebrow { color: var(--mint-layer); }

.mkt-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 760px;
  color: var(--text-primary);
  text-wrap: balance;
}
.mkt-section-dark .mkt-heading { color: #fff; }
.mkt-heading em { font-style: normal; color: var(--living-teal); }

.mkt-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 620px;
  margin-top: 18px;
  text-wrap: pretty;
}
.mkt-section-dark .mkt-sub { color: var(--on-dark-2); }

/* ── Steps ────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-top: 56px;
}
.step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.mkt-section-dark .step {
  background: var(--dark-3);
  border-color: var(--dark-4);
  color: var(--on-dark-1);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
}
.step-ico {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(23, 196, 163, 0.12);
  border: 1px solid rgba(23, 196, 163, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0 24px;
  color: var(--living-teal);
}
.step h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  color: var(--text-primary);
}
.mkt-section-dark .step h3 { color: #fff; }
.step-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.mkt-section-dark .step-desc { color: var(--on-dark-2); }
.step-footer {
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--living-teal);
}

/* ── Product preview ──────────────────────────────────────── */

.preview-wrap {
  margin-top: 64px;
  border-radius: 18px;
  background: var(--dark-2);
  border: 1px solid var(--dark-4);
  box-shadow: 0 40px 80px -20px rgba(8, 26, 34, 0.35);
  overflow: hidden;
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--dark-4);
  background: rgba(255, 255, 255, 0.02);
}
.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dark-4);
}
.preview-url {
  margin-left: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--on-dark-3);
  white-space: nowrap;
}
.preview-body { padding: 28px 32px 32px; }
.preview-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}
.preview-kpi {
  padding: 16px;
  background: var(--dark-3);
  border: 1px solid var(--dark-4);
  border-radius: 12px;
}
.preview-kpi-featured {
  background: var(--grad-primary);
  border-color: transparent;
}
.preview-kpi-label {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--on-dark-3);
  margin-bottom: 8px;
}
.preview-kpi-featured .preview-kpi-label { color: rgba(255,255,255,0.80); }
.preview-kpi-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: #fff;
  font-feature-settings: 'tnum';
}
.preview-kpi-delta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mint-layer);
  margin-top: 4px;
}

/* ── FAQ ──────────────────────────────────────────────────── */

.faq { margin-top: 56px; max-width: 800px; }
.faq-item {
  border-top: 1px solid var(--border);
  padding: 26px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-q {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.faq-a {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.6;
  max-width: 680px;
}

/* ── CTA section ──────────────────────────────────────────── */

.mkt-cta-section {
  padding: 96px 0;
}

/* ── Live dot (shared pulse) ──────────────────────────────── */

.mkt-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--living-teal);
  animation: scoby-pulse 2s ease-in-out infinite;
  display: inline-block;
}

/* ── Marketing footer ─────────────────────────────────────── */

.mkt-footer {
  background: var(--dark-1);
  color: var(--on-dark-1);
  padding: 80px 0 48px;
  border-top: 1px solid var(--dark-4);
}
.mkt-footer a { transition: color var(--t-fast); }
.mkt-footer a:hover { color: var(--living-teal); }

.mkt-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.mkt-footer-brand { max-width: 340px; }
.mkt-footer-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}
.mkt-footer-desc {
  font-size: 14px;
  color: var(--on-dark-2);
  line-height: 1.55;
}

.mkt-footer-col h4 {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-3);
  margin: 0 0 16px;
}
.mkt-footer-col span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--on-dark-1);
  padding: 5px 0;
}
.mkt-footer-col .soon {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(219, 162, 76, 0.15);
  color: var(--kombucha-amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.mkt-footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--dark-4);
  font-size: 12.5px;
  color: var(--on-dark-3);
  font-family: var(--font-mono);
}
.mkt-footer-legal-right {
  display: flex;
  gap: 24px;
  align-items: center;
  white-space: nowrap;
}
.mkt-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ═════════════════════════════════════════════════════════════
   APP PAGES (projects, authenticated views)
   ═════════════════════════════════════════════════════════════ */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.page-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}
.page-crumb {
  font-size: 13px;
  margin-bottom: 8px;
}

/* ── Form page (new project, etc.) ────────────────────────── */

.page-container {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}
.page-form {
  width: 100%;
  max-width: 520px;
}
.page-form .page-title { margin-bottom: 4px; }
.page-form .page-sub { margin-bottom: 28px; }

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

/* ── Empty state ──────────────────────────────────────────── */

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.empty-state .btn { margin-top: 18px; }

/* ── Detail page (project show) ───────────────────────────── */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-list {
  margin-top: 16px;
}
.detail-list > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.detail-list dd {
  font-size: 14px;
  color: var(--text-primary);
}

/* ── Alert banner ─────────────────────────────────────────── */

.alert {
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}
.alert-warning {
  background: var(--warning-soft);
  border: 1px solid rgba(219, 162, 76, 0.30);
}
.alert-title {
  font-size: 14px;
  font-weight: 600;
  color: #8B5E1F;
  margin-bottom: 10px;
}
.alert-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  color: var(--text-primary);
}
.alert-hint {
  font-size: 12px;
  color: #8B5E1F;
  margin-top: 8px;
}
.alert-danger {
  background: var(--danger-soft);
  border: 1px solid rgba(220, 53, 69, 0.20);
}
.alert-danger .alert-title {
  color: var(--danger);
}
.alert-danger .alert-hint {
  color: var(--danger);
  opacity: 0.8;
}
.alert-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.alert-warning .alert-danger-row .alert-title {
  color: #8B5E1F;
}
.alert-warning .alert-danger-row .alert-hint {
  color: #8B5E1F;
}

/* ── Code block ───────────────────────────────────────────── */

.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--deep-core-navy);
  color: var(--mint-layer);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-top: 14px;
  line-height: 1.6;
}

/* ═════════════════════════════════════════════════════════════
   ONBOARDING WIZARD (Asaas subaccount)
   ═════════════════════════════════════════════════════════════ */

.page-form-wide { max-width: 720px; }

/* ── Wizard progress indicator ────────────────────────────── */

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.wizard-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out);
}
.wizard-progress-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-mist);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.wizard-progress-label { line-height: 1; }

.wizard-progress-item--current {
  border-color: var(--living-teal);
  color: var(--text-primary);
  background: rgba(23, 196, 163, 0.08);
}
.wizard-progress-item--current .wizard-progress-num {
  background: var(--living-teal);
  color: #fff;
}

.wizard-progress-item--done {
  border-color: rgba(23, 196, 163, 0.30);
  color: var(--text-primary);
}
.wizard-progress-item--done .wizard-progress-num {
  background: var(--success);
  color: #fff;
}

/* ── Form sections (used inside the wizard) ───────────────── */

.form-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}
.form-section + .form-section {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.form-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.form-section-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: -8px 0 4px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-row:has(.form-group:nth-child(3)) {
  grid-template-columns: 1.4fr 1.4fr 0.6fr;
}
.form-group-narrow { max-width: 200px; }
.form-group-wide   { grid-column: span 1; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Radio cards (account type selector) ──────────────────── */

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}
.radio-card:hover { border-color: var(--living-teal); }
.radio-card input[type="radio"] { margin-top: 4px; accent-color: var(--living-teal); }
.radio-card strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.radio-card small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.radio-card:has(input:checked) {
  border-color: var(--living-teal);
  background: rgba(23, 196, 163, 0.06);
}

@media (max-width: 640px) {
  .radio-group { grid-template-columns: 1fr; }
}

/* ── Review step ──────────────────────────────────────────── */

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .review-grid { grid-template-columns: 1fr; }
}
.review-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.review-edit {
  font-size: 12px;
  color: var(--living-teal);
  font-weight: 500;
}
.review-disclaimer { margin-top: 18px; }

/* ── Status card (post-submission) ────────────────────────── */

.status-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.status-card--success { border-color: rgba(23, 196, 163, 0.30); }
.status-card--danger  { border-color: rgba(220, 80, 95, 0.25); }
.status-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 4px 0 0;
}
.status-card-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.status-next {
  margin-top: 8px;
  padding: 16px 18px;
  background: var(--surface-mist);
  border-radius: 10px;
}
.status-next h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 8px;
}
.status-next ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── Banner (project show CTA) ────────────────────────────── */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 22px;
}
.banner-body { flex: 1; min-width: 0; }
.banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.banner-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 0;
  line-height: 1.5;
}
.banner--info {
  border-left-color: var(--living-teal);
  background: linear-gradient(0deg, rgba(23, 196, 163, 0.04), rgba(23, 196, 163, 0.04)), #fff;
}
.banner--warn {
  border-left-color: var(--warning);
  background: var(--warning-soft);
}
.banner--warn .banner-sub { color: #8B5E1F; }
.banner--danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.banner--danger .banner-sub { color: #8B2A30; }

/* -- KYC progress stepper (onboarding status page) -- */
.kyc-steps {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
}
.kyc-step {
  position: relative;
  display: flex;
  gap: var(--s-3);
  padding-bottom: var(--s-5);
}
.kyc-step:last-child { padding-bottom: 0; }
/* connecting line between dots */
.kyc-step::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.kyc-step:last-child::before { display: none; }
.kyc-step-dot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: #fff;
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.kyc-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kyc-step-label {
  font-weight: 600;
  color: var(--text-primary);
}
.kyc-step-state {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.kyc-step-action {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  flex-wrap: wrap;
}
.kyc-step-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.kyc-step--approved .kyc-step-dot { border-color: var(--success); background: var(--success); }
.kyc-step--approved .kyc-step-state { color: var(--success); }

.kyc-step--awaiting .kyc-step-dot { border-color: var(--processing); background: var(--processing-soft); }
.kyc-step--awaiting .kyc-step-state { color: var(--processing); }

.kyc-step--pending .kyc-step-dot { border-color: var(--warning); background: var(--warning-soft); }
.kyc-step--pending .kyc-step-state { color: var(--warning); font-weight: 600; }

.kyc-step--rejected .kyc-step-dot { border-color: var(--danger); background: var(--danger); }
.kyc-step--rejected .kyc-step-state { color: var(--danger); font-weight: 600; }

/* ── Document verification page ───────────────────────────── */

.page-crumb-sep { color: var(--text-tertiary); margin: 0 6px; }

.verify-reject {
  margin: 4px 0 20px;
  padding: 12px 16px;
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--danger-soft);
}
.verify-reject p { margin: 0; font-size: 13px; line-height: 1.55; color: #8B2A30; }

/* Hosted handoff — the hero (QR on desktop, tap-through on mobile) */
.verify-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 12px;
}
.verify-hero-copy { flex: 1; min-width: 0; }
.verify-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--living-teal);
}
.verify-hero-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 6px 0 0;
}
.verify-hero-sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 8px 0 0;
  max-width: 44ch;
}
.verify-covers {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.verify-covers li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
}
.verify-check {
  flex: 0 0 auto;
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--living-teal);
}
.verify-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.verify-cta { margin-top: 20px; }
.verify-inline-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--living-teal);
  text-decoration: none;
}
.verify-inline-link:hover { text-decoration: underline; }

.verify-qr-frame {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.verify-qr {
  width: 168px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 0 0 5px rgba(23, 196, 163, 0.06);
}
.verify-qr svg { display: block; width: 100%; height: auto; }
.verify-qr-cap {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  max-width: 168px;
  line-height: 1.4;
}

/* API uploads — a tidy checklist */
.verify-uploads { margin-top: 24px; }
.verify-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 12px;
}
.verify-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.verify-row {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.verify-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.verify-row-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.verify-row-sub { font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 6px 0 0; }
.verify-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.verify-file { font-size: 13px; color: var(--text-secondary); max-width: 100%; }
.verify-file::file-selector-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  margin-right: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 120ms var(--ease-out);
}
.verify-file::file-selector-button:hover { background: var(--surface-mist); border-color: var(--text-tertiary); }

@media (max-width: 560px) {
  .verify-hero { flex-direction: column; align-items: stretch; gap: 24px; padding: 22px; }
  .verify-qr-frame { align-self: center; }
}

/* ═════════════════════════════════════════════════════════════
   PRODUCT UI — dark chrome (ported from ui_kits/product/styles.css)
   Everything is scoped under .product-body so it never collides with
   the light marketing/auth/app classes above.
   ═════════════════════════════════════════════════════════════ */

.product-body {
  margin: 0;
  background: var(--dark-2);
  color: var(--on-dark-1);
  font-family: var(--font-sans);
}
.product-body * { box-sizing: border-box; }
.product-body button { font-family: inherit; cursor: pointer; }
.product-body a { color: var(--living-teal); }

/* ── Shell ──────────────────────────────────────────────── */
.product-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--dark-2);
}
.product-main { display: flex; flex-direction: column; min-width: 0; }
.product-body .page { padding: 28px 36px 72px; flex: 1; }

/* ── Sidebar ────────────────────────────────────────────── */
.product-body .sidebar {
  background: var(--dark-2);
  border-right: 1px solid var(--dark-4);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.product-body .sidebar-logo { display: flex; align-items: baseline; gap: 8px; padding: 4px 8px 22px; text-decoration: none; }
.product-body .sidebar-logo .mark { width: 32px; height: 32px; flex-shrink: 0; align-self: center; margin-left: -4px; filter: drop-shadow(0 0 6px rgba(23, 196, 163, 0.35)); }
.product-body .sidebar-logo .name { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: #fff; letter-spacing: -0.03em; line-height: 1; }
.product-body .sidebar-logo .pay { font-family: var(--font-display); font-weight: 600; font-size: 11px; color: var(--living-teal); letter-spacing: -0.015em; line-height: 1; margin-left: -3px; }
.product-body .sidebar-section { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-3); font-weight: 500; padding: 14px 10px 4px; }
.product-body .nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--on-dark-2); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  border: 0; background: transparent; width: 100%; text-align: left;
  border-left: 2px solid transparent; margin-left: -2px;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast);
}
.product-body .nav-item:hover { background: var(--dark-3); color: #fff; }
.product-body .nav-item.active { background: rgba(23, 196, 163, 0.10); color: var(--living-teal); border-left-color: var(--living-teal); }
.product-body .nav-spacer { flex: 1; }
.product-body .nav-account { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--dark-4); margin-top: 12px; }
.product-body .avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--grad-growth); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.product-body .nav-account .who { font-size: 12.5px; font-weight: 500; color: #fff; }
.product-body .nav-account .org { font-size: 10.5px; color: var(--on-dark-3); }

/* ── Topbar ─────────────────────────────────────────────── */
.product-body .topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 36px; border-bottom: 1px solid var(--dark-4);
  background: rgba(8, 26, 34, 0.85); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 5;
}
.product-body .topbar-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-body .topbar-menu { display: none; }
.product-body .crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--on-dark-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-body .crumbs strong { color: #fff; font-weight: 600; }
.product-body .crumbs .sep { color: var(--on-dark-3); }
.product-body .topbar .actions { display: flex; align-items: center; gap: 10px; }
.product-body .search { display: flex; align-items: center; gap: 8px; background: var(--dark-3); border: 1px solid var(--dark-4); border-radius: 10px; padding: 7px 12px; font-size: 13px; color: var(--on-dark-3); width: 280px; }
.product-body .search input { border: 0; outline: 0; background: transparent; font-family: inherit; font-size: inherit; color: var(--on-dark-1); flex: 1; padding: 0; }
.product-body .search input::placeholder { color: var(--on-dark-3); }
.product-body .search kbd { font-family: var(--font-mono); font-size: 10px; background: var(--dark-4); border-radius: 4px; padding: 2px 6px; color: var(--on-dark-2); }
.product-body .dropdown { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 7px 12px; border-radius: 10px; background: var(--dark-3); border: 1px solid var(--dark-4); color: var(--on-dark-1); }

/* ── Buttons (dark) ─────────────────────────────────────── */
.product-body .btn { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; transition: all var(--t-fast) var(--ease-out); line-height: 1; white-space: nowrap; font-family: inherit; text-decoration: none; }
.product-body .btn.primary { background: var(--living-teal); color: #fff; border-color: var(--living-teal); }
.product-body .btn.primary:hover { background: var(--success-dark); border-color: var(--success-dark); }
.product-body .btn.secondary { background: var(--dark-3); color: var(--on-dark-1); border-color: var(--dark-4); }
.product-body .btn.secondary:hover { background: var(--dark-4); border-color: var(--dark-5); }
.product-body .btn.sm { font-size: 12.5px; padding: 6px 12px; }
.product-body .icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px; border-radius: 8px; background: transparent; color: var(--on-dark-2); border: 0; transition: all var(--t-fast); }
.product-body .icon-btn:hover { background: var(--dark-3); color: #fff; }

/* ── Page head ──────────────────────────────────────────── */
.product-body .page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.product-body .page-head h1 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; color: #fff; margin: 0; }
.product-body .page-head .sub { font-size: 13px; color: var(--on-dark-2); margin-top: 4px; }
.product-body .page-head-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── Cards ──────────────────────────────────────────────── */
.product-body .card { background: var(--dark-3); border: 1px solid var(--dark-4); border-radius: 14px; padding: 22px; }
.product-body .card-flush { padding: 0; overflow: hidden; }
.product-body .card-pad { padding: 16px 22px; }
.product-body .card-title { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
.product-body .card-eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-3); }
.product-body .drawer-section-title { margin-bottom: 18px; }

/* ── Tables (dark) ──────────────────────────────────────── */
.product-body .tbl-wrap { background: var(--dark-3); border: 1px solid var(--dark-4); border-radius: 14px; overflow: hidden; }
.product-body .tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.product-body .tbl thead th { text-align: left; font-weight: 500; color: var(--on-dark-3); font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase; padding: 12px 18px; border-bottom: 1px solid var(--dark-4); background: var(--dark-3); }
.product-body .tbl thead th.num { text-align: right; }
.product-body .tbl tbody td { padding: 14px 18px; border-bottom: 1px solid var(--dark-4); vertical-align: middle; color: var(--on-dark-1); }
.product-body .tbl tbody tr:last-child td { border-bottom: 0; }
.product-body .tbl-row { position: relative; transition: background 80ms; }
.product-body .tbl-row:hover,
.product-body .tbl-row-static:hover { background: rgba(23, 196, 163, 0.04); }
.product-body .tbl .num { font-family: var(--font-mono); font-feature-settings: 'tnum'; text-align: right; }
.product-body .tbl .id { font-family: var(--font-mono); font-size: 12px; color: var(--on-dark-2); }
.product-body .tbl .date { font-family: var(--font-mono); font-size: 12px; color: var(--on-dark-3); }
.product-body .processor { font-family: var(--font-mono); font-size: 11.5px; color: var(--on-dark-3); }
.product-body .row-link { color: var(--on-dark-2); text-decoration: none; }
.product-body .row-link::after { content: ""; position: absolute; inset: 0; }
.product-body .tbl-bordered-top { border-top: 1px solid var(--dark-4); }
.product-body .tbl-empty td, .product-body .tbl-row-static td { color: var(--on-dark-2); }
.product-body .tbl-row-static { cursor: default; }

/* ── Badges (dark) ──────────────────────────────────────── */
.product-body .badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.product-body .badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.product-body .badge.success { background: rgba(23, 196, 163, 0.14); color: var(--mint-layer); }
.product-body .badge.processing { background: rgba(93, 138, 184, 0.18); color: #94B2D4; }
.product-body .badge.warning { background: rgba(219, 162, 76, 0.18); color: #F0BE73; }
.product-body .badge.failed, .product-body .badge.danger { background: rgba(224, 77, 85, 0.18); color: #F47B82; }
.product-body .badge.neutral { background: var(--dark-4); color: var(--on-dark-2); }

/* ── Filter chips ───────────────────────────────────────── */
.product-body .filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.product-body .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--dark-4); background: var(--dark-3); font-size: 12.5px; font-weight: 500; color: var(--on-dark-2); cursor: pointer; text-decoration: none; transition: all var(--t-fast); }
.product-body .chip:hover { background: var(--dark-4); color: #fff; }
.product-body .chip.on { background: var(--living-teal); color: #fff; border-color: var(--living-teal); }

/* ── Drawer ─────────────────────────────────────────────── */
.product-body .drawer-overlay { position: fixed; inset: 0; background: rgba(5, 15, 20, 0.65); backdrop-filter: blur(8px); z-index: 50; display: flex; justify-content: flex-end; }
.product-body .drawer { width: 720px; max-width: 95vw; background: var(--dark-2); border-left: 1px solid var(--dark-4); height: 100vh; overflow-y: auto; animation: drawer-in 280ms var(--ease-out); box-shadow: -40px 0 60px -20px rgba(0,0,0,0.6); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.product-body .drawer-header { padding: 22px 32px; border-bottom: 1px solid var(--dark-4); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; background: var(--dark-2); z-index: 1; }
.product-body .drawer-id-row { display: flex; align-items: center; gap: 10px; }
.product-body .drawer-id { font-family: var(--font-mono); font-size: 13px; color: var(--on-dark-2); }
.product-body .drawer-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -0.01em; color: #fff; }
.product-body .drawer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.product-body .drawer-body { padding: 28px 32px 48px; }
.product-body .drawer-customer-name { margin-top: 8px; font-weight: 600; font-size: 14px; color: #fff; }
.product-body .drawer-customer-ref { font-size: 12px; color: var(--on-dark-2); margin-top: 4px; font-family: var(--font-mono); }
.product-body .drawer-muted { font-size: 12px; color: var(--on-dark-2); }
.product-body .drawer-line-items { margin-top: 14px; }
.product-body .routed-pill { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(23, 196, 163, 0.10); border: 1px solid rgba(23, 196, 163, 0.25); }
.product-body .routed-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--living-teal); }
.product-body .routed-name { font-family: var(--font-mono); font-size: 12px; color: var(--mint-layer); }
.product-body .routed-desc { margin-top: 14px; font-size: 12.5px; color: var(--on-dark-2); line-height: 1.6; }
.product-body .kv-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--on-dark-1); margin-top: 4px; }
.product-body .kv-label { color: var(--on-dark-3); }
.product-body .drawer-dates .kv-row { gap: 12px; }
.product-body .drawer-dates .kv-label { flex: 0 0 72px; }
.product-body .drawer-dates .kv-row > span:last-child { min-width: 0; text-align: right; }

/* ── Timeline ───────────────────────────────────────────── */
.product-body .timeline { position: relative; padding-left: 24px; }
.product-body .timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--dark-4); }
.product-body .timeline-event { position: relative; padding: 8px 0 16px; }
.product-body .timeline-event::before { content: ''; position: absolute; left: -23px; top: 14px; width: 13px; height: 13px; border-radius: 999px; background: var(--dark-3); border: 2px solid var(--on-dark-3); }
.product-body .timeline-event.success::before { border-color: var(--living-teal); background: var(--living-teal); }
.product-body .timeline-event.warning::before { border-color: var(--warning); background: var(--warning); }
.product-body .timeline-event.danger::before { border-color: var(--danger); background: var(--danger); }
.product-body .timeline-event .timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-body .timeline-event .title { font-size: 13.5px; font-weight: 500; color: #fff; }
.product-body .timeline-event .meta { font-family: var(--font-mono); font-size: 11px; color: var(--on-dark-3); white-space: nowrap; }
.product-body .timeline-event .body { font-size: 12.5px; color: var(--on-dark-2); margin-top: 4px; }

/* ── Layout helpers ─────────────────────────────────────── */
.product-body .grid-2 { display: grid; grid-template-columns: 2fr 1.2fr; gap: 14px; }
.product-body .grid-2-top { align-items: start; }
.product-body .stack > * + * { margin-top: 14px; }
.product-body .divider { height: 1px; background: var(--dark-4); margin: 18px 0; }

/* ── Empty / placeholder surface ────────────────────────── */
.product-body .empty-card { text-align: center; padding: 64px; color: var(--on-dark-3); }
.product-body .empty-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--on-dark-2); letter-spacing: -0.01em; }
.product-body .empty-body { margin-top: 8px; font-size: 13.5px; }

/* ── Mobile sidebar scrim (hidden on desktop) ───────────── */
.product-body .sidebar-scrim { display: none; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-shell { grid-template-columns: 1fr; }
  .product-body .sidebar {
    position: fixed; top: 0; left: 0; z-index: 60; width: 260px; height: 100vh;
    transform: translateX(-100%); transition: transform var(--t-base) var(--ease-out);
  }
  .product-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: 30px 0 60px -20px rgba(0,0,0,0.6); }
  .product-shell.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(5, 15, 20, 0.55); }
  .product-body .topbar-menu { display: inline-flex; }
  .product-body .topbar { padding: 14px 18px; }
  .product-body .search { display: none; }
  .product-body .page { padding: 22px 18px 64px; }
}

@media (max-width: 720px) {
  .product-body .dropdown { display: none; }
  .product-body .page-head { flex-direction: column; align-items: stretch; }
  .product-body .grid-2 { grid-template-columns: 1fr; }
  .product-body .drawer { width: 100vw; max-width: 100vw; border-left: 0; }
  .product-body .timeline-event .timeline-head { display: block; }
  .product-body .timeline-event .meta { white-space: normal; overflow-wrap: anywhere; margin-top: 4px; }
  .product-body .drawer-header { flex-direction: column; align-items: flex-start; }

  /* Invoices table → stacked cards */
  .product-body .tbl thead { display: none; }
  .product-body .tbl, .product-body .tbl tbody, .product-body .tbl tr, .product-body .tbl td { display: block; width: 100%; }
  .product-body .tbl-row { padding: 12px 16px; border-bottom: 1px solid var(--dark-4); }
  .product-body .tbl-row td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; }
  .product-body .tbl-row td::before { content: attr(data-label); color: var(--on-dark-3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
  .product-body .tbl-row .num { text-align: right; }
}

/* ═════════════════════════════════════════════════════════════
   PRODUCT UI — Dashboard + Subscriptions (scoped under .product-body)
   ═════════════════════════════════════════════════════════════ */

/* ── KPIs ───────────────────────────────────────────────── */
.product-body .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.product-body .kpi { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--dark-3); border: 1px solid var(--dark-4); border-radius: 14px; min-height: 122px; }
.product-body .kpi .label { font-size: 11px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--on-dark-3); display: flex; align-items: center; gap: 8px; }
.product-body .kpi .value { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.015em; color: #fff; }
.product-body .kpi .delta { font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.product-body .kpi .delta.up { color: var(--mint-layer); }
.product-body .kpi .delta.down { color: var(--danger); }
.product-body .kpi.featured { background: var(--grad-primary); border-color: transparent; position: relative; overflow: hidden; }
.product-body .kpi.featured::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 100% 100%, rgba(137, 241, 213, 0.30) 0%, transparent 50%); border-radius: 14px; }
.product-body .kpi.featured > * { position: relative; z-index: 1; }
.product-body .kpi.featured .label { color: rgba(255, 255, 255, 0.75); }
.product-body .kpi.featured .value { color: #fff; }
.product-body .kpi.featured .delta.up { color: var(--mint-layer); }
.product-body .live-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--mint-layer); display: inline-block; animation: scoby-pulse 2s ease-in-out infinite; }
@keyframes scoby-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Charts row ─────────────────────────────────────────── */
.product-body .dashboard-charts { margin-bottom: 14px; }

/* Line/area chart */
.product-body .line-chart { width: 100%; height: 220px; position: relative; }
.product-body .line-chart svg { width: 100%; height: 100%; display: block; }
.product-body .line-chart .grid line { stroke: var(--dark-4); stroke-width: 0.5; }
.product-body .line-chart .area { fill: url(#area-grad); }
.product-body .line-chart .line { stroke: var(--living-teal); stroke-width: 2; fill: none; }
.product-body .line-chart .y-label, .product-body .line-chart .x-label { font-family: var(--font-mono); font-size: 10px; fill: var(--on-dark-3); }

/* Donut */
.product-body .donut { display: flex; align-items: center; gap: 24px; }
.product-body .donut svg { flex-shrink: 0; }
.product-body .donut .donut-value { font-size: 20px; font-family: var(--font-display); font-weight: 700; fill: #fff; }
.product-body .donut .donut-cap { font-size: 10px; fill: var(--on-dark-3); letter-spacing: 1.5px; }
.product-body .donut .legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.product-body .donut .lg-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.product-body .donut .lg-row .left { display: flex; align-items: center; gap: 10px; color: var(--on-dark-1); }
.product-body .donut .lg-row .swatch { width: 10px; height: 10px; border-radius: 3px; }
.product-body .donut .lg-row .pct { font-family: var(--font-mono); color: var(--on-dark-2); font-size: 12.5px; }

/* Recent transactions head */
.product-body .recent-head { display: flex; align-items: center; justify-content: space-between; }
.product-body .btn.ghost { background: transparent; color: var(--on-dark-2); border-color: transparent; }
.product-body .btn.ghost:hover { background: var(--dark-3); color: #fff; }

/* ── Subscriptions plan grid ────────────────────────────── */
.product-body .plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.product-body .plan-head { display: flex; justify-content: space-between; align-items: flex-start; }
.product-body .plan-price { margin-top: 10px; font-size: 32px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.015em; color: #fff; }
.product-body .plan-interval { font-size: 12px; color: var(--on-dark-3); font-family: var(--font-mono); }
.product-body .plan-icon { width: 40px; height: 40px; border-radius: 999px; background: rgba(23, 196, 163, 0.10); border: 1px solid var(--living-teal); display: flex; align-items: center; justify-content: center; }
.product-body .plan-strong { color: #fff; }

/* ── Responsive (charts/grids) ──────────────────────────── */
@media (max-width: 900px) {
  .product-body .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .product-body .plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .product-body .kpi-grid { grid-template-columns: 1fr; }
  .product-body .dashboard-charts { grid-template-columns: 1fr; }
  .product-body .donut { flex-direction: column; align-items: flex-start; }

  /* Static tables (subscriptions) also stack into cards */
  .product-body .tbl-row-static { display: block; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--dark-4); }
  .product-body .tbl-row-static td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; }
  .product-body .tbl-row-static td::before { content: attr(data-label); color: var(--on-dark-3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
}

/* ═════════════════════════════════════════════════════════════
   PRODUCT UI — Settings (tabs + panels, scoped under .product-body)
   ═════════════════════════════════════════════════════════════ */

/* ── Tabs ───────────────────────────────────────────────── */
.product-body .settings-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--dark-4); margin-bottom: 24px; }
.product-body .settings-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 0; background: transparent;
  color: var(--on-dark-2); font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast);
}
.product-body .settings-tab:hover { color: #fff; }
.product-body .settings-tab.active { color: var(--living-teal); border-bottom-color: var(--living-teal); }
.product-body .tab-soon { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-3); background: var(--dark-4); border-radius: 999px; padding: 2px 6px; }

/* ── Panels ─────────────────────────────────────────────── */
.product-body .settings-panel.is-hidden { display: none; }

/* ── Fields (dark) ──────────────────────────────────────── */
.product-body .field { margin-top: 14px; }
.product-body .field-label { display: block; font-size: 12px; color: var(--on-dark-2); margin-bottom: 6px; }
.product-body .field-hint { font-size: 12px; color: var(--on-dark-3); margin-top: 10px; line-height: 1.5; }
.product-body .input {
  font-family: inherit; font-size: 14px; width: 100%;
  padding: 10px 14px; background: var(--dark-2);
  border: 1px solid var(--dark-4); border-radius: 10px; color: var(--on-dark-1);
}
.product-body .input:focus { outline: 0; border-color: var(--living-teal); box-shadow: 0 0 0 3px rgba(23, 196, 163, 0.18); }
.product-body .input[readonly] { color: var(--on-dark-2); }

/* ── Select (custom chevron, matches .input) ─────────────── */
/* Strip the native widget so selects align with text inputs and carry the
   Scoby stroke chevron instead of the OS arrow. Any <select class="input">
   in the product UI picks this up automatically. */
.product-body select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238FA0B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
.product-body select.input:focus {
  /* Tint the chevron teal to echo the focus ring. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2317C4A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.product-body select.input:hover { border-color: var(--dark-5); }
/* The popup list is OS-rendered, but most engines honour option colours. */
.product-body select.input option {
  background: var(--dark-2);
  color: var(--on-dark-1);
}
.product-body select.input::-ms-expand { display: none; }

/* ── Narrow form (create / edit records) ─────────────────── */
.product-body .form-narrow { max-width: 560px; }
.product-body .form-narrow .card-eyebrow { display: block; margin-bottom: 4px; }
.product-body .form-narrow .form-actions { display: flex; align-items: center; gap: 10px; }
.product-body .form-error {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: rgba(224, 77, 85, 0.12); border: 1px solid rgba(224, 77, 85, 0.32);
  font-size: 13px; color: #F47B82;
}
.product-body .form-error strong { display: block; margin-bottom: 4px; color: #F47B82; }
.product-body .form-error ul { margin: 0; padding-left: 18px; }

/* ── Wide form / component builder (plans) ───────────────── */
.product-body .form-wide { max-width: 760px; }
.product-body .form-wide .card { margin-bottom: 16px; }
.product-body .form-wide .form-actions { display: flex; align-items: center; gap: 10px; }
.product-body .pc-row {
  display: flex; gap: 12px; align-items: flex-end;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--dark-4);
}
.product-body .pc-row-main {
  flex: 1; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.product-body .pc-row-main .field { margin-top: 0; }
.product-body .pc-row-aside { display: flex; align-items: flex-end; }
.product-body .btn-icon-danger {
  display: inline-flex; align-items: center; justify-content: center;
  /* Reset the global button padding (10px 18px) — with box-sizing:border-box it
     collapses the button's content box to 0 width and shrinks the icon away. */
  padding: 0;
  /* Match .input height (line-height + 2×10px padding + 2×1px border) so the
     bottom-aligned button lines up flush with the field's input, not 8px below it. */
  width: calc(var(--lh-body) + 22px); height: calc(var(--lh-body) + 22px);
  border-radius: 10px; cursor: pointer;
  background: var(--dark-3); border: 1px solid var(--dark-4); color: var(--on-dark-2);
  transition: all var(--t-fast) var(--ease-out);
}
.product-body .btn-icon-danger:hover { color: var(--danger); border-color: var(--danger); }

/* Add-component button: breathing room below the last row. */
.product-body .pc-add { margin-top: 18px; }

/* ── Record pages (customers index / show) ───────────────── */
.product-body .page-crumb { margin: 0 0 6px; font-size: 12px; }
.product-body .page-crumb a { color: var(--on-dark-3); text-decoration: none; }
.product-body .page-crumb a:hover { color: var(--living-teal); }
.product-body .cust-name,
.product-body .entity-name { color: #fff; font-weight: 500; text-decoration: none; }
.product-body .cust-name:hover,
.product-body .entity-name:hover { color: var(--living-teal); }
.product-body .row-actions { text-align: right; white-space: nowrap; }
.product-body .tbl-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: var(--on-dark-3);
  transition: all var(--t-fast) var(--ease-out);
}
.product-body .tbl-action:hover { background: var(--dark-4); color: #fff; }
.product-body .tbl-action-danger:hover { background: rgba(224, 77, 85, 0.16); color: #F47B82; }
.product-body .tbl-action-success:hover { background: rgba(23, 196, 163, 0.16); color: var(--mint-layer); }

.product-body .btn.danger { background: rgba(224, 77, 85, 0.14); color: #F47B82; border-color: rgba(224, 77, 85, 0.32); }
.product-body .btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.product-body .danger-zone { margin-top: 16px; border-color: rgba(224, 77, 85, 0.28); }
.product-body .danger-zone.warning { border-color: rgba(219, 162, 76, 0.32); }
.product-body .card-eyebrow.danger { color: #F47B82; }

/* ── Language switch ────────────────────────────────────── */
.product-body .lang-switch { display: flex; gap: 8px; margin-top: 14px; }

/* ── Developers: API key + code ─────────────────────────── */
.product-body .api-reveal { border-color: rgba(219, 162, 76, 0.4); background: rgba(219, 162, 76, 0.08); margin-bottom: 14px; }
.product-body .api-key-code {
  display: block; margin-top: 10px; padding: 12px 14px;
  background: var(--dark-2); border: 1px solid var(--dark-4); border-radius: 8px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--mint-layer);
  word-break: break-all;
}
.product-body .code-block {
  margin-top: 10px; padding: 14px; background: var(--dark-2);
  border: 1px solid var(--dark-4); border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--on-dark-1);
  white-space: pre-wrap; word-break: break-all; line-height: 1.6;
}
.product-body .kv-row .processor { color: var(--on-dark-1); }

/* ── Payments provider row ──────────────────────────────── */
.product-body .settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.product-body .settings-provider { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.product-body .settings-provider-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: #fff; }
.product-body .settings-note { font-size: 13px; color: var(--on-dark-2); line-height: 1.6; }

@media (max-width: 720px) {
  .product-body .settings-row { flex-direction: column; align-items: stretch; }
}

/* ═════════════════════════════════════════════════════════════
   PRODUCT UI — Workspace switcher (sidebar)
   ═════════════════════════════════════════════════════════════ */
.product-body .workspace-switcher { position: relative; margin: 0 0 8px; }
.product-body .workspace-current {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 10px;
  background: var(--dark-3); border: 1px solid var(--dark-4);
  color: #fff; font-size: 13px; font-weight: 500; text-align: left;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast);
}
.product-body .workspace-current:hover { border-color: var(--dark-5); background: var(--dark-4); }
.product-body .workspace-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--grad-growth); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.product-body .workspace-avatar.small { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.product-body .workspace-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-body .workspace-caret { color: var(--on-dark-3); display: inline-flex; }

.product-body .workspace-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--dark-3); border: 1px solid var(--dark-4); border-radius: 12px;
  padding: 6px; box-shadow: var(--shadow-dark-2);
}
.product-body .workspace-menu.open { display: block; }
.product-body .workspace-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; text-decoration: none;
  color: var(--on-dark-1); font-size: 13px;
  transition: background var(--t-fast);
}
.product-body .workspace-option:hover { background: var(--dark-4); color: #fff; }
.product-body .workspace-option.active { color: #fff; }
.product-body .workspace-option-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-body .workspace-check { color: var(--living-teal); font-weight: 600; }
.product-body .workspace-new {
  margin-top: 4px; border-top: 1px solid var(--dark-4); border-radius: 0 0 8px 8px;
  color: var(--living-teal); font-weight: 500; padding-top: 12px;
}
.product-body .workspace-new:hover { background: transparent; color: var(--mint-layer); }
