:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f4f0;
  --ink: #17231f;
  --muted: #68736e;
  --line: #dfe6e1;
  --green: #19a66a;
  --green-dark: #0d7049;
  --green-soft: #dcf6e9;
  --gold: #f3b63f;
  --purple: #7668d8;
  --blue: #3988dc;
  --danger: #cf5a53;
  --shadow: 0 16px 44px rgba(30, 54, 43, .08);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(25, 166, 106, .08), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 230, 225, .9);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px 11px 11px 4px;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(25, 166, 106, .25);
}

nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  border: 0;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}
.nav-link.active { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.logged-out-actions { display: flex; align-items: center; gap: 8px; }
.account-wrap { position: relative; }
.account-button {
  height: 42px;
  padding: 0 12px 0 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-weight: 800;
}
.account-button i { color: var(--muted); font-style: normal; }
.account-initial {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.account-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 40;
  width: 245px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 18px 45px rgba(19,38,29,.16);
}
.account-summary { padding: 16px; }
.account-summary strong, .account-summary small, .account-summary span { display: block; }
.account-summary small { margin: 4px 0 12px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.account-summary span { width: max-content; padding: 5px 8px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.account-menu > button { width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); color: #9b3f39; background: #fffafa; text-align: left; font-weight: 800; }
.prototype-pill, .premium-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

main {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 62px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 840px;
  margin-bottom: 16px;
  font-size: clamp(40px, 5.3vw, 68px);
  line-height: .99;
  letter-spacing: -.055em;
}
h2 { margin-bottom: 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.035em; }
h3 { margin-bottom: 5px; font-size: 21px; letter-spacing: -.025em; }

.hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 235px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.7);
}
.hero-badge strong, .hero-badge small { display: block; }
.hero-badge small { margin-top: 3px; color: var(--muted); }
.market-refresh {
  width: 31px;
  height: 31px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: white;
  font-size: 18px;
  font-weight: 900;
}
.market-refresh:hover { border-color: var(--green); background: var(--green-soft); }
.market-refresh:disabled { cursor: wait; opacity: .55; }
.hero-badge.loading .pulse { animation: data-pulse 1s ease-in-out infinite alternate; }
.hero-badge.error .pulse { background: var(--danger); box-shadow: 0 0 0 7px #fbe1df; }
@keyframes data-pulse { to { opacity: .35; transform: scale(.8); } }
.pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px var(--green-soft);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-strip {
  display: grid;
  grid-template-columns: 1.05fr 1.4fr .8fr auto;
  align-items: end;
  gap: 20px;
  padding: 20px;
}

label > span, .control-field > span, .allocation-status > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.control-strip > label > span, .control-strip > .control-field > span {
  font-size: 16px;
  font-weight: 820;
}

.money-input, .percent-input {
  height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  overflow: hidden;
}
.money-input b { padding-left: 14px; color: var(--muted); }
.percent-input b { padding-right: 14px; color: var(--muted); }
.money-input input, .percent-input input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
}

.range-line { display: flex; align-items: center; gap: 13px; min-height: 46px; }
input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}
.range-line output {
  min-width: 54px;
  padding: 8px;
  border-radius: 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  text-align: center;
  font-weight: 850;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); box-shadow: 0 8px 18px rgba(25,166,106,.2); }
.button-secondary { color: var(--green-dark); background: var(--green-soft); border-color: #c8ead9; }
.button-secondary.premium-active { color: white; background: var(--green-dark); border-color: var(--green-dark); }
.button-ghost { color: var(--muted); background: #f7f9f7; border-color: var(--line); }
.button:disabled { cursor: not-allowed; opacity: .7; transform: none; }
.button span { margin-left: 5px; font-size: 10px; text-transform: uppercase; }
.distribute-button {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border-color: #b9e6cf;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
}

.section-heading {
  margin: 56px 0 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}
.section-heading > p { max-width: 450px; margin: 0; color: var(--muted); text-align: right; }
.toolbar-actions { display: flex; align-items: center; gap: 14px; }
.allocation-status {
  width: 190px;
  padding: 10px 13px;
  border: 1px solid #b9e6cf;
  border-radius: 13px;
  background: var(--green-soft);
}
.allocation-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.allocation-status .allocation-label span {
  margin: 0;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.allocation-status strong { color: var(--green-dark); font-size: 20px; line-height: 1; }
.allocation-status .mini-track { height: 6px; margin-top: 8px; background: rgba(255,255,255,.8); }
.mini-track, .meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeea;
}
.mini-track i, .meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--green);
  transition: width .3s ease;
}

.portfolio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; }
.portfolio-card { overflow: hidden; }
.table-toolbar {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.table-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.rating-toolbar {
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}
.rating-toolbar > div { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rating-toolbar strong { font-size: 12px; }
.rating-toolbar small { margin-left: 5px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rating-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.rating-toolbar select { height: 32px; padding: 0 28px 0 9px; border-radius: 9px; font-size: 12px; }
.add-fund-wrap { display: flex; align-items: center; gap: 8px; }
.plan-limit-badge {
  padding: 6px 8px;
  border-radius: 999px;
  color: #8a6419;
  background: #fff4d9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-limit-badge.premium { color: var(--green-dark); background: var(--green-soft); }
.add-fund-wrap input {
  width: 145px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
  font-weight: 750;
  text-transform: uppercase;
}
select {
  max-width: 150px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
  font-weight: 700;
}
.table-scroll { overflow-x: visible; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 12px 7px;
  color: var(--muted);
  background: #fafbfa;
  font-size: 11px;
  letter-spacing: .04em;
  text-align: right;
  text-transform: uppercase;
}
.info-tip {
  width: 15px;
  height: 15px;
  margin-left: 3px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #aeb8b2;
  border-radius: 50%;
  color: #7d8982;
  background: white;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: lowercase;
  cursor: help;
  position: relative;
  vertical-align: 1px;
}
.info-tip::after {
  content: attr(data-tooltip);
  width: 225px;
  padding: 10px 11px;
  border-radius: 10px;
  color: white;
  background: #24332d;
  box-shadow: 0 10px 24px rgba(23,35,31,.18);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  white-space: normal;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}
.info-tip.edge::after { left: auto; right: -8px; transform: translate(0, -4px); }
.info-tip:hover::after,
.info-tip:focus::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.info-tip.edge:hover::after,
.info-tip.edge:focus::after { transform: translate(0, 0); }
th:first-child, td:first-child { padding-left: 14px; text-align: left; }
td {
  padding: 13px 7px;
  border-top: 1px solid #edf1ee;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}
.fund-name { display: flex; align-items: center; gap: 8px; }
.ticker-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 900;
}
.fund-name small { display: block; max-width: 98px; margin-top: 3px; overflow: hidden; color: var(--muted); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.allocation-cell { min-width: 96px; white-space: nowrap; }
.latest-dividend { min-width: 82px; color: var(--green-dark); font-weight: 850; white-space: nowrap; }
.distribution-frequency { min-width: 76px; white-space: nowrap; }
.distribution-frequency span { display: inline-block; padding: 5px 7px; border-radius: 8px; color: var(--green-dark); background: #eef7f2; font-size: 11px; font-weight: 850; }
.rating-heading, .rating-cell { width: 55px; min-width: 55px; text-align: center; }
.rating-box {
  width: 34px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  font-weight: 900;
  cursor: help;
}
.rating-box.very-poor { background: #991f24; }
.rating-box.poor { background: #d65b35; }
.rating-box.average { color: #654c0c; background: #f0c94d; }
.rating-box.good { color: #0a5c3c; background: #9cdeb9; }
.rating-box.excellent { background: #087348; }
.rating-box.unrated { color: #7c8781; background: #e9eeea; }
.allocation-input { width: 55px; padding: 7px 5px; border: 1px solid var(--line); border-radius: 9px; text-align: right; font-weight: 800; }
.amount-cell { min-width: 112px; }
.amount-editor {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.amount-editor:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(25,166,106,.1); }
.amount-editor b { padding-left: 9px; color: var(--muted); }
.amount-input {
  width: 76px;
  padding: 8px 7px 8px 4px;
  border: 0;
  outline: 0;
  text-align: right;
  font-weight: 800;
  background: transparent;
}
.yield-chip, .maintenance-chip { display: inline-block; padding: 5px 6px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); white-space: nowrap; }
.maintenance-chip { background: #fff4d9; color: #8a6419; }
.remove-button { width: 30px; height: 30px; border: 0; border-radius: 9px; color: var(--muted); background: #f3f5f3; }
.inline-warning {
  padding: 10px 14px 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #9b3f39;
  background: #fff0ef;
  border-top: 1px solid #f4d1ce;
  font-size: 13px;
  font-weight: 750;
}
.fix-button {
  min-height: 34px;
  color: white;
  background: #c9534c;
  border-color: #b84640;
  white-space: nowrap;
}
.hidden { display: none !important; }

.score-card { padding: 22px; }
.score-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-ring {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-dark);
  background: conic-gradient(var(--green) 0 76%, #e7ece8 76% 100%);
  position: relative;
  font-size: 19px;
  font-weight: 900;
}
.score-ring::before { content:""; position:absolute; inset:7px; border-radius:50%; background:white; }
.score-ring { isolation: isolate; }
.score-ring::after { content: attr(data-score); position: relative; z-index: 1; }
.score-ring { color: transparent; }
.ai-controls { margin-top: 24px; display: grid; gap: 17px; }
.ai-control { display: block; }
.ai-control > span {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.ai-control > span b {
  min-width: 33px;
  padding: 3px 7px;
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
  text-align: center;
}
.ai-slider {
  --slider-color: var(--green);
  width: 100%;
  height: 7px;
  margin: 0;
  accent-color: var(--slider-color);
  cursor: pointer;
}
.ai-slider.stability { --slider-color: var(--purple); }
.ai-slider.support { --slider-color: var(--blue); }
.ai-go-button {
  width: 100%;
  min-height: 47px;
  margin-top: 20px;
  color: white;
  background: linear-gradient(135deg, #0f7f53, #1cad70);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(25,166,106,.2);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
}
.ai-go-button:hover { transform: translateY(-1px); box-shadow: 0 13px 26px rgba(25,166,106,.27); }
.ai-go-button:disabled { cursor: wait; opacity: .72; transform: none; }
.ai-go-button span { margin-right: 6px; }
.meter-group { margin-top: 28px; }
.meter-row { margin: 16px 0 7px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 750; }
.meter-row b { color: var(--ink); }
.meter.purple i { background: var(--purple); }
.meter.blue i { background: var(--blue); }
.score-note { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.score-note strong { color: var(--ink); }

.ai-thinking-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 35, 25, .48);
  backdrop-filter: blur(8px);
}
.ai-thinking-card {
  width: min(100%, 470px);
  padding: 38px 34px 34px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 25px;
  background: white;
  box-shadow: 0 30px 80px rgba(13, 45, 31, .28);
  text-align: center;
  animation: ai-card-in .28s ease both;
}
.ai-thinking-card h2 { margin: 9px 0 12px; font-size: 27px; line-height: 1.15; }
.ai-thinking-card > p:not(.eyebrow) { margin: 0 auto; color: var(--muted); line-height: 1.5; }
.ai-orbit {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border: 7px solid #e4f3eb;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: ai-spin 1s linear infinite;
}
.ai-orbit span { color: var(--green); font-size: 25px; animation: ai-counter-spin 1s linear infinite; }
.ai-thinking-track {
  height: 8px;
  margin-top: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}
.ai-thinking-track i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #67dba6);
  animation: ai-progress 5s ease-in-out forwards;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-counter-spin { to { transform: rotate(-360deg); } }
@keyframes ai-progress { to { width: 100%; } }
@keyframes ai-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.limit-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 30, 25, .48);
  backdrop-filter: blur(7px);
}
.limit-card {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  background: white;
  box-shadow: 0 28px 80px rgba(17,30,25,.24);
  text-align: center;
  animation: ai-card-in .25s ease both;
}
.limit-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  box-shadow: 0 12px 28px rgba(25,166,106,.25);
  font-size: 24px;
}
.limit-card h2 { margin-bottom: 12px; }
.limit-card > p:not(.eyebrow) { margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }
.limit-card .button-primary { width: 100%; min-height: 48px; }
.limit-dismiss { margin: 10px 0 4px; border: 0; color: var(--muted); background: transparent; font-weight: 800; }
.limit-card small { display: block; color: #8b958f; font-size: 11px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card {
  min-height: 150px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { min-height: 34px; font-size: 15px; font-weight: 800; }
.metric-card strong { display: block; margin: 13px 0 8px; font-size: 28px; letter-spacing: -.035em; }
.metric-card small { font-size: 12px; line-height: 1.4; }
.metric-card.featured { color: white; background: linear-gradient(135deg, #0f7f53, #1cad70); border-color: transparent; box-shadow: 0 16px 34px rgba(25,166,106,.22); }
.metric-card.featured span, .metric-card.featured small { color: rgba(255,255,255,.76); }
.data-disclaimer {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}
.data-disclaimer strong { color: var(--ink); }

.premium-section {
  margin-top: 68px;
  padding: 1px 0 0;
  position: relative;
}
.premium-section .section-heading { margin-top: 0; }
.premium-price { color: var(--green-dark); font-size: 18px; font-weight: 900; }
.premium-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr); gap: 20px; }
.historical-card, .simulator-card { padding: 23px; }
.scenario-title { margin: 0 0 5px; font-size: clamp(28px, 2.35vw, 38px); line-height: 1.05; letter-spacing: -.045em; }
.scenario-explainer { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.scenario-subheading { margin: 4px 0 0; font-size: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.history-period-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.history-period-select { min-width: 170px; height: 44px; padding: 0 36px 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; font-size: 15px; font-weight: 850; }
.history-coverage { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.change-chip { padding: 7px 10px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-weight: 850; }
canvas { width: 100%; height: 260px; margin-top: 18px; }
.chart-legend { display: flex; gap: 16px; color: var(--muted); font-size: 11px; font-weight: 750; }
.chart-legend i { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 50%; }
.green-dot { background: var(--green); }
.gold-dot { background: var(--gold); }
.historical-stats { margin-top: 20px; padding-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; border-top: 1px solid var(--line); }
.historical-stats span, .historical-stats strong { display: block; }
.historical-stats span { min-height: 28px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.historical-stats strong { margin-top: 7px; font-size: 16px; }

.scenario-tabs { margin: 20px 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 5px; border-radius: 12px; background: #f0f3f0; }
.scenario-tabs button { padding: 8px 4px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; }
.scenario-tabs button.active { color: var(--green-dark); background: white; box-shadow: 0 3px 10px rgba(30,54,43,.1); }
.scenario-return { display: block; }
.projection-list { margin-top: 20px; display: grid; gap: 8px; }
.projection-list > div { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #f7f9f7; }
.projection-list span { color: var(--muted); font-size: 12px; font-weight: 800; }
.projection-list strong { font-size: 18px; text-align: right; }
.projection-list small { min-width: 95px; color: var(--green-dark); font-size: 11px; text-align: right; }
.maintenance-callout { margin-top: 18px; padding: 15px; border: 1px solid #f1dfae; border-radius: 13px; background: #fff9e9; }
.maintenance-callout span, .maintenance-callout strong, .maintenance-callout small { display: block; }
.maintenance-callout span { color: #8a6419; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.maintenance-callout strong { margin: 7px 0; font-size: 19px; }
.maintenance-callout small { color: #796b49; line-height: 1.4; }

.premium-lock {
  position: absolute;
  inset: 75px -10px -12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: rgba(241, 245, 242, .76);
  backdrop-filter: blur(9px);
  text-align: center;
  z-index: 5;
  transition: .3s ease;
}
.premium-lock h3 { margin: 12px 0 8px; font-size: 25px; }
.premium-lock p { max-width: 510px; margin-bottom: 18px; color: var(--muted); line-height: 1.5; }
.premium-lock small { margin-top: 10px; color: var(--muted); }
.lock-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: white; background: var(--green); font-size: 24px; box-shadow: 0 10px 24px rgba(25,166,106,.24); }
.premium-section.unlocked .premium-lock { opacity: 0; pointer-events: none; transform: translateY(10px); }

.bottom-callout { margin-top: 56px; padding: 27px; display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.bottom-callout p:last-child { max-width: 700px; margin: 9px 0 0; color: var(--muted); line-height: 1.5; }
.bottom-callout .button { min-width: 180px; }
.saved-scenarios { margin-top: 28px; }
.saved-scenarios-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.saved-count { padding: 7px 10px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 850; }
.saved-scenario-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.saved-scenario-card { padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 10px 26px rgba(30,54,43,.055); }
.saved-scenario-card h3 { margin: 0 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-scenario-card > p { min-height: 38px; margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.saved-scenario-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.saved-scenario-meta strong { color: var(--ink); }
.saved-scenario-actions { display: flex; gap: 8px; }
.saved-scenario-actions .button { min-height: 36px; flex: 1; padding: 0 11px; font-size: 12px; }
.delete-scenario { width: 37px; min-height: 36px; border: 1px solid #f0d5d2; border-radius: 10px; color: #a8443e; background: #fff5f4; font-size: 17px; font-weight: 850; }
.save-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17,30,25,.48);
  backdrop-filter: blur(7px);
}
.save-card { position: relative; width: min(100%, 480px); padding: 34px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: white; box-shadow: 0 28px 80px rgba(17,30,25,.24); animation: ai-card-in .25s ease both; }
.save-icon { width: 54px; height: 54px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 17px; color: white; background: linear-gradient(135deg, var(--green-dark), var(--green)); font-size: 22px; font-weight: 900; }
.save-card h2 { margin-bottom: 10px; }
.save-card > p:not(.eyebrow) { margin-bottom: 22px; color: var(--muted); line-height: 1.55; }
.save-card label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 850; }
.save-card input { width: 100%; height: 49px; margin-bottom: 13px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #fbfcfb; font-weight: 750; }
.save-card input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(25,166,106,.1); }
.save-card .button { width: 100%; }
.save-card small { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; text-align: center; }
.save-close { position: absolute; top: 15px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 10px; color: var(--muted); background: #f4f6f4; font-size: 21px; }
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 5%, rgba(25,166,106,.22), transparent 34rem),
    rgba(241,245,242,.97);
  backdrop-filter: blur(13px);
}
.auth-shell {
  position: relative;
  width: min(100%, 500px);
  padding: 32px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 25px;
  background: white;
  box-shadow: 0 30px 90px rgba(17,43,31,.16);
  animation: ai-card-in .3s ease both;
}
.auth-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 11px; color: var(--muted); background: #f1f4f2; font-size: 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-size: 20px; }
.auth-copy h1 { margin-bottom: 10px; font-size: 42px; line-height: 1; }
.auth-copy > p:last-child { margin-bottom: 24px; color: var(--muted); line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 5px; border-radius: 12px; background: #f0f3f0; }
.auth-tabs button { min-height: 39px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 850; }
.auth-tabs button.active { color: var(--green-dark); background: white; box-shadow: 0 3px 10px rgba(30,54,43,.1); }
.auth-form label { display: block; margin: 0 0 7px; color: var(--ink); font-size: 13px; font-weight: 850; }
.auth-form input { width: 100%; height: 48px; margin-bottom: 15px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fbfcfb; }
.auth-form input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(25,166,106,.1); }
.auth-form .button { width: 100%; min-height: 48px; margin-top: 3px; }
.auth-message { margin: 14px 0 0; padding: 11px 12px; border: 1px solid #efcfcc; border-radius: 10px; color: #963d37; background: #fff3f2; font-size: 12px; font-weight: 750; }
.testing-bypass { margin-top: 18px; padding: 14px; border: 1px dashed #b8ddca; border-radius: 12px; background: #f2fbf6; text-align: center; }
.testing-bypass span { display: block; margin-bottom: 5px; color: var(--green-dark); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.testing-bypass button { border: 0; color: var(--green-dark); background: transparent; font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.auth-terms { display: block; margin-top: 19px; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.disclaimer { margin: 38px auto 0; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 1000px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-badge { width: max-content; }
  .control-strip { grid-template-columns: 1fr 1fr; }
  .portfolio-layout, .premium-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .saved-scenario-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .topbar { padding: 0 16px; }
  .prototype-pill { display: none; }
  #previewToggle, #headerRegisterButton { display: none; }
  main { width: min(100% - 24px, 1240px); padding-top: 38px; }
  h1 { font-size: 42px; }
  .control-strip { grid-template-columns: 1fr; }
  .section-heading, .table-toolbar, .bottom-callout { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .allocation-status { width: 100%; }
  .add-fund-wrap { width: 100%; }
  .add-fund-wrap select { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr; }
  .saved-scenario-list { grid-template-columns: 1fr; }
  .historical-stats { grid-template-columns: repeat(2, 1fr); }
  .section-heading > p { text-align: left; }
}
