:root {
  --bg: #f4f6f9; --card: #fff; --ink: #14202e; --muted: #5b6878; --line: #e1e6ee;
  --navy: #16324f; --navy-2: #1f4a73; --flame: #e8742a; --flame-dark: #b9541a;
  --up: #b8321f; --down: #1d7a45; --good-bg: #e6f4ec; --bad-bg: #fbeae6; --neutral-bg: #eef2f7;
  --shadow: 0 1px 2px rgba(20,32,46,.06), 0 4px 16px rgba(20,32,46,.06);
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--navy-2); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

header.hero { background: radial-gradient(120% 140% at 85% 0%, #2b5d8c 0%, var(--navy) 55%, #0f2438 100%); color: #fff; padding: 22px 0 56px; }
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 18px; margin-bottom: 22px; }
.brand { color: #fff; text-decoration: none; font-weight: 750; letter-spacing: .01em; font-size: 15px; }
.topnav { display: flex; gap: 16px; font-size: 14px; }
.topnav a { color: #d7e3f0; text-decoration: none; }
.topnav a:hover { color: #fff; text-decoration: underline; }
.crumbs { font-size: 13px; color: #b9c9db; margin-bottom: 10px; }
.crumbs a { color: #d7e3f0; }
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.02em; }
.lede { font-size: 18px; opacity: .92; margin: 0; max-width: 640px; }

.price-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin-bottom: 22px; }
.price-big { font-size: clamp(52px, 11vw, 84px); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff; }
.price-big small { font-size: .32em; font-weight: 600; opacity: .8; margin-left: 4px; letter-spacing: 0; }
.price-meta { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: #d7e3f0; }
.price-meta b { color: #fff; }
.chg { display: inline-block; align-self: flex-start; font-size: 13px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; }
.chg.up, .chg.down, .chg.flat { color: #fff; }
.chg.up::first-letter { color: #ffb4a6; }
.chg.down::first-letter { color: #9fe3b8; }

.finder { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.22); max-width: 680px; }
.finder-row { display: flex; gap: 10px; flex-wrap: wrap; }
.finder input, .finder select, .finder button { font: inherit; font-size: 16px; border-radius: 10px; padding: 11px 13px; border: 1.5px solid #cfd7e2; background: #fff; color: var(--ink); }
.finder input { flex: 1 1 120px; min-width: 0; }
.finder select { flex: 2 1 180px; min-width: 0; }
.finder input:focus, .finder select:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(232,116,42,.2); }
.btn, .finder .btn { background: var(--flame); color: #fff; border: 0 !important; font-weight: 700; cursor: pointer; }
.btn:hover, .finder .btn:hover { background: var(--flame-dark); }
.msg { font-size: 14px; color: var(--up); }
.msg:not(:empty) { margin-top: 10px; }

main { margin-top: -26px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
h2 { font-size: clamp(20px, 3vw, 25px); margin: 0 0 6px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 14px; }
.source { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.xlink { margin: 0 0 20px; padding: 0 4px; }

.verdict { position: relative; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--shadow); background: var(--neutral-bg); border-left: 5px solid var(--navy-2); }
.verdict.good { background: var(--good-bg); border-left-color: var(--down); }
.verdict.bad { background: var(--bad-bg); border-left-color: var(--up); }
.verdict > b:first-child { display: block; font-size: 18px; margin-bottom: 2px; }

.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 12px; }
.fact { font-size: 14px; color: var(--muted); }
.fact b { display: block; color: var(--ink); font-size: 19px; }

.chart { margin: 8px 0 0; }
.chart figcaption { font-weight: 650; font-size: 15px; margin-bottom: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.k { display: inline-block; width: 20px; height: 0; border-top: 3px solid; }
.k.cur { border-color: var(--flame); }
.k.last { border-color: #9aa7b6; }
.k.avg { border-color: var(--navy-2); border-top-style: dashed; border-top-width: 2px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ylab { font-size: 12px; fill: var(--muted); text-anchor: end; }
.chart .xlab { font-size: 12px; fill: var(--muted); text-anchor: start; }
.chart .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.cur { stroke: var(--flame); stroke-width: 3.5; }
.chart .ln.last { stroke: #9aa7b6; stroke-width: 2; }
.chart .ln.avg { stroke: var(--navy-2); stroke-width: 2; stroke-dasharray: 6 5; }
.chart .dot-cur { fill: var(--flame); stroke: #fff; stroke-width: 2; }

.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 13px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; }
.tbl tbody tr:hover { background: #f8fafc; }
.sortable th { cursor: pointer; user-select: none; }
.sortable th:hover { color: var(--ink); }
.up { color: var(--up); }
.down { color: var(--down); }

.calc { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 14px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; flex: 1 1 150px; }
.calc select, .calc input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #cfd7e2; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
.inp { position: relative; display: flex; align-items: center; }
.inp i { font-style: normal; color: var(--muted); position: absolute; pointer-events: none; }
.inp i:first-child { left: 12px; }
.inp i:last-child { right: 12px; }
.inp i:first-child + input { padding-left: 26px; }
.calc-out { display: flex; flex-wrap: wrap; gap: 12px 40px; background: var(--neutral-bg); border-radius: 12px; padding: 14px 18px; }
.calc-out .big { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc-out .lbl { font-size: 13px; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin: 8px 0 2px; color: #2d3a49; }
.prose h2 { margin-top: 18px; }
.prose h2:first-child { margin-top: 0; }

footer { font-size: 13px; color: var(--muted); padding: 10px 16px 40px; }
footer a { color: var(--muted); }

@media (max-width: 560px) {
  .panel { padding: 16px; }
  .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 7px 6px; }
  .chart .ylab, .chart .xlab { font-size: 24px; }
  .price-hero { margin-bottom: 18px; }
}
