/* Product Core dashboard styles. Same token shape as the legacy app
   (app/css/styles.css) -- CSS custom properties on :root + [data-theme] --
   so the owner's eye for this product stays consistent, but every
   component class below is new/purpose-built for the six v1 screens
   (docs/DASHBOARD.md). Mobile-first: base rules target the phone layout,
   the >=769px media query at the bottom promotes to the desktop layout. */

:root {
  --accent: #00d4ff; --accent-dim: rgba(0, 212, 255, 0.12);
  --green: #00c864; --green-dim: rgba(0, 200, 100, 0.12);
  --yellow: #ffd740; --yellow-dim: rgba(255, 215, 64, 0.12);
  --red: #ff5252; --red-dim: rgba(255, 82, 82, 0.12);
  --orange: #ff9100; --purple: #d580ff; --purple-dim: rgba(213, 128, 255, 0.12);
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --focus-ring: 0 0 0 3px var(--accent-dim), 0 0 0 1px var(--accent);
}

[data-theme='dark'] {
  --bg: #0f1117; --surface: #181c27; --surface2: #1f2435; --border: #2a3048;
  --text: #e8eaf0; --text-dim: #a7acc4; --text-muted: #6d7492; --shadow: rgba(0, 0, 0, 0.4);
}
[data-theme='light'] {
  --bg: #f0f2f7; --surface: #ffffff; --surface2: #f5f7fb; --border: #dde1ec;
  --text: #1a1f2e; --text-dim: #4a5170; --text-muted: #7981a3; --shadow: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  transition: background 0.2s, color 0.2s;
}

.mono { font-family: var(--mono); }

button { font: inherit; color: inherit; }
a { color: var(--accent); }

/* Real focus states everywhere -- accessibility non-negotiable per brief. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================== LOGIN ============================== */
#login-screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
#login-screen.active { display: flex; }

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
}
.login-header { padding: 28px 28px 18px; text-align: center; border-bottom: 1px solid var(--border); }
.login-title { font-family: var(--display); font-size: 18px; font-weight: 700; }
.login-subtitle { margin-top: 6px; font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.login-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label { font-family: var(--mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.login-input {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 16px; padding: 12px 14px; width: 100%; outline: none;
  transition: border-color 0.15s;
}
.login-input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.login-btn {
  margin-top: 4px; padding: 13px; background: var(--accent); border: none; border-radius: 6px;
  color: #00131a; font-weight: 700; font-size: 15px; cursor: pointer; transition: opacity 0.15s; width: 100%;
}
.login-btn:hover { opacity: 0.88; }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error {
  display: none; padding: 10px 12px; background: var(--red-dim); border: 1px solid var(--red);
  border-radius: 6px; font-size: 12px; color: var(--red);
}
.login-error.show { display: block; }
.login-confirm {
  display: none; padding: 10px 12px; background: var(--green-dim); border: 1px solid var(--green);
  border-radius: 6px; font-size: 12px; color: var(--green);
}
.login-confirm.show { display: block; }
.login-link-btn {
  background: none; border: none; color: var(--accent); font-family: var(--sans); font-size: 12px;
  cursor: pointer; padding: 4px 0; text-align: center; width: 100%;
}
.login-link-btn:hover { text-decoration: underline; }

/* ============================== FORGOT PASSWORD / PASSWORD RECOVERY ============================== */
/* Same card chrome as #login-screen (.login-card/.login-header/.login-body/
   .login-field/.login-input/.login-btn/.login-error are all reused as-is)
   -- these two screens are siblings of #login-screen, toggled the same way
   (see js/recovery.js), not part of the four nav-tab screens. */
#forgot-password-screen, #recovery-screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
#forgot-password-screen.active, #recovery-screen.active { display: flex; }

#recovery-expired { display: none; flex-direction: column; gap: 12px; padding: 24px 28px; }
#recovery-screen.expired .recovery-form-wrap { display: none; }
#recovery-screen.expired #recovery-expired { display: flex; }

/* ============================== APP SHELL ============================== */
#app-shell { display: none; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
#app-shell.active { display: flex; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; padding-top: env(safe-area-inset-top);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-tenant { font-family: var(--display); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; background: none; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-dim); border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--accent);
  font-family: var(--mono); font-weight: 700; flex-shrink: 0;
}

/* Desktop nav tabs -- hidden on mobile (see the 768px query) */
.nav-tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px; overflow-x: auto; }
.nav-tab {
  padding: 12px 16px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.nav-tab:hover { color: var(--text-dim); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.screen-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.active { display: flex; }
.screen-header { padding: 16px 20px 8px; }
.screen-title { font-family: var(--display); font-size: 16px; font-weight: 700; }
.screen-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.screen-body { flex: 1; overflow-y: auto; padding: 0 20px 24px; }

/* ============================== MOBILE TOPBAR / NAV DRAWER ============================== */
#mobile-topbar {
  display: none; position: sticky; top: 0; z-index: 900; background: var(--surface);
  border-bottom: 1px solid var(--border); padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  align-items: center; justify-content: space-between;
}
.mobile-topbar-title { font-family: var(--display); font-weight: 700; font-size: 15px; }

#mobile-nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1100;
}
#mobile-nav-overlay.open { display: block; }
#mobile-nav-drawer {
  position: fixed; top: 0; left: -280px; width: 280px; height: 100%; height: 100dvh;
  background: var(--bg); border-right: 1px solid var(--border); z-index: 1101;
  transition: left 0.22s ease; display: flex; flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 12px 16px;
}
#mobile-nav-drawer.open { left: 0; }
.mobile-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 8px;
  font-size: 15px; cursor: pointer; color: var(--text); border: none; background: none; text-align: left; width: 100%;
}
.mobile-nav-item:hover, .mobile-nav-item.active { background: var(--surface); color: var(--accent); }
.mobile-nav-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* ============================== BADGES ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-family: var(--mono); font-weight: 500; border: 1px solid transparent; white-space: nowrap;
}
.vendor-badge { border-width: 1px; border-style: solid; }
.state-badge-lg { font-size: 12px; padding: 5px 12px; }
.status-badge { text-transform: uppercase; letter-spacing: 0.05em; font-size: 10px; background: var(--surface2); color: var(--text-dim); }

/* ============================== LEAD FEED (screen 2) ============================== */
.lead-group { margin-bottom: 20px; }
.lead-group-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 0 8px;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em;
}
.lead-group-count {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; font-size: 10px;
}
.lead-cards { display: flex; flex-direction: column; gap: 8px; }

.lead-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.lead-card:hover { border-color: var(--accent); }
.lead-card-main { min-width: 0; }
.lead-card-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card-phone { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.lead-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.lead-card-time { font-size: 11px; color: var(--text-muted); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px;
  color: var(--text-muted); gap: 10px; text-align: center;
}
.empty-icon { font-size: 34px; opacity: 0.5; }

.loading {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 50px;
  color: var(--text-muted); font-family: var(--mono); font-size: 12px;
}
.spinner {
  width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: apdp-spin 0.8s linear infinite;
}
@keyframes apdp-spin { to { transform: rotate(360deg); } }

/* ============================== LEAD DETAIL PANEL (screen 3) ============================== */
#lead-detail-panel {
  display: none; position: fixed; inset: 0; z-index: 1200; background: var(--bg);
  flex-direction: column;
}
#lead-detail-panel.open { display: flex; }

.detail-topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0;
}
.detail-body { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.detail-name { font-family: var(--display); font-size: 19px; font-weight: 700; }
.detail-sub { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.btn-call {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 8px;
  background: var(--green); color: #002b12; font-weight: 700; font-size: 13px; text-decoration: none; flex-shrink: 0;
}

.detail-section { padding: 14px 0; border-top: 1px solid var(--border); }
.detail-section:first-of-type { border-top: none; }
.detail-section-title {
  font-family: var(--mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 10px;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-full { grid-column: 1 / -1; }
.detail-label { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.detail-value { font-size: 13px; }
.detail-value.mono { font-family: var(--mono); font-size: 12px; }
.detail-empty { color: var(--text-muted); font-size: 12px; }

.raw-payload-details summary { cursor: pointer; list-style: none; }
.raw-payload-details summary::-webkit-details-marker { display: none; }
.raw-payload-details summary::before { content: '▸ '; }
.raw-payload-details[open] summary::before { content: '▾ '; }
.raw-payload {
  margin-top: 10px; padding: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}

.ledger-list { display: flex; flex-direction: column; gap: 8px; }
.ledger-row {
  padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.ledger-row-main { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.ledger-row-time { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.ledger-row-sub { margin-top: 3px; font-size: 11px; color: var(--text-muted); }

/* ============================== ESCALATION STATUS (screen 4) ============================== */
.escalation-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  margin-bottom: 8px;
}
.escalation-row:hover { border-color: var(--accent); }
.escalation-row-name { font-weight: 600; font-size: 14px; }
.escalation-row-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.escalation-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.escalation-response { display: flex; flex-direction: column; align-items: flex-end; }
.escalation-response-value { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--green); }
.escalation-response-by { font-size: 10px; color: var(--text-muted); }

/* ============================== LEADERBOARD (screen 5) ============================== */
.leaderboard-controls { display: flex; gap: 6px; padding: 0 20px 12px; }
.window-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: none; color: var(--text-dim);
  font-family: var(--mono); font-size: 11px; cursor: pointer;
}
.window-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.scoreboard { display: flex; flex-direction: column; gap: 10px; }
.score-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.score-card-leader { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.score-rank { font-size: 24px; width: 40px; text-align: center; flex-shrink: 0; }
.score-main { flex: 1; min-width: 0; }
.score-name { font-family: var(--display); font-weight: 700; font-size: 15px; }
.score-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.score-metric { text-align: right; flex-shrink: 0; }
.score-metric-value { font-size: 20px; font-weight: 700; color: var(--accent); }
.score-metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* ============================== EXCEPTION QUEUE (screen 6) ============================== */
.exceptions-summary { font-size: 11px; color: var(--text-muted); padding: 0 0 12px; }
.exception-row {
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px;
}
.exception-row-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.exception-vendor { font-weight: 600; font-size: 13px; }
.exception-type { font-size: 11px; color: var(--text-muted); }
.exception-time { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.exception-message { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.exception-status-resolved { opacity: 0.65; }

/* ============================== TOAST ============================== */
.toast {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); right: 20px; left: 20px; max-width: 360px;
  margin-left: auto; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 10px; z-index: 3000;
  opacity: 0; transform: translateY(8px); transition: all 0.2s; pointer-events: none; box-shadow: 0 8px 24px var(--shadow);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ============================== >=769px: DESKTOP LAYOUT ============================== */
@media (min-width: 769px) {
  #mobile-topbar, #mobile-nav-drawer, #mobile-nav-overlay { display: none !important; }
  #mobile-nav-open { display: none !important; }

  .screen-body { padding: 0 32px 32px; max-width: 1100px; }
  .screen-header { padding: 20px 32px 8px; }

  .lead-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }

  #lead-detail-panel {
    inset: auto; top: 0; right: 0; bottom: 0; width: 420px; border-left: 1px solid var(--border);
    box-shadow: -8px 0 30px var(--shadow);
  }

  .scoreboard { max-width: 640px; }
}

@media (max-width: 768px) {
  .topbar, .nav-tabs { display: none !important; }
  #mobile-topbar { display: flex; }
  .screen-header { padding: 14px 16px 6px; }
  .screen-body { padding: 0 16px 24px; }
  .detail-grid { grid-template-columns: 1fr; }

  /* Prevent iOS Safari zoom on input focus (inputs < 16px trigger it) */
  @supports (-webkit-touch-callout: none) {
    input, select, textarea { font-size: 16px !important; }
  }
}

/* ============================== VENDORS / LEAD SOURCES (screen 7) ============================== */
/* Self-service vendor onboarding. Two state axes are rendered as two separate
   badges per row on purpose (delivery vs. parser) -- a single merged status
   would always be lying about one of them. See web/js/vendors-catalog.js. */

.vendor-alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--border); }
.vendor-alert-warn { background: var(--yellow-dim); border-color: var(--yellow); }
.vendor-alert-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.vendor-alert-body { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.vendor-alert-detail { font-size: 11px; color: var(--text-muted); margin-top: 6px; word-break: break-word; }

.vendor-add-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 20px;
}
.vendor-add-title { font-family: var(--display); font-weight: 700; font-size: 15px; }
.vendor-add-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

.vendor-search-wrap { position: relative; margin-top: 12px; }
.vendor-search-input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit;
}
.vendor-sample-input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12px; font-family: var(--mono);
  resize: vertical; margin-top: 6px;
}
.vendor-field-label {
  display: block; margin-top: 12px; font-family: var(--mono); font-size: 10px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em;
}

.vendor-suggestions {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; max-height: 320px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.vendor-suggestions.open { display: block; }
.vendor-suggestion {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  padding: 10px 12px; background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-family: inherit; font-size: 13px;
}
.vendor-suggestion:last-child { border-bottom: none; }
.vendor-suggestion:hover:not(:disabled) { background: var(--accent-dim); }
.vendor-suggestion:disabled { opacity: 0.5; cursor: default; }
.vendor-suggestion-name { font-weight: 600; }
/* The "why" line is what makes an alias hit trustworthy rather than surprising:
   typing "quinstreet" and getting "Modernize" reads as a bug until the row
   says it matched the alias "QuinStreet". */
.vendor-suggestion-why { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.vendor-suggestion-empty { padding: 10px 12px; font-size: 12px; color: var(--text-muted); }

.vendor-unknown-link {
  margin-top: 10px; background: none; border: none; padding: 0;
  color: var(--accent); font-size: 12px; cursor: pointer; text-decoration: underline; font-family: inherit;
}
.vendor-unknown-form { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.vendor-unknown-note { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.vendor-unknown-warn { color: var(--text-muted); font-size: 11px; margin-top: 8px; }
.vendor-primary-btn {
  margin-top: 12px; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent-dim); color: var(--accent); font-weight: 600; font-size: 13px;
  cursor: pointer; font-family: inherit;
}

.vendor-list { display: flex; flex-direction: column; gap: 10px; }
.vendor-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.vendor-row-review { border-color: var(--yellow); }
.vendor-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vendor-name { font-family: var(--display); font-weight: 700; font-size: 14px; }
.vendor-row-note { font-size: 11px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

.vendor-badge-ok   { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green); }
.vendor-badge-warn { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow); }
.vendor-badge-bad  { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red); }
.vendor-badge-info { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }

.vendor-address-block { margin-top: 10px; }
.vendor-address-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vendor-address {
  flex: 1; min-width: 0; font-size: 12px; padding: 7px 10px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border); word-break: break-all;
}
.copy-btn {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: none;
  color: var(--text-dim); font-family: var(--mono); font-size: 11px; cursor: pointer; flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* The Gmail confirmation code. Deliberately the loudest element on the row:
   the tenant is mid-task in Gmail's settings screen and needs exactly this. */
.vendor-code-box {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--yellow-dim); border: 1px solid var(--yellow);
}
.vendor-code-label { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.vendor-code-row { display: flex; align-items: center; gap: 8px; }
.vendor-code { font-size: 20px; font-weight: 700; letter-spacing: 0.14em; color: var(--yellow); }
.vendor-code-hint { font-size: 10px; color: var(--text-muted); margin-top: 6px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
