/* Real Estate — light UI */
:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #1a1d24;
  --text-soft: #3d4450;
  --muted: #5c6470;
  --line: #e2e5eb;
  --line-strong: #cfd4dc;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent2: #5b21b6;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --err: #dc2626;
  --r-lg: 12px;
  --r-sm: 8px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.theme-light,
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.topbar__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.topbar__link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
}
.topbar__link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.topbar__tabs {
  background: #e2e8f0;
  padding: 0.2rem 0.25rem;
  border-radius: 10px;
  border: 1px solid #c8d4e4;
  gap: 0.1rem;
}
.topbar__link--active {
  color: #0f172a;
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.topbar__link--active:hover {
  color: #0f172a;
  background: #fff;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.logo__text em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge--listings {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.user-pill {
  font-size: 0.84rem;
  color: var(--muted);
}

.logout-f { margin: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, transform 0.08s;
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent); background: #fff; }
.btn--danger {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.4rem 0.75rem;
}
.btn--danger:hover {
  color: #fff;
  background: #dc2626;
  border-color: #b91c1c;
}
.btn--primary {
  color: #fff;
  background: var(--accent);
  padding: 0.48rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 0.45rem 0.9rem;
}
.btn--secondary:hover { background: var(--surface-2); border-color: var(--accent); }
.btn--block { width: 100%; }
.btn:active { transform: translateY(1px); }

.main {
  flex: 1 0 auto;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  min-width: 0;
}

.h2-sec { font-size: 1.05rem; margin: 0 0 0.9rem; color: var(--text); font-weight: 600; }
/* Form column keeps a solid min width; rules table does not inherit dashboard 1400px min-width */
.notif-grid {
  display: grid;
  grid-template-columns: minmax(22rem, 0.44fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .notif-grid { grid-template-columns: 1fr; }
}
.notif-form { min-width: 0; }
.notif-list { min-width: 0; max-width: 100%; }
.notif-list .table-scroller { max-width: 100%; }
.notif-table.data-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}
.notif-form, .notif-list { padding: 1.1rem; }
.notif-form .field.block, .notif-list .field.block { width: 100%; }
.notif-form .field-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.65rem; }
.form-hint { font-size: 0.82rem; color: var(--muted); margin: 0.65rem 0 0.85rem; }
.empty-inline { color: var(--muted); margin: 0; }
.notif-table .mono.narrow { max-width: 20rem; word-break: break-all; }
.notif-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.notif-row-actions__f { display: inline; margin: 0; }
.btn--sm { font-size: 0.8rem; padding: 0.25rem 0.5rem; }

.eyebrow {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.page-head { margin-bottom: 1rem; }
.page-head--tight { margin-bottom: 0.75rem; }
.page-head__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  color: var(--text);
}
.page-head__lede {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 50ch;
  font-size: 0.9rem;
  line-height: 1.5;
}
.page-head__lede strong { color: var(--text-soft); }

/* backward compat + shared surface */
.card-elevated,
.card-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toolbar { padding: 0.9rem 1.1rem; margin-bottom: 0.9rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
/* Dashboard filters: same font/padding as global .input, wider fields to read long values */
.filters--dashboard .input--num { width: 10.5rem; }
.filters--dashboard .input--per-page { width: 4.25rem; }
.filters--dashboard .input--select { min-width: 14rem; }
.data-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  padding: 0.65rem 0.75rem;
}
.data-pagination--top {
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding-top: 0.5rem;
  padding-bottom: 0.7rem;
}
.data-pagination--bottom {
  border-top: 1px solid var(--line);
  margin: 0;
  padding-top: 0.7rem;
  padding-bottom: 0.5rem;
}
.data-pagination__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.data-pagination__summary {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  width: 100%;
}
.data-pagination__count { color: var(--muted); font-weight: 400; }
.data-pagination__spacer {
  display: inline-block;
  min-width: 4.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.86rem;
  color: var(--muted);
  opacity: 0.5;
  text-align: center;
}

.field { display: flex; flex-direction: column; gap: 0.2rem; }
.field--inline { min-width: 0; }
.field__label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.input, select.input, input.input {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 0.42rem 0.55rem;
  font-family: inherit;
  font-size: 0.88rem;
  min-width: 0;
}
.input:focus, select.input:focus, input.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.input--num { width: 5rem; }
.input--w { width: 4rem; }
.input--n { width: 2.4rem; padding-left: 0.3rem; }
.input--select { min-width: 8.5rem; }

.enrich { padding: 0.65rem 1rem; margin-bottom: 0.9rem; }
.enrich__form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.enrich__label { color: var(--text-soft); font-size: 0.86rem; }
.enrich__label input { display: inline-block; margin: 0 0.1rem; vertical-align: middle; }
.enrich__meta { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--muted); }

.mono, code, .mono--wrap { font-family: var(--mono), monospace; }
code {
  font-size: 0.82em;
  color: var(--accent2);
  background: var(--surface-2);
  padding: 0.08em 0.3em;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.alert { padding: 0.7rem 0.9rem; border-radius: var(--r-sm); margin: 0 0 0.85rem; font-size: 0.86rem; }
.alert--err {
  color: #7f1d1d;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.alert--ok {
  color: #14532d;
  background: var(--ok-soft);
  border: 1px solid #a7f3d0;
}
.err-list { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.hint-block { font-size: 0.8rem; color: var(--muted); margin-top: 0.9rem; line-height: 1.5; }
.hint-block--tight { margin-top: 0.65rem; }
.hint-block--subtle { color: var(--muted); font-size: 0.8rem; margin: 0 0 0.5rem; }

.data-shell { padding: 0; overflow: hidden; }
.table-scroller {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 1445px; /* + star column on dashboard */
  table-layout: auto;
}
.col-fav,
.td-fav {
  width: 2.6rem;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}
.th-fav {
  font-size: 0.72rem;
  opacity: 0.55;
}
.star-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 1.12rem;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.star-fav:hover {
  color: #d97706;
  background: #fffbeb;
}
.star-fav.is-favorite,
.star-fav[aria-pressed="true"] {
  color: #d97706;
}
.star-fav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.data-table th {
  text-align: left;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.5rem 0.65rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.4;
  background: var(--surface);
}
.data-table tbody tr:hover td { background: #fafbfc; }
.col-ia { min-width: 14rem; width: 18%; }
.col-title { min-width: 14rem; width: 20%; }
.col-narrow {
  width: 3.5rem;
  min-width: 3.5rem;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 1px 0 0 var(--line);
  background: var(--surface) !important;
}
.data-table thead .col-narrow { z-index: 3; background: var(--surface-2) !important; }
.data-table tbody tr:hover .col-narrow { background: #fafbfc !important; }

.td-score { font-variant-numeric: tabular-nums; }
.score-pill {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ok);
  font-family: var(--mono);
  line-height: 1.2;
}
.score-row {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-deal { min-width: 7.5rem; }
.deal-profit {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ok);
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
}
.deal-profit--bad { color: var(--err); }
.deal-line {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
}
.cell-strong { font-weight: 600; color: var(--text); }
.cell-meta { font-size: 0.78rem; color: var(--muted); }
.cell-tiny { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.td-loc { min-width: 7.5rem; }
.geo-line { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.3rem; align-items: center; }
.geo-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: var(--mono);
}
.geo-pill--r { background: #fef3c7; color: #b45309; }
.geo-pill--h { background: #f3f4f6; color: #4b5563; }
.geo-maplink { font-size: 0.72rem; color: var(--accent); text-decoration: none; margin-top: 0.2rem; display: inline-block; }
.geo-maplink:hover { text-decoration: underline; }
.td-title { min-width: 10rem; }
.td-title__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.td-title__link:hover { text-decoration: underline; }
.td-title__text { color: var(--text); line-height: 1.4; }
.suspect { color: var(--warn); font-weight: 700; text-decoration: none; cursor: help; margin-left: 0.1rem; }
.td-args { min-width: 11rem; max-width: 20rem; }
.args-merged {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.arg-risk { color: #b91c1c; }
.td-ia { min-width: 12rem; }
.ia-line1 { line-height: 1.25; margin: 0 0 0.2rem; }
.ia-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  margin: 0.2rem 0 0.25rem;
  line-height: 1.2;
}
.ia-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  max-width: 100%;
  line-height: 1.3;
}
.ia-pill--q { background: #e0f2fe; color: #0369a1; }
.ia-pill--v { background: #f3f4f6; color: #4b5563; }
.ia-pill--c { background: #f0fdf4; color: #166534; }
.revente { color: #0369a1; font-weight: 700; font-size: 0.95rem; }
.ia-slash { color: var(--muted); font-size: 0.8rem; margin: 0 0.1rem; }
.ia-brief { color: var(--muted); font-size: 0.78rem; }
.iasum {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.4;
}
.iasum.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.td-cta { text-align: right; white-space: nowrap; }
.link-go {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #eff6ff;
}
.link-go:hover { background: #dbeafe; }

.empty-state { padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); font-size: 0.92rem; }
.site-foot {
  flex-shrink: 0;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.site-foot p { margin: 0; }

/* Auth */
.auth-layout { min-height: 65vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; padding: 2rem 1.75rem; }
.auth-card__title { margin: 0.2rem 0 0.35rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.auth-card__lede { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.88rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.9rem; }
.auth-form .input { width: 100%; padding: 0.55rem 0.7rem; }
.auth-form .btn--primary { padding: 0.6rem; margin-top: 0.2rem; }
.auth-form .btn--block { min-height: 2.6rem; }

/* Listing report modal (detail dialog) */
.btn--detail {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.btn--detail:hover { background: #dbeafe; border-color: var(--accent); }
.btn--detail.is-loading:disabled { opacity: 0.9; cursor: wait; }
.col-action { min-width: 5.5rem; width: 1%; }
.td-action { vertical-align: middle; text-align: right; }
.action-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 4.75rem;
}
.enrich-one-form { margin: 0; }
.btn--run {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.btn--run:hover:enabled { background: #ede9fe; border-color: #5b21b6; }
.btn--run:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--run.is-loading:disabled { opacity: 0.9; cursor: wait; }
.btn.is-loading { pointer-events: none; }
.data-table tbody tr.tr--enriched td { background: #f0f9ff; }
.detail-dialog {
  width: min(1080px, 96vw);
  max-width: 100%;
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  background: var(--surface);
}
.detail-dialog::backdrop { background: rgba(15, 20, 30, 0.5); }
.detail-dialog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.detail-dialog__title { font-size: 1.1rem; margin: 0; font-weight: 700; }
.detail-dialog__actions { display: flex; align-items: center; gap: 0.4rem; }
.detail-dialog__body { padding: 1rem 1.15rem 1.4rem; overflow: auto; max-height: min(78vh, 900px); }
#detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}
.detail-footnote {
  margin: 0;
  padding: 0.65rem 1.1rem 1rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.detail-loading { margin: 0; text-align: center; padding: 1.2rem; color: var(--muted); }
.detail-hero { margin-bottom: 0; }
.detail-hero__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.detail-hero__title { margin: 0.35rem 0 0.2rem; font-size: 1.15rem; line-height: 1.3; }
.detail-hero__loc { margin: 0; color: var(--muted); font-size: 0.88rem; }
.detail-hero__go { margin: 0.4rem 0 0; }
.detail-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.detail-link:hover { text-decoration: underline; }
.detail-ref { font-size: 0.78rem; color: var(--muted); }
.detail-pill {
  font-size: 0.68rem;
  color: #4338ca;
  background: #ede9fe;
  border-radius: 4px;
  padding: 0.12rem 0.35rem;
}
.detail-metricbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0;
}
.detail-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: #fcfcfd;
}
.detail-tile__k {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.detail-tile__v { display: block; font-size: 1.05rem; font-weight: 700; }
.detail-tile--score { color: var(--accent2); }
.detail-tile__s { font-size: 0.75rem; color: var(--muted); display: block; }
.detail-suspect { color: var(--warn); font-weight: 500; }
.detail-two { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0.9rem; margin: 0; }
.detail-two--deal { grid-template-columns: 0.9fr 1.1fr; }
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
}
.detail-panel--deal { background: linear-gradient(180deg, #f8fafc 0%, #fff 100%); }
.detail-panel--llm-offer {
  border-left: 3px solid #6366f1;
  background: linear-gradient(90deg, #eef2ff 0%, #fff 18%);
  margin: 0;
}
.detail-ul--llm-offer li { line-height: 1.45; }
.detail-panel--ai { margin-top: 0; background: #f9fafb; }
.detail-h { margin: 0 0 0.4rem; font-size: 0.85rem; font-weight: 700; }
.detail-h--tight { margin-top: 0.75rem; }
.detail-hint { font-size: 0.75rem; color: var(--muted); margin: 0 0 0.6rem; line-height: 1.45; }
.detail-radar-legend {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-soft);
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.detail-radar-legend__p { margin: 0 0 0.4rem; }
.detail-radar-legend__p:last-child { margin-bottom: 0; }
.detail-radar-legend code { font-size: 0.9em; }
.detail-chartwrap { min-height: 200px; position: relative; }
.detail-chartwrap--wide { min-height: 180px; }
/* Property report: price line chart — short footprint */
.detail-chartwrap--price {
  min-height: 0;
  height: 120px;
  max-height: 128px;
}
@media (min-width: 1200px) {
  .detail-chartwrap--price { height: 128px; max-height: 136px; }
}
.detail-map {
  height: 300px;
  border-radius: 8px;
  z-index: 0;
}
.detail-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 0;
}
@media (max-width: 1000px) { .detail-two, .detail-two--deal, .detail-grid3 { grid-template-columns: 1fr; } }
.detail-grid-table { width: 100%; font-size: 0.82rem; border-collapse: collapse; }
.detail-grid-table td { border-bottom: 1px solid var(--line); padding: 0.3rem 0.15rem; }
.detail-grid-table td:first-child { color: var(--muted); width: 60%; }
.detail-deal-list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.detail-deal-list li { margin: 0.2rem 0; }
.detail-ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.detail-ul--compact { font-size: 0.86rem; }
.detail-prose { margin: 0.2rem 0; line-height: 1.55; }
.detail-prose--mono { font-family: var(--mono), monospace; font-size: 0.78rem; }
.detail-muted { color: var(--muted); }
.detail-subh { font-size: 0.8rem; margin: 0.6rem 0 0.25rem; }
.detail-eyebrow-n { font-size: 0.8rem; color: var(--text-soft); margin: 0.15rem 0 0.5rem; }
.detail-kicker { color: var(--accent); }
.detail-forecast-note { font-size: 0.7rem; color: var(--muted); margin: 0.4rem 0 0; line-height: 1.4; }
.small { font-size: 0.85em; }
@media print {
  /* Do not use visibility:hidden on a broad selector: hidden nodes still
     occupy full layout height in the print model → blank following pages. */
  @page {
    margin: 10mm 12mm;
  }
  html.print-report,
  html.print-report body {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
  }
  html.print-report .page-bg,
  html.print-report .topbar,
  html.print-report .site-foot {
    display: none !important;
  }
  /* Dashboard (and any page that hosts the dialog): dialog is a direct child of .main. */
  html.print-report .main > *:not(.detail-dialog) {
    display: none !important;
  }
  html.print-report .main {
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  html.print-report .detail-dialog {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: auto;
    page-break-inside: auto;
  }
  html.print-report .detail-dialog__head {
    position: static !important;
    break-after: avoid;
  }
  html.print-report .detail-dialog__body {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }
  html.print-report .no-print-dlg {
    display: none !important;
  }
  /* Avoid Leaflet/oversized map tiles generating extra blank print pages. */
  html.print-report .detail-map,
  html.print-report .leaflet-container,
  html.print-report .leaflet-control-container {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
@media (max-width: 700px) {
  .page-head__title { font-size: 1.3rem; }
  .toolbar { padding: 0.75rem; }
  .data-table th, .data-table td { padding: 0.4rem; }
  .main { padding-left: 1rem; padding-right: 1rem; }
  .detail-dialog { width: 100%; max-height: 100dvh; }
  .detail-dialog__body { max-height: 75dvh; }
}
