:root {
  color-scheme: dark;
  --bg: #080a0e;
  --panel: rgba(18, 21, 27, 0.88);
  --panel-2: #101319;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #9299a6;
  --text: #f6f7f9;
  --red: #f04438;
  --red-bright: #ff5548;
  --amber: #f5a524;
  --green: #47c994;
  --display: "Barlow Condensed", sans-serif;
  --body: "Inter", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 68%);
}
.ambient { position: fixed; border-radius: 999px; filter: blur(120px); pointer-events: none; opacity: .16; }
.ambient-one { width: 420px; height: 420px; right: -100px; top: 110px; background: var(--red); }
.ambient-two { width: 300px; height: 300px; left: -170px; top: 620px; background: #244fdc; opacity: .08; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; position: relative; }
.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 35px; height: 35px; border: 1px solid var(--red); color: var(--red-bright); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-style: italic; transform: skew(-7deg); }
.brand strong, .brand small { display: block; line-height: 1; letter-spacing: .12em; }
.brand strong { font-family: var(--display); font-size: 18px; }
.brand small { color: var(--muted); font-size: 8px; margin-top: 4px; }
.tank-pill { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; font-size: 12px; color: #c9cdd4; display: flex; gap: 8px; align-items: center; }
.tank-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
.hero { padding: 72px 0 80px; }
.hero-copy { max-width: 760px; margin-bottom: 42px; }
.eyebrow, .step-label { color: var(--red-bright); font-family: var(--display); font-weight: 700; letter-spacing: .18em; font-size: 12px; }
h1, h2 { font-family: var(--display); text-transform: uppercase; margin: 0; }
h1 { font-size: clamp(52px, 7vw, 84px); line-height: .9; letter-spacing: -.02em; }
h1 em { color: var(--muted); font-style: normal; font-weight: 500; }
.intro { max-width: 570px; color: var(--muted); line-height: 1.65; margin: 24px 0 0; }
.calculator-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 18px; align-items: stretch; }
.panel { background: linear-gradient(145deg, rgba(22,25,32,.96), rgba(13,15,20,.96)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.input-panel, .result-panel { padding: 30px; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.panel-head h2, .section-title h2, .method-section h2 { font-size: 29px; margin-top: 5px; letter-spacing: .01em; }
.text-button { border: 0; background: transparent; color: #b9bec7; font: 600 12px var(--body); padding: 6px 0; cursor: pointer; border-bottom: 1px solid #4a4f58; }
.text-button:hover { color: #fff; }
.text-button.danger { color: #e87068; }
.text-button:disabled { opacity: .35; cursor: default; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: block; }
.field.full-width { grid-column: 1 / -1; }
.field > span, .status-field legend { display: block; color: #c6cad1; font-size: 12px; font-weight: 600; margin-bottom: 9px; }
.input-wrap { height: 52px; border: 1px solid #343943; border-radius: 9px; display: flex; align-items: center; padding: 0 14px; background: #0c0f14; transition: .2s; }
.input-wrap:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(240,68,56,.1); }
.input-wrap.invalid { border-color: var(--red); }
.input-wrap input { min-width: 0; width: 100%; background: transparent; border: 0; outline: none; color: #fff; font: 700 19px var(--display); letter-spacing: .02em; }
.input-wrap input::placeholder { color: #555b64; }
.input-wrap b { color: #7e8590; font-size: 12px; white-space: nowrap; }
.input-wrap.prefix { gap: 10px; }
.error { min-height: 15px; color: #ff786e; display: block; font-size: 10px; margin-top: 5px; }
.status-field { border: 0; padding: 0; margin: 10px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-field legend { grid-column: 1 / -1; width: 100%; }
.radio-card { min-width: 0; border: 1px solid #30353e; background: #0d1015; border-radius: 10px; padding: 13px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: .2s; }
.radio-card.active { border-color: rgba(240,68,56,.7); background: rgba(240,68,56,.055); }
.radio-card input { position: absolute; opacity: 0; }
.radio-dot { flex: 0 0 auto; width: 16px; height: 16px; border: 1px solid #656c76; border-radius: 50%; position: relative; }
.radio-card.active .radio-dot::after { content: ""; width: 8px; height: 8px; background: var(--red); border-radius: 50%; position: absolute; inset: 3px; }
.radio-card strong, .radio-card small { display: block; }
.radio-card strong { font-size: 12px; }
.radio-card small { color: var(--muted); font-size: 9px; line-height: 1.4; margin-top: 4px; }
.form-alert { display: none; color: #ffb15c; background: rgba(245,165,36,.09); border: 1px solid rgba(245,165,36,.28); padding: 10px 12px; border-radius: 8px; font-size: 11px; line-height: 1.45; margin: -3px 0 14px; }
.form-alert.show { display: block; }
.primary-button, .secondary-button { width: 100%; border: 0; border-radius: 9px; min-height: 52px; cursor: pointer; font: 700 13px var(--body); transition: .2s; }
.primary-button { color: white; background: linear-gradient(100deg, #cf3027, var(--red-bright)); display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 10px 24px rgba(240,68,56,.18); }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-button span { font-size: 18px; }
.secondary-button { color: white; background: #242932; border: 1px solid #353b45; }
.secondary-button:hover:not(:disabled) { background: #2d333e; }
.secondary-button:disabled { opacity: .35; cursor: default; }
.accuracy-badge { font: 700 9px var(--body); letter-spacing: .1em; padding: 7px 9px; border-radius: 999px; color: var(--green); background: rgba(71,201,148,.1); border: 1px solid rgba(71,201,148,.25); }
.accuracy-badge.estimate { color: var(--amber); background: rgba(245,165,36,.1); border-color: rgba(245,165,36,.25); }
.gauge { position: relative; width: 250px; height: 150px; margin: 34px auto 24px; overflow: hidden; }
.gauge-ring { position: absolute; width: 250px; height: 250px; border-radius: 50%; background: conic-gradient(from 270deg, var(--red) calc(var(--gauge-value) * 1.8deg), #292e37 0 180deg, transparent 0); }
.gauge-ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--panel-2); }
.gauge-center { position: absolute; z-index: 2; left: 50%; top: 76px; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.gauge-center strong { display: block; font: 800 55px/.8 var(--display); letter-spacing: -.03em; }
.gauge-center span { font: 600 10px var(--body); color: var(--muted); letter-spacing: .13em; }
.gauge-min, .gauge-max { position: absolute; bottom: 0; color: #6f7681; font: 600 10px var(--body); }
.gauge-min { left: 4px; } .gauge-max { right: 0; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.metric-grid article { padding: 16px; border-right: 1px solid var(--line); }
.metric-grid article:nth-child(2) { border-right: 0; }
.metric-grid .range-metric { grid-column: 1 / -1; border-top: 1px solid var(--line); border-right: 0; background: rgba(255,255,255,.015); }
.metric-grid span, .metric-grid small { color: var(--muted); font-size: 10px; display: block; }
.metric-grid strong { font: 700 25px var(--display); margin: 4px 0 1px; display: inline-block; }
.metric-grid small { display: inline; margin-left: 5px; }
.result-note { min-height: 38px; color: var(--muted); font-size: 10px; line-height: 1.55; margin: 14px 2px; }
.history-section { padding: 78px 0; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.history-actions { display: flex; gap: 22px; }
.table-wrap { overflow-x: auto; position: relative; min-height: 195px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { color: #737a85; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; text-align: left; padding: 15px 16px; border-bottom: 1px solid var(--line); }
td { font-size: 12px; color: #d9dce1; padding: 17px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
td strong { font: 700 16px var(--display); }
.status-tag { font-size: 8px; font-weight: 700; letter-spacing: .08em; padding: 5px 7px; border-radius: 999px; color: var(--green); background: rgba(71,201,148,.09); }
.status-tag.estimate { color: var(--amber); background: rgba(245,165,36,.09); }
.delete-row { color: #7a818c; border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.delete-row:hover { color: var(--red-bright); }
.empty-state { min-height: 145px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-state.hidden { display: none; }
.empty-icon { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid #373c45; border-radius: 50%; color: var(--red); margin-bottom: 10px; }
.empty-state strong { font-size: 12px; }
.empty-state span { color: var(--muted); font-size: 10px; margin-top: 5px; }
.summary-strip { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; color: var(--muted); margin: 15px 4px 0; font-size: 10px; }
.summary-strip strong { color: var(--text); font: 700 23px var(--display); }
.method-section { border-top: 1px solid var(--line); padding: 78px 0 70px; }
.method-cards { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 25px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.method-cards article { padding: 24px; display: flex; gap: 15px; border-right: 1px solid var(--line); background: rgba(255,255,255,.015); }
.method-cards article:last-child { border: 0; }
.method-cards b { color: var(--red); font: 700 18px var(--display); }
.method-cards p { color: #b1b6bf; font-size: 11px; line-height: 1.6; margin: 0; }
.disclaimer { color: #686f7a; font-size: 9px; margin: 14px 3px 0; }
footer { height: 76px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: #656b75; font: 600 9px var(--body); letter-spacing: .08em; }

@media (max-width: 850px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .result-panel { min-height: 565px; }
  .method-cards { grid-template-columns: 1fr; }
  .method-cards article { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1160px); }
  .topbar { height: 72px; }
  .hero { padding: 50px 0 60px; }
  h1 { font-size: 48px; }
  .intro { font-size: 13px; }
  .input-panel, .result-panel { padding: 21px; }
  .field-grid, .status-field { grid-template-columns: 1fr; }
  .field.full-width, .status-field legend { grid-column: auto; }
  .result-panel { min-height: 535px; }
  .section-title { align-items: flex-start; gap: 18px; }
  .history-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  .summary-strip { justify-content: flex-start; flex-wrap: wrap; }
  .method-section, .history-section { padding: 58px 0; }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
