:root {
  --bg: #f6f5f1; --surface: #ffffff; --ink: #16181d; --muted: #5d6270; --line: #e3e1da;
  --accent: #0f5c4a; --accent-soft: #e3efe9;
  --personal: #2f5fb3; --company: #c2552d; --inside: #8a6d1f;
  --good: #1d7a4f; --bad: #b3372b;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --surface: #1a1d23; --ink: #eceae4; --muted: #9ea3ad; --line: #2b2f37;
    --accent: #5cc2a3; --accent-soft: #1d2d28;
    --personal: #7fa6ec; --company: #ec8a63; --inside: #d8b45a;
    --good: #5cc28b; --bad: #ef7b6f;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 'IBM Plex Sans', system-ui, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.num, td, .card .big { font-variant-numeric: tabular-nums; }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.brand span { font-weight: 400; color: var(--muted); margin-left: 6px; }
nav { display: flex; gap: 18px; align-items: center; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--ink); }
.btn-sm { border: 1px solid var(--accent); color: var(--accent) !important; padding: 5px 12px; border-radius: 6px; font-weight: 500; }

.hero { padding: 56px 20px 28px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.02em; }
.lede { font-size: 17px; color: var(--muted); max-width: 760px; margin: 0 0 12px; }
.stamp { font-size: 13px; color: var(--muted); margin: 0; }

.grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; padding-bottom: 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.inputs { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.tag { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 10px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
input[type=number], select { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 13px; }
.check input { margin-top: 3px; }
.hint { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.reset { width: 100%; padding: 9px; font: inherit; font-size: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 7px; cursor: pointer; }
.reset:hover { border-color: var(--accent); }

.results { display: grid; gap: 16px; min-width: 0; }
.verdict { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; font-size: 16px; }
.verdict b { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; border-top: 3px solid var(--c); }
.card h3 { margin: 0 0 2px; font-size: 14px; }
.card .sub { font-size: 12px; color: var(--muted); margin: 0 0 10px; min-height: 2.6em; }
.card .big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.card .big small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 12px 0 0; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.best { font-size: 11px; font-weight: 600; background: var(--c); color: var(--surface); padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: 2px; }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel h2 { font-size: 15px; margin: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font: 11px 'IBM Plex Sans', sans-serif; fill: var(--muted); }
.buy { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; }
.buy div { border-left: 2px solid var(--line); padding-left: 10px; }
.buy dt { font-size: 12px; color: var(--muted); }
.buy dd { margin: 2px 0 0; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 5px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tr.total td { font-weight: 600; border-top: 2px solid var(--line); }
.neg { color: var(--bad); }
#rank tbody tr { cursor: pointer; }
#rank tbody tr:hover { background: var(--accent-soft); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: var(--surface); background: var(--c); }

.sec { font-size: 26px; margin: 40px 0 6px; letter-spacing: -.01em; }
.sec-lede { color: var(--muted); max-width: 780px; margin: 0 0 14px; }
.method .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.method h3 { font-size: 15px; margin: 18px 0 6px; }
.method ul { margin: 0; padding-left: 18px; color: var(--muted); }
.method li { margin-bottom: 6px; }
.sources li { color: var(--ink); }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 18px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .inputs { position: static; max-height: none; }
  .cards { grid-template-columns: 1fr; }
  .buy { grid-template-columns: 1fr 1fr; }
  .method .cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  nav a:not(.btn-sm) { display: none; }
  .three { grid-template-columns: 1fr 1fr; }
}
