:root {
  --paper: #f1eee5;
  --paper-deep: #e9e5d9;
  --card: #fbfaf6;
  --ink: #171713;
  --ink-soft: #2a2b25;
  --muted: #737166;
  --muted-light: #a3a095;
  --line: #d8d3c6;
  --line-strong: #b8b2a2;
  --lime: #d8ff3e;
  --lime-deep: #b9e229;
  --oil: #f2633b;
  --gas: #8398ff;
  --electric: #b7df25;
  --dark: #151713;
  --dark-raised: #1c1f1a;
  --white: #f7f4ea;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "Courier New", monospace;
  --shadow-panel: 0 1px 0 rgba(23, 23, 19, 0.04), 0 28px 50px -42px rgba(23, 23, 19, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(23, 23, 19, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 19, 0.045) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 58vh);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 58vh);
}

::selection {
  background: var(--ink);
  color: var(--lime);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 2px;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-copy small {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.live-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime-deep);
  box-shadow: 0 0 0 3px rgba(185, 226, 41, 0.18);
  animation: pulse 2.6s ease-in-out infinite;
}

.topbar-rule {
  width: 1px;
  height: 14px;
  background: var(--line);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(185, 226, 41, 0.15); }
  50% { box-shadow: 0 0 0 5px rgba(185, 226, 41, 0.04); }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: end;
  gap: 64px;
  padding: 66px 0 54px;
}

.hero-main {
  animation: rise-in 0.65s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.eyebrow span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0;
  color: var(--ink);
}

.hero h1 {
  max-width: 880px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(56px, 6.8vw, 102px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.headline-accent {
  position: relative;
  display: inline-block;
  z-index: 0;
}

.headline-accent::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.025em;
  right: -0.045em;
  bottom: 0.055em;
  height: 0.255em;
  background: var(--lime);
  transform: rotate(-1.1deg);
  transform-origin: left center;
}

.hero-side {
  max-width: 440px;
  padding-bottom: 7px;
  animation: rise-in 0.65s 0.12s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.hero-intro {
  margin: 0 0 28px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}

.hero-intro strong {
  color: var(--ink);
  font-weight: 600;
  font-feature-settings: "tnum";
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
}

.hero-facts > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.hero-facts > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-facts span {
  font-family: var(--font-mono);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--ink);
}

.hero-facts span em {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 10px;
  margin-left: 1px;
}

.hero-facts small {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Layout ---------- */

.workbench {
  display: grid;
  grid-template-columns: minmax(350px, 0.82fr) minmax(0, 1.58fr);
  align-items: start;
  gap: 22px;
  animation: rise-in 0.7s 0.2s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
}

.controls-panel {
  padding: 26px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.section-kicker {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted-light);
}

.panel-heading h2,
.chart-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.reset-button svg {
  width: 12px;
  height: 12px;
}

.reset-button:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.reset-button:active {
  transform: translateY(1px);
}

.control-group {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.control-group + .control-group {
  margin-top: 22px;
}

.group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.group-heading h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.group-heading > span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--muted-light);
}

/* ---------- Price inputs ---------- */

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.field {
  min-width: 0;
  padding: 9px 11px 8px;
  background: #f5f2ea;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.field:hover {
  border-color: var(--line);
}

.field:focus-within {
  background: #fffef9;
  border-color: var(--ink);
}

.field label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
}

.field label small {
  margin-left: auto;
  font-size: 8px;
  color: var(--muted-light);
  letter-spacing: 0.02em;
}

.dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dot-oil { color: var(--oil); }
.dot-gas { color: var(--gas); }
.dot-electric { color: var(--electric); }

.number-shell {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 4px;
}

.number-shell .prefix {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.number-shell input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.05em;
  font-feature-settings: "tnum";
  -moz-appearance: textfield;
}

.number-shell input::-webkit-outer-spin-button,
.number-shell input::-webkit-inner-spin-button,
.dual-input input::-webkit-outer-spin-button,
.dual-input input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.number-shell input[type="number"],
.dual-input input[type="number"] {
  -moz-appearance: textfield;
}

/* ---------- Peak share ---------- */

.peak-group {
  padding-top: 20px;
}

.range-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.range-heading label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.range-heading output {
  padding: 4px 8px;
  background: var(--paper-deep);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.range-input {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--ink) 0 var(--fill, 50%), var(--line) var(--fill, 50%) 100%);
  border-radius: 4px;
}

.range-input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6.5px;
  border-radius: 50%;
  border: 3px solid var(--lime);
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s ease;
}

.range-input:hover::-webkit-slider-thumb {
  transform: scale(1.12);
}

.range-input::-moz-range-track {
  height: 3px;
  background: var(--line);
  border-radius: 4px;
}

.range-input::-moz-range-progress {
  height: 3px;
  background: var(--ink);
  border-radius: 4px;
}

.range-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid var(--lime);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: var(--muted-light);
}

/* ---------- Consumption ---------- */

.consumption-group {
  margin-top: 22px;
}

.consumption-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 76px;
  align-items: center;
  min-height: 43px;
  border-top: 1px solid #e5e1d6;
}

.consumption-row:first-of-type {
  border-top: 1px solid var(--line);
}

.consumption-row-single {
  border-bottom: 1px solid #e5e1d6;
}

.consumption-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-soft);
}

.dual-input {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.dual-input input {
  width: 43px;
  height: 28px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  outline: 0;
  font-feature-settings: "tnum";
  transition: border-color 0.18s ease, background 0.18s ease;
}

.dual-input input:hover {
  border-bottom-color: var(--line-strong);
}

.dual-input input:focus {
  background: #fffef9;
  border-bottom-color: var(--ink);
}

.dual-input > span {
  color: var(--muted-light);
  font-size: 11px;
}

.dual-input .single-hint {
  margin-left: 7px;
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--muted-light);
}

.consumption-unit {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.01em;
  color: var(--muted-light);
}

.formula-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding: 11px 12px;
  background: var(--paper-deep);
}

.formula-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 9px;
  font-style: italic;
  color: var(--muted);
}

.formula-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
}

.formula-note strong {
  display: block;
  margin-bottom: 1px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- Results ---------- */

.results-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.verdict {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 20px;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
}

.verdict::after {
  content: "";
  position: absolute;
  top: -80px;
  right: 18%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 255, 62, 0.1), transparent 68%);
  pointer-events: none;
}

.verdict-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(247, 244, 234, 0.22);
  color: var(--lime);
}

.verdict-icon svg {
  width: 18px;
  height: 18px;
}

.verdict-copy {
  position: relative;
  z-index: 1;
}

.verdict-copy > p {
  margin: 0 0 3px;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #96998d;
}

.verdict-copy h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.verdict-save {
  padding: 3px 7px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.verdict-basis {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: #898c80;
  text-align: right;
  white-space: nowrap;
}

/* ---------- Cards ---------- */

.result-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 176px;
  padding: 15px 15px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.result-card:hover {
  border-color: var(--line-strong);
}

.result-card[data-energy="oil"] { --accent: var(--oil); }
.result-card[data-energy="gas"] { --accent: var(--gas); }
.result-card[data-energy="electric"] { --accent: var(--electric); }

.result-card.is-cheapest {
  border-color: var(--ink);
  background: #fffef8;
}

.card-topline {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 38px;
  height: 3px;
  background: var(--accent);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.card-delta {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.card-delta.is-low {
  padding: 3px 6px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.card-label {
  margin: 20px 0 2px;
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.card-total {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  font-family: var(--font-mono);
  line-height: 1;
  letter-spacing: -0.065em;
  font-feature-settings: "tnum";
}

.card-total > span {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
}

.card-total strong {
  font-size: clamp(25px, 2.15vw, 34px);
  font-weight: 500;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 8px;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}

.card-meta > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

/* ---------- Chart ---------- */

.chart-panel {
  position: relative;
  padding: 23px 24px 15px;
  overflow: hidden;
  background: var(--dark);
  color: var(--white);
  border: 1px solid var(--dark);
}

.chart-panel::after {
  content: "100K";
  position: absolute;
  top: 30px;
  right: -7px;
  z-index: 0;
  font-family: var(--font-mono);
  font-size: 104px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.1em;
  color: rgba(247, 244, 234, 0.022);
  pointer-events: none;
}

.chart-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.chart-header .section-kicker {
  color: #70756a;
}

.chart-header h2 {
  color: var(--white);
  font-size: 21px;
}

.chart-subtitle {
  margin: 5px 0 0;
  font-size: 8.5px;
  letter-spacing: 0.03em;
  color: #777c71;
}

.legend {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 5px;
  font-size: 10px;
  color: #b5b8ac;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-line {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.line-oil { color: var(--oil); }
.line-gas { color: var(--gas); }
.line-electric { color: var(--lime); }

.chart-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 8px;
}

#costChart {
  display: block;
  width: 100%;
  overflow: visible;
  cursor: crosshair;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

#costChart:focus-visible {
  outline: 1px solid var(--lime);
  outline-offset: 3px;
}

.chart-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  padding-top: 11px;
  border-top: 1px solid rgba(247, 244, 234, 0.1);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  color: #72776c;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  width: 190px;
  padding: 10px 12px 9px;
  background: #f8f5eb;
  color: var(--ink);
  border: 1px solid #0c0d0b;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: #f8f5eb;
  border-right: 1px solid #0c0d0b;
  border-bottom: 1px solid #0c0d0b;
  transform: translateX(-50%) rotate(45deg);
}

.tt-km {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #d9d4c6;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.tt-km strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.tt-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 2.5px 0;
  font-size: 9px;
}

.tt-row i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.tt-row span {
  color: var(--muted);
}

.tt-row b {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ---------- Insight / footer ---------- */

.insight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  background: var(--lime);
  border: 1px solid #b9e229;
  color: var(--ink);
}

.insight-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(23, 23, 19, 0.3);
}

.insight-mark svg {
  width: 16px;
  height: 16px;
}

.insight p {
  margin: 0;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.005em;
}

.insight strong {
  font-weight: 700;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-top: 52px;
  padding: 21px 0 34px;
  border-top: 1px solid var(--line-strong);
}

.footer-brand {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.footer-brand span {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted-light);
}

.footer-note {
  max-width: 590px;
  margin: 0;
  font-size: 8.5px;
  line-height: 1.7;
  color: var(--muted);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--muted-light);
}

/* ---------- Error state ---------- */

input.is-invalid {
  background: #ffe8df !important;
  border-color: var(--oil) !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .page-shell { padding: 0 32px; }
  .hero { gap: 42px; }
  .workbench { grid-template-columns: minmax(330px, 0.8fr) minmax(0, 1.5fr); gap: 16px; }
  .controls-panel { padding: 22px; }
  .result-card { padding: 14px 13px 12px; }
  .card-total strong { font-size: 27px; }
}

@media (max-width: 1080px) {
  .workbench { grid-template-columns: 1fr; }
  .controls-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
  }
  .panel-heading { grid-column: 1 / -1; margin-bottom: 20px; }
  .control-group { padding-top: 0; border-top: 0; }
  .control-group + .control-group { margin-top: 0; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .peak-group { padding-top: 16px; border-top: 1px solid var(--line); }
  .consumption-group { padding-top: 16px; border-top: 1px solid var(--line); }
  .formula-note { grid-column: 1 / -1; margin-top: 18px; }
  .price-grid .field { padding: 8px 9px; }
  .hero h1 { font-size: clamp(56px, 7.6vw, 82px); }
  .result-cards { gap: 10px; }
  .card-total strong { font-size: clamp(27px, 3.1vw, 36px); }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 48px 0 38px;
  }
  .hero-side {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr);
    gap: 28px;
    max-width: none;
    align-items: end;
  }
  .hero-intro { margin-bottom: 0; }
  .hero-facts { padding-top: 11px; }
  .hero-facts span { font-size: 18px; }
  .controls-panel { column-gap: 24px; }
}

@media (max-width: 720px) {
  .page-shell { padding: 0 18px; }
  .topbar { min-height: 66px; }
  .topbar-right { gap: 12px; }
  .topbar-domain { display: none; }
  .topbar-rule { display: none; }
  .hero { padding: 38px 0 30px; }
  .eyebrow { margin-bottom: 18px; }
  .hero h1 { font-size: clamp(46px, 10.5vw, 70px); }
  .hero-side { grid-template-columns: 1fr; gap: 22px; }
  .hero-intro { max-width: 480px; }
  .hero-facts { max-width: 380px; }
  .controls-panel {
    display: block;
    padding: 20px;
  }
  .panel-heading { margin-bottom: 20px; }
  .control-group { padding-top: 18px; border-top: 1px solid var(--line); }
  .control-group + .control-group { margin-top: 18px; }
  .peak-group { padding-top: 18px; }
  .consumption-group { padding-top: 18px; }
  .price-grid .field { padding: 9px 10px; }
  .number-shell input { font-size: 19px; }
  .formula-note { margin-top: 18px; }
  .verdict { padding: 13px 14px; min-height: 70px; gap: 10px; }
  .verdict-icon { width: 32px; height: 32px; }
  .verdict-copy h2 { font-size: 18px; }
  .verdict-basis { display: none; }
  .result-cards { grid-template-columns: 1fr; }
  .result-card { min-height: 142px; padding: 14px 15px 12px; }
  .card-label { margin-top: 14px; }
  .card-total strong { font-size: 32px; }
  .card-meta { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; white-space: normal; }
  .card-meta > span { display: inline-flex; gap: 5px; }
  .card-meta > span:last-child { text-align: right; }
  .chart-panel { padding: 19px 18px 13px; }
  .chart-header { flex-direction: column; gap: 14px; }
  .legend { margin-top: 0; gap: 18px; }
  .chart-header h2 { font-size: 19px; }
  .chart-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .insight { align-items: flex-start; padding: 13px 14px; }
  .insight p { font-size: 11px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 36px; padding-bottom: 26px; }
  .footer-right { align-items: flex-start; }
}

@media (max-width: 480px) {
  .page-shell { padding: 0 14px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-copy strong { font-size: 13px; }
  .live-indicator { font-size: 9px; }
  .hero h1 { font-size: clamp(42px, 12vw, 56px); }
  .hero-intro { font-size: 12px; }
  .hero-facts > div { padding-left: 10px; }
  .hero-facts span { font-size: 16px; }
  .hero-facts small { font-size: 8px; }
  .controls-panel { padding: 16px; }
  .section-kicker { font-size: 7px; }
  .panel-heading h2 { font-size: 20px; }
  .reset-button { font-size: 9px; }
  .price-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .field label { font-size: 9px; }
  .field label small { display: none; }
  .number-shell input { font-size: 18px; }
  .consumption-row { grid-template-columns: 58px minmax(0, 1fr) 67px; min-height: 42px; }
  .consumption-name { gap: 5px; font-size: 10px; }
  .dual-input { gap: 2px; }
  .dual-input input { width: 38px; font-size: 14px; }
  .consumption-unit { font-size: 7px; }
  .formula-note { padding: 10px; }
  .verdict-copy h2 { font-size: 17px; gap: 6px; }
  .verdict-save { font-size: 8px; }
  .chart-panel { padding: 17px 12px 12px; }
  .chart-header { padding: 0 4px; }
  .legend { font-size: 9px; }
  .chart-tooltip { width: 176px; }
  .insight p { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Inline validation ---------- */

.form-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #ffe8df;
  border-left: 2px solid var(--oil);
  font-size: 9px;
  line-height: 1.5;
  color: #8a2e17;
}

.form-error[hidden] {
  display: none;
}

.chart-tooltip.below {
  transform: translate(-50%, 14px);
}

.chart-tooltip.below::after {
  top: -5px;
  bottom: auto;
  border: 0;
  border-left: 1px solid #0c0d0b;
  border-top: 1px solid #0c0d0b;
}
