:root {
  --bg: #0A0F1C;
  --bg-grad: #0C1322;
  --surface: #111A2B;
  --surface-2: #0E1726;
  --border: #1E2B42;
  --border-soft: #172238;
  --text: #E8EDF7;
  --muted: #8593AC;
  --muted-2: #5C6B85;
  --accent: #F6A623;
  --accent-soft: #FBB94A;
  --accent-dim: rgba(246, 166, 35, 0.14);
  --green: #34D399;
  --navy-chip: #1B2740;
  --radius: 14px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(246, 166, 35, 0.07), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(45, 90, 160, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

h1, h2, h3, .fig {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), #B9760F);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px -8px rgba(246, 166, 35, 0.6);
}

.logo svg {
  width: 22px;
  height: 22px;
}

.brand h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.acct {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acct .who {
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
}

.acct .who b {
  color: var(--text);
  font-weight: 600;
  display: block;
  font-size: 13px;
}

.ghost-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter';
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.lede {
  max-width: 680px;
  margin-bottom: 26px;
}

.lede h2 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.lede h2 .hl {
  color: var(--accent);
}

.lede p {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 10px;
}

/* layout */
.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 16px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 500;
}

.input-money {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.input-money span {
  padding: 0 12px;
  color: var(--muted-2);
  font-size: 14px;
  border-right: 1px solid var(--border);
}

.input-money input {
  width: 100%;
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  font-family: 'Space Grotesk';
  outline: none;
}

.input-money input:focus {
  color: var(--accent-soft);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* sliders */
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-head .val {
  font-family: 'Space Grotesk';
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: var(--border);
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid #1a2236;
  box-shadow: 0 0 0 1px var(--accent);
}

input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid #1a2236;
}

.scale {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 6px;
}

/* toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
}

.toggle-row span {
  font-size: 13px;
  color: var(--text);
}

.switch {
  position: relative;
  width: 46px;
  height: 25px;
  flex: none;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 25px;
  transition: .2s;
  cursor: pointer;
}

.track:before {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}

.switch input:checked + .track {
  background: var(--accent);
}

.switch input:checked + .track:before {
  transform: translateX(21px);
}

.range-dual {
  display: flex;
  gap: 10px;
  align-items: center;
}

.range-dual .input-money {
  flex: 1;
}

.generate {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #D98A12);
  color: #1a1205;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Space Grotesk';
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px -12px rgba(246, 166, 35, 0.7);
  transition: transform .12s, filter .12s;
}

.generate:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.generate:active {
  transform: translateY(0);
}

/* custom areas */
.custom-areas-container {
  margin-top: 14px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

.grp {
  margin-bottom: 14px;
}

.grp h4 {
  font-size: 11.5px;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  font-weight: 600;
}

.area-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.mini-sw {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted-2);
  font-weight: 500;
}

.mini-sw .switch {
  width: 38px;
  height: 21px;
}

.mini-sw .track:before {
  width: 15px;
  height: 15px;
}

.mini-sw input:checked + .track:before {
  transform: translateX(17px);
}

/* results */
.results-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 30px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.results-empty svg {
  width: 46px;
  height: 46px;
  opacity: .4;
  margin-bottom: 14px;
}

.results-empty h3 {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.results-empty p {
  font-size: 13.5px;
  max-width: 340px;
}

.res-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.res-head h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin: 0;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.bar-grp-label {
  font-size: 10.5px;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 10px 0 4px;
  font-weight: 600;
}

.bar-row {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.bar-row .lbl {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  line-height: 1.3;
}

.bar-track {
  height: 18px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #D98A12, var(--accent), var(--accent-soft));
  border-radius: 6px;
  width: 0;
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}

.bar-row .amt {
  font-size: 12.5px;
  color: var(--green);
  font-family: 'Space Grotesk';
  font-weight: 600;
  white-space: nowrap;
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--border);
  margin-top: 16px;
  padding-top: 14px;
}

.total-line .t {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.total-line .v {
  font-family: 'Space Grotesk';
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}

.projection {
  margin-top: 22px;
}

.proj-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.proj-head h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.compound-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent-soft);
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compound-btn:hover {
  background: var(--accent-dim);
}

.proj-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.pcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
}

.pcard .k {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.pcard .fig {
  font-size: 21px;
  font-weight: 700;
}

.pcard.accent .fig {
  color: var(--accent);
}

.pcard.green .fig {
  color: var(--green);
}

.op {
  font-family: 'Space Grotesk';
  font-size: 20px;
  color: var(--muted-2);
  text-align: center;
}

.footer-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 18px;
  align-items: end;
  margin-top: 22px;
  border-top: 1px solid var(--border-soft);
  padding-top: 18px;
}

.footer-bar .roi .k {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.footer-bar .roi .fig {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
}

.footer-bar .roi small {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 400;
  display: block;
}

.share {
  align-self: end;
  background: var(--navy-chip);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk';
}

.share:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.status {
  font-size: 11.5px;
  margin-top: 10px;
  color: var(--muted-2);
}

.status.ok {
  color: var(--green);
}

.status.warn {
  color: var(--accent-soft);
}

/* compound explainer */
.explainer-box {
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 18px;
}

.explainer-box ol {
  margin: 10px 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.explainer-box li {
  margin-bottom: 7px;
}

.explainer-box li b {
  color: var(--text);
}

/* modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 20px;
}

.overlay.show {
  display: grid;
}

.modal {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}

.modal .lock {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent-dim);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.modal .lock svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

.modal h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--text);
  text-transform: none;
}

.modal p {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 20px;
}

.modal .field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  outline: none;
  font-family: 'Inter';
}

.modal .field input:focus {
  border-color: var(--accent);
}

.modal .field input.err {
  border-color: #ef5350 !important;
}

.modal .errmsg {
  color: #ef8a87;
  font-size: 11.5px;
  margin-top: 6px;
}

.modal .generate {
  margin-top: 8px;
}

.modal .fine {
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .proj-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .op {
    display: none;
  }
  .bar-row {
    grid-template-columns: 130px 1fr auto;
    gap: 8px;
  }
  .bar-row .lbl {
    font-size: 11px;
  }
  .footer-bar {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .share {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bar-fill {
    transition: none;
  }
  .generate {
    transition: none;
  }
}