/* ImmoCheck — design system.
   Visual language from pixel's "A — Precision" round 1: dark-first, cyan accent,
   sidebar + section cards, mono for identifiers. Tokens are the same on both
   themes so nothing has to be re-styled per component.

   One deliberate deviation from the design comp: there is no 0–10 property score.
   A single number next to a property reads as a valuation, and this product
   explicitly is not one. The sidebar instead shows which dimensions were read and
   which flags were raised — facts, not a grade. */

:root {
  color-scheme: dark;

  --bg: #0a0f1e;
  --surface: #111827;
  --surface-2: #1c2535;
  --surface-3: #2a3447;
  --accent: #0891b2;
  --accent-h: #22d3ee;
  --accent-glow: rgba(8, 145, 178, 0.14);
  --text: #f0f4ff;
  --text-2: #8899b4;
  --text-3: #4e637d;
  --border: rgba(255, 255, 255, 0.07);
  --border-h: rgba(255, 255, 255, 0.14);
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --info: #3b82f6;
  --r: 10px;
  --r-sm: 6px;

  --sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "DM Mono", Menlo, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #e8edf4;
  --text: #0d1829;
  --text-2: #506480;
  --text-3: #94a3b8;
  --border: rgba(0, 0, 0, 0.07);
  --border-h: rgba(0, 0, 0, 0.14);
  --accent-glow: rgba(8, 145, 178, 0.07);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #e8edf4;
    --text: #0d1829;
    --text-2: #506480;
    --text-3: #94a3b8;
    --border: rgba(0, 0, 0, 0.07);
    --border-h: rgba(0, 0, 0, 0.14);
    --accent-glow: rgba(8, 145, 178, 0.07);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--accent-h); text-underline-offset: 2px; }
:root[data-theme="light"] a { color: var(--accent); }

h1, h2, h3, h4 { letter-spacing: -0.3px; line-height: 1.2; margin: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 16px; top: 12px; }

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

/* ── TOPBAR ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.4px;
  color: var(--text); text-decoration: none; flex-shrink: 0;
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #0891b2, #22d3ee);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-mark svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.crumb {
  font-size: 13px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.crumb__sep { color: var(--text-3); font-weight: 300; font-size: 16px; }
.crumb strong { color: var(--text); font-weight: 500; }
.topbar-r { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-h); color: var(--text); }
.btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn-icon { padding: 5px; width: 30px; justify-content: center; }
.btn-lg { padding: 10px 18px; font-size: 13px; }

@media (max-width: 720px) {
  .crumb { display: none; }
}

/* ── LAYOUT ─────────────────────────────────────────────────────────────── */
.layout {
  display: flex; gap: 20px;
  max-width: 1360px; margin: 0 auto; padding: 20px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  /* In column direction align-items:flex-start would size each child to its
     max-content width, which overflows the viewport as soon as one long table
     exists. Stretch instead. */
  .layout { flex-direction: column; padding: 12px; gap: 14px; align-items: stretch; }
  .main-col, .sidebar { width: 100%; max-width: 100%; min-width: 0; }
}

.sidebar {
  width: 252px; flex-shrink: 0;
  position: sticky; top: 72px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 90px); overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 0; }
@media (max-width: 900px) {
  .sidebar { width: 100%; position: static; max-height: none; }
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }

/* ── REPORT STATUS CARD (replaces the design's score ring) ──────────────── */
.status-card { padding: 16px; }
.status-card__label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-3); margin-bottom: 12px;
}
.status-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.status-card__head h4 { font-size: 15px; font-weight: 700; }
.status-card__head p { font-size: 12px; color: var(--text-2); margin: 2px 0 0; }
.status-card__icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-glow); color: var(--accent-h);
}
.status-card__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.status-list { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.status-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-list__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-list__label { color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-list__value { color: var(--text); font-weight: 500; flex-shrink: 0; font-family: var(--mono); font-size: 11px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-err { background: var(--err); }
.dot-idle { background: var(--text-3); }

/* ── SIDEBAR NAV ────────────────────────────────────────────────────────── */
.nav-card { overflow: hidden; }
@media (max-width: 900px) { .nav-card { display: none; } }
.ni {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; font-size: 13px; color: var(--text-2);
  border-bottom: 1px solid var(--border); text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.ni:last-child { border-bottom: none; }
.ni:hover { background: var(--surface-2); color: var(--text); }
.ni svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: 0.8; flex-shrink: 0; }
.ni__badge {
  margin-left: auto; font-size: 9px; padding: 2px 6px;
  border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-3); color: var(--text-2);
}
.ni__badge--ok { background: rgba(16, 185, 129, 0.15); color: var(--ok); }
.ni__badge--warn { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.ni__badge--accent { background: var(--accent-glow); color: var(--accent-h); }

.sources-card { padding: 14px; }
.sources-card h5 {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-3); margin: 0 0 10px;
}
.sources-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sources-card li { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); }
.sources-card__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.sources-card__stamp { margin: 12px 0 0; font-size: 10px; color: var(--text-3); }

/* ── REPORT HEADER ──────────────────────────────────────────────────────── */
.report-head { padding: 20px; }
.report-head__kicker {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--accent-h); margin: 0 0 6px;
}
:root[data-theme="light"] .report-head__kicker { color: var(--accent); }
.report-head h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.report-head__sub { font-size: 13px; color: var(--text-2); margin: 0 0 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2);
}
.chip--accent { background: var(--accent-glow); border-color: rgba(8, 145, 178, 0.3); color: var(--accent-h); }
.chip--warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: var(--warn); }
.chip--ok { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: var(--ok); }

.kv-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
}
.kv-strip > div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.kv-strip dt {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-3); margin-bottom: 3px;
  overflow-wrap: anywhere;
}
@media (max-width: 620px) {
  .kv-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-strip dt { letter-spacing: 0.2px; }
}
.kv-strip dd {
  margin: 0; font-size: 14px; font-weight: 600; color: var(--text);
  font-family: var(--mono); overflow: hidden; text-overflow: ellipsis;
}

/* ── SECTION CARD ───────────────────────────────────────────────────────── */
.section { overflow: hidden; }
.section__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.section__icon {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  display: grid; place-items: center; align-self: flex-start;
  background: var(--surface-2); color: var(--accent-h);
}
.section__icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.section__titles { min-width: 0; flex: 1 1 auto; }
.section__titles h2 { font-size: 14px; font-weight: 600; }
.section__titles p {
  margin: 1px 0 0; font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.section__badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 7px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-2);
}
.section__badge--ok { background: rgba(16, 185, 129, 0.15); color: var(--ok); }
.section__badge--warn { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.section__badge--err { background: rgba(239, 68, 68, 0.15); color: var(--err); }
.section__body { padding: 4px 18px 14px; }
.section__note { font-size: 11px; color: var(--text-3); margin: 10px 0 0; }
.section__empty { padding: 16px 18px; font-size: 12px; color: var(--text-2); margin: 0; }

@media (max-width: 560px) {
  .section__head { padding: 12px 14px; }
  .section__body { padding: 4px 14px 12px; }
  .report-head { padding: 16px 14px; }
}

/* ── FACT ROWS ──────────────────────────────────────────────────────────── */
.factlist { margin: 0; padding: 0; }
.fact {
  display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.fact:last-child { border-bottom: none; }
.fact dt { font-size: 12px; color: var(--text-3); }
.fact dd {
  margin: 0; font-size: 13px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.fact__value { font-weight: 500; }
.fact__value--mono { font-family: var(--mono); font-size: 12px; }

@media (max-width: 620px) {
  .fact { grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; }
  .fact dt { grid-column: 1 / -1; font-size: 11px; }
  .fact dd { grid-column: 1; }
}

/* ── PROVENANCE BADGE ───────────────────────────────────────────────────── */
.prov { flex-shrink: 0; max-width: 100%; min-width: 0; }
.prov summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; min-width: 0;
  padding: 2px 8px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 10px; color: var(--text-3);
  transition: border-color 0.15s, color 0.15s;
}
.prov summary::-webkit-details-marker { display: none; }
.prov summary:hover { border-color: var(--border-h); color: var(--text-2); }
.prov summary::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ok); flex-shrink: 0;
}
.prov__source { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov__method { display: none; }

.prov__detail {
  margin: 6px 0 0; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px; font-size: 11px;
}
.prov__detail dt { color: var(--text-3); white-space: nowrap; }
.prov__detail dd { margin: 0; color: var(--text-2); word-break: break-word; }

@media (max-width: 620px) {
  .prov { display: block; width: 100%; }
  .prov summary { width: 100%; justify-content: flex-start; }
  .prov__source { max-width: none; }
  .prov__detail { grid-template-columns: 1fr; }
  .prov__detail dt { margin-top: 4px; }
}

/* ── FLOOD / RISK CARDS ─────────────────────────────────────────────────── */
.risk-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  padding-top: 10px;
}
.risk-card {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px; background: var(--surface-2); min-width: 0;
}
.risk-card--hit { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.06); }
.risk-card--clear { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.05); }
.risk-card__label {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-3); margin-bottom: 5px;
}
.risk-card__value { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.risk-card--hit .risk-card__value { color: var(--err); }
.risk-card--clear .risk-card__value { color: var(--ok); }
.risk-card__level {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
}
.risk-card--hit .risk-card__level { background: rgba(239, 68, 68, 0.15); color: var(--err); }
.risk-card--clear .risk-card__level { background: rgba(16, 185, 129, 0.15); color: var(--ok); }

/* ── TRADE LIST ─────────────────────────────────────────────────────────── */
.trade-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trade {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2); min-width: 0;
}
.trade__body { min-width: 0; flex: 1; }
.trade__name { font-size: 13px; font-weight: 600; }
.trade__meta { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.trade__status {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 3px; flex-shrink: 0;
  background: rgba(16, 185, 129, 0.15); color: var(--ok);
}

/* ── OWNER CARDS ────────────────────────────────────────────────────────── */
.owner-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.owner {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px; background: var(--surface-2); min-width: 0;
}
.owner__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.owner__name { font-size: 13px; font-weight: 600; }
.owner__fn { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.owner__facts {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 11px; color: var(--text-2); margin-top: 6px; font-family: var(--mono);
}
.owner__company {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 8px; font-size: 11px; color: var(--text-2);
}
.owner__hint { margin: 8px 0 0; font-size: 11px; color: var(--text-3); }
.owner__trades { margin-top: 8px; }

.mock-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(245, 158, 11, 0.15); color: var(--warn);
}

/* ── PRIVACY NOTE ───────────────────────────────────────────────────────── */
.privacy-note {
  margin: 14px 0 0; padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--accent-glow);
  border-left: 2px solid var(--accent);
  font-size: 12px; color: var(--text-2);
}
.privacy-note strong { color: var(--text); }

/* ── MORTGAGES / EASEMENTS ──────────────────────────────────────────────── */
.stat-row { display: flex; flex-wrap: wrap; gap: 20px; padding: 10px 0; }
.stat { min-width: 0; }
.stat__value { font-size: 20px; font-weight: 700; font-family: var(--mono); }
.stat__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); }

.bank-list { list-style: none; margin: 8px 0 0; padding: 0; }
.bank-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.bank-list li:last-child { border-bottom: none; }
.bank-list__name { min-width: 0; }
.bank-list__count { font-family: var(--mono); color: var(--text); flex-shrink: 0; }

.simultan { margin-top: 10px; font-size: 12px; }
.simultan summary { cursor: pointer; color: var(--accent-h); }
:root[data-theme="light"] .simultan summary { color: var(--accent); }
.simultan ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-family: var(--mono); font-size: 11px; }

.easement-list { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--text-2); }
.easement-list__tz { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-right: 6px; }

/* ── TABLE ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left; padding: 8px 10px;
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table td:first-child { color: var(--text); font-weight: 500; }

/* ── ALERTS ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 12px; border: 1px solid transparent;
}
.alert--warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); color: var(--warn); }
.alert--error { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.25); color: var(--err); }
.alert--info { background: var(--accent-glow); border-color: rgba(8, 145, 178, 0.25); color: var(--text-2); }

/* ── LOCKED / TEASER ────────────────────────────────────────────────────── */
.locked {
  position: relative; padding: 28px 20px; text-align: center;
  border-top: 1px solid var(--border);
}
.locked__inner { max-width: 420px; margin: 0 auto; }
.locked__inner h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.locked__inner p { font-size: 12px; color: var(--text-2); margin: 0 0 14px; }
.locked__hint { font-size: 10px; color: var(--text-3); margin-top: 10px !important; }

/* ── CHAT ───────────────────────────────────────────────────────────────── */
.chat__form { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; }
.chat__form input {
  flex: 1 1 220px; min-width: 0;
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 11px;
}
.chat__form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chat__form input::placeholder { color: var(--text-3); }
.chat__log { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.chat__item { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 11px 14px; background: var(--surface-2); }
.chat__question { margin: 0 0 6px; font-weight: 600; font-size: 12px; color: var(--text); }
.chat__answer { margin: 0; white-space: pre-wrap; font-size: 12px; color: var(--text-2); }
.chat__meta { margin: 8px 0 0; font-size: 10px; color: var(--text-3); }

/* ── HERO / LANDING ─────────────────────────────────────────────────────── */
.hero { padding: 40px 0 24px; max-width: 640px; }
.hero__kicker {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.9px; color: var(--accent-h); margin: 0 0 10px;
}
:root[data-theme="light"] .hero__kicker { color: var(--accent); }
.hero h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 700; letter-spacing: -1px; margin-bottom: 12px; }
.hero__lede { font-size: 15px; color: var(--text-2); margin: 0; max-width: 56ch; }

.lookup {
  padding: 20px; display: grid; gap: 14px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}
.lookup > .upload, .lookup > .lookup__submit, .lookup > .hint, .lookup > .alert { grid-column: 1 / -1; }
@media (max-width: 640px) { .lookup { grid-template-columns: 1fr; } }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-3); }
.field input[type="text"] {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 11px; width: 100%;
}
.field input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input[type="text"]::placeholder { color: var(--text-3); }
.field input[type="file"] {
  font: inherit; font-size: 12px; color: var(--text-2); width: 100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px;
}
.hint { font-size: 11px; color: var(--text-3); margin: 0; }

.checkbox { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--text-2); }
.checkbox input { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

.upload { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); }
.upload summary { cursor: pointer; font-weight: 500; font-size: 12px; color: var(--text-2); }
.upload summary:hover { color: var(--text); }
.upload__body { display: grid; gap: 12px; margin-top: 14px; }
.upload__intro { margin: 0; font-size: 12px; color: var(--text-2); }
.upload__intro strong { color: var(--text); }

.lookup__submit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.dimensions { margin-top: 40px; }
.dimensions h2 { font-size: 16px; margin-bottom: 14px; }
.dimension-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.dimension-card { padding: 14px 16px; min-width: 0; }
.dimension-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.dimension-card p { font-size: 12px; color: var(--text-2); margin: 0 0 10px; }
.dimension-card .tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  background: var(--surface-3); color: var(--text-2);
}
.dimension-card .tag--deep { background: var(--accent-glow); color: var(--accent-h); }

/* ── DISAMBIGUATION ─────────────────────────────────────────────────────── */
.candidate-list { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.candidate button {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  display: grid; grid-template-columns: 5ch minmax(0, 1fr) auto;
  gap: 4px 14px; align-items: baseline;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 11px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.candidate button:hover { border-color: var(--accent); background: var(--accent-glow); }
.candidate__plz { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.candidate__place { font-weight: 500; font-size: 13px; }
.candidate__street { color: var(--text-3); font-size: 11px; font-family: var(--mono); }

/* ── LEGAL PAGES ────────────────────────────────────────────────────────── */
.legal { max-width: 74ch; }
.legal h1 { font-size: 26px; margin-bottom: 14px; }
.legal h2 { font-size: 15px; margin: 28px 0 8px; }
.legal h3 { font-size: 13px; margin: 18px 0 6px; color: var(--text-2); }
.legal p, .legal li { font-size: 13px; color: var(--text-2); }
.legal ul { padding-left: 20px; }
.legal .notice {
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.07);
  color: var(--warn);
  border-radius: var(--r-sm); padding: 12px 14px; margin: 16px 0; font-size: 12px;
}
.legal .notice strong { color: var(--warn); }
.legal .todo {
  display: inline-block; background: rgba(245, 158, 11, 0.15); color: var(--warn);
  border-radius: 3px; padding: 1px 6px; font-size: 10px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 20px; }
.site-footer__inner { max-width: 1360px; margin: 0 auto; display: grid; gap: 10px; }
.site-footer__note, .site-footer__licences { margin: 0; font-size: 11px; color: var(--text-3); max-width: 80ch; }
.site-footer__nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer__nav a { font-size: 12px; color: var(--text-2); text-decoration: none; }
.site-footer__nav a:hover { color: var(--text); }

/* ── UTILITIES ──────────────────────────────────────────────────────────── */
.shell { max-width: 1360px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 720px) { .shell { padding: 0 12px; } }
.mt-0 { margin-top: 0; }
