/* ============================================================
   TrackProof — global styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

/* ============================================================
   Design tokens — semantic palette for the light theme.
   --brand is injected per-agency in base.html.
   ============================================================ */
:root {
  /* Surfaces */
  --bg:        #f6f7f9;   /* page background */
  --surface:   #ffffff;   /* card / panel */
  --surface-2: #f8fafc;   /* raised / subtle fill */

  /* Borders */
  --line:      #e2e8f0;
  --line-2:    #d1d5db;
  --line-soft: #f1f5f9;

  /* Text */
  --txt:       #0f172a;   /* primary */
  --mut:       #64748b;   /* secondary / meta */
  --faint:     #94a3b8;   /* labels / placeholders */
  --faintest:  #cbd5e1;   /* disabled / em-dash */

  /* Semantic */
  --ok:        #16a34a;
  --warn:      #f59e0b;
  --bad:       #dc2626;

  /* Spacing scale (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;

  /* Radii */
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;

  /* Shadow */
  --sh: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);

  /* Fonts */
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }

/* Brand-tinted text selection */
::selection { background: rgba(80,70,229,.18); color: var(--txt); }

/* Thin, rounded, on-brand scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }

/* Keyboard focus for links / disclosure toggles — scoped so it never
   doubles up on .btn or .form-control, which own their own focus ring. */
a:focus-visible,
summary:focus-visible,
.check-group:focus-within {
  outline: 2px solid var(--brand, #5046e5);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.nav a:focus-visible { outline-offset: -2px; }

/* Disabled buttons get a real affordance */
.btn:disabled, .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Subtle page entrance */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.page { animation: page-enter 0.24s ease both; }

/* Dashboard stat cards feel alive on hover */
.stat-card { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.stat-card:hover { border-color: var(--line-2); box-shadow: var(--sh); transform: translateY(-1px); }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #f6f7f9;
  color: #0f172a;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */

.app-wrap { min-height: 100vh; display: flex; flex-direction: column; }

.header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand, #5046e5);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}
.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--brand, #5046e5);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { color: #fff; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  color: #64748b;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.12s, background 0.12s;
}
.nav a:hover { color: #0f172a; background: #f1f5f9; }
.nav a.active { color: var(--brand, #5046e5); background: #eff2fd; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  flex: 1;
}

/* ── Page header ─────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-header-text {}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.page-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}
.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ── Cards ───────────────────────────────────────────────────── */

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.card-body { padding: 24px; }

/* ── Stats ───────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f172a;
}
.stat-value.green { color: #16a34a; }
.stat-value.red   { color: #dc2626; }
.stat-value.gray  { color: #94a3b8; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:focus-visible { outline: 2px solid var(--brand, #5046e5); outline-offset: 2px; }

.btn-primary {
  background: var(--brand, #5046e5);
  color: #fff;
  border-color: var(--brand, #5046e5);
}
.btn-primary:hover { filter: brightness(0.92); }

.btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #e2e8f0;
}
.btn-secondary:hover { background: #f8fafc; border-color: #d1d5db; }

.btn-danger {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger:hover { background: #fef2f2; }

.btn-ghost {
  background: transparent;
  color: #64748b;
  border-color: transparent;
}
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }

/* ── Badges ──────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending  { background: #f1f5f9; color: #64748b; }
.badge-healthy  { background: #dcfce7; color: #16a34a; }
.badge-failing  { background: #fee2e2; color: #dc2626; }

/* platform tags */
.tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.tag-cr   { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tag-wc   { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.tag-ga4  { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.tag-gads { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.tag-meta { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.tag-form { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

.monitor-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.monitor-calls { background: #fff7ed; color: #c2410c; }
.monitor-forms { background: #f0fdf4; color: #15803d; }

/* ── Table ───────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  max-width: 260px;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.08s; }
tbody tr:hover td { background: #fafbfc; }

.cell-name { display: flex; align-items: center; gap: 12px; }
.client-name { font-weight: 600; color: #0f172a; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-meta { font-size: 12px; color: #94a3b8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Avatar ──────────────────────────────────────────────────── */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand, #5046e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Stack badges ────────────────────────────────────────────── */

.stack-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ── Forms ───────────────────────────────────────────────────── */

.form-card { max-width: 680px; }
.form-section { margin-bottom: 32px; }
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 20px;
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}
.form-label sup { color: #ef4444; margin-left: 2px; }
.form-hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--brand, #5046e5);
  box-shadow: 0 0 0 3px rgba(80,70,229,0.12);
}
.form-control::placeholder { color: #cbd5e1; }
.form-control.error { border-color: #f87171; }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.check-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.check-group:hover { background: #f8fafc; border-color: #d1d5db; }
.check-group input[type="checkbox"] {
  accent-color: var(--brand, #5046e5);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.check-group-text {}
.check-group-label { font-size: 13px; font-weight: 600; color: #0f172a; display: block; }
.check-group-desc { font-size: 12px; color: #94a3b8; margin-top: 1px; }
.check-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

/* ── Alerts ──────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

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

.empty-state {
  text-align: center;
  padding: 56px 24px;
}
.empty-icon {
  width: 56px;
  height: 56px;
  background: #eff2fd;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 8px;
}
.empty-desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Detail grid ─────────────────────────────────────────────── */

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-section { margin-bottom: 0; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; gap: 12px; }
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 13px; color: #64748b; font-weight: 500; flex-shrink: 0; }
.detail-val { font-size: 13px; color: #0f172a; font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.detail-val.mono { font-family: "SF Mono", ui-monospace, monospace; font-size: 12px; color: #374151; }
.detail-val.muted { color: #94a3b8; font-weight: 400; }

/* ── Color swatch ────────────────────────────────────────────── */

.color-input-wrap { display: flex; align-items: center; gap: 10px; }
.color-input-wrap input[type="color"] { width: 36px; height: 36px; padding: 2px; border: 1px solid #e2e8f0; border-radius: 7px; cursor: pointer; background: none; }
.color-text { flex: 1; }

/* ── Responsive ──────────────────────────────────────────────── */

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

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .stats-grid { gap: 10px; }
  /* Nav becomes a horizontally scrollable strip so logo + links
     never overflow the viewport on small screens. */
  .nav {
    flex-shrink: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex-shrink: 0; }
  .logo { flex-shrink: 0; }
}

@media (max-width: 375px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 22px; }
  .card-header { padding: 14px 16px; }
  td, th { padding: 10px 12px; }
}

/* ── Spinner ─────────────────────────────────────────────────── */

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--brand, #5046e5);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Monospace utility ───────────────────────────────────────── */

.mono { font-family: "SF Mono", ui-monospace, "Cascadia Code", monospace; }

/* ── Step list (run detail) ──────────────────────────────────── */

.steps-list { display: flex; flex-direction: column; gap: 0; }

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.step-item:last-child { border-bottom: none; }

.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-pass .step-dot { background: #dcfce7; color: #16a34a; }
.step-fail .step-dot { background: #fee2e2; color: #dc2626; }
.step-skip .step-dot { background: #f1f5f9; color: #94a3b8; }

.step-body { flex: 1; min-width: 0; }
.step-label { font-size: 13px; font-weight: 500; color: #0f172a; }
.step-pass .step-label { color: #166534; }
.step-fail .step-label { color: #991b1b; }
.step-skip .step-label { color: #64748b; }

.step-detail-toggle {
  margin-top: 6px;
}
.step-detail-toggle summary {
  font-size: 11px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.step-detail-toggle summary:hover { color: #64748b; }
.step-detail-toggle[open] summary { color: #64748b; }
.step-payload {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #374151;
  overflow-x: auto;
  white-space: pre;
  max-height: 200px;
  line-height: 1.6;
}

/* ── Run row ─────────────────────────────────────────────────── */

.run-row td { transition: background 0.08s; }
.run-row:hover td { background: #f8fafc; }

/* ── Receipt verification grid ───────────────────────────────── */

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.receipt-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.1s;
}
.receipt-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.receipt-card.pass { border-color: #86efac; background: #f0fdf4; }
.receipt-card.fail { border-color: #fca5a5; background: #fef2f2; }
.receipt-card.skip { border-color: #e2e8f0; background: #f8fafc; }

.receipt-platform { margin-bottom: 10px; }

.receipt-status {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.receipt-card.pass .receipt-status { color: #16a34a; }
.receipt-card.fail .receipt-status { color: #dc2626; }
.receipt-card.skip .receipt-status { color: #94a3b8; }

.receipt-steps-count {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}
.receipt-latency { color: #94a3b8; }

.receipt-failure-hint {
  font-size: 11px;
  color: #dc2626;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #fecaca;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Select dropdown ─────────────────────────────────────────── */

select.form-control,
select.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Latency badge ───────────────────────────────────────────── */

.latency-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "SF Mono", ui-monospace, monospace;
  letter-spacing: 0;
  flex-shrink: 0;
}
.step-pass .latency-badge { background: #dcfce7; color: #15803d; }
.step-fail .latency-badge { background: #fee2e2; color: #dc2626; }
.step-skip .latency-badge { background: #f1f5f9; color: #94a3b8; }

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

/* ── White-label report ──────────────────────────────────────── */

.verdict-banner {
  border-radius: 14px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.verdict-banner.pass   { background: linear-gradient(135deg,#f0fdf4,#dcfce7); border: 1px solid #86efac; }
.verdict-banner.fail   { background: linear-gradient(135deg,#fef2f2,#fee2e2); border: 1px solid #fca5a5; }
.verdict-banner.pending{ background: #f8fafc; border: 1px solid #e2e8f0; }

.verdict-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.verdict-banner.pass .verdict-icon    { background: #16a34a; color: #fff; }
.verdict-banner.fail .verdict-icon    { background: #dc2626; color: #fff; }
.verdict-banner.pending .verdict-icon { background: #e2e8f0; color: #94a3b8; }

.verdict-content { flex: 1; min-width: 0; }
.verdict-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.verdict-banner.pass    .verdict-title   { color: #166534; }
.verdict-banner.fail    .verdict-title   { color: #991b1b; }
.verdict-banner.pending .verdict-title   { color: #475569; }
.verdict-sub { font-size: 13px; }
.verdict-banner.pass    .verdict-sub  { color: #166534; opacity: 0.75; }
.verdict-banner.fail    .verdict-sub  { color: #991b1b; opacity: 0.75; }
.verdict-banner.pending .verdict-sub  { color: #94a3b8; }

.verdict-date { text-align: right; flex-shrink: 0; }
.verdict-date-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.verdict-date-value { font-size: 13px; font-weight: 600; }
.verdict-banner.pass .verdict-date-label, .verdict-banner.pass .verdict-date-value { color: #166534; opacity: 0.7; }
.verdict-banner.fail .verdict-date-label, .verdict-banner.fail .verdict-date-value { color: #991b1b; opacity: 0.7; }

/* Report agency header (in the printable area) */
.report-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--brand, #5046e5);
  margin-bottom: 28px;
}
.report-brand-mark {
  width: 40px; height: 40px;
  background: var(--brand, #5046e5);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
  flex-shrink: 0; text-transform: uppercase;
}
.report-brand-name { font-size: 16px; font-weight: 700; color: #0f172a; letter-spacing: -0.3px; }
.report-brand-sub  { font-size: 11px; color: #94a3b8; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.06em; }
.report-client-name { font-size: 18px; font-weight: 700; color: #0f172a; letter-spacing: -0.3px; text-align: right; }
.report-generated  { font-size: 11px; color: #94a3b8; text-align: right; margin-top: 2px; }

/* Shareable link box */
.link-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.link-url {
  flex: 1;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recon platform dots */
.recon-platform-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.recon-plat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.recon-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recon-dot.match    { background: #16a34a; }
.recon-dot.mismatch { background: #dc2626; }
.recon-dot.baseline { background: #94a3b8; }
.recon-dot.nodata   { background: #e2e8f0; }

/* Report footer */
.report-footer {
  padding-top: 20px;
  margin-top: 4px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}

/* Public report page wrapper */
.report-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 32px;
}
@media (max-width: 640px) {
  .report-page { padding: 24px 16px; }
  .verdict-banner { flex-wrap: wrap; }
  .verdict-date { width: 100%; text-align: left; }
  .report-brand-header { flex-wrap: wrap; }
  .report-client-name, .report-generated { text-align: left; }
}

/* ── Billing page ────────────────────────────────────────────── */

.billing-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.billing-plan-card { max-width: 680px; }

.billing-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.billing-plan-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.billing-plan-name {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.billing-plan-price {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.billing-plan-per {
  font-size: 13px;
  font-weight: 400;
  color: #94a3b8;
}

.billing-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.billing-badge-trial   { background: #f1f5f9; color: #64748b; }
.billing-badge-starter { background: #eff2fd; color: #5046e5; }
.billing-badge-pro     { background: #faf5ff; color: #7c3aed; }

.billing-meter-section {
  margin-bottom: 20px;
}

.billing-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 8px;
}

.billing-meter-count {
  font-weight: 700;
  color: #0f172a;
}

.billing-meter-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.billing-meter-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--brand, #5046e5);
  transition: width 0.3s ease;
}

.billing-meter-fill.warn   { background: #f59e0b; }
.billing-meter-fill.danger { background: #dc2626; }

.billing-meter-warning {
  font-size: 12px;
  color: #dc2626;
  margin: 8px 0 0;
  font-weight: 500;
}

.billing-mrr-row {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.billing-mrr-item {}

.billing-mrr-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.billing-mrr-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.billing-trial-note {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

/* Plan option cards */
.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.billing-plan-option {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.12s, border-color 0.12s;
}

.billing-plan-option:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.billing-plan-option.current { border-color: var(--brand, #5046e5); background: #fdfcff; }
.billing-plan-option.recommended { border-color: var(--brand, #5046e5); }

.billing-recommended-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand, #5046e5);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

.billing-option-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.billing-option-price {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1;
}

.billing-option-per {
  font-size: 12px;
  color: #94a3b8;
  margin: 4px 0 16px;
}

.billing-option-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  flex: 1;
}

.billing-option-features li {
  font-size: 12px;
  color: #374151;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.billing-option-features li:last-child { border-bottom: none; }
.billing-option-features li::before {
  content: "✓";
  color: #16a34a;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}
.billing-plan-option.current .billing-option-features li::before { color: var(--brand, #5046e5); }

@media (max-width: 800px) {
  .billing-plans-grid { grid-template-columns: 1fr; }
  .billing-plan-card { max-width: 100%; }
}

/* ── Print ───────────────────────────────────────────────────── */

@media print {
  .no-print { display: none !important; }
  .header   { display: none !important; }
  body      { background: #fff; font-size: 12px; }
  .page     { padding: 0; max-width: 100%; }
  .app-wrap { min-height: 0; }
  .card     { box-shadow: none; border: 1px solid #e2e8f0; break-inside: avoid; }
  .verdict-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .verdict-icon   { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stats-grid     { break-inside: avoid; }
  .receipt-grid   { break-inside: avoid; }
  .report-brand-header { border-bottom: 2px solid #5046e5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
