/* ============================================================
   SuperGen Property OS · Production design system
   Inter + Newsreader (Tiempos-adjacent), near-black + cognac,
   glass chat bar, generous whitespace. No em-dashes.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=Inter:wght@300;400;450;500;600;700&display=swap');

:root {
  --bg: #FAFAFA;
  --bg-paper: #FBF9F6;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --hairline: rgba(24, 24, 27, 0.06);
  --hairline-strong: rgba(24, 24, 27, 0.11);
  --text: #09090B;
  --text-2: #18181B;
  --text-muted: #52525B;
  --text-soft: #71717A;
  --text-faint: #A1A1AA;
  --accent: #C2410C;
  --accent-2: #9A330A;
  --accent-tint: rgba(194, 65, 12, 0.06);
  --emerald: #166534;
  --emerald-tint: rgba(22, 101, 52, 0.08);
  --rose: #9F1239;
  --rose-tint: rgba(190, 18, 60, 0.08);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow: 0 4px 24px -8px rgba(24, 24, 27, 0.08);
  --shadow-chat: 0 8px 32px -8px rgba(24, 24, 27, 0.18), 0 2px 8px rgba(24, 24, 27, 0.06);
  --radius: 12px;
  --radius-sm: 6px;
  --radius-pill: 999px;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Inter', system-ui, sans-serif; color: var(--text);
  font-size: 14.5px; line-height: 1.55;
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh; padding-bottom: 160px;
  background:
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(194, 65, 12, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 100% 100%, rgba(24, 24, 27, 0.025) 0%, transparent 70%),
    var(--bg-paper);
  background-attachment: fixed;
}
::selection { background: rgba(194, 65, 12, 0.15); }

.serif { font-family: 'Newsreader', Georgia, serif; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv11" 1; }

/* App shell ================================================ */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { padding: 36px 20px 36px 28px; border-right: 1px solid var(--hairline); }
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 40px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--text); display: grid; place-items: center; }
.brand-mark svg { width: 15px; height: 15px; color: var(--bg-paper); }
.brand-name { font-family: 'Newsreader', serif; font-weight: 500; font-size: 20px; letter-spacing: -0.015em; color: var(--text); line-height: 1.05; }
.brand-sub { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 9.5px; letter-spacing: 0.16em; color: var(--text-soft); text-transform: uppercase; margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 0 -12px; border-radius: 7px; color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 400; transition: color 160ms ease, background 160ms ease; }
.nav a:hover { background: rgba(24, 24, 27, 0.04); color: var(--text); }
.nav a.active { background: rgba(24, 24, 27, 0.06); color: var(--text); font-weight: 500; }
.nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.6; stroke-width: 1.75; }
.nav a.active svg { opacity: 1; color: var(--accent); }
.nav .spacer { height: 18px; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: rgba(99, 102, 241, 0.12); color: #6366f1; }

.sidebar-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline); font-size: 12px; color: var(--text-soft); line-height: 1.65; }
.sidebar-foot .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); margin-right: 8px; vertical-align: middle; }
.sidebar-foot strong { display: block; color: var(--text-2); font-weight: 500; margin-top: 6px; font-size: 12.5px; }

/* Main ============================================================ */
.main { padding: 48px 72px 96px; max-width: 1180px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 56px; }
.topbar .crumbs { font-size: 13px; color: var(--text-soft); }
.topbar .crumbs strong { color: var(--text); font-weight: 500; }
.topbar .crumbs em { font-family: 'Newsreader', serif; font-style: italic; color: var(--text); letter-spacing: 0; font-size: 16px; font-weight: 500; }
.topbar .actions { display: flex; align-items: center; gap: 10px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 8px; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 13.5px; letter-spacing: -0.005em; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: all 160ms ease; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--hairline-strong); }
.btn-ghost:hover { background: var(--surface-strong); color: var(--text); border-color: var(--text-faint); }
.btn-primary { background: var(--text); color: var(--bg-paper); border-color: var(--text); }
.btn-primary:hover { background: var(--text-2); }
.btn-accent { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-2); }
.btn svg { width: 15px; height: 15px; }

/* Hero + typography ============================================== */
.hero { margin-bottom: 56px; }
.h-display { font-family: 'Newsreader', serif; font-weight: 400; font-size: 56px; line-height: 1.05; letter-spacing: -0.025em; color: var(--text); margin-bottom: 22px; }
.h-display em { font-style: italic; font-weight: 400; color: var(--accent); }
.lede { font-size: 16.5px; line-height: 1.7; color: var(--text-muted); max-width: 720px; font-weight: 400; }
.lede strong { color: var(--text); font-weight: 500; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline-strong); }
.section-head h2 { font-family: 'Newsreader', serif; font-weight: 500; font-size: 26px; letter-spacing: -0.015em; color: var(--text); line-height: 1.1; }
.section-head h2 em { font-style: italic; font-weight: 400; }
.section-head .meta { font-size: 12px; color: var(--text-soft); }

/* KPI strip ====================================================== */
.kpis { display: grid; gap: 0; padding: 28px 0; border-top: 1px solid var(--hairline-strong); border-bottom: 1px solid var(--hairline-strong); margin: 40px 0; }
.kpis.cols-4 { grid-template-columns: repeat(4, 1fr); }
.kpis.cols-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 0 28px; border-right: 1px solid var(--hairline); }
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: none; padding-right: 0; }
.kpi-label { font-size: 11.5px; font-weight: 500; color: var(--text-soft); letter-spacing: 0.02em; margin-bottom: 10px; }
.kpi-value { font-family: 'Newsreader', serif; font-weight: 400; font-size: 34px; color: var(--text); letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; color: var(--text-soft); margin-top: 10px; font-weight: 400; }
.kpi-delta.up { color: var(--emerald); }
.kpi-delta.warn { color: var(--accent); }

/* Pills ========================================================== */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 9px; border-radius: var(--radius-pill); font-weight: 500; letter-spacing: 0.01em; background: rgba(24, 24, 27, 0.06); color: var(--text-2); }
.pill-ok { background: var(--emerald-tint); color: var(--emerald); }
.pill-warn { background: var(--accent-tint); color: var(--accent); }

/* Filters ======================================================== */
.filters { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; align-items: center; }
.filter-chip { padding: 7px 14px; border-radius: var(--radius-pill); background: transparent; border: 1px solid var(--hairline-strong); font-size: 12.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 160ms ease; }
.filter-chip:hover { background: var(--surface-strong); color: var(--text); }
.filter-chip.active { background: var(--text); color: var(--bg-paper); border-color: var(--text); }
.filter-search { flex: 1; min-width: 240px; max-width: 360px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-pill); padding: 7px 16px; font-size: 13px; color: var(--text); outline: none; backdrop-filter: blur(8px); font-family: inherit; }
.filter-search::placeholder { color: var(--text-soft); }

/* Owner snapshot grid (dashboard) ================================ */
.owners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 56px; }
.owner-card { background: var(--surface); backdrop-filter: blur(8px) saturate(140%); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px 20px 18px; text-decoration: none; color: inherit; display: block; transition: all 180ms ease; }
.owner-card:hover { border-color: var(--hairline-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.owner-card .name { font-family: 'Newsreader', serif; font-weight: 500; font-size: 17px; letter-spacing: -0.01em; color: var(--text); line-height: 1.2; margin-bottom: 3px; }
.owner-card .loc { font-size: 11.5px; color: var(--text-soft); margin-bottom: 14px; }
.owner-card .row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; }
.owner-card .row .k { color: var(--text-soft); }
.owner-card .row .v { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.owner-card .row .v.warn { color: var(--accent); }
.owner-card .foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.owner-card .foot strong { color: var(--text); font-weight: 500; }
.auto-meter { display: flex; gap: 3px; align-items: center; margin-top: 4px; }
.auto-meter .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--hairline-strong); }
.auto-meter .pip.on { background: var(--accent); }
.auto-meter .label { font-size: 10.5px; color: var(--text-soft); margin-left: 6px; letter-spacing: 0.04em; }

/* Two-column layout =============================================== */
.lower { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; }
.layout-brief { margin-top: 40px; display: grid; grid-template-columns: 1fr 280px; gap: 56px; align-items: start; }

/* Flag list ====================================================== */
.flag { padding: 18px 0; }
.flag + .flag { border-top: 1px solid var(--hairline); }
.flag-num, .flag-owner { font-family: 'Newsreader', serif; font-style: italic; font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.flag-title { font-weight: 500; font-size: 14.5px; color: var(--text); margin-bottom: 8px; line-height: 1.4; letter-spacing: -0.005em; }
.flag-desc { font-size: 13px; color: var(--text-muted); line-height: 1.65; }
.flag-desc strong { color: var(--text); font-weight: 500; }

/* Activity feed ================================================== */
.activity-item { padding: 16px 0; display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: start; }
.activity-item + .activity-item { border-top: 1px solid var(--hairline); }
.ch-pill { width: 32px; height: 32px; border-radius: 50%; background: rgba(24,24,27,0.05); display: grid; place-items: center; color: var(--text-soft); flex-shrink: 0; }
.ch-pill svg { width: 14px; height: 14px; stroke-width: 1.75; }
.ch-pill.accent { background: var(--accent-tint); color: var(--accent); }
.activity-meta { font-size: 11.5px; color: var(--text-soft); margin-bottom: 2px; }
.activity-meta strong { color: var(--text); font-weight: 500; }
.activity-text { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.activity-time { font-size: 11px; color: var(--text-faint); white-space: nowrap; padding-top: 4px; }

/* Data tables ==================================================== */
table.data { width: 100%; border-collapse: collapse; }
table.data thead th { font-weight: 500; font-size: 11.5px; color: var(--text-soft); letter-spacing: 0.02em; text-align: left; padding: 0 12px 18px; }
table.data thead th.right { text-align: right; }
table.data tbody td { padding: 22px 12px; border-top: 1px solid var(--hairline); font-size: 14px; vertical-align: middle; }
table.data tbody tr { cursor: pointer; transition: background 160ms ease; }
table.data tbody tr:hover { background: rgba(24, 24, 27, 0.02); }
table.data .name strong { font-family: 'Newsreader', serif; font-weight: 500; font-size: 16px; letter-spacing: -0.01em; color: var(--text); display: block; line-height: 1.2; margin-bottom: 3px; }
table.data .name small { font-size: 12px; color: var(--text-soft); }
table.data .num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
table.data .num-cell small { display: block; font-size: 11.5px; color: var(--text-soft); margin-top: 3px; font-weight: 400; }
table.data .addr-cell { display: flex; align-items: center; gap: 14px; }
table.data .gap { color: var(--accent); font-weight: 500; }

/* Avatar circles ================================================= */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-family: 'Newsreader', serif; font-weight: 500; font-size: 14px; color: white; background: var(--text); }
.avatar.a-1 { background: #1E3A8A; }
.avatar.a-2 { background: #166534; }
.avatar.a-3 { background: #C2410C; }
.avatar.a-4 { background: #581C87; }
.avatar.a-5 { background: #831843; }
.avatar.sm { width: 18px; height: 18px; font-size: 9.5px; }

/* Property cards ================================================= */
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.prop-card { background: var(--surface); backdrop-filter: blur(8px) saturate(140%); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 22px 24px; transition: all 180ms ease; text-decoration: none; color: inherit; display: block; }
.prop-card:hover { border-color: var(--hairline-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.prop-card.vacant { background: rgba(194, 65, 12, 0.03); border-color: rgba(194, 65, 12, 0.12); }
.prop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.prop-addr { font-family: 'Newsreader', serif; font-weight: 500; font-size: 18px; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); margin-bottom: 4px; }
.prop-loc { font-size: 12px; color: var(--text-soft); }
.prop-owner { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.prop-status { font-size: 11px; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; font-weight: 500; }
.status-occ { background: var(--emerald-tint); color: var(--emerald); }
.status-vac { background: var(--accent-tint); color: var(--accent); }
.prop-rent { font-family: 'Newsreader', serif; font-weight: 400; font-size: 26px; letter-spacing: -0.02em; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; margin: 12px 0; }
.prop-rent small { font-family: 'Inter', sans-serif; font-weight: 400; font-size: 13px; color: var(--text-soft); }
.prop-foot { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--hairline); font-size: 12px; }
.prop-foot .k { color: var(--text-soft); }
.prop-foot .v { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.prop-foot .v.warn { color: var(--accent); }
.budget-bar { height: 4px; background: var(--hairline); border-radius: 2px; margin: 12px 0 6px; overflow: hidden; }
.budget-bar .fill { height: 100%; background: var(--emerald); border-radius: 2px; transition: width 240ms ease; }
.budget-bar .fill.mid { background: var(--text-soft); }
.budget-bar .fill.high { background: var(--accent); }
.budget-text { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-soft); }
.budget-text .pct { font-weight: 500; font-variant-numeric: tabular-nums; }
.budget-text .pct.high { color: var(--accent); }

/* Preset catalog ================================================ */
.cat-block { margin-bottom: 56px; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline-strong); }
.cat-head h3 { font-family: 'Newsreader', serif; font-weight: 500; font-size: 22px; letter-spacing: -0.015em; color: var(--text); }
.cat-head h3 em { font-style: italic; font-weight: 400; }
.cat-head .count { font-size: 12px; color: var(--text-soft); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.preset { background: var(--surface); backdrop-filter: blur(8px) saturate(140%); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px 22px 18px; transition: all 180ms ease; cursor: pointer; display: flex; flex-direction: column; }
.preset:hover { border-color: var(--hairline-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.preset-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.preset-icon { width: 34px; height: 34px; border-radius: 8px; background: rgba(24,24,27,0.06); display: grid; place-items: center; color: var(--text-2); flex-shrink: 0; }
.preset-icon svg { width: 16px; height: 16px; stroke-width: 1.75; }
.preset-icon.accent { background: var(--accent-tint); color: var(--accent); }
.preset h4 { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14.5px; color: var(--text); line-height: 1.3; letter-spacing: -0.005em; flex: 1; }
.preset h4 em { font-family: 'Newsreader', serif; font-style: italic; font-weight: 500; color: var(--accent); }
.preset .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; flex: 1; }
.preset .footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--hairline); }
.preset .footer .api { font-size: 11px; color: var(--text-faint); }
.badge-tier { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.badge-pro { background: var(--text); color: white; }
.badge-free { background: transparent; color: var(--text-soft); border: 1px solid var(--hairline-strong); }

/* Brief / units table =========================================== */
.brief-hero h1 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 60px; line-height: 1.05; letter-spacing: -0.025em; color: var(--text); margin-bottom: 24px; max-width: 880px; }
.brief-hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
table.units { width: 100%; border-collapse: collapse; }
table.units thead th { font-weight: 500; font-size: 11.5px; color: var(--text-soft); text-align: left; padding: 0 0 20px; }
table.units thead th.right { text-align: right; }
table.units thead th + th { padding-left: 20px; }
table.units tbody td { padding: 26px 0; border-top: 1px solid var(--hairline); font-size: 14.5px; vertical-align: middle; }
table.units tbody td + td { padding-left: 20px; }
table.units .addr strong { font-weight: 500; color: var(--text); display: block; line-height: 1.3; font-size: 15.5px; margin-bottom: 4px; }
table.units .addr small { color: var(--text-soft); font-size: 12.5px; }
table.units .num-cell { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; font-size: 15px; }
table.units .num-cell small { display: block; font-size: 12px; color: var(--text-faint); font-weight: 400; margin-top: 5px; }
table.units .gap { color: var(--accent); font-weight: 500; }

/* Legal lookup =================================================== */
.query-box { background: var(--surface); backdrop-filter: blur(12px) saturate(140%); border: 1px solid var(--hairline-strong); border-radius: var(--radius); padding: 8px 8px 8px 22px; display: flex; align-items: center; gap: 14px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.query-box:focus-within { border-color: var(--text-faint); box-shadow: var(--shadow); }
.query-box .qicon { width: 24px; height: 24px; flex-shrink: 0; color: var(--text-soft); }
.query-box input { flex: 1; background: transparent; border: 0; outline: none; font-family: inherit; font-size: 16px; color: var(--text); padding: 12px 0; font-weight: 400; }
.query-box input::placeholder { color: var(--text-soft); }
.query-box .state-pill { padding: 6px 14px; border-radius: var(--radius-pill); background: rgba(24,24,27,0.06); font-size: 12.5px; color: var(--text-muted); font-weight: 500; cursor: pointer; }
.query-box .qsend { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg-paper); display: grid; place-items: center; border: 0; cursor: pointer; flex-shrink: 0; }
.query-box .qsend svg { width: 16px; height: 16px; }
.state-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 56px; }
.state-chip { padding: 6px 13px; border-radius: var(--radius-pill); background: var(--surface-strong); border: 1px solid var(--hairline); font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.state-chip:hover { color: var(--text); border-color: var(--hairline-strong); }
.state-chip.covered { background: var(--accent-tint); color: var(--accent); border-color: rgba(194, 65, 12, 0.16); }
.examples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 64px; }
.ex-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; transition: all 180ms ease; }
.ex-card:hover { border-color: var(--hairline-strong); background: var(--surface-strong); }
.ex-state { font-family: 'Newsreader', serif; font-style: italic; font-size: 12.5px; color: var(--accent); margin-bottom: 6px; }
.ex-q { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.comp-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 28px 32px; backdrop-filter: blur(8px); }
.comp-card.them { border-style: dashed; }
.comp-card.us { border-left: 3px solid var(--accent); }
.comp-source { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-soft); margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.comp-source .badge { padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.badge-them { background: rgba(24, 24, 27, 0.06); color: var(--text-muted); }
.badge-us { background: var(--accent); color: white; }
.comp-q { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; font-size: 17px; color: var(--text-2); line-height: 1.4; margin-bottom: 18px; }
.comp-a { font-size: 14px; line-height: 1.65; color: var(--text); margin-bottom: 16px; }
.comp-a strong { font-weight: 500; }
.comp-a .wrong { background: var(--rose-tint); color: var(--rose); padding: 1px 4px; border-radius: 3px; font-weight: 500; }
.comp-cite { font-size: 12.5px; line-height: 1.65; padding-top: 14px; border-top: 1px solid var(--hairline); color: var(--text-muted); }
.comp-cite a { color: var(--accent); text-decoration: none; }
.comp-flaw { margin-top: 14px; padding: 12px 16px; background: var(--rose-tint); border-left: 2px solid var(--rose); border-radius: 6px; font-size: 12.5px; line-height: 1.55; color: #7F1D1D; font-style: italic; }
.comp-disclaimer { margin-top: 14px; padding: 12px 16px; background: var(--accent-tint); border-radius: 6px; font-size: 12px; line-height: 1.55; color: var(--accent-2); font-style: italic; }
.comp-wrap { position: relative; }
.vs-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--bg-paper); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: 'Newsreader', serif; font-style: italic; font-size: 16px; color: var(--text-soft); border: 1px solid var(--hairline-strong); z-index: 5; pointer-events: none; }

/* Chat transcript (sits above the chat bar) ===================== */
.chat-transcript {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 48px));
  max-height: 50vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: var(--radius);
  padding: 14px 18px;
  z-index: 99;
  box-shadow: var(--shadow-chat);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-agent { justify-content: flex-start; }
.chat-msg-bubble {
  max-width: 78%;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg-user .chat-msg-bubble {
  background: var(--text);
  color: var(--bg-paper);
  border-bottom-right-radius: 4px;
}
.chat-msg-agent .chat-msg-bubble {
  background: rgba(24, 24, 27, 0.05);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-mic.recording {
  background: var(--accent);
  color: white;
  animation: chat-pulse 1.2s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0); }
}

/* Floating chat bar ============================================== */
.chat-bar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 48px)); background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: 1px solid rgba(24, 24, 27, 0.08); border-radius: var(--radius-pill); box-shadow: var(--shadow-chat); padding: 8px 8px 8px 22px; display: flex; align-items: center; gap: 14px; z-index: 100; transition: all 220ms cubic-bezier(.2,.8,.2,1); }
.chat-bar:focus-within { background: rgba(255, 255, 255, 0.85); box-shadow: 0 12px 40px -8px rgba(24, 24, 27, 0.20), 0 2px 8px rgba(24, 24, 27, 0.08); border-color: rgba(24, 24, 27, 0.16); }
.chat-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--text); display: grid; place-items: center; flex-shrink: 0; position: relative; }
.chat-avatar svg { width: 14px; height: 14px; color: var(--bg-paper); }
.chat-avatar::after { content: ""; position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22C55E; border: 2px solid var(--bg-paper); }
.chat-input { flex: 1; background: transparent; border: 0; outline: none; font-family: inherit; font-size: 14.5px; color: var(--text); font-weight: 400; padding: 8px 0; }
.chat-input::placeholder { color: var(--text-soft); font-weight: 400; }
.chat-mic, .chat-send { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; transition: all 160ms ease; }
.chat-mic { background: transparent; color: var(--text-soft); }
.chat-mic:hover { background: rgba(24, 24, 27, 0.06); color: var(--text); }
.chat-send { background: var(--text); color: var(--bg-paper); }
.chat-send:hover { background: var(--accent); }
.chat-mic svg, .chat-send svg { width: 16px; height: 16px; stroke-width: 2; }

/* Minimize button on the bar ===================================== */
.chat-min { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; transition: all 160ms ease; }
.chat-min:hover { background: rgba(24, 24, 27, 0.06); color: var(--text); }
.chat-min svg { width: 14px; height: 14px; stroke-width: 2; }

/* Clear button in transcript top-right =========================== */
.chat-clear {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; color: var(--text-faint); border: 0; cursor: pointer;
  display: grid; place-items: center; opacity: 0.55;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}
.chat-clear:hover { background: rgba(190, 18, 60, 0.08); color: var(--rose); opacity: 1; }
.chat-clear svg { width: 14px; height: 14px; }

/* Minimize / restore state transitions =========================== */
.chat-bar.chat-hidden,
.chat-transcript.chat-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}
/* Floating Action Button (collapsed chat) ======================== */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--text); color: var(--bg-paper);
  border: 1px solid rgba(24, 24, 27, 0.08);
  box-shadow: var(--shadow-chat);
  display: grid; place-items: center; cursor: pointer;
  z-index: 101;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), box-shadow 200ms ease, background 200ms ease;
}
.chat-fab:hover { transform: translateY(-2px); background: var(--accent); box-shadow: 0 14px 36px -8px rgba(24,24,27,0.28), 0 2px 8px rgba(24,24,27,0.10); }
.chat-fab svg { width: 22px; height: 22px; }

/* Responsive ===================================================== */
/* Tablet + below, <= 960px: tighten side padding, allow some grids to stack */
@media (max-width: 960px) {
  .main { padding: 40px 40px 96px; }
  .lower { grid-template-columns: 1fr; gap: 40px; }
  .layout-brief { grid-template-columns: 1fr; gap: 32px; }
  .h-display { font-size: 44px; }
  .brief-hero h1 { font-size: 46px; }
}

/* Mobile, <= 720px: collapse sidebar, single column, smaller chat bar */
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  body { padding-bottom: 110px; }
  .main { padding: 24px 18px 64px; max-width: 100%; }
  .topbar { margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
  .topbar .crumbs { font-size: 12.5px; }
  .topbar .actions .btn { padding: 8px 14px; font-size: 12.5px; }
  .hero { margin-bottom: 36px; }
  .h-display { font-size: 34px; margin-bottom: 16px; letter-spacing: -0.02em; }
  .lede { font-size: 15px; line-height: 1.6; }
  .brief-hero h1 { font-size: 36px; }
  .section-head { margin-bottom: 20px; padding-bottom: 12px; flex-wrap: wrap; gap: 6px; }
  .section-head h2 { font-size: 22px; }

  /* KPI strip: 2 cols on phones, with each cell flowing without right-borders */
  .kpis { padding: 20px 0; margin: 28px 0; }
  .kpis.cols-4, .kpis.cols-5 { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .kpi { padding: 0 14px 0 0; border-right: 1px solid var(--hairline); }
  .kpi:nth-child(2n) { border-right: none; padding-right: 0; }
  .kpi:nth-child(2n+1) { padding-left: 0; }
  .kpi-value { font-size: 26px; }

  /* Property + preset + owner grids: single column */
  .props, .preset-grid, .owners-grid, .examples-grid { grid-template-columns: 1fr; gap: 14px; }

  /* Legal comparison: stack and hide the floating "vs" stamp */
  .comparison { grid-template-columns: 1fr; gap: 14px; }
  .comp-card { padding: 22px 22px; }
  .vs-stamp { display: none; }

  /* Tables: shrink padding + allow horizontal scroll via wrapper */
  table.data, table.units { font-size: 13px; }
  table.data tbody td { padding: 16px 8px; }
  table.units tbody td { padding: 18px 0; }
  table.units thead th + th, table.units tbody td + td { padding-left: 10px; }

  /* Filters wrap cleanly; search input takes full row */
  .filters { gap: 6px; }
  .filter-search { width: 100%; max-width: none; min-width: 0; }

  /* Query box: stack input + send vertically when too tight */
  .query-box { padding: 6px 6px 6px 14px; gap: 8px; }
  .query-box input { font-size: 15px; padding: 10px 0; }
  .query-box .state-pill { display: none; }

  /* Chat bar: keep visible but compact */
  .chat-bar { width: calc(100% - 24px); bottom: 14px; padding: 6px 6px 6px 16px; gap: 8px; }
  .chat-input { font-size: 13.5px; padding: 6px 0; }
  .chat-mic, .chat-send { width: 36px; height: 36px; }
  .chat-min { width: 28px; height: 28px; }
  .chat-avatar { width: 24px; height: 24px; }
  .chat-avatar svg { width: 12px; height: 12px; }
  .chat-transcript { width: calc(100% - 24px); bottom: 70px; max-height: 45vh; padding: 12px 14px; }
  .chat-fab { right: 14px; bottom: 14px; width: 48px; height: 48px; }
}

/* Small phones, <= 380px: hide mic to make room for input */
@media (max-width: 380px) {
  .main { padding: 20px 14px 56px; }
  .h-display { font-size: 30px; }
  .brief-hero h1 { font-size: 32px; }
  .kpis.cols-4, .kpis.cols-5 { grid-template-columns: 1fr; }
  .kpi { padding: 0 0 18px; border-right: none; border-bottom: 1px solid var(--hairline); }
  .kpi:last-child { border-bottom: none; padding-bottom: 0; }
  .topbar .actions { width: 100%; justify-content: flex-end; }
  .chat-mic { display: none; }
}

/* Empty + loading ============================================== */
.empty { padding: 60px 20px; text-align: center; color: var(--text-soft); }
.empty h3 { font-family: 'Newsreader', serif; font-weight: 500; font-size: 22px; color: var(--text-muted); margin-bottom: 8px; }
.loading { color: var(--text-faint); font-style: italic; font-family: 'Newsreader', serif; font-size: 13px; }

/* /market page ============================================== */
.market-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 24px; }
.market-result { margin-top: 12px; }
.market-estimate { padding: 24px; background: rgba(99, 102, 241, 0.06); border: 1px solid rgba(99, 102, 241, 0.15); border-radius: 12px; margin-bottom: 24px; }
.market-headline { font-family: 'Newsreader', serif; font-weight: 500; font-size: 36px; color: var(--text); line-height: 1.1; }
.market-range { margin-top: 6px; color: var(--text-muted); font-size: 14px; }
.market-source { margin-top: 4px; color: var(--text-soft); font-size: 12px; }
.comps-h { font-family: 'Newsreader', serif; font-weight: 500; font-size: 18px; color: var(--text-muted); margin: 0 0 12px; }

/* /knowledge banner ============================================== */
.kb-banner { padding: 12px 16px; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); border-radius: 8px; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.kb-banner strong { color: var(--text); font-weight: 500; }

/* Dashboard nudges ============================================== */
.nudges { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 0 0 28px; }
.nudge-card { position: relative; padding: 22px 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.nudge-card.nudge-upgrade { background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02)); border-color: rgba(99,102,241,0.2); }
.nudge-title { font-family: 'Newsreader', serif; font-weight: 500; font-size: 18px; color: var(--text); }
.nudge-body { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); margin-bottom: 6px; }
.nudge-card .btn { align-self: flex-start; padding: 8px 16px; font-size: 13px; }
.nudge-close { position: absolute; top: 10px; right: 10px; background: transparent; border: 0; color: var(--text-soft); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.nudge-close:hover { background: rgba(0,0,0,0.04); color: var(--text); }

/* Onboarding tour ============================================== */
.tour-slide { padding: 48px 32px; max-width: 720px; margin: 0 auto; text-align: center; }
.tour-slide h2 { font-family: 'Newsreader', serif; font-weight: 500; font-size: 32px; color: var(--text); margin-bottom: 12px; }
.tour-slide p { color: var(--text-muted); font-size: 16px; line-height: 1.6; margin-bottom: 28px; }
.tour-dots { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.tour-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); }
.tour-dot.active { background: var(--accent); }
.tour-actions { display: flex; justify-content: center; gap: 12px; }

/* First-visit tooltip ============================================== */
.tip-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 50; pointer-events: none; }
.tip-pop { position: absolute; max-width: 280px; padding: 14px 16px; background: var(--text); color: white; border-radius: 8px; font-size: 13px; line-height: 1.5; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 51; pointer-events: auto; }
.tip-pop .tip-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
.tip-pop button { background: rgba(255,255,255,0.15); border: 0; color: white; padding: 5px 12px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.tip-pop button.tip-primary { background: var(--accent); }
