:root {
  color-scheme: dark;
  --bg: #07090b;
  --surface: #101317;
  --surface-2: #15191e;
  --surface-3: #1b2026;
  --line: #2b3139;
  --line-soft: #20262d;
  --text: #f6f4ef;
  --muted: #aeb5bd;
  --muted-2: #7f8994;
  --orange: #ff6b1a;
  --orange-light: #ff9a5f;
  --green: #53d39d;
  --red: #ff7777;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --shell: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 11% 0%, rgba(255, 107, 26, 0.14), transparent 24rem),
    linear-gradient(180deg, #080b0e 0%, var(--bg) 70%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(7, 9, 11, .86);
  backdrop-filter: blur(20px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--orange);
  color: #111316;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.1; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: flex; margin-left: auto; gap: 8px; }
.main-nav a { padding: 10px 13px; border-radius: 10px; color: var(--muted); font-size: 14px; text-decoration: none; }
.main-nav a:hover, .main-nav a:focus-visible { background: var(--surface-2); color: var(--text); }
.rule-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.rule-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(83, 211, 157, .1); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; padding-block: 76px 52px; }
.eyebrow, .step-label { margin: 0 0 12px; color: var(--orange-light); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 {
  max-width: 950px;
  margin: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  font-size: clamp(42px, 6.2vw, 88px);
  line-height: .98;
  letter-spacing: -.06em;
}
.hero-copy {
  max-width: 800px;
  margin: 28px 0 0;
  overflow-wrap: anywhere;
  hyphens: auto;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
}
.hero-facts { display: grid; gap: 10px; padding-bottom: 6px; }
.hero-facts span { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.hero-facts span::before { content: ""; width: 7px; height: 7px; border: 2px solid var(--green); border-radius: 50%; }

.calculator-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); align-items: start; overflow: clip; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
.input-panel, .result-panel { min-width: 0; }
.input-panel { padding: 34px; }
.result-panel { border-left: 1px solid var(--line); background: #0c0f12; }
.result-sticky { position: sticky; top: 96px; padding: 34px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.panel-heading h2 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; }
.text-button, .icon-button { min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.text-button { padding: 9px 13px; font-size: 12px; }
.icon-button { padding: 9px 14px; color: var(--text); }
.text-button:hover, .icon-button:hover { border-color: #59626e; color: var(--text); }

form { display: grid; gap: 26px; }
.calc-section { min-width: 0; margin: 0; padding: 26px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-2); }
.calc-section legend { padding: 0 12px 0 0; color: var(--text); font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.calc-section legend span { display: inline-grid; width: 30px; height: 30px; margin-right: 9px; place-items: center; border-radius: 9px; background: rgba(255,107,26,.13); color: var(--orange-light); font-size: 11px; }
.field-grid { display: grid; gap: 18px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field.full, .check-card.full { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.field small { margin-top: -5px; color: var(--muted-2); font-size: 11px; font-weight: 450; }
input, select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #353c45;
  border-radius: 12px;
  outline: none;
  background: #0c0f12;
  color: var(--text);
  padding: 0 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,26,.14); }
.input-with-unit { position: relative; display: block; }
.input-with-unit input { padding-right: 78px; }
.input-with-unit b { position: absolute; right: 14px; top: 50%; max-width: 66px; overflow: hidden; color: var(--muted-2); font-size: 11px; transform: translateY(-50%); white-space: nowrap; }
.subsection { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.subsection h3 { margin: 0 0 16px; font-size: 14px; }
.check-card { display: flex; min-height: 76px; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #353c45; border-radius: 12px; background: #0c0f12; cursor: pointer; }
.check-card input { flex: 0 0 auto; width: 20px; min-height: 20px; height: 20px; accent-color: var(--orange); }
.check-card b, .check-card small { display: block; }
.check-card b { font-size: 13px; }
.check-card small { margin-top: 4px; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.status-line { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: rgba(83,211,157,.07); color: var(--muted); font-size: 12px; }
.status-line strong { max-width: 58%; color: var(--green); text-align: right; }
.inline-note { margin: 20px 0 0; padding: 14px; border: 1px solid rgba(255,154,95,.24); border-radius: 12px; background: rgba(255,107,26,.07); color: #dfc1af; font-size: 12px; }
.advanced { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.advanced summary { margin-bottom: 18px; color: var(--orange-light); font-size: 13px; font-weight: 700; cursor: pointer; }

.result-heading { margin-bottom: 20px; }
.grant-hero { padding: 25px; border: 1px solid rgba(255,107,26,.3); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,107,26,.19), rgba(255,107,26,.045)); }
.grant-hero > span { color: #f3c5aa; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.grant-hero > strong { display: block; margin-top: 4px; font-size: clamp(43px, 5vw, 68px); line-height: 1; letter-spacing: -.055em; }
.grant-hero p { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.grant-hero p b { color: var(--orange-light); }
.share-track { display: flex; height: 8px; margin-top: 22px; overflow: hidden; border-radius: 20px; background: var(--surface-3); }
.share-track span { background: var(--orange); }
.share-track i { background: #4a535e; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line-soft); border-radius: 15px; background: var(--surface); }
.kpi-grid span, .kpi-grid small { display: block; color: var(--muted-2); font-size: 10px; line-height: 1.35; }
.kpi-grid strong { display: block; margin: 6px 0 3px; overflow-wrap: anywhere; font-size: clamp(17px, 2vw, 24px); line-height: 1.12; letter-spacing: -.035em; }
.kpi-grid article.is-negative strong { color: var(--red); }
.breakdown-card, .economy-card, .projection-card { margin-top: 10px; padding: 20px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--surface); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-title h3, .projection-card h3 { margin: 0; font-size: 14px; }
.section-title > span { color: var(--orange-light); font-size: 11px; }
dl { margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 12px; }
dl dt { color: var(--muted); }
dl dd { margin: 0; font-weight: 750; text-align: right; }
.cost-row + .cost-row { margin-top: 16px; }
.cost-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.cost-row strong { color: var(--text); }
.cost-track { height: 8px; overflow: hidden; border-radius: 10px; background: var(--surface-3); }
.cost-track i { display: block; height: 100%; border-radius: inherit; background: #737e8a; }
.cost-row.future .cost-track i { background: var(--green); }
.micro { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.micro span { padding: 5px 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 9px; }
.micro-note { margin: 10px 0 0; color: var(--muted-2); font-size: 9px; }
.projection-card div { display: flex; justify-content: space-between; gap: 15px; padding-top: 10px; color: var(--muted); font-size: 12px; }
.projection-card strong { color: var(--text); }
.warning-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.warning-list li { position: relative; padding: 11px 12px 11px 30px; border: 1px solid rgba(255,154,95,.17); border-radius: 10px; background: rgba(255,107,26,.045); color: #c9b4a8; font-size: 10px; }
.warning-list li::before { content: "i"; position: absolute; left: 11px; top: 11px; display: grid; width: 12px; height: 12px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 8px; font-weight: 800; }

.source-section { padding-block: 96px; }
.source-section > div:first-child { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.source-section h2 { max-width: 720px; margin: 0; font-size: clamp(32px, 5vw, 60px); line-height: 1.03; letter-spacing: -.05em; }
.source-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.source-grid article { min-height: 220px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.source-grid article > span { color: var(--orange-light); font-size: 26px; font-weight: 850; letter-spacing: -.04em; }
.source-grid h3 { margin: 38px 0 8px; font-size: 16px; }
.source-grid p { margin: 0; color: var(--muted); font-size: 12px; }
.official-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.official-links h3 { margin: 0 auto 0 0; font-size: 13px; }
.official-links a { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-decoration: none; }
.official-links a:hover { color: var(--text); }
.legal-note { margin: 18px 0 0; color: var(--muted-2); font-size: 11px; }

.site-footer { border-top: 1px solid var(--line-soft); background: #060809; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding-block: 34px; }
.footer-inner strong { font-size: 14px; }
.footer-inner p { margin: 5px 0 0; color: var(--muted-2); font-size: 11px; }
.footer-inner nav { display: flex; align-items: center; gap: 18px; }
.footer-inner a { color: var(--muted); font-size: 12px; text-decoration: none; }
.footer-inner a:hover { color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: repeat(3, auto); justify-content: start; }
  .calculator-shell { grid-template-columns: 1fr; }
  .result-panel { border-top: 1px solid var(--line); border-left: 0; }
  .result-sticky { position: static; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .header-inner { min-height: 66px; gap: 15px; }
  .main-nav { display: none; }
  .rule-badge { margin-left: auto; font-size: 10px; }
  .hero { padding-block: 48px 32px; }
  h1 { font-size: clamp(40px, 13vw, 62px); }
  .hero-copy { margin-top: 20px; font-size: 16px; }
  .hero-facts { grid-template-columns: 1fr; }
  .calculator-shell { border-radius: 22px; }
  .input-panel, .result-sticky { padding: 18px; }
  .panel-heading { align-items: center; margin-bottom: 20px; }
  .panel-heading h2 { font-size: 27px; }
  .calc-section { padding: 18px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .field.full, .check-card.full { grid-column: auto; }
  .status-line { display: grid; }
  .status-line strong { max-width: none; text-align: left; }
  .kpi-grid.three { grid-template-columns: 1fr; }
  .source-section { padding-block: 64px; }
  .source-grid { grid-template-columns: 1fr; }
  .source-grid article { min-height: auto; }
  .source-grid h3 { margin-top: 24px; }
  .official-links { align-items: stretch; }
  .official-links h3 { width: 100%; }
  .official-links a { flex: 1 1 100%; }
  .footer-inner { display: grid; }
}

@media (max-width: 420px) {
  .brand small { display: none; }
  .rule-badge { max-width: 110px; text-align: right; line-height: 1.2; }
  .text-button { max-width: 112px; }
  .grant-hero { padding: 20px; }
  .grant-hero > strong { font-size: 46px; }
  .kpi-grid { grid-template-columns: 1fr; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  .site-header, .hero-facts, .input-panel, .source-section, .site-footer, .icon-button { display: none !important; }
  .hero { display: block; padding: 0 0 20px; }
  .hero h1 { font-size: 34px; }
  .hero-copy { color: #444; font-size: 14px; }
  .calculator-shell { display: block; border: 0; box-shadow: none; }
  .result-panel { border: 0; background: #fff; }
  .result-sticky { padding: 0; }
  .grant-hero, .kpi-grid article, .breakdown-card, .economy-card, .projection-card { break-inside: avoid; border-color: #bbb; background: #fff; }
  .grant-hero > strong, .kpi-grid strong, dl dd, .cost-row strong, .projection-card strong { color: #111; }
  .grant-hero p, .kpi-grid span, .kpi-grid small, dl dt, .cost-row > div:first-child, .micro-note { color: #444; }
  .warning-list li { color: #555; background: #fff; border-color: #ccc; }
}
