:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede5;
  --text: #1b1f1e;
  --muted: #646b68;
  --border: #e3ddd1;
  --nav: #0f2e2b;
  --nav-text: #bcd3cf;
  --nav-active: #1c4642;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-ink: #ffffff;
  --brand-soft: #d5f3ee;
  --accent: #e07a35;
  --accent-soft: #fcebdc;
  --pos: #15803d;
  --neg: #b42318;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --info-soft: #e3f3f0;
  --info: #115e59;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 1px 3px rgba(28, 25, 23, .07);
  --shadow-lg: 0 10px 30px rgba(15, 46, 43, .12);
  --radius: 14px;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1514; --surface: #12201e; --surface-2: #1a2c29; --text: #e8efed; --muted: #94a9a5;
    --border: #25403b; --nav: #071110; --nav-text: #b9cfcb; --nav-active: #17332f; --brand: #14a394; --brand-hover: #0f8f82; --brand-soft: #12382f;
    --accent: #f29a5c; --accent-soft: #3a2616; --pos: #4ade80; --neg: #f87171; --warn: #fbbf24; --warn-soft: #3b2d0b;
    --info-soft: #123532; --info: #99e0d6; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1514; --surface: #12201e; --surface-2: #1a2c29; --text: #e8efed; --muted: #94a9a5;
  --border: #25403b; --nav: #071110; --nav-text: #b9cfcb; --nav-active: #17332f; --brand: #14a394; --brand-hover: #0f8f82; --brand-soft: #12382f;
  --accent: #f29a5c; --accent-soft: #3a2616; --pos: #4ade80; --neg: #f87171; --warn: #fbbf24; --warn-soft: #3b2d0b;
  --info-soft: #123532; --info: #99e0d6; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 232px; flex: none;
  background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; padding: 18px 12px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 18px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #c8571c); display: grid; place-items: center; font-size: .8rem; color: #fff; }
.logo small { display: block; font-size: .7rem; font-weight: 500; color: var(--nav-text); letter-spacing: 0; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--nav-text); text-decoration: none; font-weight: 500; font-size: .92rem;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: var(--nav-active); color: #fff; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: #fff; background: rgba(255, 255, 255, .05); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.sidebar-user .small { color: var(--nav-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }

.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; flex: 1; min-width: 180px; }

.tabbar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    background: var(--nav); color: #fff; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  }
  .topbar .logo { padding: 0; font-size: 1.05rem; flex: 1; }
  .topbar .logo-mark { width: 30px; height: 30px; }
  .topbar .icon-btn { color: #fff; }
  .page { padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--brand); }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-deals { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; }
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 9px 14px; border-radius: 9px; font: inherit; font-weight: 600;
  font-size: .9rem; cursor: pointer; text-decoration: none; min-height: 40px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-dark { background: var(--nav); border-color: var(--nav); color: #fff; }
.btn-dark:hover { background: var(--nav-active); }
.btn-danger { color: var(--neg); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--text); }
.chip-btn.active { background: var(--nav); border-color: var(--nav); color: #fff; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.badge-green { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.badge-amber { background: var(--warn-soft); color: var(--warn); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-gray { background: var(--surface-2); color: var(--muted); }

.search { display: flex; gap: 8px; flex: 1; min-width: 240px; max-width: 460px; }
.search input { flex: 1; }

label.field { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; min-height: 42px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: .92rem; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* Deal card */
.deal { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.deal:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, .12); }
.deal-photo { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.deal-photo img, .deal-photo svg.ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.deal-photo .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.deal-photo .badge { box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.deal-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.deal-price { display: flex; align-items: center; justify-content: space-between; font-size: 1.2rem; font-weight: 800; }
.deal-addr { font-size: .85rem; color: var(--muted); }
.deal-cf { font-size: .88rem; font-weight: 600; }
.deal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.heart { border: 0; background: none; cursor: pointer; padding: 4px; color: var(--muted); display: grid; }
.heart svg { width: 22px; height: 22px; }
.heart.on { color: #e11d48; }
.heart.on svg { fill: currentColor; }

/* Metric list */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.metric { background: var(--surface); padding: 12px 14px; }
.metric .label { font-size: .75rem; color: var(--muted); font-weight: 600; }
.metric .value { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tables / lists */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

.tabs { scrollbar-width: none; display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty > svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: .88rem; margin-bottom: 16px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 50px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sheet / modal */
.overlay { position: fixed; inset: 0; background: rgba(7, 20, 18, .5); z-index: 50; display: flex; justify-content: flex-end; }
.sheet { background: var(--surface); width: min(440px, 100%); height: 100%; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; animation: slideIn .18s ease-out; }
.overlay.center { align-items: center; justify-content: center; padding: 16px; }
.overlay.center .sheet { height: auto; max-height: 90vh; border-radius: 16px; width: min(560px, 100%); animation: pop .15s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; }
@media (max-width: 900px) {
  .overlay, .overlay.center { align-items: flex-end; justify-content: center; padding: 0; }
  .sheet, .overlay.center .sheet { width: 100%; height: auto; max-height: 92vh; border-radius: 18px 18px 0 0; animation: slideUp .2s ease-out; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--nav); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 80; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); }
@media (min-width: 901px) { .toast { bottom: 24px; } }
.toast.err { background: #b91c1c; }

/* Landing */
.hero { background: radial-gradient(circle at 85% 20%, rgba(224, 122, 53, .35), transparent 45%), linear-gradient(135deg, var(--nav), #14504a); color: #fff; border-radius: 18px; padding: 42px 32px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 720px; letter-spacing: -.02em; }
.hero p { color: #cfe3df; max-width: 620px; font-size: 1.05rem; }
.hero .row { margin-top: 18px; }
.feature svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 8px; }
@media (max-width: 600px) { .hero { padding: 28px 20px; } }

.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment { padding: 12px 0; border-top: 1px solid var(--border); }
details.card summary { cursor: pointer; padding: 14px 18px; font-weight: 700; }
details.card[open] summary { border-bottom: 1px solid var(--border); }
.calc-out .value { font-size: 1.25rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- County Profitability Map ---------- */
:root { --cf-1: #f4a6a6; --cf-2: #f6ad55; --cf-3: #f3d64e; --cf-4: #7fd39a; --cf-5: #22975a; --cf-none: #cfd6e1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cf-1: #b85c5c; --cf-2: #c7802f; --cf-3: #c4a92c; --cf-4: #4da36c; --cf-5: #1f7a4a; --cf-none: #3a4560; }
}
:root[data-theme="dark"] { --cf-1: #b85c5c; --cf-2: #c7802f; --cf-3: #c4a92c; --cf-4: #4da36c; --cf-5: #1f7a4a; --cf-none: #3a4560; }
.cf-1 { fill: var(--cf-1); background: var(--cf-1); } .cf-2 { fill: var(--cf-2); background: var(--cf-2); }
.cf-3 { fill: var(--cf-3); background: var(--cf-3); } .cf-4 { fill: var(--cf-4); background: var(--cf-4); }
.cf-5 { fill: var(--cf-5); background: var(--cf-5); } .cf-none { fill: var(--cf-none); background: var(--cf-none); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: .85rem; padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--nav); color: #fff; }

.cm-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cm-search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.cm-search input { width: 100%; padding-left: 36px; }
.cm-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.cm-search-icon svg { width: 17px; height: 17px; }
.cm-results { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; right: 0; padding: 4px; max-height: 320px; overflow-y: auto; }
.cm-results button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: .9rem; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text); }
.cm-results button:hover, .cm-results button:focus-visible { background: var(--surface-2); }
.cm-results button .muted { margin-left: auto; }
.cm-beds { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.cm-beds select { width: auto; }

.cm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cm-mapcard { position: relative; padding: 10px 10px 8px; overflow: hidden; }
#cm-svg { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; user-select: none; }
#cm-svg:active { cursor: grabbing; }
#cm-counties path { stroke: var(--surface); stroke-width: .3; vector-effect: non-scaling-stroke; cursor: pointer; }
#cm-counties path:hover { stroke: var(--text); stroke-width: 1.2; }
.cm-states { fill: none; stroke: var(--surface); stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.cm-nation { fill: none; stroke: var(--muted); stroke-width: .6; vector-effect: non-scaling-stroke; pointer-events: none; opacity: .5; }
#cm-sel path { fill: none; stroke: var(--text); stroke-width: 2.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.cm-zoom { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 2px; background: var(--surface); border-radius: 9px; border: 1px solid var(--border); }
.cm-zoom .icon-btn svg { width: 18px; height: 18px; }
.cm-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--nav); color: #fff; font-size: .8rem; padding: 6px 10px; border-radius: 7px; white-space: nowrap; box-shadow: var(--shadow); }
.cm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 6px 2px; font-size: .78rem; color: var(--muted); }
.cm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cm-legend i, .cm-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: none; }
.cm-dot { margin-right: 8px; vertical-align: -1px; }
.cm-foot { margin-top: 10px; }

.cm-listbar { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cm-listbar select { width: auto; }
.cm-table th { white-space: nowrap; }
.cm-sort { border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 0; }
.cm-table tr.sel td, .cm-mini tr.sel td { background: var(--brand-soft); }
.cm-table td { white-space: nowrap; }
.cm-more { padding: 12px; text-align: center; }
.cm-more:empty { display: none; }

.cm-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px; }
.cm-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cm-panel-head h2 { margin: 0; flex: 1; font-size: 1.1rem; }
.cm-metrics { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.cm-metrics .value { font-size: 1rem; }
.cm-cf { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 12px; border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; font-weight: 600; font-size: .88rem; }
.cm-cf b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.cm-th { margin: 16px 0 6px; font-size: .95rem; }
.cm-mini { font-size: .88rem; }
.cm-mini th { text-align: left; font-size: .75rem; color: var(--muted); }
.cm-mini th.num, .cm-mini td.num { text-align: right; }
@media (max-width: 1100px) {
  .cm-layout { grid-template-columns: 1fr; }
  .cm-panel { position: static; max-height: none; }
}
.page:has(.cm-layout) { max-width: 1680px; }

/* ---------- Inspection checklist ---------- */
.ck-hero { display: flex; gap: 28px; align-items: center; padding: 28px; margin-bottom: 14px; overflow: hidden; position: relative;
  background: radial-gradient(circle at 100% 0%, var(--accent-soft), transparent 55%), var(--surface); }
.ck-hero h1 { margin: 2px 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.ck-hero p { color: var(--muted); max-width: 560px; }
.ck-eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ck-hero-body { flex: 1; min-width: 0; }
.ck-status { font-size: .92rem; margin: 4px 0 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ck-actions { gap: 8px; }
.ck-ring { position: relative; width: 132px; height: 132px; flex: none; }
.ck-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ck-ring circle { fill: none; stroke-width: 11; }
.ck-ring-bg { stroke: var(--surface-2); }
.ck-ring-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ck-ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ck-ring-label b { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ck-ring-label span { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.ck-tip { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px;
  background: var(--accent-soft); border-left: 4px solid var(--accent); font-size: .88rem; }
.ck-tip b { color: var(--accent); white-space: nowrap; }

.ck-grid { columns: 340px 3; column-gap: 16px; }
.ck-sec { display: block; overflow: hidden; transition: border-color .2s; break-inside: avoid; margin-bottom: 16px; }
.ck-sec summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.ck-sec summary::-webkit-details-marker { display: none; }
.ck-sec[open] summary { border-bottom: 1px solid var(--border); }
.ck-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.ck-icon svg { width: 21px; height: 21px; }
.ck-sec-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ck-sec-meta { display: flex; align-items: center; gap: 10px; }
.ck-mini { flex: 1; max-width: 160px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ck-mini span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 3px; transition: width .3s ease; }
.ck-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; flex: none; }
.ck-sec[open] .ck-chev { transform: rotate(180deg); }
.ck-sec.complete { border-color: color-mix(in srgb, var(--pos) 45%, var(--border)); }
.ck-sec.complete .ck-icon { background: color-mix(in srgb, var(--pos) 15%, transparent); color: var(--pos); }
.ck-sec.complete .ck-mini span { background: var(--pos); }
.ck-sec ul { list-style: none; margin: 0; padding: 6px 8px; }
.ck-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; border-radius: 9px; cursor: pointer; font-size: .92rem; }
.ck-item:hover { background: var(--surface-2); }
.ck-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ck-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border); flex: none; display: grid; place-items: center; background: var(--surface); transition: background .15s, border-color .15s; margin-top: 1px; }
.ck-box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.ck-item input:checked + .ck-box { background: var(--brand); border-color: var(--brand); }
.ck-item input:checked + .ck-box svg { opacity: 1; transform: none; }
.ck-item input:checked ~ .ck-text { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.ck-item input:focus-visible + .ck-box { outline: 2px solid var(--brand); outline-offset: 2px; }
.ck-grid.only-open li:has(input:checked) { display: none; }
.ck-sec-foot { padding: 4px 16px 14px; display: flex; justify-content: flex-end; }
@media (max-width: 700px) {
  .ck-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .ck-ring { width: 104px; height: 104px; }
  .ck-grid { columns: 1; }
}
@media print {
  .sidebar, .topbar, .tabbar, .ck-actions, .ck-sec-foot, .ck-chev, .ck-tip { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  .ck-grid { columns: 1; }
  .ck-sec { break-inside: avoid; margin-bottom: 10px; }
  .ck-sec[hidden] { display: block !important; }
  .ck-grid.only-open li { display: list-item !important; }
}

/* ---------- Sign in / create account ---------- */
body.auth-mode .sidebar, body.auth-mode .topbar, body.auth-mode .tabbar { display: none; }
body.auth-mode .page { max-width: none; padding: 0; }
.auth { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; min-height: 100vh; }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 32px; padding: 36px 44px; color: #fff;
  background: radial-gradient(circle at 90% 8%, rgba(224, 122, 53, .45), transparent 42%), radial-gradient(circle at 0% 100%, rgba(20, 163, 148, .35), transparent 50%), linear-gradient(160deg, var(--nav), #14504a); }
.auth-brand .logo { padding: 0; }
.auth-pitch { margin: auto 0; }
.auth-pitch h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); letter-spacing: -.02em; line-height: 1.15; max-width: 420px; margin-bottom: 26px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.auth-pitch li { display: flex; gap: 14px; align-items: flex-start; }
.auth-pitch li svg { width: 22px; height: 22px; flex: none; padding: 9px; box-sizing: content-box; border-radius: 11px; background: rgba(255, 255, 255, .1); color: #f6b07c; }
.auth-pitch li b { display: block; font-size: .98rem; }
.auth-pitch li span { color: #cfe3df; font-size: .9rem; }
.auth-pitch li span b { color: #fff; }
.auth-foot { color: #9fc4be; font-size: .85rem; margin: 0; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 1.7rem; letter-spacing: -.02em; margin: 22px 0 4px; }
.auth-card > .muted { margin-bottom: 18px; }
.auth-tabs { display: flex; width: 100%; }
.auth-tabs a { flex: 1; text-align: center; text-decoration: none; padding: 9px 12px; border-radius: 7px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.auth-tabs a.active { background: var(--nav); color: #fff; }
.auth-form { display: grid; gap: 14px; }
.auth-form label.field input, .auth-form label.field select { margin-top: 6px; min-height: 46px; font-size: 1rem; }
.auth-row { display: grid; grid-template-columns: 1fr 96px; gap: 12px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; width: 100%; }
.pw-toggle { position: absolute; right: 4px; top: calc(50% + 3px); transform: translateY(-50%); border: 0; background: none; padding: 8px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; }
.pw-toggle:hover { background: var(--surface-2); }
.pw-toggle[aria-pressed="true"] { color: var(--brand); }
.pw-toggle svg { width: 20px; height: 20px; }
.auth-submit { min-height: 48px; font-size: 1rem; margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 18px; }
.auth-switch a, .auth-card .notice a { color: var(--brand); font-weight: 600; }
.auth-mobile-logo { display: none; color: var(--text); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { place-items: start center; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); }
  .auth-mobile-logo { display: flex; padding: 0 0 18px; }
  .auth-mobile-logo small { display: none; }
}
