/* ============================================================
   불셈 / Fire Math
   Warm charcoal, ember signal, gold for the target line.
   ============================================================ */

:root {
  --bg: #0b0908;
  --bg-2: #0e0b09;
  --panel: #14100d;
  --panel-2: #191411;
  --panel-3: #201913;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f5efe7;
  --text-2: #d9cec3;
  --muted: #a2938a;
  --faint: #6f625a;
  --ember: #ff8a4c;
  --ember-2: #ffb185;
  --ember-soft: rgba(255, 138, 76, .11);
  --ember-line: rgba(255, 138, 76, .3);
  --gold: #f6c65b;
  --gold-soft: rgba(246, 198, 91, .1);
  --gold-line: rgba(246, 198, 91, .3);
  --jade: #4bd6a0;
  --jade-soft: rgba(75, 214, 160, .1);
  --jade-line: rgba(75, 214, 160, .28);
  --blue: #7aa7ff;
  --blue-soft: rgba(122, 167, 255, .1);
  --blue-line: rgba(122, 167, 255, .28);
  --rose: #ff728d;
  --rose-soft: rgba(255, 114, 141, .1);
  --rose-line: rgba(255, 114, 141, .3);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 60px -38px rgba(0, 0, 0, .9);
  --sans: "Inter", "Pretendard", "Apple SD Gothic Neo", "Noto Sans CJK KR", "Noto Sans KR", "Malgun Gothic", "DejaVu Sans", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", "Menlo", "Consolas", monospace;
  --serif: Georgia, "Times New Roman", "Noto Serif KR", "Noto Serif CJK KR", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 78px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  word-break: keep-all;
}

/* atmosphere: faint grid + ember glow top right */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(255, 138, 76, .13), transparent 68%),
    radial-gradient(700px 420px at 0% 8%, rgba(246, 198, 91, .045), transparent 70%),
    linear-gradient(180deg, #0c0908, #0b0908 60%, #0a0807);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(1200px 800px at 50% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(1200px 800px at 50% 0%, #000 10%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ember); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.04em; line-height: 1.16; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ember); color: #2a1206; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ember); color: #2a1206; font-weight: 700;
  padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 16px; }

.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------------- ticker ---------------- */

.ticker {
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--faint);
  font-family: var(--mono);
  overflow: hidden;
}
.ticker .wrap {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ticker .wrap > * { flex: none; white-space: nowrap; }
.ticker .wrap::-webkit-scrollbar { display: none; }
.ticker b { color: var(--text-2); font-weight: 600; }
.ticker .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 3px rgba(255, 138, 76, .12); flex: none; }
.ticker .sep { width: 1px; height: 10px; background: var(--line-2); flex: none; }
.ticker .live { color: var(--ember); }

/* ---------------- topbar ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(11, 9, 8, .82);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #ffa463, #ff7a3d 62%, #f2662a);
  color: #2a1206; font-weight: 900; font-size: 17px; letter-spacing: -.06em;
  box-shadow: 0 6px 18px -8px rgba(255, 122, 61, .8), 0 1px 0 rgba(255, 255, 255, .25) inset;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 17px; letter-spacing: -.05em; }
.brand-text span {
  font-size: 9.5px; color: var(--faint); letter-spacing: .14em; text-transform: uppercase;
  font-family: var(--mono); margin-top: 4px;
}
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a {
  padding: 8px 11px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); transition: background .15s, color .15s; white-space: nowrap;
}
.topnav a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.topnav a[aria-current="page"] { color: var(--ember); font-weight: 700; }
.topnav .lang {
  margin-left: 6px; border: 1px solid var(--line-2); border-radius: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 6px 10px; color: var(--text-2);
}

/* ---------------- hero ---------------- */

.hero { padding: 34px 0 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ember);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--ember); opacity: .7; }
.hero h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  margin: 14px 0 12px; letter-spacing: -.055em; line-height: 1.08;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #ffb185, #ff8a4c 45%, #f6c65b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 640px; font-size: 15.5px; color: var(--text-2); line-height: 1.62; }
.lede strong { color: var(--text); font-weight: 700; }
.facts {
  display: flex; flex-wrap: wrap; gap: 7px; list-style: none;
  padding: 0; margin: 18px 0 0;
}
.facts li {
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; background: rgba(255, 255, 255, .015);
  font-variant-numeric: tabular-nums;
}
.facts b { font-weight: 700; color: var(--text); }
.facts .is-accent { border-color: var(--ember-line); color: var(--ember); background: var(--ember-soft); }

/* ---------------- tabs ---------------- */

.tabs {
  display: flex; gap: 4px; margin-top: 30px; padding: 5px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
  border-radius: 13px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: max-content; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: transparent; cursor: pointer;
  padding: 11px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 650; color: var(--muted);
  transition: background .15s, color .15s;
}
.tab i {
  font-style: normal; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .08em; color: var(--faint);
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.tab[aria-selected="true"] {
  color: var(--text); background: var(--panel-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 0 0 1px var(--line-2);
}
.tab[aria-selected="true"] i { color: var(--ember); }
.tab .tab-sub { display: none; font-size: 11px; color: var(--faint); font-weight: 500; }

/* ---------------- app ---------------- */

.app { padding: 24px 0 8px; }
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 22px;
  align-items: start;
}
.panel[hidden] { display: none; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 120px), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.inputs { padding: 24px 24px 20px; }

.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 19px; letter-spacing: -.045em; }
.panel-head p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.panel-head .tag {
  flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  color: var(--ember); background: var(--ember-soft); border: 1px solid var(--ember-line);
  border-radius: 6px; padding: 4px 8px; margin-top: 2px; white-space: nowrap;
}

/* ---------------- fields ---------------- */

.field { padding: 19px 0 2px; }
.field + .field { border-top: 1px solid var(--line); }
.field-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 9px;
}
.field-head label, .field-head .flabel {
  font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer;
}
.field-head .hint {
  font-size: 11px; color: var(--faint); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.field-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: 8px; font-size: 11px; color: var(--faint); flex-wrap: wrap;
}
.field-foot b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.field-foot .warn { color: var(--gold); }

.input-row {
  display: flex; align-items: baseline; gap: 8px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line-2);
  border-radius: 10px; padding: 0 13px; height: 52px;
  transition: border-color .15s, background .15s;
}
.input-row:focus-within {
  border-color: var(--ember-line);
  background: rgba(255, 138, 76, .04);
  box-shadow: 0 0 0 3px rgba(255, 138, 76, .08);
}
.input-row input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; outline: none;
  color: var(--text); font-family: var(--sans);
  font-size: 22px; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; padding: 0;
}
.input-row input::-webkit-outer-spin-button,
.input-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-row .unit { font-size: 12.5px; color: var(--muted); font-weight: 600; flex: none; padding-left: 2px; }
.input-row .prefix { font-size: 15px; color: var(--muted); font-weight: 600; flex: none; }
.input-row.is-sm { height: 44px; }
.input-row.is-sm input { font-size: 16px; font-weight: 700; }

.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; margin: 9px 0 0; background: transparent; cursor: pointer;
  --p: 50%;
}
.range::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--ember) var(--p), rgba(255, 255, 255, .13) var(--p));
}
.range::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .13); }
.range::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--ember); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #1b1410; border: 2px solid var(--ember);
  margin-top: -6px; box-shadow: 0 0 0 4px rgba(255, 138, 76, .1);
  transition: transform .12s;
}
.range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #1b1410; border: 2px solid var(--ember);
}
.range:focus-visible { outline-offset: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chips button {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  color: var(--muted); border-radius: 7px; padding: 5px 9px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: all .13s;
}
.chips button:hover { border-color: var(--line-2); color: var(--text); }
.chips button[aria-pressed="true"] { background: var(--ember-soft); border-color: var(--ember-line); color: var(--ember); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0;
}
.switch-row + .switch-row { border-top: 1px dashed var(--line); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 38px; height: 21px; border-radius: 99px; background: rgba(255, 255, 255, .12);
  position: relative; transition: background .18s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px;
  border-radius: 50%; background: #8a7a6f; transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: var(--ember); }
.switch input:checked + .track::after { transform: translateX(17px); background: #2a1206; }
.switch input:focus-visible + .track { outline: 2px solid var(--ember); outline-offset: 2px; }
.switch .sw-note { font-size: 11px; color: var(--faint); font-weight: 500; }

.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg {
  display: flex; width: 100%;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden;
}
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 9px 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .13s, color .13s; white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--ember); }

.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pair-item { min-width: 0; }
.pair-item .field-head { margin-bottom: 8px; }

.adv { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }
.adv summary {
  list-style: none; cursor: pointer; padding: 12px 0 8px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::after { content: "+"; margin-left: auto; color: var(--faint); }
.adv[open] summary::after { content: "−"; }
.adv summary:hover { color: var(--text-2); }

/* ---------------- result ---------------- */

.result {
  position: sticky; position: -webkit-sticky; top: 84px;
  padding: 22px 24px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background:
    radial-gradient(520px 260px at 88% -10%, rgba(255, 138, 76, .14), transparent 70%),
    linear-gradient(180deg, #17110e, #110d0b);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 30px 70px -46px rgba(0, 0, 0, 1);
  overflow: hidden;
}
.result::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  opacity: .85;
}
.result-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.result-top .rlabel {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
}
.stamp {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  color: var(--gold); border: 1px solid var(--gold-line); border-radius: 4px;
  padding: 2px 6px; align-self: flex-start;
}
.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: .02em;
  padding: 4px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--ember); background: var(--ember-soft); border: 1px solid var(--ember-line);
}
.pill.is-warn { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.pill.is-bad { color: var(--rose); background: var(--rose-soft); border-color: var(--rose-line); }
.pill.is-blue { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-line); }
.pill.is-jade { color: var(--jade); background: var(--jade-soft); border-color: var(--jade-line); }

.big-out {
  display: flex; align-items: baseline; gap: 2px;
  font-size: 42px; font-weight: 800; letter-spacing: -.055em;
  line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px;
  color: var(--text);
}
.big-out .cur { font-size: .46em; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-left: 5px; }
.big-out .prefix { font-size: .5em; font-weight: 700; color: var(--muted); letter-spacing: 0; align-self: flex-start; margin-top: 5px; }
.big-out.is-pos { color: var(--jade); }
.big-out.is-neg { color: var(--rose); }
.big-out.is-ember { color: var(--ember); }
.res-sub { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.res-sub b { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.kpi { background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 10px; padding: 11px 11px 12px; min-width: 0; }
.kpi span {
  display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.kpi b {
  display: block; font-size: 17px; font-weight: 750; letter-spacing: -.03em;
  margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.kpi em { display: block; font-style: normal; font-size: 10px; color: var(--faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.is-pos b { color: var(--jade); }
.kpi.is-neg b { color: var(--rose); }
.kpi.is-amber b { color: var(--gold); }
.kpi.is-blue b { color: var(--blue); }
.kpi.is-ember b { color: var(--ember); }

.ledger { margin-top: 18px; border-top: 1px solid var(--line); }
.lrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.lrow:last-child { border-bottom: 0; }
.lrow .ll { color: var(--muted); display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.lrow .ll em { font-style: normal; font-size: 10px; color: var(--faint); white-space: nowrap; }
.lrow .lv { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.lrow.is-total { border-bottom: 0; border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 11px; }
.lrow.is-total .ll { color: var(--text-2); font-weight: 700; }
.lrow.is-total .lv { font-weight: 800; font-size: 14px; }
.lrow .lv.is-pos { color: var(--jade); }
.lrow .lv.is-neg { color: var(--rose); }
.lrow .lv.is-amber { color: var(--gold); }
.lrow .lv.is-blue { color: var(--blue); }
.lrow .lv.is-ember { color: var(--ember); }

.comp { margin-top: 18px; }
.comp-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 10.5px; color: var(--faint); letter-spacing: .04em; margin-bottom: 7px; }
.comp-bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--line); gap: 2px; }
.comp-bar i { display: block; height: 100%; transition: width .4s cubic-bezier(.2, .7, .3, 1); min-width: 0; }
.comp-key { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-top: 10px; }
.comp-key div { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); min-width: 0; }
.comp-key i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.comp-key span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-key b { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.chart { margin-top: 16px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.chart-head .ct { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
.legend i { width: 11px; height: 3px; border-radius: 2px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-family: var(--mono); font-size: 13px; letter-spacing: .02em; paint-order: stroke; stroke: #0f0b09; stroke-width: 3px; stroke-linejoin: round; }
.chart .axis.strong { font-size: 13px; }
.chart .line-real { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-fire { fill: none; stroke: var(--ember); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#gFire); }
.chart .target-line { stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 6 5; opacity: .8; }
.chart .mark-line { stroke: rgba(255, 138, 76, .35); stroke-width: 1; stroke-dasharray: 3 3; }

/* horizontal bars */
.hbars { margin-top: 16px; display: grid; gap: 11px; }
.hbar { min-width: 0; }
.hb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hb-label { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.hb-val { font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.hb-track { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .06); margin-top: 5px; overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 4px; transition: width .4s cubic-bezier(.2, .7, .3, 1); }
.hb-note { display: block; font-size: 10px; color: var(--faint); margin-top: 3px; }
.hbar.is-on .hb-label { color: var(--text); }

/* tables */
.table-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.table-box .tb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.table-box .tb-head span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.table-box .tb-head em { font-style: normal; font-size: 10px; color: var(--faint); }
.table-scroll { max-height: 236px; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-table th {
  position: sticky; top: 0; background: #13100d;
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; text-align: right; padding: 6px 4px;
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.mini-table th:first-child { text-align: left; }
.mini-table td {
  text-align: right; padding: 7px 4px; color: var(--text-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mini-table td:first-child { text-align: left; font-weight: 600; color: var(--text); }
.mini-table tr.is-me td { color: var(--ember); background: var(--ember-soft); font-weight: 700; }
.mini-table tr.is-me td:first-child::after { content: " ←"; font-size: 9px; }

.note-box {
  margin-top: 16px; padding: 12px 13px;
  background: rgba(255, 255, 255, .022); border: 1px solid var(--line);
  border-left: 2px solid var(--ember-line); border-radius: 8px;
  font-size: 11px; line-height: 1.62; color: var(--muted);
}
.note-box b { color: var(--text-2); font-weight: 700; }
.note-box.is-warn { border-left-color: var(--gold-line); }

/* next-step cross links inside the result */
.next-links { margin-top: 16px; display: grid; gap: 7px; }
.next-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .018); transition: border-color .15s, background .15s;
}
.next-link:hover { border-color: var(--ember-line); background: var(--ember-soft); }
.next-link .nl-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  color: #2a1206; background: linear-gradient(150deg, #ffb185, #ff8a4c);
}
.next-link .nl-mark.is-mint { background: linear-gradient(150deg, #8bf3cb, #3ecf95); }
.next-link .nl-mark.is-blue { background: linear-gradient(150deg, #b9d0ff, #7aa7ff); }
.next-link .nl-mark.is-amber { background: linear-gradient(150deg, #ffe4a3, #f2b94b); }
.next-link div { min-width: 0; }
.next-link small { display: block; font-size: 9.5px; color: var(--faint); letter-spacing: .04em; }
.next-link b { display: block; font-size: 12px; font-weight: 650; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-link .arrow { margin-left: auto; color: var(--faint); font-size: 13px; }

.actions { display: flex; gap: 6px; margin-top: 18px; }
.btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  border-radius: 9px; padding: 11px 8px; cursor: pointer;
  font-size: 12px; font-weight: 650; color: var(--text-2);
  transition: all .14s;
}
.btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-primary {
  background: linear-gradient(180deg, #ffa463, #ff7a3d); color: #2a1206; border-color: transparent;
  box-shadow: 0 8px 22px -12px rgba(255, 122, 61, .9);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffb47c, #ff8a4c); color: #2a1206; }

/* ---------------- ads ---------------- */

.ad-slot {
  margin: 18px 0; border: 1px dashed var(--line-2); border-radius: 12px;
  background: rgba(255, 255, 255, .012); position: relative;
  min-height: 76px; display: flex; flex-direction: column; justify-content: center;
}
.ad-slot .ad-label {
  position: absolute; top: 8px; left: 12px;
  font-family: var(--mono); font-size: 8px; letter-spacing: .22em; color: var(--faint);
}
.ad-body { text-align: center; padding: 11px 12px 8px; }
.ad-body span { display: block; font-size: 12px; color: var(--faint); letter-spacing: .02em; }
.ad-body small { display: block; margin-top: 2px; font-size: 10px; color: var(--faint); opacity: .65; }
.ad-bottom { margin-top: 30px; min-height: 150px; }
@media (max-width: 660px) {
  .ad-slot { min-height: 64px; }
  .ad-bottom { min-height: 150px; }
}

/* ---------------- guide section ---------------- */

.guide { padding: 46px 0 8px; margin-top: 34px; border-top: 1px solid var(--line); }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 40px; }
.sec-num {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ember); margin-bottom: 8px;
}
.guide h2 { font-size: 19px; letter-spacing: -.04em; margin-bottom: 9px; }
.guide p { font-size: 13.5px; color: var(--muted); line-height: 1.68; margin-bottom: 9px; }
.guide p strong { color: var(--text-2); font-weight: 650; }
.calc-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255, 255, 255, .018);
}
.calc-cta b { display: block; font-size: 12.5px; color: var(--text-2); }
.calc-cta span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.calc-cta a { font-size: 12px; font-weight: 700; color: var(--ember); white-space: nowrap; }
.glink-list { display: grid; gap: 1px; margin-top: 12px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.glink-list a { display: block; background: var(--panel); padding: 11px 13px; transition: background .15s; }
.glink-list a:hover { background: var(--panel-2); }
.glink-list .k { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--ember); }
.glink-list b { display: block; font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-top: 2px; }
.glink-list small { display: block; font-size: 10.5px; color: var(--faint); margin-top: 1px; }

.faq { margin-top: 40px; }
.faq h2 { font-size: 20px; margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 13px 0; }
.faq summary {
  cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--text-2);
  list-style: none; display: flex; align-items: baseline; gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; font-family: var(--mono); font-size: 10px; color: var(--ember); flex: none; }
.faq .faq-a { font-size: 12.5px; color: var(--muted); line-height: 1.7; padding: 9px 0 2px 20px; }
.faq .faq-a b { color: var(--text-2); }

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

.site-foot { border-top: 1px solid var(--line); margin-top: 46px; padding: 30px 0 40px; }
.xlinks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.xlink {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px;
  background: rgba(255, 255, 255, .017); transition: border-color .15s, background .15s;
}
.xlink:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .035); }
.xmark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  color: #2a1206; background: linear-gradient(150deg, #ffb185, #ff8a4c);
}
.xmark.is-mint { background: linear-gradient(150deg, #8bf3cb, #3ecf95); }
.xmark.is-blue { background: linear-gradient(150deg, #b9d0ff, #7aa7ff); }
.xmark.is-amber { background: linear-gradient(150deg, #ffe4a3, #f2b94b); }
.xmark.is-steel { background: linear-gradient(150deg, #cfe0f5, #8fb4dd); }
.xlink div { min-width: 0; }
.xlink small { display: block; font-size: 9.5px; color: var(--faint); letter-spacing: .04em; }
.xlink b { display: block; font-size: 12px; font-weight: 650; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xlink .arrow { margin-left: auto; color: var(--faint); font-size: 13px; }

.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 24px; font-size: 12px; color: var(--muted); }
.foot-links a:hover { color: var(--ember); }
.foot-disc { margin-top: 18px; max-width: 760px; }
.foot-disc p { font-size: 10.5px; color: var(--faint); line-height: 1.7; margin-bottom: 6px; }
.foot-disc b { color: var(--muted); }
.copy { font-family: var(--mono); font-size: 10px; letter-spacing: .05em; color: var(--faint); margin-top: 18px; }

/* ---------------- minibar ---------------- */

.minibar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: none; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(15, 11, 9, .96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-2);
}
.minibar .mb-label { font-size: 9.5px; color: var(--faint); letter-spacing: .06em; font-family: var(--mono); text-transform: uppercase; }
.minibar .mb-value { font-size: 19px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.minibar .mb-value small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.minibar a {
  margin-left: auto; background: linear-gradient(180deg, #ffa463, #ff7a3d);
  color: #2a1206; font-size: 12px; font-weight: 750; padding: 10px 16px; border-radius: 9px;
}

/* ---------------- toast ---------------- */

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  z-index: 90; background: #241a13; color: var(--text);
  border: 1px solid var(--line-2); border-radius: 9px;
  padding: 10px 16px; font-size: 12.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9); max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Content pages: guides, about, privacy
   ============================================================ */

.doc { padding: 40px 0 10px; max-width: 780px; margin: 0 auto; }
.doc .updated { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .05em; margin-bottom: 14px; }
.doc .lead { font-size: 16px; color: var(--text-2); line-height: 1.68; margin-bottom: 22px; }
.doc .box { margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line); border-left: 2px solid var(--ember-line); border-radius: 8px; background: rgba(255, 255, 255, .02); font-size: 13px; color: var(--muted); line-height: 1.72; }
.doc code, .article code { font-family: var(--mono); font-size: .92em; background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 4px; color: var(--text-2); }
.doc h1 { font-size: 34px; margin: 8px 0 14px; }
.doc .dek { font-size: 15px; color: var(--text-2); line-height: 1.65; margin-bottom: 24px; }
.doc h2 { font-size: 19px; margin: 30px 0 10px; }
.doc p, .doc li { font-size: 14px; color: var(--muted); line-height: 1.75; margin-bottom: 10px; }
.doc strong { color: var(--text-2); }
.doc a.inline { color: var(--ember); text-decoration: underline; text-underline-offset: 3px; }
.doc ul { padding-left: 18px; }

/* article layout */
.article { padding: 34px 0 10px; max-width: 760px; margin: 0 auto; }
.crumbs { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ember); }
.article h1 { font-size: clamp(28px, 4vw, 38px); margin: 14px 0 12px; line-height: 1.16; }
.article .dek { font-size: 15.5px; color: var(--text-2); line-height: 1.65; margin-bottom: 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 10.5px; color: var(--faint); font-family: var(--mono); letter-spacing: .04em; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article h2 { font-size: 22px; margin: 38px 0 12px; letter-spacing: -.04em; }
.article h3 { font-size: 16px; margin: 24px 0 8px; color: var(--text-2); }
.article p, .article li { font-size: 15px; color: var(--text-2); line-height: 1.8; margin-bottom: 12px; }
.article ul, .article ol { padding-left: 20px; }
.article li { margin-bottom: 7px; }
.article b, .article strong { color: var(--text); font-weight: 700; }
.article a.inline { color: var(--ember); text-decoration: underline; text-underline-offset: 3px; }
.article blockquote {
  margin: 18px 0; padding: 14px 18px; border-left: 2px solid var(--ember-line);
  background: rgba(255, 255, 255, .02); border-radius: 0 8px 8px 0;
  font-size: 14px; color: var(--muted); line-height: 1.7;
}
.article .table-wrap { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--line); border-radius: 10px; }
.article table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 420px; }
.article th {
  text-align: right; padding: 9px 11px; background: var(--panel-2);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.article th:first-child { text-align: left; }
.article td { text-align: right; padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.article td:first-child { text-align: left; color: var(--text); font-weight: 600; }
.article tr:last-child td { border-bottom: 0; }
.article .callout {
  margin: 20px 0; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: 11px; background: linear-gradient(180deg, rgba(255, 138, 76, .06), transparent 130px), var(--panel);
}
.article .callout b { display: block; font-size: 12px; color: var(--ember); letter-spacing: .06em; font-family: var(--mono); text-transform: uppercase; margin-bottom: 6px; }
.article .callout p { font-size: 13.5px; margin: 0; color: var(--muted); }
.article .next { display: grid; gap: 8px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.article .next a { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.article .next a:hover { color: var(--ember); }
.toc {
  margin: 20px 0 8px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255, 255, 255, .016);
}
.toc b { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { font-size: 12.5px; margin-bottom: 4px; color: var(--muted); }
.toc a:hover { color: var(--ember); }

.guides-head { padding: 38px 0 6px; }
.guides-head h1 { font-size: clamp(28px, 4vw, 38px); margin: 10px 0 12px; }
.guides-head p { color: var(--muted); font-size: 14.5px; max-width: 640px; }
.guides-grid { display: grid; gap: 10px; margin-top: 24px; }
.gcard {
  display: block; border: 1px solid var(--line); border-radius: 13px; padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 90px), var(--panel);
  transition: border-color .15s, transform .15s;
}
.gcard:hover { border-color: var(--ember-line); transform: translateY(-1px); }
.gcard .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--ember); }
.gcard h3 { font-size: 16px; margin: 6px 0 5px; color: var(--text); letter-spacing: -.03em; }
.gcard p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.gcard .r { display: inline-block; margin-top: 9px; font-size: 11px; color: var(--faint); font-family: var(--mono); }

/* ---------------- responsive ---------------- */

@media (min-width: 720px) {
  .guides-grid { grid-template-columns: 1fr 1fr; }
  .glink-list { grid-template-columns: 1fr 1fr; }
  .article .next { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .panel { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .result { position: relative; top: auto; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .hero { padding-top: 32px; }
  .topnav a.nav-about { display: none; }
  .xlinks { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 660px) {
  body { font-size: 15px; padding-bottom: 72px; }
  .wrap { padding: 0 16px; }
  .ticker .wrap { height: 29px; gap: 12px; font-size: 9.5px; -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .topbar .wrap { height: 56px; }
  .brand-mark { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
  .brand-text b { font-size: 15.5px; }
  .brand-text span { font-size: 9px; }
  .topnav a { padding: 7px 8px; font-size: 12px; }
  .topnav .lang { margin-left: 2px; }

  .hero { padding-top: 24px; }
  .hero h1 { font-size: 29px; margin: 11px 0 9px; line-height: 1.14; }
  .lede { font-size: 13.6px; line-height: 1.56; }
  .facts { gap: 5px; margin-top: 13px; }
  .facts li { font-size: 10.5px; padding: 4px 9px; }

  .tabs { margin-top: 20px; padding: 4px; gap: 3px; }
  .tab { flex-direction: column; gap: 2px; font-size: 12px; padding: 9px 4px 8px; line-height: 1.25; }
  .tab i { font-size: 9px; }

  .app { padding-top: 16px; }
  .inputs, .result { padding: 19px 17px 17px; }
  .panel-head h2 { font-size: 17px; }
  .panel-head p { font-size: 11px; }
  .panel-head .tag { display: none; }
  .field { padding-top: 16px; }
  .field-head label { font-size: 13px; }
  .field-head .hint { font-size: 10px; }
  .input-row { height: 49px; padding: 0 11px; }
  .input-row input { font-size: 20px; }
  .input-row .unit { font-size: 11.5px; }
  .seg button { padding: 8px 6px; font-size: 10.5px; }
  .chips button { padding: 5px 8px; font-size: 10.5px; }
  .field-pair { gap: 10px; }

  .big-out { font-size: 34px; }
  .res-sub { font-size: 11.5px; }
  .kpis { margin-top: 16px; gap: 6px; }
  .kpi { padding: 9px 8px 10px; }
  .kpi span { font-size: 8px; letter-spacing: .04em; }
  .kpi b { font-size: 14px; }
  .kpi em { font-size: 9px; }
  .lrow { font-size: 12px; padding: 8px 0; }
  .comp-key { grid-template-columns: 1fr; gap: 4px; }
  .actions { gap: 5px; }
  .btn { padding: 10px 6px; font-size: 11.5px; }
  .btn svg { width: 13px; height: 13px; }
  .mini-table th, .mini-table td { font-size: 10.5px; }
  .mini-table th:nth-child(5), .mini-table td:nth-child(5) { display: none; }
  .next-link b { font-size: 11.5px; }

  .minibar { display: flex; }
  .guide { padding-top: 34px; margin-top: 30px; }
  .xlinks { grid-template-columns: 1fr; }
  .doc { padding-top: 28px; }
  .doc h1 { font-size: 28px; }
  .article { padding-top: 24px; }
  .article h1 { font-size: 27px; }
  .article .dek { font-size: 14px; }
  .article p, .article li, .article ul, .article ol { font-size: 14px; }
  .article h2 { margin-top: 32px; font-size: 20px; }
  .toc { padding: 11px 13px; }
  .toast { bottom: 84px; }
}

@media (min-width: 981px) {
  .minibar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

@media print {
  .topbar, .ticker, .minibar, .actions, .tabs, .site-foot, .guide, .ad-slot { display: none; }
  body { background: #fff; color: #111; }
  body::before, body::after { display: none; }
  .card, .result { box-shadow: none; background: #fff; border-color: #ddd; }
  .result { position: static; }
}
