:root {
  /* System stack — no web font fetch (faster first paint on mobile) */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --brand: #0f766e;
  --brand-hover: #0d9488;
  --brand-light: #ccfbf1;
  --brand-muted: #134e4a;
  --sidebar-bg: #0c1222;
  --sidebar-hover: #1a2338;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #64748b;
  --success: #059669;
  --success-bg: #d1fae5;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.04);
  --shadow-lg: 0 8px 30px rgba(15,23,42,.1);
  --space-xs: .5rem;
  --space-sm: .75rem;
  --space-md: 1.25rem;
  --space-lg: 1.75rem;
  --space-xl: 2.25rem;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: hidden;
  transition: width .22s ease;
  z-index: 100;
}

.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.app-shell.sidebar-collapsed .sidebar-brand .tenant-name,
.app-shell.sidebar-collapsed .nav-section,
.app-shell.sidebar-collapsed .sidebar-nav a span,
.app-shell.sidebar-collapsed .user-chip .meta,
.app-shell.sidebar-collapsed .sidebar-footer .sign-out span {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding: .65rem;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  padding: 1.25rem .5rem 1rem;
  text-align: center;
}

.app-shell.sidebar-collapsed .sidebar-footer {
  padding: 1rem .5rem;
}

.app-shell.sidebar-collapsed .user-chip {
  justify-content: center;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 99;
}

.btn-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}

.btn-sidebar-toggle:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: var(--text);
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-brand-text {
  min-width: 0;
  flex: 1;
}

.sidebar-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-close-btn:hover,
.sidebar-close-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.app-shell.sidebar-collapsed .sidebar-close-btn svg {
  transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .sidebar-brand-top {
  flex-direction: column;
  align-items: center;
}

.app-shell.sidebar-collapsed .sidebar-brand-text {
  width: 100%;
}
.sidebar-brand .logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}
.sidebar-brand .logo span { color: var(--brand-hover); }
.sidebar-brand .tenant-name {
  font-size: .8rem;
  color: var(--sidebar-text);
  margin-top: .35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .75rem .75rem 1rem;
  -webkit-overflow-scrolling: touch;
}
.nav-section {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: .75rem .75rem .35rem;
  margin-top: .25rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--brand) 0%, #14b8a6 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.35);
}
.sidebar-nav a svg { width: 18px; height: 18px; opacity: .85; flex-shrink: 0; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.06);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
}

a.user-chip-link {
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: .35rem;
  margin: -.35rem;
  transition: background .15s;
}

a.user-chip-link:hover,
a.user-chip-link.active {
  background: rgba(255, 255, 255, .08);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
}
.user-chip .name { color: #fff; font-size: .85rem; font-weight: 600; }
.user-chip .role { font-size: .75rem; color: var(--sidebar-text); }
.sidebar-footer a.sign-out {
  display: block;
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--sidebar-text);
}

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

/* mobile-simple.css sets .desktop-only { display: block } — keep topbar flex on desktop */
header.topbar.desktop-only {
  display: flex;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.topbar-search { margin: 0; }

.topbar-search input {
  width: 280px;
  max-width: 100%;
  padding: .6rem 1rem .6rem 2.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") .75rem center / 1rem no-repeat;
}

.topbar-quick-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--border);
}

.topbar-user-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.35rem;
  margin: -0.2rem -0.35rem;
  transition: background 0.15s;
}

.topbar-user-identity:hover,
.topbar-user-identity:focus-visible {
  background: var(--bg);
}

.topbar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.topbar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}

.topbar-user-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar-user-signout {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.topbar-user-signout:hover,
.topbar-user-signout:focus-visible {
  color: var(--danger, #dc2626);
  background: var(--danger-bg, #fef2f2);
}

@media (max-width: 900px) {
  .topbar-user-name {
    max-width: 7rem;
  }
}
@media (max-width: 900px) {
  .topbar-quick-actions .btn-ghost { display: none; }
  .topbar-quick-actions .btn span { display: none; }
  .topbar-quick-actions .btn-ai svg { margin: 0; }
}
@media (max-width: 520px) {
  .topbar-quick-actions .btn:nth-child(3) { display: none; }
}
.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
  border: none;
}
.btn-ai:hover { filter: brightness(1.05); color: #fff; }
.btn-ai svg { width: 1rem; height: 1rem; }
.trader-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Support tickets — trader + platform thread */
.support-ticket-thread .card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
}

.support-ticket-msg {
  padding: var(--space-md, 1rem);
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.support-ticket-msg--platform {
  background: #ecfdf5;
  border-color: #99f6e4;
}

.support-ticket-msg--internal {
  background: #fef3c7;
  border-color: #fcd34d;
}

.support-ticket-msg-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.support-ticket-msg-head time {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.support-ticket-msg-body {
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.btn-icon-pdf { color: var(--text-secondary); }
.btn-icon-pdf:hover { color: var(--primary); }

.main {
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
  flex: 1;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.page-header h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-header .subtitle { color: var(--text-secondary); font-size: .95rem; margin-top: .25rem; }

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.page-header-form {
  margin: 0;
  display: inline-flex;
}

/* Cards & metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #14b8a6);
}
.metric-card .label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.metric-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: .35rem;
  letter-spacing: -.02em;
}
.metric-card .trend { font-size: .8rem; color: var(--success); margin-top: .25rem; }

/* Tap-friendly action tiles (Today, Jobs, Quotes, etc.) */
.action-tiles,
.dashboard-quick-actions {
  margin-bottom: var(--space-lg);
}

.action-tiles-divider,
.dashboard-quick-actions-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 1rem;
}

.action-tiles-title,
.dashboard-quick-actions-title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.action-tiles-grid,
.dashboard-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.action-tile,
.dashboard-quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 1rem 1rem 0.9rem;
  min-height: 5.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.action-tile:hover,
.action-tile:focus-visible,
.dashboard-quick-action-card:hover,
.dashboard-quick-action-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.12);
}

.action-tile:active,
.dashboard-quick-action-card:active {
  transform: scale(0.99);
}

.action-tile-icon,
.dashboard-quick-action-icon {
  display: flex;
  margin-bottom: 0.15rem;
}

.action-tile-icon svg,
.dashboard-quick-action-icon svg {
  width: 1.65rem;
  height: 1.65rem;
  color: var(--brand);
}

.action-tile-label,
.dashboard-quick-action-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.action-tile-desc,
.dashboard-quick-action-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.page-header--compact {
  margin-bottom: var(--space-md);
}

.page-header--compact .page-header-actions {
  display: none;
}

/* Page layout: breadcrumb → title → page actions → content */
.trader-page-top {
  margin-bottom: var(--space-lg);
}

.trader-page-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.trader-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.trader-breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.trader-breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin: 0 0.35rem;
  opacity: 0.45;
  font-weight: 400;
}

.trader-breadcrumb-item a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.trader-breadcrumb-item a:hover {
  text-decoration: underline;
}

.trader-breadcrumb-item span[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
}

.trader-global-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.trader-global-shortcut {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.trader-global-shortcut:hover,
.trader-global-shortcut:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light, #f0fdfa);
}

.trader-page-header {
  margin-bottom: 0.65rem;
}

.trader-page-actions.action-tiles {
  margin-bottom: var(--space-md);
}

/* Quote — trader marks accepted / rejected */
.quote-outcome {
  margin-bottom: var(--space-md);
}

.quote-outcome-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quote-outcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.quote-outcome-form {
  margin: 0;
  min-width: 0;
}

.quote-outcome-btn {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.quote-outcome-btn--accept {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
}

.quote-outcome-btn--reject {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.quote-outcome-btn--current {
  opacity: 0.85;
  cursor: default;
  text-align: center;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-outcome-current {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quote-bill-primary {
  margin-bottom: var(--space-md);
  border: 2px solid var(--brand, #0f766e);
}

.quote-bill-primary .card-body {
  padding: 1rem 1.1rem;
}

.quote-bill-lead {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.quote-bill-btn {
  min-height: 3rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.invoice-got-paid-primary {
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
}

.invoice-got-paid-primary .card-body {
  padding: 1rem 1.1rem;
}

.invoice-got-paid-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.invoice-got-paid-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.invoice-got-paid-amount {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
}

.invoice-got-paid-btn {
  min-width: 6.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.invoice-got-paid-more {
  margin-top: 0.65rem;
}

.invoice-got-paid-more summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.invoice-lines-total {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
}

.invoice-payments-simple {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.invoice-status-banner--paid {
  border-color: var(--success, #059669);
  background: #ecfdf5;
  margin-bottom: var(--space-md);
}

.quote-outcome--compact {
  margin: 0.65rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.quote-outcome--compact .quote-outcome-btn {
  min-height: 2.75rem;
  font-size: 0.9rem;
}

.quote-status-archive-form {
  margin-top: 0.65rem;
}

.quote-status-archive-btn {
  width: 100%;
}

.mobile-list-card--quote {
  display: block;
  padding: 0;
  text-decoration: none;
  color: inherit;
}

.mobile-list-card--quote .mobile-list-card-hit {
  display: block;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
}

.mobile-list-card--quote .quote-outcome {
  margin: 0;
  padding: 0 1rem 1rem;
}

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

.btn-block {
  display: block;
  width: 100%;
}

/* Quote — on-site simplified flow */
.quote-back-link {
  margin: -0.35rem 0 0.5rem;
  font-size: 0.9rem;
}

.quote-back-link a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.quote-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--space-md);
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quote-hero-customer {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.quote-hero-title {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.quote-hero-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quote-hero-total {
  text-align: right;
}

.quote-hero-total-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.quote-hero-total-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.job-hero-actions {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.15rem;
}

@media (max-width: 520px) {
  .job-hero.quote-hero {
    flex-wrap: wrap;
  }

  .job-hero-actions {
    width: 100%;
    margin-top: 0.5rem;
  }

  .job-hero-actions .btn {
    width: 100%;
  }
}

.help-screenshot {
  margin: 1rem 0 1.25rem;
}

.help-screenshot-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt, #f8fafc);
}

.help-screenshot-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.help-screenshot figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.help-article-body .help-screenshot img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.quote-send-primary {
  margin-bottom: var(--space-md);
  border: 2px solid #25d366;
  background: #f0fdf4;
}

.quote-send-primary .card-body {
  padding: 1rem 1.1rem;
}

.quote-send-whatsapp-btn {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: #25d366;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.quote-send-whatsapp-btn:hover,
.quote-send-whatsapp-btn:focus-visible {
  background: #1fb855;
}

.quote-send-phone-input {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.quote-send-more {
  margin-top: 0.75rem;
}

.quote-send-more summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.quote-send-more-body {
  margin-top: 0.65rem;
}

/* Job money — cash jobs without a formal bill */
.job-money-card .card-body {
  padding: 1rem 1.1rem;
}

.job-money-lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.job-money-label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.job-money-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.job-got-paid-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.job-got-paid-amount {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.job-got-paid-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.job-request-payment-wrap {
  margin-bottom: 1rem;
}

.job-got-paid-block--after-request {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.job-money-bill-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.job-wrapup-card {
  margin-bottom: var(--space-md);
  padding: 1rem 1.1rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
}

.job-wrapup-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.job-wrapup-lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.job-wrapup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.job-wrapup-btn {
  width: 100%;
  min-height: 2.75rem;
}

.quote-lines-card {
  margin-bottom: var(--space-md);
}

.quote-lines-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.quote-lines-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quote-lines-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.quote-lines-item:last-child {
  border-bottom: none;
}

.quote-lines-desc {
  font-weight: 600;
  color: var(--text);
}

.quote-lines-qty {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quote-lines-price {
  font-size: 1rem;
  white-space: nowrap;
}

.quote-lines-edit summary {
  font-size: 0.8rem;
  color: var(--brand);
  cursor: pointer;
  margin-top: 0.25rem;
}

.quote-lines-edit-form {
  margin-top: 0.5rem;
  min-width: 12rem;
}

.quote-lines-edit-form input {
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.quote-lines-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.quote-build-card .card-header,
.quote-build-card .quote-build-inner {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.quote-add-line-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.quote-add-line-details summary {
  font-weight: 600;
  cursor: pointer;
}

.quote-add-line-body {
  margin-top: 0.65rem;
}

.quote-add-more-prices,
.quote-more-options {
  margin-top: var(--space-md);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: #fafbfc;
}

.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: var(--space-lg);
}

/* Forms placed directly inside .card (legacy) still get padding */
.card > form {
  display: block;
  padding: var(--space-lg);
}

.card > form .form-footer {
  margin-left: calc(-1 * var(--space-lg));
  margin-right: calc(-1 * var(--space-lg));
  margin-bottom: calc(-1 * var(--space-lg));
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.card-body.flush { padding: 0; }

/* Padded blocks inside flush cards (tables stay edge-to-edge) */
.card-body.flush > .communications-empty,
.card-body.flush > .empty-state {
  padding: var(--space-lg);
}

.communications-empty .form-hint,
.card-body.flush > .empty-state p {
  margin: 0;
}

.card-body.flush > .empty-state h3 {
  margin: 0 0 var(--space-sm);
}

.card.form-card {
  max-width: 720px;
}

/* Job show + settings — sectioned workflow pages */
.job-flow,
.settings-flow {
  max-width: 720px;
}

.job-flow-section,
.settings-flow-section {
  margin-bottom: var(--space-lg, 1.5rem);
}

.job-flow-section .card.form-card,
.settings-flow-section .card.form-card {
  margin-bottom: var(--space-md, 1rem);
}

.job-flow-section .card.form-card:last-child,
.settings-flow-section .card.form-card:last-child {
  margin-bottom: 0;
}

.job-flow-label,
.settings-flow-label {
  margin: 0 0 var(--space-sm, 0.5rem);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
}

.job-wrapup-card {
  max-width: 720px;
  margin: 0 0 var(--space-lg, 1.5rem);
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  border: 2px solid var(--primary, #2563eb);
  border-radius: 12px;
}

.job-wrapup-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.job-wrapup-lead {
  margin: 0 0 1rem;
  color: var(--text-secondary, #64748b);
  font-size: 0.98rem;
}

.job-wrapup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.job-wrapup-btn {
  width: 100%;
  justify-content: center;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
}

.job-wrapup-form {
  margin: 0;
}

.job-wrapup-hint {
  margin: 0.5rem 0 0;
}

/* Sidebar — daily links + collapsible “More” */
.sidebar-more {
  margin-top: 0.25rem;
}

.sidebar-more-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--sidebar-text);
  font-weight: 500;
  border-radius: 8px;
}

.sidebar-more-summary::-webkit-details-marker {
  display: none;
}

.sidebar-more-summary:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active);
}

.sidebar-more[open] .sidebar-more-summary {
  color: var(--sidebar-active);
}

.sidebar-more-links {
  padding: 0 0 0.35rem 0.5rem;
}

.sidebar-more-links a {
  font-size: 0.92rem;
  opacity: 0.92;
}

/* Today dashboard — money owed strip + setup */
.dashboard-money-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: var(--space-md, 1rem);
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
  border: 2px solid var(--danger, #dc2626);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  max-width: 720px;
}

.dashboard-money-strip:hover {
  border-color: #b91c1c;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.12);
}

.dashboard-money-strip-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--danger, #dc2626);
  width: 100%;
}

@media (min-width: 480px) {
  .dashboard-money-strip-label {
    width: auto;
  }
}

.dashboard-money-strip-amount {
  font-size: 1.65rem;
  font-weight: 800;
  color: #991b1b;
  line-height: 1.1;
}

.dashboard-money-strip-meta {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-secondary, #64748b);
}

.dashboard-money-strip-cta {
  margin-left: auto;
}

.dashboard-setup-banner {
  max-width: 720px;
  margin-bottom: var(--space-md, 1rem);
  padding: 1rem 1.15rem;
  background: var(--info-bg, #eff6ff);
  border-radius: 10px;
  border: 1px solid #bfdbfe;
}

.dashboard-setup-banner-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.dashboard-setup-banner-lead {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary, #64748b);
}

.dashboard-setup-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-more-metrics summary,
.dashboard-more-panel summary {
  cursor: pointer;
  font-weight: 600;
}

@media (min-width: 480px) {
  .job-wrapup-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .job-wrapup-btn {
    width: auto;
    min-width: 11rem;
    flex: 1 1 auto;
  }
}

.settings-nav {
  max-width: 720px;
  margin-bottom: var(--space-lg, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
}

.settings-nav-group-label {
  margin: 0 0 var(--space-xs, 0.35rem);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #334155;
}

.settings-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm, 0.5rem);
}

.settings-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid #94a3b8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.settings-nav-link:hover {
  color: var(--brand-muted);
  background: var(--brand-light);
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.12);
}

.settings-nav-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.settings-nav-link.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-hover);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
}

.settings-nav-link.active:hover {
  color: #fff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.job-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm, 0.5rem);
  margin: var(--space-md, 1rem) 0;
}

.job-status-actions-form {
  margin: 0;
  flex: 1 1 auto;
  min-width: 9rem;
}

.job-status-actions-form .btn {
  width: 100%;
  justify-content: center;
}

.job-status-actions-card {
  margin-top: var(--space-md, 1rem);
}

.card.form-card-narrow {
  max-width: 520px;
}

.card-body > :first-child { margin-top: 0; }

.card-body h3 {
  margin: 0 0 var(--space-md);
  font-size: .95rem;
}

.card-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

.card-body p {
  margin: 0 0 var(--space-md);
}

.card-body p:last-child { margin-bottom: 0; }

.card + .card,
.grid-2 + .card,
.tabs + .card {
  margin-top: 0;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  padding: .75rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
table.data-table td {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: rgba(15, 118, 110, 0.06); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table a.row-link { font-weight: 500; color: var(--text); }
table.data-table a.row-link:hover { color: var(--brand); }

/* Compact tables (e.g. Settings → AI instruction log) */
table.data-table-compact th {
  font-size: 0.62rem;
  padding: 0.35rem 0.55rem;
  letter-spacing: 0.04em;
}
table.data-table-compact td {
  font-size: 0.72rem;
  line-height: 1.35;
  padding: 0.35rem 0.55rem;
  vertical-align: top;
}
table.data-table-compact tbody tr:hover {
  background: rgba(15, 118, 110, 0.04);
}
.card-header-compact {
  padding: 0.55rem 0.75rem;
}
.card-header-compact .h2-compact {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}
.settings-ai-empty,
.settings-ai-log-note {
  padding: 0.55rem 0.75rem;
  margin: 0;
  font-size: 0.72rem;
}
.ai-instruction-history .col-when {
  white-space: nowrap;
  width: 1%;
}
.ai-instruction-history .col-how {
  white-space: nowrap;
  width: 1%;
}
.ai-instruction-history .col-instruction {
  max-width: 11rem;
  word-break: break-word;
}
.ai-instruction-history .col-outcome {
  white-space: nowrap;
  width: 1%;
}
.ai-instruction-history .outcome-intent {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn-icon:hover,
.btn-icon:focus-visible {
  color: var(--brand-muted);
  border-color: var(--brand);
  background: var(--brand-light);
}
.btn-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}
.table-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
  vertical-align: middle;
}
.table-actions .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.table-actions .btn-icon:first-child {
  margin-left: 0;
}
.table-actions .btn.btn-sm {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.table-actions .table-action-form {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0 0 0.35rem;
}
.table-actions .table-action-form:first-child {
  margin-left: 0;
}
.table-action-form button.btn-icon {
  margin: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.table-action-form button.btn-icon svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

/* Icon button tooltips (View, Edit, Archive, …) */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  z-index: 30;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.table-actions [data-tooltip]::after {
  bottom: calc(100% + 0.35rem);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #14b8a6 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.3);
}
.btn-primary:hover { color: #fff; box-shadow: 0 4px 14px rgba(15,118,110,.4); }
.btn-secondary { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; color: var(--text); border-color: #cbd5e1; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover,
.btn-ghost:focus-visible { background: #e2e8f0; color: var(--text); }

.topbar .btn-ghost:hover,
.topbar .btn-ghost:focus-visible,
.card-header .btn-ghost:hover,
.card-header .btn-ghost:focus-visible {
  background: #e2e8f0;
  color: var(--text);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea,
.card-body > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.card-body > select,
.card-body > textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

.form-hint {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  line-height: 1.45;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.card-body .form-footer,
.card > form .form-footer {
  margin-top: var(--space-lg);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-success { background: var(--success-bg); color: #047857; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger { background: var(--danger-bg); color: #b91c1c; }
.badge-info { background: var(--info-bg); color: #0369a1; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* Admin / setup notices (missing Stripe, integrations, etc.) */
.admin-notice {
  display: inline-block;
  max-width: 42rem;
  margin: 0 0 var(--space-md);
  padding: .5rem .9rem;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: .8125rem;
  line-height: 1.45;
  font-weight: 500;
}
.admin-notice--block {
  display: block;
  border-radius: var(--radius-sm);
}
.admin-notice:last-child {
  margin-bottom: 0;
}
.admin-notice a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.admin-notice a:hover {
  text-decoration: underline;
}
.admin-notice code {
  font-size: .75rem;
  padding: .1rem .35rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
}

.setup-checklist {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
}
.setup-checklist li {
  margin-bottom: .5rem;
}
.setup-checklist li.done {
  color: var(--text-muted);
}
.setup-checklist li.done strong::after {
  content: ' ✓';
  color: var(--success, #16a34a);
}
.code-block {
  display: inline-block;
  padding: .35rem .65rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  word-break: break-all;
}

/* Alerts */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-error { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }

/* AI assistant panel */
.ai-assistant-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.45);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ai-assistant-fab-icon svg { width: 1.1rem; height: 1.1rem; display: block; }

.ai-assistant-fab:hover {
  transform: scale(1.05);
}

.ai-assistant-fab[aria-expanded="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.85);
}

/* Chat widget size: ~400×680px desktop (Intercom/HubSpot/Zendesk range) */
.ai-assistant-panel {
  --ai-chat-width: 400px;
  --ai-chat-height: min(680px, calc(100dvh - 2.5rem));
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 901;
  width: min(var(--ai-chat-width), calc(100vw - 1.5rem));
  height: var(--ai-chat-height);
  max-height: calc(100dvh - 2.5rem);
  min-height: min(560px, calc(100dvh - 3rem));
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.ai-assistant-panel--minimized {
  height: auto;
  min-height: 0;
  max-height: none;
  width: auto;
  min-width: 12rem;
}

.ai-assistant-panel--minimized .ai-assistant-panel-body {
  display: none !important;
}

.ai-assistant-panel-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 0 0 13px 13px;
}

.ai-assistant-panel[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .ai-assistant-panel:not(.ai-assistant-panel--minimized) {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    --ai-chat-height: min(620px, calc(100dvh - 5.5rem - env(safe-area-inset-bottom, 0px)));
    height: var(--ai-chat-height);
    max-height: calc(100dvh - 5rem - env(safe-area-inset-bottom, 0px));
    min-height: min(460px, calc(100dvh - 6rem - env(safe-area-inset-bottom, 0px)));
  }

  .app-has-mobile-nav .ai-assistant-panel:not(.ai-assistant-panel--minimized) {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    --ai-chat-height: min(640px, calc(100dvh - 6rem - env(safe-area-inset-bottom, 0px)));
    height: var(--ai-chat-height);
    max-height: calc(100dvh - 5.75rem - env(safe-area-inset-bottom, 0px));
    min-height: min(440px, calc(100dvh - 7rem - env(safe-area-inset-bottom, 0px)));
  }
}

.ai-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 0 0 auto;
  position: relative;
  z-index: 12;
  overflow: visible;
  padding: 0.45rem 0.5rem 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
  border-radius: 14px 14px 0 0;
}

.ai-assistant-panel--minimized .ai-assistant-header {
  border-radius: 999px;
  border-bottom: none;
}

.ai-assistant-header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ai-assistant-header-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.ai-assistant-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.ai-assistant-header-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.ai-assistant-header-link:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: underline;
}

/* Credits tooltip: drop below header (upward tooltips are clipped by the chat body) */
.ai-assistant-header [data-tooltip] {
  position: relative;
  z-index: 20;
}

.ai-assistant-header [data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 0.4rem);
  left: auto;
  right: 0;
  z-index: 200;
  max-width: 240px;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
  transform: translateX(0) translateY(-2px);
}

.ai-assistant-header [data-tooltip]:hover::after,
.ai-assistant-header [data-tooltip]:focus-visible::after {
  transform: translateX(0) translateY(0);
}

.ai-assistant-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.ai-assistant-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ai-assistant-compose {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06);
}

.ai-assistant-body {
  padding: 0.5rem 0.65rem 0.6rem;
}

.ai-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.ai-quick-pick {
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ai-quick-pick:hover {
  background: var(--brand-light);
  border-color: var(--brand-hover);
  color: var(--brand-muted);
}

.ai-quick-pick:focus-visible {
  outline: 2px solid var(--brand-hover);
  outline-offset: 2px;
}

.ai-assistant-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt, #f8fafc);
}

.ai-assistant-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.ai-assistant-tab.active {
  color: #0d9488;
  box-shadow: inset 0 -2px 0 #0d9488;
}

.ai-assistant-pane[hidden] {
  display: none !important;
}

.ai-chat-log {
  flex: 1 1 auto;
  min-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.ai-chat-msg {
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  max-width: 92%;
}

.ai-chat-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

.ai-chat-msg--assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.ai-chat-bubble {
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
}

.ai-chat-msg--user .ai-chat-bubble {
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.ai-chat-msg--assistant .ai-chat-bubble {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-primary, #0f172a);
  border-bottom-left-radius: 2px;
}

.ai-chat-msg--error .ai-chat-bubble {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.ai-chat-action {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0d9488;
  text-decoration: none;
}

.ai-chat-action:hover {
  text-decoration: underline;
}

.ai-chat-choices {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
  width: 100%;
  max-width: 100%;
}

.ai-chat-choice {
  font-size: 0.78rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ai-chat-choice:hover {
  background: var(--brand-light);
  border-color: var(--brand-hover);
  color: var(--brand-muted);
}

.ai-chat-choice:focus-visible {
  outline: 2px solid var(--brand-hover);
  outline-offset: 2px;
}

.ai-chat-msg--choice .ai-chat-bubble {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.ai-instruction-wrap {
  margin-bottom: 0.5rem !important;
}

#ai-instruction {
  display: block;
  width: 100%;
  min-height: 2.35rem;
  max-height: 5rem;
  resize: none;
  font-size: 0.92rem;
  line-height: 1.35;
  padding: 0.45rem 0.55rem;
  box-sizing: border-box;
}

.ai-assistant-compose .btn-block {
  width: 100%;
}

.job-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}
.job-photo-thumb {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt, #f8fafc);
}
.job-photo-thumb img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
}
.job-photo-thumb span {
  display: block;
  font-size: 0.7rem;
  padding: 0.35rem 0.5rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Customer picker (inline new customer on job/quote forms) */
.customer-mode-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.customer-mode-tab {
  padding: .45rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.customer-mode-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.customer-mode-tab.active {
  background: var(--brand-light, #ccfbf1);
  border-color: var(--brand);
  color: #0f766e;
}

.customer-mode-panel[hidden] {
  display: none !important;
}

/* Job schedule when + duration */
.job-schedule-fields .form-group + .form-group {
  margin-top: var(--space-md);
}

.job-schedule-when-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: .65rem;
  align-items: end;
}

.job-schedule-when-field label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.job-schedule-when-field {
  min-width: 0;
}

.job-schedule-when-field input,
.job-schedule-when-field select {
  width: 100%;
}

@media (max-width: 420px) {
  .job-schedule-when-row {
    grid-template-columns: 1fr;
  }
}

.duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .35rem;
}

.duration-chip {
  padding: .5rem .75rem;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: border-color .15s, background .15s, color .15s;
}

.duration-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.duration-chip.active {
  background: var(--brand-light, #ccfbf1);
  border-color: var(--brand);
  color: #0f766e;
}

.job-same-as-last {
  margin-top: 0.65rem;
}

.job-same-as-last-btn {
  min-height: 2.5rem;
}

.job-same-as-last .form-hint {
  margin-top: 0.35rem;
}

.duration-other-panel {
  margin-top: .65rem;
}

.duration-other-panel[hidden] {
  display: none !important;
}

.duration-other-group {
  margin: 0;
  padding: .75rem .85rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle, #f8fafc);
}

.duration-other-legend {
  padding: 0 .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.duration-other-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: .65rem;
  align-items: end;
}

.duration-other-field label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.duration-other-field {
  min-width: 0;
}

.duration-other-select {
  width: 100%;
  min-width: 0;
}

@media (max-width: 420px) {
  .duration-other-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Job month calendar */
.job-calendar {
  width: 100%;
  min-width: 640px;
}

.job-calendar-head,
.job-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.job-calendar-head {
  background: var(--surface-alt, #f8fafc);
  border-bottom: 1px solid var(--border);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
}

.job-calendar-head span {
  padding: .6rem .5rem;
  text-align: center;
}

.job-calendar-week {
  border-bottom: 1px solid var(--border);
  min-height: 100px;
}

.job-calendar-week:last-child {
  border-bottom: none;
}

.job-calendar-day {
  border-right: 1px solid var(--border);
  padding: .35rem .4rem .5rem;
  vertical-align: top;
  min-height: 100px;
  background: #fff;
}

.job-calendar-day:last-child {
  border-right: none;
}

.job-calendar-day--pad {
  background: var(--surface-alt, #f8fafc);
  min-height: 100px;
}

.job-calendar-day--today {
  background: #f0fdfa;
  box-shadow: inset 0 0 0 2px var(--brand, #0d9488);
}

.job-calendar-day-num {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .25rem;
}

.job-calendar-day--today .job-calendar-day-num {
  color: var(--brand, #0d9488);
}

.job-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-calendar-event {
  display: block;
  font-size: .7rem;
  line-height: 1.25;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--brand-light, #ccfbf1);
  color: #0f766e;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-calendar-event:hover {
  background: var(--brand, #0d9488);
  color: #fff;
}

.job-calendar-day--clickable {
  cursor: pointer;
}
.job-calendar-day--clickable:hover {
  background: #f1f5f9;
}
.job-calendar-add-hint {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 0.25rem;
  opacity: 0;
}
.job-calendar-day--clickable:hover .job-calendar-add-hint {
  opacity: 1;
}
.calendar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.calendar-modal-backdrop[hidden] { display: none !important; }
.calendar-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}
.calendar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt, #f8fafc);
}
.calendar-modal-body { padding: 1rem 1.25rem 1.25rem; }
.calendar-modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.team-limit-card {
  margin-bottom: var(--space-lg);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.team-limit-card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.team-limit-card__text { flex: 1; min-width: 200px; }
.team-limit-card__text h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.team-limit-card__text p { margin: 0; color: #9a3412; font-size: 0.9rem; }
.job-calendar-more {
  font-size: .65rem;
  color: var(--text-secondary);
  padding-left: 4px;
}

@media (max-width: 768px) {
  .job-calendar {
    min-width: 0;
  }
  .job-calendar-week {
    min-height: 72px;
  }
  .job-calendar-day,
  .job-calendar-day--pad {
    min-height: 72px;
  }
  .job-calendar-event {
    font-size: .65rem;
  }
}

/* Reports */
.report-period-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.report-period-label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-right: .25rem;
}

.report-bars {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.report-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 6.5rem;
  gap: .75rem;
  align-items: center;
}

.report-bar-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.report-bar-track {
  height: 1.35rem;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.report-bar-fill {
  height: 100%;
  min-width: 2px;
  background: linear-gradient(90deg, var(--brand), #14b8a6);
  border-radius: 999px;
  transition: width .3s ease;
}

.report-bar-value {
  font-size: .875rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .report-bar-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .report-bar-value {
    text-align: left;
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}
.empty-state h3 { color: var(--text); margin: 0 0 .5rem; }

/* Integration cards */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.integration-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  background: var(--surface);
}

.integration-card .form-group {
  margin-bottom: var(--space-md);
}

.integration-card h3 {
  margin: 0 0 var(--space-sm);
}
.integration-card.enabled { border-color: #5eead4; background: linear-gradient(180deg, #f0fdfa 0%, #fff 40%); }
.integration-card h3 { margin: 0 0 .35rem; display: flex; align-items: center; gap: .5rem; }
.integration-card .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #cbd5e1;
}
.integration-card.enabled .status-dot { background: var(--success); }

/* Tabs */
.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  padding-bottom: 0;
}
.tabs a {
  padding: .65rem 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Auth & public */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0c1222 0%, #134e4a 50%, #0f766e 100%);
  padding: 1.5rem;
}
.auth-box {
  background: var(--surface);
  padding: var(--space-xl);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-box .form-group {
  margin-bottom: var(--space-md);
}
.auth-box .brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .25rem;
}
.auth-box .brand-title span { color: var(--brand); }

.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--sidebar-bg);
  color: #fff;
}
.public-hero {
  max-width: 720px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.public-hero h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.public-hero p { font-size: 1.15rem; color: var(--text-secondary); line-height: 1.6; }

/* —— Public marketing site —— */
body.public-site { background: #f8fafc; }
.public-main { min-height: 60vh; }
.public-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.02em;
}
.public-logo span { color: #5eead4; }
.public-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.public-nav a { color: #e2e8f0; text-decoration: none; font-weight: 500; font-size: .95rem; }
.public-nav a:hover { color: #fff; }
.public-nav-muted { opacity: .85; }
.public-hero--dark {
  background: linear-gradient(160deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
  color: #fff;
  max-width: none;
  margin: 0;
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
}
.public-hero--dark h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); max-width: 18ch; margin: 0 auto .75rem; }
.public-hero--dark .public-lead { color: #ccfbf1; max-width: 42rem; margin: 0 auto 1.5rem; font-size: 1.1rem; }
.public-hero--compact { max-width: 720px; margin: 2.5rem auto 0; padding: 0 1.5rem; text-align: center; }
.public-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 700;
  color: #99f6e4;
  margin: 0 0 1rem;
}
.public-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-bottom: .75rem; }
.public-cta-note { font-size: .85rem; color: #99f6e4; margin: 0; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.public-section { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.public-section--alt { background: #fff; border-block: 1px solid var(--border); }
.public-section--cta { text-align: center; padding: 3.5rem 1.5rem; }
.public-section-head { text-align: center; max-width: 36rem; margin: 0 auto 2rem; }
.public-section-head h2 { margin: 0 0 .5rem; font-size: 1.75rem; }
.public-section-head p { color: var(--text-secondary); margin: 0; }
.public-section-cta { text-align: center; margin-top: 1.5rem; }
.public-section-cta a { font-weight: 600; color: var(--brand); }
.public-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.mkt-feature-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 960px;
  margin: 0 auto;
}

.mkt-compare-grid--simple {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 720px;
  margin: 0 auto;
}
.public-feature-grid--large .public-feature-card { padding: 1.35rem; }
.public-feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.public-feature-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.public-feature-card p { margin: 0; color: var(--text-secondary); font-size: .92rem; line-height: 1.55; }
.public-feature-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand);
  margin-bottom: .35rem;
}
.public-tier-note { margin-top: .75rem !important; font-size: .8rem !important; color: var(--text-muted) !important; }
.public-tier-note--live { color: var(--success, #059669) !important; font-weight: 600; }

.legal-prose { max-width: 42rem; margin: 0 auto; font-size: .95rem; line-height: 1.65; color: var(--text-secondary, #475569); }
.legal-prose h2 { margin: 1.75rem 0 .65rem; font-size: 1.15rem; color: var(--text, #0f172a); }
.legal-prose p { margin: 0 0 .85rem; }
.legal-prose ul { margin: 0 0 1rem 1.15rem; padding: 0; }
.legal-prose li { margin-bottom: .4rem; }
.legal-prose a { color: var(--brand, #0f766e); }
.public-compare-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
}
.public-compare-banner h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.public-compare-banner p { margin: 0; color: var(--text-secondary); max-width: 36rem; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.pricing-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
}
.pricing-card--featured {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(15, 118, 110, .12);
}
.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 999px;
}
.pricing-card h3 { margin: 0 0 .25rem; }
.pricing-tagline { font-size: .85rem; color: var(--text-secondary); margin: 0 0 1rem; min-height: 2.5em; }
.pricing-price { margin-bottom: .25rem; }
.pricing-amount { font-size: 1.75rem; font-weight: 800; }
.pricing-period { color: var(--text-secondary); font-size: .9rem; }
.pricing-annual-note { font-size: .8rem; color: var(--text-muted); margin: 0 0 1rem; }
.pricing-features-mini {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  flex: 1;
  font-size: .85rem;
  color: var(--text-secondary);
}
.pricing-features-mini li { padding: .2rem 0; }
.pricing-flex-callout {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
}
.pricing-flex-callout h3 { margin: 0 0 .35rem; }
.pricing-flex-callout p { margin: 0; color: var(--text-secondary); }
.pricing-compare-wrap { overflow-x: auto; }
.pricing-compare th, .pricing-compare td { text-align: center; font-size: .88rem; }
.pricing-compare th:first-child, .pricing-compare td:first-child { text-align: left; }
.pricing-check { color: #059669; font-weight: 700; }
.pricing-dash { color: #cbd5e1; }
.pricing-planned-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .12rem .45rem;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
}
.pricing-planned-text { font-size: .82rem; color: var(--text-secondary); }
.billing-plan-card__features li.is-planned { opacity: .85; }
.billing-plan-card__features li.is-planned::before { content: '◦'; color: var(--warning); }
.public-offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.public-offer-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
}
.public-offer-card h3 { margin: 0 0 .4rem; font-size: 1rem; }
.public-offer-card p { margin: 0; font-size: .88rem; color: var(--text-secondary); }
.public-audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.public-audience-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
}
.public-audience-card h3 { margin: 0 0 .35rem; }
.public-audience-card p { font-size: .88rem; color: var(--text-secondary); margin: 0 0 .75rem; }
.public-audience-card a { font-weight: 600; font-size: .88rem; }

/* —— Marketing revamp (homepage, features, pricing) —— */
.mkt-hero .public-cta { margin-bottom: 1.25rem; }
.mkt-hero--short { padding: 3rem 1.5rem 2.5rem; }

.mkt-hero--with-image { text-align: left; }
.mkt-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 44%);
  gap: 2.5rem;
  align-items: center;
}
.mkt-hero--with-image h1 {
  margin-left: 0;
  max-width: 22ch;
}
.mkt-hero--with-image .public-lead {
  margin-left: 0;
}
.mkt-hero--with-image .public-cta {
  justify-content: flex-start;
}
.mkt-hero-media {
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.mkt-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
@media (max-width: 900px) {
  .mkt-hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .mkt-hero--with-image {
    text-align: center;
  }
  .mkt-hero--with-image h1 {
    margin-left: auto;
    margin-right: auto;
    max-width: 18ch;
  }
  .mkt-hero--with-image .public-lead {
    margin-left: auto;
    margin-right: auto;
  }
  .mkt-hero--with-image .public-cta {
    justify-content: center;
  }
  .mkt-hero-media {
    order: -1;
    max-width: 28rem;
    margin: 0 auto;
  }
}
.mkt-trust-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  max-width: 52rem;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.mkt-trust-item {
  text-align: center;
  font-size: 0.8rem;
  color: #99f6e4;
}
.mkt-trust-item strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.mkt-trades-strip {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.mkt-trades-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}
.mkt-trades-sub {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}
.mkt-trades-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.mkt-trades-pills li {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: #f1f5f9;
  border-radius: 999px;
  color: #334155;
}
.mkt-feature-card--highlight {
  border-color: #99f6e4;
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.08);
}
.mkt-steps-section { padding-top: 2rem; }
.mkt-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}
.mkt-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.mkt-step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.mkt-step-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: #0f766e;
  color: #fff;
  border-radius: 50%;
}
.mkt-step h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.mkt-step p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.mkt-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.mkt-compare-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.mkt-compare-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #0f766e;
}
.mkt-compare-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.mkt-final-cta .public-cta {
  justify-content: center;
  margin-top: 0.5rem;
}
.mkt-help-banner {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.mkt-help-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #99f6e4;
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
}
.mkt-help-banner-inner h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}
.mkt-help-banner-inner p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 36rem;
}
.mkt-included-list {
  max-width: 36rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.mkt-included-list li {
  margin-bottom: 0.25rem;
}
.mkt-hooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.mkt-hook-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.mkt-hook-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #0f766e;
}
.mkt-hook-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.mkt-referral-note {
  margin: 1.25rem 0 0;
  padding: 1rem 1.15rem;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
}
.mkt-referral-note a {
  font-weight: 600;
  color: #0f766e;
}
@media (max-width: 640px) {
  .mkt-trust-bar {
    grid-template-columns: 1fr 1fr;
  }
  .mkt-help-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
.public-footer {
  background: var(--sidebar-bg);
  color: #94a3b8;
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}
.public-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.public-footer p { margin: 0; font-size: .88rem; }
.public-footer nav { display: flex; gap: 1.25rem; }
.public-footer nav a { color: #cbd5e1; text-decoration: none; font-size: .88rem; }
.public-footer nav a:hover { color: #fff; }
.public-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  margin-bottom: 0.25rem;
}
.public-footer-social a {
  color: #5eead4;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.public-footer-social a:hover { color: #fff; }
@media (max-width: 640px) {
  .public-nav .public-nav-muted { display: none; }
  .public-header { padding: 1rem; }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.grid-2 .card {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Mobile bottom nav — one app at /login (phone + desktop) */
.app-mobile-nav {
  display: none;
}
@media (max-width: 768px) {
  .app-has-mobile-nav .main {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }
  .app-mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    justify-content: space-around;
    align-items: flex-end;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.35rem 0.1rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
  }

  .app-mobile-nav a {
    position: relative;
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 0.28rem 0.1rem;
    min-height: 48px;
    max-width: 5.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    -webkit-tap-highlight-color: transparent;
  }

  .app-mobile-nav a:active {
    background: #f1f5f9;
  }

  .app-mobile-nav a.active {
    color: #0f766e;
    font-weight: 700;
  }

  .app-mobile-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #5eead4;
    border-radius: 0 0 2px 2px;
  }

  .app-mobile-nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
  }

  .app-mobile-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
  }
  .app-has-mobile-nav .ai-assistant-fab {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-page-header h1 {
    font-size: 1.35rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width) !important;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }

  .app-shell.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-mobile-open .sidebar-backdrop {
    display: block;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: var(--sidebar-width) !important;
  }

  .app-shell.sidebar-collapsed .nav-section,
  .app-shell.sidebar-collapsed .sidebar-nav a span,
  .app-shell.sidebar-collapsed .sidebar-brand .tenant-name,
  .app-shell.sidebar-collapsed .user-chip .meta,
  .app-shell.sidebar-collapsed .sidebar-footer .sign-out span {
    display: block;
    opacity: 1;
    width: auto;
  }

  .app-shell.sidebar-collapsed .sidebar-nav a {
    justify-content: flex-start;
    padding: .55rem .75rem;
  }

  .main {
    padding: var(--space-md);
  }

  .topbar-search input {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 1100px) {
  .topbar-search input {
    width: 200px;
  }
}

@media (max-width: 960px) {
  .topbar-search {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar-left {
    flex-wrap: wrap;
  }

  .topbar-search {
    width: 100%;
  }

  .topbar-search input {
    width: 100%;
  }
}

html {
  scroll-behavior: smooth;
}

.quote-edit-anchor {
  scroll-margin-top: 5.5rem;
}

/* —— In-app billing / upgrade —— */
.page-header--compact { margin-bottom: var(--space-md); }

.billing-hero {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #134e4a 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-lg);
}
.billing-hero--urgent {
  background: linear-gradient(135deg, #7f1d1d 0%, #b45309 55%, #134e4a 100%);
}
.billing-hero--trial {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f766e 100%);
}
.billing-hero--active {
  background: linear-gradient(135deg, #064e3b 0%, #0f766e 100%);
}
.billing-hero h2 {
  margin: 0 0 .5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.billing-hero p {
  margin: 0;
  color: #ccfbf1;
  max-width: 40rem;
  line-height: 1.55;
}
.billing-hero__perks {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  font-size: .88rem;
  color: #99f6e4;
}
.billing-hero__perks li::before {
  content: '✓ ';
  font-weight: 700;
}

.billing-admin-notice {
  background: var(--info-bg);
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  font-size: .92rem;
}

.billing-section { margin-bottom: var(--space-xl); }
.billing-section__head {
  text-align: center;
  max-width: 32rem;
  margin: 0 auto var(--space-lg);
}
.billing-section__head h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.billing-section__head p { margin: 0; color: var(--text-secondary); font-size: .92rem; }

.billing-interval-toggle {
  display: flex;
  width: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin: 0 auto var(--space-lg);
}
.billing-interval-btn {
  border: none;
  background: transparent;
  padding: .45rem 1rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.billing-interval-btn.active {
  background: var(--brand);
  color: #fff;
}
.billing-interval-save {
  font-size: .72rem;
  font-weight: 700;
  opacity: .9;
  margin-left: .2rem;
}

.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  align-items: stretch;
}
.billing-plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}
.billing-plan-card:hover {
  box-shadow: var(--shadow-lg);
}
.billing-plan-card--featured {
  border-color: var(--brand);
  box-shadow: 0 8px 28px rgba(15, 118, 110, .15);
}
.billing-plan-card--current {
  border-color: var(--success);
}
.billing-plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.billing-plan-badge--current {
  background: var(--success);
}
.billing-plan-card__head h3 {
  margin: .5rem 0 .2rem;
  font-size: 1.15rem;
}
.billing-plan-card__tagline {
  margin: 0;
  font-size: .82rem;
  color: var(--text-secondary);
  min-height: 2.4em;
  line-height: 1.4;
}
.billing-plan-card__price {
  margin: var(--space-md) 0 .15rem;
}
.billing-plan-card__amount {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.billing-plan-card__period {
  color: var(--text-secondary);
  font-size: .9rem;
}
.billing-plan-card__billed {
  margin: 0 0 var(--space-md);
  font-size: .78rem;
  color: var(--text-secondary);
  min-height: 1.2em;
}
.billing-plan-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
  flex: 1;
  font-size: .85rem;
  color: var(--text-secondary);
}
.billing-plan-card__features li {
  padding: .28rem 0 .28rem 1.35rem;
  position: relative;
}
.billing-plan-card__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}
.billing-plan-card__cta { margin-top: auto; }
.billing-plan-card__status {
  display: block;
  text-align: center;
  font-size: .85rem;
  color: var(--text-secondary);
  padding: .65rem;
}

.billing-trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}
.billing-trust__item {
  text-align: center;
  font-size: .85rem;
}
.billing-trust__item strong {
  display: block;
  margin-bottom: .15rem;
  color: var(--text);
}
.billing-trust__item span {
  color: var(--text-secondary);
}

.billing-compare-details {
  margin: var(--space-lg) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.billing-compare-details summary {
  padding: var(--space-md);
  cursor: pointer;
  font-weight: 600;
}
.billing-compare-inner {
  padding: 0 var(--space-md) var(--space-md);
  overflow-x: auto;
}

.billing-admin-panel {
  margin-top: var(--space-xl);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}
.billing-admin-panel summary {
  padding: var(--space-md);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: .9rem;
}
.billing-admin-panel__body { margin: 0 var(--space-md) var(--space-md); }

.billing-account-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}
.billing-account-cta {
  margin-top: var(--space-md);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.billing-account-cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

@media (max-width: 640px) {
  .billing-hero { padding: var(--space-md); }
  .billing-hero h2 { font-size: 1.25rem; }
  .billing-plans-grid { grid-template-columns: 1fr; }
}

/* —— Performance (fast paint & tap on mobile) —— */
html {
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
a, button, .btn, input, select, textarea {
  touch-action: manipulation;
}
.app-body .main {
  contain: layout style;
}
.main--navigating {
  opacity: 0.92;
  transition: opacity 0.08s ease;
}
.card .table-wrap,
.report-bars {
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}
.data-table img {
  content-visibility: auto;
}
.sidebar-nav a,
.topbar-quick-actions a {
  -webkit-user-select: none;
  user-select: none;
}

/* —— Help centre (public, app, portal) —— */
.help-centre {
  --help-max: 1080px;
  background: #f8fafc;
  min-height: 50vh;
}
.help-hero--brand {
  background: linear-gradient(160deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
  color: #fff;
  text-align: center;
  padding: 3.5rem 1.5rem 2.75rem;
  margin: 0;
  max-width: none;
}
.help-hero--brand h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 auto 0.75rem;
  max-width: 20ch;
}
.help-hero--brand .public-lead {
  color: #ccfbf1;
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
}
.help-hero--compact {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  text-align: left;
}
.help-hero--compact h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.help-hero--compact .public-lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.help-search-wrap {
  max-width: 28rem;
  margin: 0 auto;
}
.help-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.help-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 1rem center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  color: #0f172a;
}
.help-search-input:focus {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}
.help-toolbar {
  max-width: var(--help-max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #f8fafc 85%, transparent);
}
.help-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.help-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: #475569;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.help-filter:hover {
  border-color: #0f766e;
  color: #0f766e;
}
.help-filter.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.help-filter-count {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}
.help-no-results {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #b45309;
}
.help-body {
  max-width: var(--help-max);
  margin: 0 auto;
  padding: 1rem 1.5rem 2.5rem;
}
.help-category {
  margin-bottom: 2.5rem;
}
.help-category-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0f766e;
  display: inline-block;
}
.help-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.help-card-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.help-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-height: 100%;
}
.help-card--highlight {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
}
.help-card:hover {
  border-color: #0f766e;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.12);
  transform: translateY(-2px);
}
.help-card[hidden] {
  display: none !important;
}
.help-card--compact {
  padding: 1rem;
}
.help-card--compact .help-card-excerpt,
.help-card--compact .help-card-link {
  display: none;
}
.help-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.help-card-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f766e;
  margin-bottom: 0.35rem;
}
.help-card-type--lg {
  font-size: 0.8rem;
}
.help-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.help-badge--faq { background: #e0f2fe; color: #0369a1; }
.help-badge--howto { background: #d1fae5; color: #047857; }
.help-badge--video { background: #fce7f3; color: #9d174d; }
.help-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  color: #0f172a;
}
.help-card-excerpt {
  flex: 1;
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #64748b;
}
.help-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f766e;
  margin-top: auto;
}
.help-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}
.help-cta {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  background: #fff;
  border-top: 1px solid var(--border);
}
.help-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}
.help-cta p {
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
}
.help-cta--inline {
  max-width: var(--help-max);
  margin: 0 auto 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ecfdf5;
}
.help-cta--inline p {
  margin-bottom: 1rem;
}
/* Article page */
.help-article-hero {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.help-breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: #64748b;
}
.help-breadcrumb a {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}
.help-breadcrumb a:hover {
  text-decoration: underline;
}
.help-breadcrumb span[aria-hidden] {
  margin: 0 0.35rem;
  opacity: 0.5;
}
.help-article-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: #0f172a;
}
.help-article-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}
.help-article-layout {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}
.help-article-main {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-top: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.help-article-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.help-related {
  max-width: var(--help-max);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}
.help-related h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
.help-article-prose {
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
}
.help-article-prose h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.2rem;
  color: #0f172a;
}
.help-article-prose h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: #0f172a;
}
.help-article-prose p {
  margin: 0 0 1rem;
}
.help-article-prose ul,
.help-article-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.help-article-prose li {
  margin-bottom: 0.45rem;
}
.help-article-prose a {
  color: #0f766e;
  font-weight: 500;
}
.help-article-prose a:hover {
  text-decoration: underline;
}
.help-article-prose strong {
  color: #0f172a;
}
.help-content-figure {
  margin: 1.5rem 0;
  padding: 0;
}
.help-content-figure img,
.help-content-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.help-content-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
}
.support-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.support-upload-btn {
  cursor: pointer;
  margin: 0;
}
.support-upload-btn input {
  display: none;
}
.support-upload-status {
  font-size: 0.85rem;
  color: #94a3b8;
}
.support-upload-status.is-success {
  color: #86efac;
}
.support-upload-status.is-error {
  color: #fca5a5;
}
.support-upload-status.is-loading {
  color: #fcd34d;
}
.support-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.support-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius-md);
  background: #0f172a;
}
.support-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Affiliate partner portal */
.affiliate-public-header,
.affiliate-portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.affiliate-public-logo,
.affiliate-portal-header .affiliate-public-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}
.affiliate-public-logo span { color: #2dd4bf; }
.affiliate-public-nav,
.affiliate-portal-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.affiliate-public-nav a,
.affiliate-portal-nav a {
  color: #99f6e4;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.affiliate-public-nav a:hover,
.affiliate-portal-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.affiliate-nav-divider {
  display: inline-block;
  width: 1px;
  height: 1.1rem;
  background: rgba(148, 163, 184, 0.45);
  margin: 0 0.15rem;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .affiliate-public-header,
  .affiliate-portal-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .affiliate-public-nav,
  .affiliate-portal-nav {
    width: 100%;
    gap: 0.65rem 0.85rem;
  }
  .affiliate-nav-divider {
    display: none;
  }
}
.affiliate-portal-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #99f6e4;
  margin-left: 0.35rem;
}
.affiliate-public-main,
.affiliate-portal-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
/* Affiliate pages — centered “Questions?” resource links */
.affiliate-footer-links {
  max-width: 36rem;
  margin: 1.75rem auto 0;
  padding-top: 1.5rem;
  text-align: center;
}
.affiliate-footer-links__label {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.affiliate-footer-links__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}
.affiliate-footer-links__nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.affiliate-footer-links--light {
  border-top: 1px solid var(--border);
}
.affiliate-footer-links--light .affiliate-footer-links__label {
  color: var(--text-secondary);
}
.affiliate-footer-links--light .affiliate-footer-links__nav a {
  color: var(--brand);
  background: rgba(15, 118, 110, 0.06);
  border-color: rgba(15, 118, 110, 0.2);
}
.affiliate-footer-links--light .affiliate-footer-links__nav a:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.affiliate-footer-links--dark {
  border-top: 1px solid rgba(153, 246, 228, 0.25);
}
.affiliate-footer-links--dark .affiliate-footer-links__label {
  color: #99f6e4;
}
.affiliate-footer-links--dark .affiliate-footer-links__nav a {
  color: #ccfbf1;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(153, 246, 228, 0.35);
}
.affiliate-footer-links--dark .affiliate-footer-links__nav a:hover {
  color: #0f172a;
  background: #99f6e4;
  border-color: #99f6e4;
}
.public-section--alt .affiliate-footer-links {
  margin-bottom: 0.5rem;
}
.mkt-faq .affiliate-footer-links {
  padding-bottom: 0.25rem;
}
@media (max-width: 480px) {
  .affiliate-footer-links__nav {
    flex-direction: column;
    width: 100%;
    max-width: 16rem;
    margin: 0 auto;
  }
  .affiliate-footer-links__nav a {
    width: 100%;
    justify-content: center;
  }
}
.affiliate-form-section {
  max-width: 520px;
  margin: 0 auto;
}
.affiliate-form-section--wide {
  max-width: 640px;
}
/* Section panels — bordered groups by form type */
.affiliate-form-panel {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  overflow: hidden;
}
.affiliate-form-panel:first-of-type {
  margin-top: 0;
}
.affiliate-form-panel--nested {
  margin-top: 1rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}
.affiliate-form-panel--choice {
  border-color: rgba(15, 118, 110, 0.35);
  background: linear-gradient(180deg, #f0fdfa 0%, #fafbfc 100%);
}
.affiliate-form-panel--choice .affiliate-form-panel__title {
  color: var(--brand);
}
.affiliate-form-panel__title {
  margin: 0;
  padding: 0.85rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border);
}
.affiliate-form-panel--choice .affiliate-form-panel__title {
  background: rgba(255, 255, 255, 0.55);
  border-bottom-color: rgba(15, 118, 110, 0.2);
}
.affiliate-form-panel__body {
  padding: 1.15rem 1.15rem 1.25rem;
}
.affiliate-form-panel__body > .form-row:last-child {
  margin-bottom: 0;
}
.affiliate-form-panel__follow {
  margin-top: 0.5rem;
}
.affiliate-form-subpanel {
  margin-bottom: 1rem;
  padding: 1rem 1rem 0.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.affiliate-form-subpanel:last-child {
  margin-bottom: 0;
}
.affiliate-form-subpanel__title {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.affiliate-form .form-row--half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 540px) {
  .affiliate-form .form-row--half {
    grid-template-columns: 1fr;
  }
}
/* Tick / radio choice tiles */
.affiliate-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
@media (min-width: 520px) {
  .affiliate-choice-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.affiliate-choice-grid--inline {
  grid-template-columns: repeat(2, minmax(6rem, 1fr));
  max-width: 16rem;
}
.affiliate-choice-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.affiliate-choice-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}
.affiliate-choice-tile--block {
  align-items: flex-start;
  padding: 0.85rem 1rem;
  font-weight: 400;
  font-size: 0.9rem;
}
.affiliate-choice-tile:hover {
  border-color: rgba(15, 118, 110, 0.45);
  background: #f0fdfa;
}
.affiliate-choice-tile:has(input:checked) {
  border-color: var(--brand);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}
.affiliate-choice-tile input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.affiliate-choice-tile__text {
  flex: 1;
}
.affiliate-choice-tile__text a {
  color: var(--brand);
  font-weight: 600;
}
.affiliate-choice-tile:has(input:checked) .affiliate-choice-tile__text::before {
  content: "✓ ";
  color: var(--brand);
  font-weight: 700;
}
.affiliate-choice-tile--block:has(input:checked) .affiliate-choice-tile__text::before {
  display: inline;
}
/* God console — full partner application */
.platform-application-card {
  margin-bottom: 1.5rem;
  border-color: rgba(15, 118, 110, 0.35);
}
.platform-application-card > h2 {
  margin-bottom: 0.35rem;
}
.platform-application-meta {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0 0 1.25rem;
}
.platform-application-pending {
  color: #fbbf24;
  font-weight: 600;
}
.platform-app-section {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}
.platform-app-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.platform-app-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin: 0 0 0.65rem;
}
.platform-app-channel-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.35);
}
.platform-app-channel-badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ccfbf1;
  background: rgba(15, 118, 110, 0.35);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 999px;
}
.platform-app-fields {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem 1.25rem;
}
.platform-app-field {
  margin: 0;
}
.platform-app-field--wide {
  grid-column: 1 / -1;
}
.platform-app-field dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin: 0;
}
.platform-app-field dd {
  margin: 0.2rem 0 0;
  color: #e2e8f0;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.platform-app-field dd a {
  color: #5eead4;
  word-break: break-all;
}
.platform-app-legacy {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.platform-app-legacy-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fbbf24;
  margin: 0 0 0.35rem;
}
.platform-app-legacy p:last-child {
  margin: 0;
  color: #e2e8f0;
}
.affiliate-form-section h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  color: var(--text);
}
.affiliate-public-main .affiliate-form-section .text-muted,
.affiliate-portal-main .text-muted {
  color: var(--text-secondary);
  margin-bottom: 0;
}
.affiliate-form.card {
  max-width: 100%;
  margin-top: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
/* Partner forms use .form-row (not .form-group) — style inputs explicitly */
.affiliate-form .form-row {
  margin-bottom: var(--space-md);
}
.affiliate-form .form-row:last-of-type {
  margin-bottom: 0;
}
.affiliate-form .form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text);
}
.affiliate-form .form-row input,
.affiliate-form .form-row select,
.affiliate-form .form-row textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.affiliate-form .form-row input:focus,
.affiliate-form .form-row select:focus,
.affiliate-form .form-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.affiliate-form .form-row textarea {
  min-height: 5rem;
  resize: vertical;
}
.affiliate-form .form-hint {
  margin-top: var(--space-xs);
  margin-bottom: 0;
}
.affiliate-form .btn-block {
  width: 100%;
  margin-top: 1.25rem;
}
.affiliate-public-main .alert,
.affiliate-portal-main .alert {
  max-width: 520px;
  margin: 0 auto 1rem;
}
.affiliate-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.affiliate-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.affiliate-stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.affiliate-stat-card strong { font-size: 1.35rem; }
.affiliate-link-card { margin: 1.5rem 0; padding: 1.25rem; }

/* Affiliate / marketing FAQ (also SEO FAQPage content) */
.mkt-faq-list {
  max-width: 720px;
  margin: 0 auto;
}
.mkt-faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.mkt-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
}
.mkt-faq-item summary::-webkit-details-marker { display: none; }
.mkt-faq-item summary h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: inline;
}
.mkt-faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.mkt-faq-answer {
  padding: 1rem 1.25rem 1.15rem;
}
.mkt-faq-answer p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}
.affiliate-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.affiliate-terms-check input { margin-top: 0.2rem; flex-shrink: 0; }
body.affiliate-public .legal-prose {
  max-width: 720px;
  margin: 0 auto;
}
body.affiliate-public .legal-prose h2 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}
body.affiliate-public .legal-prose p,
body.affiliate-public .legal-prose li {
  color: var(--text-secondary);
  line-height: 1.6;
}
.affiliate-link-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.affiliate-link-input {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}
.affiliate-sample-copy {
  margin: 0;
  padding: 1rem;
  background: var(--bg-alt, #f8fafc);
  border-left: 4px solid var(--primary, #0d9488);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
}
.affiliate-payout-pre {
  white-space: pre-wrap;
  font-size: 0.9rem;
  background: #f1f5f9;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}
.platform-inline-forms { display: inline-block; margin-right: 0.5rem; }
.platform-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .affiliate-link-row { flex-direction: column; }
}

/* Portal help (reuse cards) */
.portal-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.portal-help-list .portal-list-link {
  display: block;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.support-kb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.support-kb-list li {
  margin-bottom: 0.65rem;
}
.support-kb-list a {
  color: #e2e8f0;
}
.help-card-grid--portal {
  grid-template-columns: 1fr;
  margin-bottom: 1.25rem;
}
.help-article-main--portal {
  margin-top: 0;
}
@media (max-width: 640px) {
  .help-toolbar {
    position: static;
  }
  .help-card-grid {
    grid-template-columns: 1fr;
  }
  .help-article-main {
    padding: 1.15rem;
  }
}
