/* Porchlights design system.
   Inter is self-hosted (no Google Fonts calls, so no third-party requests
   and no cookie banner needed). */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --brand: #3056d3;
  --brand-dark: #2343b0;
  --brand-soft: #eef2ff;
  --brand-ring: rgba(48, 86, 211, .18);
  --glow: #f5a524;
  --glow-soft: #fff4e0;
  --nav: #0f1a36;
  --nav-2: #18264a;
  --nav-text: #b8c2db;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #101828;
  --ink: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --danger: #c4320a;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --warn: #a15c07;
  --warn-soft: #fffaeb;
  --warn-line: #fedf89;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --ok-line: #abefc6;
  --info: #1849a9;
  --info-soft: #eff8ff;
  --info-line: #b2ddff;
  --violet: #5925dc;
  --violet-soft: #f4f3ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -6px rgba(16, 24, 40, .16), 0 4px 8px -4px rgba(16, 24, 40, .06);
  /* chart series (validated: categorical slots 1-2) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img { max-width: 100%; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.08rem; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: 1rem; margin: 0 0 6px; font-weight: 650; }
.lead { color: var(--muted); font-size: 1rem; margin: 0 0 22px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.num-tab { font-variant-numeric: tabular-nums; }
code { background: #f2f4f7; padding: 1px 6px; border-radius: 6px; font-size: .88em; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- Public pages: header & footer ---------- */
.site-header { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-header .inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { color: var(--text); text-decoration: none; font-weight: 750; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; }
.logo-mark svg { width: 34px; height: 34px; display: block; border-radius: 9px; box-shadow: 0 2px 8px -2px rgba(48, 86, 211, .45); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.site-nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .93rem; font-weight: 550; }
.site-nav a:hover { background: #f2f4f7; }
.site-nav a.cta { background: var(--brand); color: #fff; }
.site-nav a.cta:hover { background: var(--brand-dark); }
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.narrow { max-width: 720px; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 28px 16px 44px; border-top: 1px solid var(--border); background: #fff; }
.site-footer a { color: var(--muted); }
.site-footer .company { margin-top: 6px; font-size: .78rem; color: var(--faint); }

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side-nav { background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; gap: 2px; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-nav .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 750; font-size: 1.12rem; padding: 4px 8px 18px; text-decoration: none; letter-spacing: -.02em; }
.side-nav .section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6f7ea3; padding: 14px 10px 6px; font-weight: 650; }
.side-nav a.nav { text-decoration: none; color: var(--nav-text); padding: 9px 10px; border-radius: 9px; font-weight: 550; font-size: .93rem; display: flex; gap: 11px; align-items: center; }
.side-nav a.nav:hover { background: var(--nav-2); color: #fff; }
.side-nav a.nav.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(48, 86, 211, .6); }
.side-nav a.nav .count { margin-left: auto; background: #f04438; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; min-width: 20px; text-align: center; font-weight: 700; line-height: 18px; }
.side-nav .grow { flex: 1; }
.side-nav .me { border-top: 1px solid var(--nav-2); margin-top: 12px; padding: 14px 8px 2px; display: flex; gap: 10px; align-items: center; color: #fff; font-size: .88rem; }
.side-nav .me .muted { color: #8391b5; font-size: .78rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #6d8bff, var(--brand)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-main > * { min-width: 0; }
.topbar { display: none; background: #fff; border-bottom: 1px solid var(--border); padding: 10px 16px; gap: 12px; align-items: center; position: sticky; top: 0; z-index: 10; }
.topbar-brand { font-weight: 700; letter-spacing: -.02em; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.back-link a { text-decoration: none; }
.icon.flip { transform: rotate(180deg); }
#banners:not(:empty) + .content { padding-top: 14px; }
.topbar .crumbs { font-size: .9rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; }
.content { padding: 24px 28px 64px; max-width: 1320px; width: 100%; }
#banners:empty { display: none; }
#banners { padding: 20px 28px 0; }
#banners .alert { margin: 0 0 8px; }

/* ---------- Page header ---------- */
.page-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .spacer { flex: 1; }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-xs); }
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .spacer { flex: 1; }
.card-head a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

/* KPI tiles */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-xs); transition: box-shadow .15s, transform .15s; }
a.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat .top { display: flex; align-items: center; gap: 10px; }
.stat .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.stat .ico.red { background: var(--danger-soft); color: var(--danger); }
.stat .ico.amber { background: var(--warn-soft); color: var(--warn); }
.stat .ico.green { background: var(--ok-soft); color: var(--ok); }
.stat .ico.violet { background: var(--violet-soft); color: var(--violet); }
.stat .lbl { color: var(--muted); font-size: .85rem; font-weight: 550; }
.stat .num { font-size: 1.65rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.alert { border-color: var(--danger-line); background: linear-gradient(180deg, #fff, var(--danger-soft)); margin: 0; padding: 16px 18px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; font-size: inherit; color: inherit; }
.stat.alert .num { color: var(--danger); }

/* ---------- Forms ---------- */
.row { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
label { display: block; font-weight: 600; font-size: .88rem; margin: 14px 0 6px; color: #344054; }
label .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; }
.choice-group { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.choice { border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 450; margin: 0; background: #fff; }
.choice input { margin-top: 3px; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.choice strong { display: block; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { font-weight: 500; margin: 0; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: #fff; font-size: .88rem; }
.checks label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.inline-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.inline-check input { margin-top: 3px; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: none; }
.switch-row .txt { flex: 1; }
.switch-row .txt b { display: block; font-weight: 600; }
.switch { position: relative; width: 40px; height: 22px; flex: none; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d0d5dd; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-ring); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; font-size: .9rem; line-height: 1.25; box-shadow: var(--shadow-xs); transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: #344054; border-color: var(--border-strong); }
.btn.secondary:hover { background: #f9fafb; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.glow { background: var(--glow); border-color: var(--glow); color: #2a1a00; }
.btn.glow:hover { background: #e39514; }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.solid-danger { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn.solid-danger:hover { background: #b42318; }
.btn.small { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.alert > .icon { margin-top: 1px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.alert a { color: inherit; font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 9px 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap; vertical-align: middle; border: 1px solid #d5ddfb; line-height: 1.5; }
.badge::first-letter { text-transform: uppercase; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.emergency, .badge.expired, .badge.overdue, .badge.missing, .badge.missed, .badge.failed, .badge.declined, .badge.high, .badge.late, .badge.part_late, .badge.disputed { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.urgent, .badge.due_soon, .badge.quoting, .badge.reported, .badge.invited, .badge.logged, .badge.trialing, .badge.past_due, .badge.due, .badge.part_paid, .badge.draft { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.resolved, .badge.ok, .badge.done, .badge.met, .badge.sent, .badge.quoted, .badge.accepted, .badge.active, .badge.paid, .badge.acknowledged-ok, .badge.agreed { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.closed, .badge.withdrawn, .badge.not_selected, .badge.n\/a, .badge.ended, .badge.canceled, .badge.inactive, .badge.upcoming { background: #f2f4f7; color: #475467; border-color: var(--border); }
.badge.awaiting_signoff, .badge.scheduled, .badge.assigned, .badge.acknowledged, .badge.routine, .badge.completed { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge.nation, .badge.plain { background: #f9fafb; color: #475467; border-color: var(--border); }
.badge.nation::before, .badge.plain::before { display: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; background: #f9fafb; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f9fafb; }
.card > .table-wrap { margin: 0 -20px -20px; }
.card > .table-wrap table { border-top: 1px solid var(--border); }
.card > .table-wrap th:first-child, .card > .table-wrap td:first-child { padding-left: 20px; }
.card > .table-wrap th:last-child, .card > .table-wrap td:last-child { padding-right: 20px; }

/* list rows (dashboard) */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.list .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #f2f4f7; color: #475467; flex: none; }
.list .ico.red { background: var(--danger-soft); color: var(--danger); }
.list .ico.amber { background: var(--warn-soft); color: var(--warn); }
.list .main { flex: 1; min-width: 0; }
.list .main b { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.list .main span { color: var(--muted); font-size: .82rem; }
.list a.row-link { color: inherit; text-decoration: none; display: contents; }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover { background: #f9fafb; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button, .tabs a { background: none; border: none; padding: 10px 14px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; margin-bottom: -1px; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: #f2f4f7; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li { padding: 0 0 14px 18px; position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.timeline li.system::before { background: #98a2b3; }
.timeline li.tenant::before { background: var(--glow); }
.timeline li.tradesperson::before { background: #7a5af8; }
.timeline li.alert::before { background: #f04438; }
.timeline time { display: block; font-size: .78rem; color: var(--muted); }
.timeline .who { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 6px; }

.steps { display: flex; gap: 6px; margin: 12px 0 18px; flex-wrap: wrap; }
.steps span { flex: 1; min-width: 96px; text-align: center; padding: 8px 6px; border-radius: 8px; background: #f2f4f7; color: #667085; font-size: .8rem; font-weight: 600; }
.steps span.done { background: var(--brand); color: #fff; }

.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 104px; height: 80px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.photos .del { position: relative; display: inline-block; }
.photos .del button { position: absolute; top: 4px; right: 4px; border: none; background: rgba(16, 24, 40, .7); color: #fff; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; line-height: 1; }
pre.email { white-space: pre-wrap; background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: .85rem; margin: 8px 0 0; font-family: inherit; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.clock { display: flex; gap: 10px; flex-wrap: wrap; }
.clock > div { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 190px; flex: 1; }
.clock .when { font-weight: 700; }
.inv { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inv .amount { font-size: 1.2rem; font-weight: 700; }
.link-box { display: flex; gap: 6px; align-items: center; }
.link-box input { font-size: .8rem; color: var(--muted); }

/* ---------- Property cards ---------- */
.prop-card { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: block; transition: box-shadow .15s, transform .15s; }
.prop-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.prop-card .cover { height: 92px; background: linear-gradient(135deg, #e0e8ff, #f7f9ff 60%, #fff4e0); position: relative; display: flex; align-items: flex-end; padding: 12px 16px; }
.prop-card .cover .house { position: absolute; right: 14px; top: 14px; color: var(--brand); opacity: .9; }
.prop-card .body { padding: 14px 16px 16px; }
.prop-card .meta { display: flex; gap: 14px; margin-top: 12px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.prop-card .meta span { display: inline-flex; gap: 5px; align-items: center; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 36px 16px; }
.empty .bubble { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; box-shadow: 0 0 0 8px #f5f7ff; }
.empty h3 { margin: 6px 0 4px; }
.empty p { color: var(--muted); margin: 0 auto 14px; max-width: 420px; font-size: .92rem; }

/* ---------- Progress / checklist ---------- */
.progress { height: 8px; border-radius: 999px; background: #eaecf0; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 9px 0; font-size: .92rem; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; color: #fff; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); }
.checklist li.done a { color: var(--muted); text-decoration: line-through; }

/* ---------- Chart ---------- */
.viz { position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.viz .grid line { stroke: #eaecf0; }
.viz .bar { transition: opacity .12s; }
.viz .hit { fill: transparent; cursor: default; }
.viz .hit:focus { outline: none; }
.viz .hit:focus-visible { stroke: var(--brand); stroke-width: 1.5; }
.viz.hovering .bar { opacity: .45; }
.viz.hovering .bar.on { opacity: 1; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: #344054; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: .8rem; min-width: 140px; z-index: 5; transform: translate(-50%, -100%); white-space: nowrap; }
.tip .t { color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.tip .r { display: flex; align-items: center; gap: 8px; }
.tip .r i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.tip .r b { font-variant-numeric: tabular-nums; }
.tip .r span { color: var(--muted); }

/* ---------- Dialogs & toasts ---------- */
dialog { border: none; border-radius: 16px; padding: 0; max-width: 680px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.wide { max-width: 980px; }
dialog::backdrop { background: rgba(16, 24, 40, .5); backdrop-filter: blur(2px); }
dialog .dlg-body { padding: 22px 24px; max-height: 86vh; overflow-y: auto; }
dialog .dlg-body > h2:first-child { font-size: 1.15rem; margin-bottom: 4px; }
dialog .dlg-close { position: absolute; top: 14px; right: 14px; border: none; background: #f2f4f7; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; color: #475467; }
dialog .dlg-close:hover { background: #eaecf0; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: #101828; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; animation: toast-in .18s ease-out; }
.toast.error { background: #b42318; }
.toast.success .icon { color: #75e0a7; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Inspection editor ---------- */
.room { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: 14px; overflow: hidden; }
.room > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: 650; }
.room > summary::-webkit-details-marker { display: none; }
.room > summary .spacer { flex: 1; }
.room[open] > summary { border-bottom: 1px solid var(--border); background: #f9fafb; }
.room .items { padding: 6px 18px 14px; }
.item-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 10px 14px; padding: 12px 0; border-bottom: 1px dashed var(--border); align-items: start; }
.item-row:last-child { border-bottom: none; }
.item-row .name { font-weight: 600; padding-top: 6px; }
.conds { display: flex; gap: 4px; flex-wrap: wrap; }
.conds label { margin: 0; font-size: .78rem; font-weight: 600; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 10px; cursor: pointer; background: #fff; color: #344054; }
.conds input { position: absolute; opacity: 0; width: 0; height: 0; }
.conds label:has(input:checked) { color: #fff; }
.conds label.c-excellent:has(input:checked), .conds label.c-good:has(input:checked) { background: var(--ok); border-color: var(--ok); }
.conds label.c-fair:has(input:checked) { background: #dc6803; border-color: #dc6803; }
.conds label.c-poor:has(input:checked), .conds label.c-damaged:has(input:checked), .conds label.c-missing:has(input:checked) { background: #d92d20; border-color: #d92d20; }
.conds label.c-n\/a:has(input:checked) { background: #667085; border-color: #667085; }
.conds label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-ring); }
.item-row textarea { min-height: 40px; height: 40px; margin-top: 6px; font-size: .88rem; padding: 8px 10px; }
.add-photo { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--brand); cursor: pointer; font-weight: 600; margin: 6px 0 0; }
.add-photo input { display: none; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(245, 247, 251, .92); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--border); margin-top: 16px; z-index: 4; }
.cmp-worse { background: var(--danger-soft); }

/* ---------- Tenant emergency screen ---------- */
.em-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.em-btn { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--danger-line); background: var(--danger-soft); color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; width: 100%; }
.em-btn:hover { border-color: var(--danger); }
.em-btn .icon { font-size: 1.5rem; width: auto; height: auto; }
.em-panel { border: 3px solid #d92d20; border-radius: 16px; padding: 18px; background: #fff; }
.em-panel h2 { color: var(--danger); }
.call-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: #d92d20; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; padding: 16px; border-radius: 14px; margin: 12px 0; }
.em-panel ol { padding-left: 20px; }
.em-panel li { margin-bottom: 6px; }
.not-em { margin-top: 14px; }

/* Tenant / public card pages */
.tenant-page main { max-width: 760px; }
.tenant-hero { background: linear-gradient(135deg, var(--nav), #233a7a); color: #fff; border-radius: 18px; padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-lg); }
.tenant-hero h1 { color: #fff; }
.tenant-hero p { color: #c9d3ee; margin: 0; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.45rem; }
.otp { letter-spacing: .35em; font-size: 1.3rem !important; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Landing ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 36px 0 28px; }
.hero h1 { font-size: 3rem; line-height: 1.08; letter-spacing: -.035em; margin-bottom: 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), #7a5af8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; max-width: 560px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: .8rem; font-weight: 650; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #d5ddfb; padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.mock { background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .25); overflow: hidden; display: grid; grid-template-columns: 64px 1fr; min-height: 340px; }
.mock .mside { background: var(--nav); padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mock .mside i { width: 26px; height: 26px; border-radius: 8px; background: var(--nav-2); display: block; }
.mock .mside i.on { background: var(--brand); }
.mock .mmain { padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.mock .mrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock .mtile { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.mock .mtile b { display: block; font-size: 1.2rem; letter-spacing: -.02em; }
.mock .mtile span { font-size: .72rem; color: var(--muted); }
.mock .mchart { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.mock .mchart i { flex: 1; background: var(--series-1); border-radius: 4px 4px 0 0; display: block; }
.mock .mchart i:nth-child(odd) { background: #c9dbf5; }
.mock .mlist { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; font-size: .78rem; }
.mock .mlist div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.mock .mlist div:last-child { border-bottom: none; }
.trust { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin-top: 18px; }
.trust span { display: inline-flex; gap: 6px; align-items: center; }
.section-title { text-align: center; margin: 64px auto 26px; max-width: 680px; }
.section-title h2 { font-size: 2rem; letter-spacing: -.03em; margin-bottom: 8px; }
.section-title p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.feature { transition: box-shadow .15s; }
.feature:hover { box-shadow: var(--shadow); }
.feature .ficon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ficon.amber { background: var(--glow-soft); color: #b54708; }
.feature .ficon.red { background: var(--danger-soft); color: var(--danger); }
.feature .ficon.green { background: var(--ok-soft); color: var(--ok); }
.feature .ficon.violet { background: var(--violet-soft); color: var(--violet); }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.compare td, .compare th { text-align: center; }
.compare td:first-child, .compare th:first-child { text-align: left; }
.compare .yes { color: var(--ok); font-weight: 700; }
.price-card { position: relative; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.price-card .tag { position: absolute; top: -12px; left: 20px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price { font-size: 2.6rem; font-weight: 750; letter-spacing: -.03em; }
.price small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
ul.ticks { padding-left: 0; list-style: none; }
ul.ticks li { padding-left: 28px; position: relative; margin: 8px 0; }
ul.ticks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23067647' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.cta-band { background: linear-gradient(135deg, var(--nav), #2343b0); color: #fff; border-radius: 22px; padding: 40px; text-align: center; margin-top: 64px; }
.cta-band h2 { color: #fff; font-size: 1.8rem; letter-spacing: -.02em; }
.cta-band p { color: #c9d3ee; }
/* Market rent check */
.badge.mkt-below { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge.mkt-in_line { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.mkt-above { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.mkt-card { margin-top: 16px; }
.mkt-card .card-head h2 { display: inline-flex; gap: 8px; align-items: center; }
.mkt-card .card-head h2 .icon { color: var(--violet); }
.mkt-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.mkt-range { margin: 30px 0 4px; }
.mkt-range .track { position: relative; height: 10px; border-radius: 999px; background: var(--border); }
.mkt-range .band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: #c7d7fe; }
.mkt-range .typ { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--brand); transform: translateX(-1px); }
.mkt-range .you { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--violet); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--violet); transform: translateX(-10px); }
.mkt-range .you b { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .75rem; color: var(--violet); }
.mkt-range .ends { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.mkt-sub { font-size: .9rem; margin: 16px 0 4px; }
.mkt-comps li { gap: 10px; }
.mkt-comps .main span a { color: var(--brand); }
.mkt-rules { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--bg); }
.mkt-rules summary { cursor: pointer; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.mkt-rules ul { padding-left: 18px; margin: 10px 0; }
.mkt-rules li { margin: 4px 0; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Landing: feature showcases (same rhythm as the AI triage band, but light) */
.showcase { scroll-margin-top: 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-top: 28px; padding: 48px; border-radius: 24px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.showcase.flip .sc-copy { order: 2; }
.showcase h2 { font-size: 2.1rem; line-height: 1.14; letter-spacing: -.03em; margin-bottom: 14px; }
.showcase h2 em { font-style: normal; color: var(--brand); }
.showcase .sc-copy > p { color: var(--muted); font-size: 1.05rem; }
.sc-kicker { display: inline-flex; gap: 7px; align-items: center; font-size: .8rem; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #d5ddfb; padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.sc-kicker.green { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.sc-kicker.amber { color: #b54708; background: var(--glow-soft); border-color: #fedf89; }
.sc-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 11px; }
.sc-points li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.sc-points li svg { flex: none; margin-top: 2px; color: var(--brand); }
.sc-visual { display: grid; gap: 14px; min-width: 0; padding: 22px; border-radius: 20px; background: linear-gradient(135deg, #eef2ff, #f4f3ff); }
.sc-panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; box-shadow: 0 18px 36px -18px rgba(16, 24, 40, .25); min-width: 0; }
.sc-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-panel-head b { display: inline-flex; gap: 6px; align-items: center; }
.sc-panel-head b svg { color: var(--violet); }
.sc-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.sc-steps { list-style: none; padding: 0 0 0 4px; margin: 16px 0 12px; }
.sc-steps li { position: relative; padding: 0 0 14px 24px; border-left: 2px solid var(--ok-line); margin-left: 6px; }
.sc-steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.sc-steps li::before { content: ""; position: absolute; left: -8px; top: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ok-line); }
.sc-steps li.now::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.sc-steps b { display: block; font-size: .88rem; }
.sc-steps span { font-size: .78rem; color: var(--muted); }
.sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sc-stats div { background: var(--bg); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.sc-stats span { display: block; font-size: .72rem; color: var(--muted); }
.sc-stats b { font-size: 1.15rem; letter-spacing: -.02em; }
.sc-ledger { margin-top: 10px; font-size: .84rem; }
.sc-ledger div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sc-ledger div:last-child { border-bottom: none; }
.sc-mkt .mkt-range { margin-top: 32px; }
.sc-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0; text-align: center; font-size: .78rem; }
.sc-cal span { position: relative; padding: 6px 0 9px; border-radius: 8px; color: var(--text); }
.sc-cal span.dow { color: var(--faint); font-weight: 600; padding-bottom: 4px; }
.sc-cal span.has { background: var(--bg); font-weight: 650; }
.sc-cal span.today { box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand); font-weight: 700; }
.sc-cal span i { position: absolute; left: 50%; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; transform: translateX(-50%); }
.sc-due { list-style: none; padding: 0; margin: 0; font-size: .84rem; }
.sc-due li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.sc-due li i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sc-due li b { flex: 1; font-weight: 600; min-width: 0; }
/* Landing: AI triage showcase */
a.eyebrow.ai-pill { text-decoration: none; background: var(--violet-soft); color: var(--violet); border-color: #d9d6fe; padding: 4px 12px 4px 4px; }
a.eyebrow.ai-pill:hover { border-color: var(--violet); }
.ai-pill .new { background: var(--violet); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.ai-band { scroll-margin-top: 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; margin-top: 40px; padding: 48px; border-radius: 24px; color: #fff; background: radial-gradient(120% 90% at 100% 0%, rgba(122, 90, 248, .45), transparent 55%), linear-gradient(135deg, var(--nav) 0%, #1c2a5c 100%); box-shadow: var(--shadow-lg); }
.ai-band h2 { color: #fff; font-size: 2.3rem; line-height: 1.12; letter-spacing: -.03em; margin-bottom: 14px; }
.ai-band h2 em { font-style: normal; background: linear-gradient(90deg, #a4bcfd, #d6bbfb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-band .ai-copy > p { color: #c9d3ee; font-size: 1.05rem; }
.ai-kicker { display: inline-flex; gap: 7px; align-items: center; font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: #d6bbfb; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.ai-points { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 11px; }
.ai-points li { display: flex; gap: 10px; align-items: flex-start; color: #e4e9f7; font-size: .95rem; }
.ai-points li svg { flex: none; margin-top: 2px; color: #a4bcfd; }
.ai-demo { display: grid; gap: 14px; justify-items: center; min-width: 0; }
.ai-demo .phone { width: 100%; max-width: 400px; background: #f2f4f7; color: var(--text); border-radius: 22px; padding: 14px; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .5); display: grid; gap: 10px; }
.phone-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; color: var(--muted); padding: 0 4px 6px; border-bottom: 1px solid var(--border); }
.phone-top b { color: var(--text); font-size: .9rem; }
.sms { max-width: 88%; padding: 9px 12px; border-radius: 16px; font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.sms small { display: block; font-size: .7rem; margin-top: 4px; opacity: .7; }
.sms.in { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; justify-self: start; }
.sms.out { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; justify-self: end; }
.ai-arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), #7a5af8); box-shadow: 0 0 0 6px rgba(122, 90, 248, .25); }
.ai-card { width: 100%; max-width: 400px; background: #fff; color: var(--text); border-radius: 16px; padding: 16px 18px; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .5); border-top: 4px solid #7a5af8; }
.ai-card-head { display: inline-flex; gap: 6px; align-items: center; font-size: .75rem; font-weight: 700; color: var(--violet); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ai-card h3 { font-size: 1.1rem; margin: 0 0 10px; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ai-why { font-size: .85rem; color: var(--muted); margin: 0 0 12px; }
.ai-clock { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 8px; align-items: baseline; font-size: .8rem; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.ai-clock span { color: var(--muted); }
.legal h2 { margin-top: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-main { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.3rem; }
  .ai-band { grid-template-columns: 1fr; padding: 36px 28px; gap: 32px; }
  .showcase { grid-template-columns: 1fr; padding: 36px 28px; gap: 28px; }
  .site-nav a.sec { display: none; }
  .showcase.flip .sc-copy { order: 0; }
  .showcase h2 { font-size: 1.8rem; }
  .ai-band h2 { font-size: 1.9rem; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .side-nav { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 40; }
  .menu-btn { display: inline-grid; place-items: center; }
  .topbar { display: flex; }
  .content { padding: 18px 16px 64px; }
  #banners { padding: 12px 16px 0; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.9rem; }
  .site-nav { margin-left: 0; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .item-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .mock { display: none; }
  .cta-band { padding: 28px 18px; }
  .ai-band { padding: 28px 18px; border-radius: 18px; margin-top: 24px; }
  .showcase { padding: 26px 16px; border-radius: 18px; margin-top: 18px; }
  .showcase h2 { font-size: 1.5rem; }
  .sc-visual { padding: 12px; }
  .sc-stats { grid-template-columns: 1fr 1fr; }
  .ai-band h2 { font-size: 1.6rem; }
  .ai-clock { grid-template-columns: auto 1fr; }
}
@media print {
  .site-header, .side-nav, .topbar, .btn, .site-footer, .sticky-actions, #banners { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; }
}

/* Inline-editable names in the inspection editor */
.room summary input, .item-row [data-iname] { border-color: transparent; box-shadow: none; background: transparent; padding-left: 6px; }
.room summary input:hover, .item-row [data-iname]:hover { border-color: var(--border); }
.room summary input:focus, .item-row [data-iname]:focus { border-color: var(--brand); background: #fff; }

/* ---------- Dashboard calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title h2 { margin: 0; }
.cal-head .spacer { flex: 1; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.cal-filter { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: .85rem; color: #344054; cursor: pointer; }
.cal-filter i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-filter input { width: 15px; height: 15px; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: #f9fafb; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; }
.cal-day { background: #fff; border: none; font: inherit; text-align: left; padding: 6px 6px 8px; min-height: 96px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; color: inherit; }
.cal-day:hover { background: #f9fafb; }
.cal-day:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-day.other { background: #fcfcfd; }
.cal-day.other .cal-num { color: var(--faint); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-num { font-size: .8rem; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { font-size: .7rem; line-height: 1.3; padding: 2px 6px 2px 7px; border-radius: 5px; background: color-mix(in srgb, var(--k) 12%, #fff); border-left: 3px solid var(--k); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cal-chip.over { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.cal-chip.done { opacity: .55; text-decoration: line-through; }
.cal-more { font-size: .7rem; color: var(--muted); font-weight: 600; padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cal-day.has-over .cal-num { box-shadow: 0 0 0 2px #f04438; }
.cal-agenda h3 { margin: 0 0 8px; }
.cal-agenda .list .main b { -webkit-line-clamp: 3; }
.loading-soft { opacity: .6; transition: opacity .15s; }
@media (max-width: 1100px) {
  .cal-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .cal-day { min-height: 52px; align-items: center; padding: 4px 2px; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-dow { padding: 6px 2px; text-align: center; font-size: .65rem; }
}
.cal-nav { display: flex; gap: 6px; flex: none; }
.stat .num.num-text { font-size: 1.25rem; line-height: 1.32; }
.card .btn { white-space: normal; text-align: center; }
.back-btn { margin: -4px 0 8px -10px; padding-left: 8px; color: var(--muted); }
.back-btn:hover { color: var(--brand); }
.card-dirty { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
#compBar { justify-content: flex-end; }


/* ================= Responsive: phones, tablets, laptops ================= */
img, svg, video { max-width: 100%; }
.stat, .card, .room, .item-row > * { min-width: 0; }
.kv dd, .list .main, td { overflow-wrap: anywhere; }
.row { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }

/* Tabs and segmented controls scroll sideways instead of wrapping. */
.tabs, .seg { max-width: 100%; }
@media (max-width: 860px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { white-space: nowrap; flex: none; }
  .seg { overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  /* 16px stops iPhones zooming into form fields. */
  input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input[type=url], input[type=search], select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 34px; }
  .page-head { align-items: flex-start; }
  .page-head .spacer { display: none; }
  .page-head > div:first-child { flex: 1 1 100%; }
  /* Repair page: actions come before the long history on one column. */
  .grid-main.interleave > .grid { display: contents; }
  .grid-main.interleave > .grid > .order-last { order: 10; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  dialog .dlg-body { padding: 18px 16px; max-height: calc(100dvh - 16px); }
  dialog .btn-row { position: sticky; bottom: -18px; background: #fff; padding: 10px 0 12px; margin-bottom: -6px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* Phones */
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  .content { padding: 14px 12px 72px; }
  #banners { padding: 10px 12px 0; }
  #banners .alert { font-size: .82rem; padding: 9px 11px; }
  .card { padding: 16px; border-radius: 12px; }
  .card > .table-wrap { margin: 0 -16px -16px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 8px; }
  .stat .ico { width: 32px; height: 32px; }
  .stat .num { font-size: 1.3rem; }
  .stat .num.num-text { font-size: 1.02rem; }
  .stat .lbl { font-size: .78rem; }
  .stat .sub { font-size: .74rem; }
  .sticky-actions { gap: 6px; padding: 10px 0; }
  .sticky-actions .btn { padding: 8px 12px; font-size: .85rem; }
  .clock > div { min-width: 0; }
  .link-box { flex-wrap: wrap; }
  .link-box input { min-width: 0; }
  .prop-card .cover { height: 72px; }
  .cta-band h2 { font-size: 1.4rem; }
  .section-title h2 { font-size: 1.5rem; }
  .site-header .inner { padding: 10px 12px; gap: 8px; }
  .site-nav a { padding: 7px 8px; font-size: .88rem; }
  main { padding: 18px 12px 48px; }
  .auth-card .card { padding: 20px 16px; }

  /* Tables become stacked cards: one block per row, labels from the header. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: none; }
  table.stack td { border: none; padding: 3px 0; text-align: left !important; }
  table.stack td[data-label]:not([data-label=""]) { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  table.stack td[data-label]:not([data-label=""])::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; flex: none; }
  table.stack td[data-label]:not([data-label=""]) > * { text-align: right; }
  table.stack td.stack-title { font-size: 1rem; padding-bottom: 6px; display: block; }
  table.stack td.stack-title::before { display: none; }
  table.stack td:empty { display: none; }
  table.stack td .btn { margin-top: 4px; }
  .card > .table-wrap table.stack td:first-child, .card > .table-wrap table.stack td:last-child { padding-left: 0; padding-right: 0; }
  .table-wrap:has(table.stack) { overflow: visible; }
}
@media (max-width: 380px) {
  .stat-row { gap: 8px; }
  .stat .num { font-size: 1.15rem; }
  .btn { padding: 8px 12px; }
  .cal-filters { gap: 4px 10px; }
}

/* Large screens: use the space. */
@media (min-width: 1600px) {
  .content { max-width: 1480px; }
}
.toolbar > .seg { min-width: 0; }
@media (max-width: 640px) {
  table.stack td { white-space: normal !important; }
  table.stack td > div[style*="display:flex"] { flex-wrap: wrap; }
}
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
td.actions-cell { text-align: right; }
@media (max-width: 640px) {
  .badge { white-space: normal; }
  table.stack td.actions-cell .row-actions { justify-content: flex-start; padding-top: 6px; }
}
@media (max-width: 640px) {
  table.stack td .cell-v { min-width: 0; text-align: right; }
  table.stack td[data-label]:not([data-label=""]) > .cell-v { flex: 1 1 auto; }
  .list li { flex-wrap: wrap; row-gap: 6px; }
  .list .main { flex: 1 1 calc(100% - 50px); }
  .list li > .badge, .list li > strong, .list li > button { margin-left: 46px; }
}

/* Help centre */
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.help-list li:first-child { border-top: 0; padding-top: 0; }
.help-steps { padding-left: 1.25em; margin: 0 0 16px; }
.help-steps li { margin: 0 0 8px; line-height: 1.55; }
.help-article p { line-height: 1.6; }
