/**
 * Dark theme + mobile overrides for static RAAM property reports (iframe).
 * Aligns with src/app/globals.css tokens (Raam RVA fintech dark).
 */
html.raam-rva-property-report {
  color-scheme: dark;
}

html.raam-rva-property-report,
html.raam-rva-property-report body {
  background: #0a0a0f !important;
  color: #f0f0f5 !important;
}

html.raam-rva-property-report body {
  font-size: clamp(14px, 2.8vw, 16px) !important;
  line-height: 1.65 !important;
  padding-left: max(12px, env(safe-area-inset-left)) !important;
  padding-right: max(12px, env(safe-area-inset-right)) !important;
  padding-bottom: max(48px, env(safe-area-inset-bottom)) !important;
}

/* --- Containers (Royal Crest / generic) --- */
html.raam-rva-property-report .container,
html.raam-rva-property-report .c {
  max-width: min(960px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: clamp(12px, 4vw, 24px) clamp(14px, 4vw, 30px) 48px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* --- Royal Crest variables → dark --- */
html.raam-rva-property-report {
  --bg: #0a0a0f;
  --card-bg: #16161f;
  --text: #f0f0f5;
  --text-muted: #a0a0b8;
  --border: rgba(255, 255, 255, 0.08);
  --green: #34d399;
  --green-bg: rgba(16, 185, 129, 0.12);
  --green-border: rgba(16, 185, 129, 0.35);
  --red: #f87171;
  --red-bg: rgba(239, 68, 68, 0.12);
  --red-border: rgba(239, 68, 68, 0.35);
  --amber: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.35);
  --blue: #60a5fa;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --blue-border: rgba(59, 130, 246, 0.35);
  --purple: #a78bfa;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --property-color: #8b5cf6;
}

html.raam-rva-property-report .verdict-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #6d28d9 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html.raam-rva-property-report .verdict-banner h1,
html.raam-rva-property-report .verdict-banner .address,
html.raam-rva-property-report .verdict-banner .verdict-label {
  color: #fff !important;
}

html.raam-rva-property-report h2,
html.raam-rva-property-report h3 {
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html.raam-rva-property-report .card,
html.raam-rva-property-report table {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html.raam-rva-property-report .card p,
html.raam-rva-property-report .card-title {
  color: var(--text) !important;
}

html.raam-rva-property-report th {
  background: #1e1e2a !important;
  color: var(--text-muted) !important;
}

html.raam-rva-property-report td {
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html.raam-rva-property-report tr:hover td {
  background: rgba(255, 255, 255, 0.03) !important;
}

html.raam-rva-property-report pre {
  background: #0f0f14 !important;
  color: #e4e4ef !important;
  border: 1px solid var(--border);
}

html.raam-rva-property-report footer {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}

html.raam-rva-property-report .print-btn,
html.raam-rva-property-report .pb {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

html.raam-rva-property-report .link-btn.zillow {
  background: #2563eb !important;
}

html.raam-rva-property-report .link-btn.assessor {
  background: #1d4ed8 !important;
}

/* Verdict stats grid: 2 cols on narrow phones */
@media (max-width: 520px) {
  html.raam-rva-property-report .verdict-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html.raam-rva-property-report .link-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  html.raam-rva-property-report .link-btn {
    justify-content: center !important;
  }

  html.raam-rva-property-report .cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Knobhill (quick take) --- */
html.raam-rva-property-report {
  --kn-bg: #0a0a0f;
  --kn-card: #16161f;
  --kn-tx: #f0f0f5;
  --kn-tx2: #a0a0b8;
  --kn-mt: #6b6b82;
  --kn-bd: rgba(255, 255, 255, 0.08);
  --kn-rl: rgba(255, 255, 255, 0.12);
  --kn-g: #34d399;
  --kn-gbg: rgba(16, 185, 129, 0.12);
  --kn-r: #f87171;
  --kn-rbg: rgba(239, 68, 68, 0.1);
  --kn-a: #fbbf24;
  --kn-abg: rgba(245, 158, 11, 0.12);
  --kn-b: #60a5fa;
  --kn-bbg: rgba(59, 130, 246, 0.12);
  --kn-prop: #c4b5fd;
  --kn-pbg: rgba(139, 92, 246, 0.1);
}

html.raam-rva-property-report body {
  background: var(--kn-bg) !important;
}

html.raam-rva-property-report .banner {
  background: linear-gradient(135deg, #16161f, #1e1b4b) !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
}

html.raam-rva-property-report .banner .addr,
html.raam-rva-property-report .banner .sub {
  color: var(--kn-tx2) !important;
}

html.raam-rva-property-report .tier {
  background: #3b82f6 !important;
}

html.raam-rva-property-report .links a {
  background: #16161f !important;
  border-color: var(--kn-bd) !important;
  color: #93c5fd !important;
}

html.raam-rva-property-report .card {
  background: var(--kn-card) !important;
  border-color: var(--kn-bd) !important;
}

html.raam-rva-property-report .card.ok {
  border-left-color: var(--kn-g) !important;
  background: var(--kn-gbg) !important;
}

html.raam-rva-property-report .card.w {
  border-left-color: var(--kn-a) !important;
  background: var(--kn-abg) !important;
}

html.raam-rva-property-report .card.no {
  border-left-color: var(--kn-r) !important;
  background: var(--kn-rbg) !important;
}

html.raam-rva-property-report .card.bl {
  border-left-color: var(--kn-b) !important;
  background: var(--kn-bbg) !important;
}

html.raam-rva-property-report .g2 {
  grid-template-columns: 1fr !important;
}

@media (min-width: 640px) {
  html.raam-rva-property-report .g2 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* --- Whitecastle (simple eval) --- */
html.raam-rva-property-report .container {
  background: #16161f !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.raam-rva-property-report header {
  border-color: #3b82f6 !important;
}

html.raam-rva-property-report h1,
html.raam-rva-property-report h2,
html.raam-rva-property-report h3,
html.raam-rva-property-report p,
html.raam-rva-property-report li {
  color: #f0f0f5 !important;
}

html.raam-rva-property-report .meta {
  color: #a0a0b8 !important;
}

html.raam-rva-property-report .grid-item {
  background: #111118 !important;
  border-left-color: #3b82f6 !important;
}

html.raam-rva-property-report .grid-item-value {
  color: #f0f0f5 !important;
}

html.raam-rva-property-report .grid-item-label {
  color: #a0a0b8 !important;
}

html.raam-rva-property-report .highlight-box {
  background: rgba(59, 130, 246, 0.1) !important;
  border-left-color: #3b82f6 !important;
}

html.raam-rva-property-report .positive {
  color: #34d399 !important;
}

html.raam-rva-property-report .caution {
  color: #fbbf24 !important;
}

html.raam-rva-property-report footer a {
  color: #60a5fa !important;
}

/* Print: light paper for readability */
@media print {
  html.raam-rva-property-report,
  html.raam-rva-property-report body {
    background: #fff !important;
    color: #1e293b !important;
  }

  html.raam-rva-property-report .container,
  html.raam-rva-property-report .c {
    background: #fff !important;
    color: #1e293b !important;
  }

  html.raam-rva-property-report .print-btn,
  html.raam-rva-property-report .pb {
    display: none !important;
  }
}
