:root {
  --slate: #1e293b;
  --slate-2: #0f172a;
  --slate-3: #334155;
  --orange: #f97316;
  --orange-hover: #ea580c;
  --orange-ink: #c2410c;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --ink: #0f172a;
  --muted: #475569;
  --soft: #f1f5f9;
  --focus: #f97316;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange-ink); text-underline-offset: 2px; }
a:hover { color: var(--orange-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* header */
header.site { background: var(--slate); color: #fff; border-bottom: 1px solid var(--slate-3); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(15, 23, 42, .25); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; line-height: 1.1; }
.brand:hover { color: #fff; }
.logo { width: 40px; height: 40px; border-radius: 10px; background: var(--orange); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(249, 115, 22, .25); flex: none; }
.logo svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.brand small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); margin-top: 2px; }
nav.top { display: flex; gap: 6px; }
nav.top a { color: #cbd5e1; text-decoration: none; font-size: .9rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
nav.top a:hover { color: #fff; background: var(--slate-3); }

main { padding: 28px 0 56px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 8px 0 12px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; line-height: 1.25; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: 1.1rem; margin: 22px 0 6px; }
.lead { color: var(--muted); font-size: 1.05rem; margin-top: 0; max-width: 760px; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 0; }
.crumbs a { color: var(--muted); }

/* hero (home) */
.hero { background: linear-gradient(180deg, var(--slate) 0%, var(--slate-2) 100%); color: #fff; padding: 40px 0 72px; margin: 0 0 32px; text-align: center; }
.hero .badge { display: inline-block; background: rgba(249, 115, 22, .1); border: 1px solid rgba(249, 115, 22, .3); color: var(--orange); padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; margin: 16px auto 12px; max-width: 800px; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero p { color: #cbd5e1; max-width: 640px; margin: 0 auto; }
.ticks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 20px 0 0; padding: 0; list-style: none; font-size: .85rem; color: #94a3b8; font-weight: 500; }
.ticks li::before { content: "\2713"; color: var(--orange); font-weight: 800; margin-right: 6px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 24px 0; overflow: hidden; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.calc-bar { background: var(--slate-2); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--slate); }
.calc-bar .ttl { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.calc-bar .ico { width: 36px; height: 36px; border-radius: 9px; background: var(--orange); display: grid; place-items: center; flex: none; }
.calc-bar .ico svg { width: 20px; height: 20px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; color: #34d399; background: rgba(6, 78, 59, .6); border: 1px solid #065f46; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; }

#calc { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { #calc { grid-template-columns: 7fr 5fr; } }
.calc-form { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 24px; align-content: start; }
@media (min-width: 560px) { .calc-form { grid-template-columns: 1fr 1fr; } }
.field[hidden] { display: none; }
.field label { display: block; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #334155; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  min-height: 46px;
}
.field input:focus, .field select:focus { border-color: var(--orange); background: #fff; outline: none; box-shadow: 0 0 0 1px var(--orange); }
.dim { display: flex; gap: 8px; }
.dim input { flex: 1 1 55%; min-width: 0; }
.dim select { flex: 1 1 45%; min-width: 0; }
.dim.prefixed { align-items: center; }
.dim.prefixed .prefix { color: #64748b; font-weight: 700; }
.hint { margin: 5px 0 0; font-size: .78rem; color: #64748b; line-height: 1.4; }

/* results panel */
.calc-out { background: var(--slate-2); color: #fff; padding: 24px; position: relative; }
.calc-out .placeholder { color: #94a3b8; margin: 0; }
.headline { background: rgba(30, 41, 59, .9); border: 1px solid #334155; border-radius: 16px; padding: 20px; margin-bottom: 18px; text-align: center; }
.hl-label { display: block; font-size: .72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.hl-value { font-size: clamp(2.4rem, 7vw, 3.2rem); font-weight: 900; line-height: 1.1; color: var(--orange); margin-right: 8px; font-variant-numeric: tabular-nums; }
.hl-unit { font-size: 1.05rem; font-weight: 700; color: #e2e8f0; }
table.results { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.results th, table.results td { text-align: left; padding: 9px 12px; vertical-align: top; background: rgba(30, 41, 59, .6); }
table.results th { font-weight: 500; font-size: .85rem; width: 46%; color: #cbd5e1; border-radius: 8px 0 0 8px; }
table.results td { border-radius: 0 8px 8px 0; }
table.results tr.strong th { color: #fff; font-weight: 700; }
table.results .val { font-weight: 700; display: block; color: #fff; font-variant-numeric: tabular-nums; }
table.results tr.strong .val { color: var(--orange); }
table.results .note { display: block; color: #94a3b8; font-size: .78rem; line-height: 1.35; }

/* content tables */
table.data { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; background: #fff; border-radius: 10px; overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
table.data th { background: var(--slate); color: #fff; font-weight: 600; }
table.data td .hint { color: var(--muted); }

.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--orange); box-shadow: 0 8px 20px rgba(15, 23, 42, .08); color: var(--ink); }
.tile .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tile .ti { width: 46px; height: 46px; border-radius: 12px; background: var(--soft); color: #334155; display: grid; place-items: center; transition: background .15s, color .15s; }
.tile:hover .ti { background: #fff7ed; color: var(--orange-hover); }
.tile .ti svg { width: 24px; height: 24px; }
.tile .tag { font-size: .7rem; font-weight: 600; color: #64748b; background: var(--soft); padding: 3px 8px; border-radius: 6px; }
.tile strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.tile:hover strong { color: var(--orange-ink); }
.tile span.d { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.tile .open { border-top: 1px solid var(--soft); padding-top: 12px; font-size: .8rem; font-weight: 700; color: var(--orange-ink); }

.refs { background: linear-gradient(135deg, var(--slate-2), var(--slate)); color: #fff; border-radius: 16px; padding: 28px; margin-top: 44px; }
.refs .eyebrow { color: var(--orange); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.refs h2 { color: #fff; margin: 4px 0 18px; }
.refs .grid { gap: 14px; }
.refs .ref { background: rgba(30, 41, 59, .7); border: 1px solid #334155; border-radius: 12px; padding: 16px; font-size: .9rem; color: #cbd5e1; }
.refs .ref b { display: block; color: var(--orange); margin-bottom: 6px; }
.refs .ref strong { color: #fff; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }
.note-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius); padding: 12px 16px; font-size: .95rem; }
.ad-slot { min-height: 100px; margin: 20px 0; text-align: center; }
.ad-slot:empty { display: none; }
footer.site { background: var(--slate); border-top: 1px solid var(--slate-3); padding: 28px 0 40px; color: #94a3b8; font-size: .85rem; }
footer.site a { color: #cbd5e1; margin-right: 18px; text-decoration: none; }
footer.site a:hover { color: var(--orange); }
.disclaimer { font-size: .82rem; color: #64748b; }
@media print { header.site, footer.site, .live { display: none !important; } .calc-out { background: #fff; color: #000; } }
main.has-hero { padding-top: 0; }
main.has-hero .wrap > h2:first-child { margin-top: 0; }
main.has-hero .grid { position: relative; }

nav.top a { white-space: nowrap; }
@media (max-width: 480px) { nav.top a:first-child { display: none; } .brand b { font-size: 1rem; } }
