/* VR Zone: dark sidebar, light work area */
:root {
  --ink: #10141a; --ink-2: #1a2029; --ink-line: #2a323e; --ink-text: #c9d1dc; --ink-mute: #7d8899;
  --bg: #f4f5f2; --panel: #ffffff; --line: #e1e3dd; --text: #161a1f; --mute: #646b74;
  --accent: #0e9f8f; --accent-soft: #d6f1ed; --accent-ink: #06574f;
  --warn: #b7791f; --bad: #c0392b; --good: #1f8a4c;
  --full: #d1495b; --part: #f2a7b0; --free: #eef0ea;
  --radius: 10px; --gap: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }

/* layout */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: var(--ink-text); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em; color: #fff; }
.brand b { font-size: 1.05rem; display: block; }
.brand small { color: var(--ink-mute); font-size: .78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-text); text-decoration: none; font-size: .93rem; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; border-top: 1px solid var(--ink-line); padding: 14px 8px 0; font-size: .82rem; color: var(--ink-mute); display: flex; flex-direction: column; gap: 8px; }
.side-foot button { background: none; border: 1px solid var(--ink-line); color: var(--ink-text); border-radius: 7px; padding: 6px 10px; cursor: pointer; font: inherit; }
.topbar { display: none; }
.main { padding: 28px max(16px, 3vw) 48px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head p { color: var(--mute); max-width: 75ch; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); font-weight: 600; }

/* blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sub { color: var(--mute); font-size: .86rem; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .label { font-size: .8rem; color: var(--mute); }
.tile .value { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .note { font-size: .8rem; color: var(--mute); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--free); color: var(--mute); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.bad { background: #f9dcdf; color: var(--bad); }
.pill.warn { background: #f8ecd4; color: var(--warn); }
.pill.good { background: #d9f0e2; color: var(--good); }
.notice { background: #fff8e6; border: 1px solid #f0dca8; border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; }
.notice.ok { background: var(--accent-soft); border-color: #9fdcd3; }
.pos { color: var(--good); } .neg { color: var(--bad); }
ul.plain { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--mute); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.sum td { font-weight: 700; border-top: 2px solid var(--text); }

/* heatmap */
.heat { display: grid; gap: 3px; font-size: .72rem; min-width: 560px; }
.heat .h { color: var(--mute); text-align: center; line-height: 1.2; padding-bottom: 4px; }
.heat .t { color: var(--mute); text-align: right; padding-right: 6px; align-self: center; }
.heat .c { height: 26px; border-radius: 4px; background: var(--free); display: grid; place-items: center; font-weight: 600; color: #fff; }
.heat .c.part { background: var(--part); color: var(--text); }
.heat .c.full { background: var(--full); }
.heat .c.none { background: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--mute); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; position: relative; }
.bar { flex: 1; min-width: 4px; background: var(--accent); border-radius: 3px 3px 0 0; position: relative; }
.bar.we { background: var(--accent-ink); }
.bar span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .65rem; color: var(--mute); }
.bar-axis { display: flex; gap: 3px; font-size: .66rem; color: var(--mute); }
.bar-axis span { flex: 1; text-align: center; min-width: 4px; overflow: hidden; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 8px; font-size: .85rem; }
.hbar .track { background: var(--free); border-radius: 4px; height: 14px; overflow: hidden; }
.hbar .fill { background: var(--accent); height: 100%; }

/* listings */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--mute); }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
input, select, textarea, button.btn { font: inherit; font-size: .9rem; }
input[type=number], input[type=text], input[type=email], input[type=password], select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; }
.btn.ghost { background: #fff; color: var(--accent-ink); border-color: var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.pand { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 16px; }
.pand-photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: var(--free); aspect-ratio: 4 / 3; }
.pand-photos img { width: 100%; height: 100%; object-fit: cover; flex: none; scroll-snap-align: start; }
.pand-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pand-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.price { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.score { font-weight: 700; font-size: .85rem; padding: 3px 9px; border-radius: 999px; background: var(--free); }
.score.hi { background: var(--accent); color: #fff; } .score.mid { background: var(--accent-soft); color: var(--accent-ink); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84rem; color: var(--mute); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pand form { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.pand form .row { display: flex; gap: 6px; }
.pand form select { flex: 1; }
.pand textarea { min-height: 54px; resize: vertical; }

/* forecast */
.scen { display: flex; gap: 6px; flex-wrap: wrap; }
.scen button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: .88rem; }
.scen button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 22px; }
.sliders label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: var(--mute); }
.sliders b { color: var(--text); font-variant-numeric: tabular-nums; }
.sliders input[type=range] { width: 100%; accent-color: var(--accent); }
.chart { width: 100%; min-height: 240px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 11px; fill: var(--mute); }
.tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.08); border-radius: 6px; padding: 5px 8px; font-size: .8rem; white-space: nowrap; }
details.more { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 16px; }
details.more summary { cursor: pointer; font-weight: 600; }
details.more[open] summary { margin-bottom: 10px; }

/* services */
.svc { display: flex; flex-direction: column; gap: 10px; }
.svc-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.svc dl { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: .88rem; }
.svc dt { color: var(--mute); }
.svc dd { margin: 0; }
.stars { color: var(--accent); letter-spacing: 1px; white-space: nowrap; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.auth .card { width: min(420px, 100%); gap: 14px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--mute); }
.error { color: var(--bad); font-size: .85rem; }
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 8px; width: fit-content; }
code.secret { font-family: var(--mono); font-size: .8rem; word-break: break-all; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
  .topbar button { background: none; border: 1px solid var(--ink-line); color: #fff; border-radius: 7px; padding: 6px 10px; font: inherit; }
  .main { padding-top: 18px; }
  .svc dl { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .tile .value { font-size: 1.45rem; }
  .svc dt { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
@media print { .side, .topbar, .filters, .pand form { display: none; } .app { display: block; } }
