:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #5b6474;
  --line: #e2e6ef;
  --accent: #1d4ed8;
  --accent-soft: #e8efff;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }

.site-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
nav a { text-decoration: none; }

.btn { display: inline-block; border-radius: 9px; padding: 9px 16px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }

.hero { padding: 40px 20px 18px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; max-width: 820px; }
.lead { font-size: 18px; color: var(--muted); max-width: 760px; margin: 0; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel h2 { font-size: 18px; margin: 0; }
.panel h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
label small { font-size: 12px; }
input, select { width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; font-size: 15px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid3 label, .grid2 label { margin-top: 0; }
.grid2 { margin-top: 8px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { white-space: nowrap; border: 0; background: #fff; padding: 6px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

.results h2 { margin-bottom: 10px; }
.tihi { display: flex; align-items: baseline; justify-content: space-between; background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
.tihi span { color: var(--muted); }
.tihi strong { font-size: 30px; color: var(--accent); }
#diagram { margin-top: 14px; }
#diagram svg { width: 100%; max-height: 300px; display: block; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.metrics { margin: 12px 0 0; display: grid; gap: 6px; }
.metrics div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.metrics dt { color: var(--muted); }
.metrics dd { margin: 0; font-weight: 700; }
.notes p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.notes .warn { color: var(--bad); }
.notes .tease { color: var(--accent); }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 9px; padding: 10px 12px; }

.install { margin-top: 18px; }
.cta { display: flex; align-items: center; gap: 18px; }
.cta h2 { margin-bottom: 6px; }
.cta p { margin: 0; color: var(--muted); font-size: 15px; }
.cta .btn { white-space: nowrap; }

.prose { margin-top: 36px; max-width: 820px; }
.prose h2 { font-size: 26px; margin: 0 0 10px; letter-spacing: -0.01em; }
.prose h3 { font-size: 19px; margin: 24px 0 6px; }
.prose li { margin-bottom: 8px; }
.prose table { border-collapse: collapse; width: 100%; background: #fff; border-radius: 10px; overflow: hidden; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }

.site-foot { margin-top: 48px; padding: 22px 0; border-top: 1px solid var(--line); background: #fff; font-size: 14px; }
.foot-row { display: flex; gap: 20px; color: var(--muted); }

@media (max-width: 760px) {
  .calc { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
  nav a:not(.btn) { display: none; }
}
