:root {
  --bg: #0e1412;
  --bg-2: #141c18;
  --panel: #1a2420;
  --line: #2a3832;
  --text: #e8efe9;
  --muted: #9aada3;
  --gold: #c8a45a;
  --gold-2: #e4c57a;
  --teal: #3d9b7a;
  --teal-2: #6bc4a3;
  --leak: #d36b5b;
  --gain: #6bc4a3;
  --warn: #e0b15a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

body {
  background-image:
    radial-gradient(1200px 500px at 10% -10%, rgba(200, 164, 90, 0.12), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(61, 155, 122, 0.1), transparent 45%);
}

h1,
h2,
h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.15;
}

h2 {
  font-size: 1.25rem;
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.lead {
  color: var(--muted);
  line-height: 1.55;
  max-width: 56ch;
}

.screen-lead {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.lead-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  background: linear-gradient(180deg, rgba(26, 36, 32, 0.9), rgba(20, 28, 24, 0.92));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.lead-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

input,
select {
  width: 100%;
  background: #0f1714;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 90, 0.18);
}

.field-inline {
  min-width: 260px;
}

.money-input {
  display: block;
  width: 100%;
  min-width: 180px;
  min-height: 48px;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  color: var(--text);
  caret-color: var(--gold-2);
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

.help {
  color: var(--muted);
  font-size: 0.75rem;
}

.error {
  color: var(--leak);
  min-height: 1em;
  font-size: 0.75rem;
}

.fineprint {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0;
}

.field-consent {
  margin-top: 4px;
}

.consent-box {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.45;
  cursor: pointer;
}

.consent-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary,
.btn-ghost {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn-primary {
  margin-top: 6px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a160c;
  border-radius: 12px;
  padding: 13px 16px;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}

.calc-top,
.panel-head,
.wealth-banner,
.kpis,
.scenario-grid {
  display: grid;
  gap: 16px;
}

.calc-top {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 24px;
}

.calc-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.btn-pdf,
#btn-calculate {
  margin-top: 0;
  white-space: nowrap;
}

.wealth-banner,
.panel,
.kpi,
.scenario {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.wealth-banner {
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 22px 24px;
  margin-bottom: 18px;
}

.wealth-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.8rem;
  margin: 4px 0 0;
  color: var(--gold-2);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel-head {
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 16px;
}

.hint {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.alloc-meter {
  min-width: 260px;
}

.alloc-meter-track {
  height: 8px;
  background: #0f1714;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.alloc-meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.2s ease, background 0.2s ease;
}

.alloc-meter-fill.over {
  background: var(--leak);
}

.alloc-meter-label {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.table-wrap {
  overflow-x: auto;
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.sheet th,
.sheet td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.sheet .num,
.sheet .num input {
  text-align: right;
}

.sheet tfoot th,
.sheet tfoot td {
  border-bottom: 0;
  padding-top: 14px;
}

.pct-input {
  width: 88px;
  padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace;
}

.value-input {
  width: 160px;
  min-width: 140px;
  padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
}

.rate-input {
  width: 92px;
  padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
}

.mono,
.sheet .num {
  font-family: "IBM Plex Mono", monospace;
}

.leak {
  color: var(--leak);
}

.gain {
  color: var(--gain);
}

.warning {
  margin: 12px 0 0;
  color: var(--warn);
  font-size: 0.85rem;
}

.kpis {
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 18px;
}

.kpi {
  padding: 18px;
}

.kpi-leak {
  background: linear-gradient(180deg, #2a1c1a, var(--panel));
}

.kpi-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.25rem;
  margin: 8px 0 4px;
}

.kpi-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.scenario-grid {
  grid-template-columns: 1fr 1fr;
}

.scenario {
  padding: 18px;
  background: #151d1a;
}

.scenario-opt {
  border-color: rgba(107, 196, 163, 0.35);
}

.scenario-kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scenario h3 {
  margin-bottom: 14px;
}

.scenario dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.scenario div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.scenario dt {
  color: var(--muted);
}

.scenario dd {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
}

.chart-box {
  background: #101714;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.sheet-compact {
  font-size: 0.85rem;
}

.calc-foot {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.calc-action {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  justify-items: start;
}

.calc-action .btn-primary {
  margin-top: 0;
  min-width: 220px;
}

.results-block.hidden {
  display: none;
}

.whats-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(320px, calc(100vw - 32px));
}

.whats-card {
  background: #102018;
  border: 1px solid rgba(107, 196, 163, 0.35);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.whats-kicker {
  margin: 0 0 4px;
  color: #6bc4a3;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.whats-title {
  margin: 0 0 6px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
}

.whats-copy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.btn-whats {
  display: block;
  text-align: center;
  text-decoration: none;
  background: #25d366;
  color: #082012;
  font-weight: 600;
  border-radius: 10px;
  padding: 11px 12px;
}

@media (max-width: 860px) {
  .whats-dock {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 1100px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .lead-shell,
  .calc-top,
  .wealth-banner,
  .panel-head,
  .kpis,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .lead-shell {
    padding: 24px;
  }
}
