:root {
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --dark: #0f172a;
  --good: #059669;
  --bad: #dc2626;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --warn-text: #92400e;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 45%, #eef2f7 100%);
  color: var(--text);
}
.container { max-width: 1380px; margin: 0 auto; padding: 80px 24px 24px; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }
.badge { display: inline-block; background: var(--dark); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 10px; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 54px); line-height: 1.02; letter-spacing: -0.04em; max-width: 920px; }
.subtext { max-width: 860px; color: var(--muted); font-size: 15px; margin-top: 14px; line-height: 1.6; }
.top-switches { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 14px; width: min(100%, 420px); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.switch-card { padding: 16px; }
.switch-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); background: #eef2f7; padding: 4px; border-radius: 16px; gap: 4px; }
.segmented button { border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; font-weight: 700; color: var(--muted); cursor: pointer; transition: 0.2s ease; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(15,23,42,0.08); }
.main-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; }
.card { padding: 22px; }
.card-title { margin: 0 0 18px; font-size: 22px; letter-spacing: -0.02em; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; line-height: 1.3; }
.help { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: -2px; }
.input-wrap { position: relative; }
.prefix, .suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 600; pointer-events: none; }
.prefix { left: 12px; }
.suffix { right: 12px; }
input[type="number"] { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 13px 14px; font-size: 15px; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
input.with-prefix { padding-left: 28px; }
input.with-suffix { padding-right: 34px; }
input:focus { border-color: #94a3b8; box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.15); }
.soft-box { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 14px; }
.soft-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.soft-head .title { font-size: 14px; font-weight: 700; }
.derived-output { min-height: 48px; display: flex; align-items: center; border: 1px solid var(--line); background: #f1f5f9; border-radius: 14px; padding: 13px 14px; font-size: 18px; font-weight: 800; }
.hero-result { background: linear-gradient(135deg, #0f172a 0%, #111827 100%); color: #fff; overflow: hidden; }
.hero-result .eyebrow { color: #cbd5e1; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.headline { font-size: clamp(36px, 5vw, 54px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 0; }
.headline-sub { color: #cbd5e1; margin-top: 10px; line-height: 1.6; font-size: 14px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.mini-box { background: rgba(255,255,255,0.08); border-radius: 18px; padding: 16px; }
.mini-box .k { color: #cbd5e1; font-size: 12px; }
.mini-box .v { font-size: 24px; font-weight: 800; margin-top: 6px; }
.rows { display: grid; }
.row { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-title { font-size: 14px; color: var(--muted); font-weight: 500; }
.row-detail { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; max-width: 310px; }
.row-value { text-align: right; font-weight: 800; font-size: 17px; white-space: nowrap; }
.positive { color: var(--good); }
.negative { color: var(--bad); }
.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 20px; color: var(--warn-text); line-height: 1.6; }
.warn strong { display: block; margin-bottom: 8px; }
.list-grid { display: grid; gap: 12px; }
.list-item { padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel-soft); line-height: 1.6; font-size: 14px; color: #334155; }
.list-item strong { color: var(--text); }
.range-row { display: grid; gap: 10px; }
input[type="range"] { width: 100%; }
.table-wrap { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.table-wrap h3 { margin: 0 0 10px; font-size: 16px; }
table { width: 100%; border-collapse: collapse; }
td { padding: 10px 8px; border-top: 1px solid var(--line); font-size: 14px; }
td:last-child { text-align: right; font-weight: 700; }
@media (max-width: 1100px) { .main-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .container { padding: 16px; }
  .field-grid, .compact-grid, .two-col, .mini-grid, .top-switches { grid-template-columns: 1fr; }
  .row { align-items: start; }
  .row-value { font-size: 16px; }
}
@media (max-width: 480px) {
  .container { padding: 12px; }
  h1 { font-size: clamp(24px, 3vw, 32px); }
  .subtext { font-size: 13px; }
  .card { padding: 16px; }
  .card-title { font-size: 18px; margin-bottom: 14px; }
  .field-grid, .compact-grid, .two-col, .mini-grid, .top-switches { grid-template-columns: 1fr; }
  .segmented button { padding: 8px 10px; font-size: 12px; }
  .primary, .secondary, button { width: 100%; }
  button { padding: 14px 16px; }
  input[type="number"] { padding: 11px 12px; font-size: 14px; }
  .panel { padding: 14px; }
  .switch-card { padding: 12px; }
  table { font-size: 12px; }
  td { padding: 8px 6px; }
  .table-wrap { overflow-x: auto; margin: 0 -12px; padding: 18px 12px 18px 0; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
