/* Goldnewhigh — focused financial calculator, dark theme */
:root {
  color-scheme: dark;
  --bg: #142b46;
  --surface: #203e60;
  --raised: #294e76;
  --line: #4a6c90;
  --text: #f1f6fd;
  --muted: #d1def0;
  --accent: #8fc8ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 20% 0%, #325d86 0%, #1d3e60 35%, var(--bg) 75%);
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.7 "Tahoma", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1220px; margin: auto; padding: 0 40px 28px; }
header {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid #6588aa;
  box-shadow: 0 1px 0 #102940;
  margin-bottom: 38px;
}
.brand { display: flex; align-items: baseline; font: 650 24px/1.3 "Segoe UI", sans-serif; letter-spacing: -.035em; }
.brand-accent { color: #edd29d; }
.brand-domain { font-size: 16px; font-weight: 400; letter-spacing: 0; color: #bfd1e7; margin-left: 3px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
h1 { font-size: clamp(24px, 2.8vw, 30px); line-height: 1.6; font-weight: 600; margin: 0; }
.education-notice {
  margin: 5px 0 0;
  padding: 5px 0 5px 12px;
  border-left: 2px solid #efd29a;
  color: #ffebc4;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.8;
}
.intro { margin: 10px 0 30px; color: var(--muted); font-size: 15px; }
h2 { font-size: 19px; font-weight: 600; line-height: 1.65; margin: 0 0 26px; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #2b4d71 0%, var(--surface) 65%);
  border-radius: 12px;
  box-shadow: 0 18px 38px #07172955, 0 3px 6px #07172944, inset 0 1px 0 #91badb66;
}
.panel { min-width: 0; padding: 30px 34px; }
.panel h2 { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.field { margin-bottom: 23px; }
label { display: block; font-size: 16px; font-weight: 600; color: #e0eaf7; margin-bottom: 8px; }
.input-wrap { position: relative; }
input {
  width: 100%;
  min-width: 0;
  display: block;
  border: 1px solid #688bb0;
  border-radius: 6px;
  background: linear-gradient(180deg, #122c47, #193754);
  box-shadow: inset 0 2px 5px #05182c88, 0 1px 0 #80a5cd44;
  padding: 11px 86px 11px 15px;
  color: #f5f7fa;
  font: 500 23px/1.45 "Segoe UI", Tahoma, sans-serif;
  font-variant-numeric: tabular-nums;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: #91b9e8; }
input::placeholder { color: #b3c9e0; font-size: 16px; font-weight: 400; }
input[aria-invalid="true"] { border-color: #ec9696; }
.unit { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); font-size: 14px; color: #c8dcf1; pointer-events: none; }
.hint { font-size: 14px; color: #bbd0e7; line-height: 1.85; margin-top: 7px; }
.presets { display: flex; gap: 0; margin-top: 10px; flex-wrap: wrap; }
button {
  min-height: 34px;
  border: 1px solid #7395b6;
  border-radius: 0;
  background: linear-gradient(180deg, #3c6186, #2c4e72);
  box-shadow: inset 0 1px 0 #a3c2e355, 0 2px 3px #09203955;
  color: #e4effb;
  padding: 5px 17px;
  font: 500 14px/1.5 "Segoe UI", sans-serif;
  cursor: pointer;
  margin-right: -1px;
}
button:hover { background: #466f98; }
button[aria-pressed="true"] { background: linear-gradient(180deg, #548ec6, #3675b0); color: #fff; border-color: #a2cefb; box-shadow: inset 0 1px 0 #c8e5ff66, 0 3px 7px #08284a77; position: relative; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; z-index: 1; }
.error { color: #f2b5b5; margin: 0; font-size: 14px; min-height: 23px; }
.result { border-left: 1px solid var(--line); background: linear-gradient(140deg, #214365 0%, #16324f 50%, #10283f 100%);
  border-radius: 0 12px 12px 0;
  box-shadow: inset 1px 0 0 #9cc5ea33; display: flex; flex-direction: column; }
.result h2 { color: #e0ecf9; }
.hero-number { display: flex; align-items: baseline; gap: 16px; margin: 6px 0; flex-wrap: wrap; }
.hero-number strong {
  font: 500 clamp(58px, 7.2vw, 78px)/1.2 "Segoe UI", sans-serif;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 2px 3px #0b254466;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.hero-number span { color: #d2e4f6; font-size: 18px; }
.rounded { color: var(--muted); font-size: 14px; margin: 12px 0 38px; }
.actual { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #6384a8; padding-top: 22px; font-size: 15px; }
.actual strong { font: 500 30px/1.5 "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; color: #b9dfff; }
.bar { height: 3px; background: #1a3654; overflow: hidden; margin: 13px 0 10px; }
.bar div { height: 100%; width: 0; background: linear-gradient(90deg, #68a5df, #a8d9ff); }
.bar-label { color: var(--muted); font-size: 14px; text-align: right; margin-bottom: 28px; }
dl { margin: auto 0 0; }
dl div { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 17px 0; font-size: 16px; }
dt { color: #c8daee; }
dd { margin: 0; text-align: right; font-family: "Segoe UI", Tahoma, sans-serif; font-weight: 500; font-variant-numeric: tabular-nums; }
.details { border-top: 1px solid var(--line); padding: 30px 0 4px; margin-top: 30px; }
.details h2 { font-size: 18px; margin-bottom: 12px; }
.details p { font-size: 16px; color: var(--muted); line-height: 1.95; margin: 12px 0; }
.eyebrow { font-size: 14px; color: #c2d6eb; margin-bottom: 6px; letter-spacing: .04em; }
section[aria-labelledby="risk-title"] { padding: 26px 28px; margin-top: 24px; border: 1px solid var(--line); background: linear-gradient(145deg, #2a4b6f, #1e3c5c); border-radius: 12px; box-shadow: 0 12px 26px #07192b44, inset 0 1px 0 #a5c9ec44; }
.details .assumption { padding: 9px 12px; border-left: 2px solid #ac9870; background: #284661; color: #f0ddb7; font-size: 14px; }
.risk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 26px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.risk-card { min-width: 0; padding: 22px 24px; border-left: 1px solid var(--line); }
.risk-card:first-child { border-left: 0; padding-left: 0; }
.risk-card:last-child { padding-right: 0; }
.risk-card h3 { font-size: 16px; font-weight: 500; color: #d2e2f3; margin: 0 0 12px; }
.risk-card strong { display: block; color: #f4f8ff; font: 500 29px/1.6 "Segoe UI", Tahoma, sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.risk-card span { display: block; color: #bed3e9; font-size: 14px; line-height: 1.9; margin-top: 7px; }
.details .risk-status { color: #efd9af; font-size: 14px; }
.details .formula { font-size: 16px; color: #deecfa; background: #203e5e; box-shadow: inset 0 1px 0 #8cb7e033; padding: 14px 18px; border-left: 2px solid #7e9bbd; overflow-wrap: anywhere; }
section[aria-labelledby="disclaimer-title"] { margin-top: 26px; padding-top: 24px; }
section[aria-labelledby="disclaimer-title"] h2 { font-size: 18px; color: #deebfa; }
section[aria-labelledby="disclaimer-title"] p { font-size: 15px; color: #d1def0; }
footer {
  margin-top: 32px;
  padding: 26px 0 8px;
  border-top: 1px solid var(--line);
  color: #c3d5e9;
  font-size: 14px;
  line-height: 1.9;
}
.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px 36px;
}
.footer-brand { display: block; color: #edf4fd; font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.footer-note { margin: 0; }
.footer-source { padding-top: 4px; }
.copyright { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid #4a6c9066; font-size: 13px; color: #b5c9df; }
@media (max-width: 800px) {
  .footer-main { flex-direction: column; gap: 16px; }
  .footer-source { padding-top: 0; }
  .copyright { margin-top: 20px; }
}
a { color: #bee2ff; text-underline-offset: 4px; }
a:hover { color: #fff; }

@media (max-width: 800px) {
  main { padding: 0 18px 24px; }
  header { min-height: 84px; margin-bottom: 26px; padding: 18px 0; }
  .brand { font-size: 22px; }
  .page-heading { gap: 8px; }
  .education-notice { margin-top: 4px; }
  .intro { margin-bottom: 22px; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 24px; }
  .result { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
  section[aria-labelledby="risk-title"] { padding: 24px 20px; }
  .risk-grid { grid-template-columns: 1fr; }
  .risk-card, .risk-card:first-child, .risk-card:last-child { padding: 20px 0; border-left: 0; border-top: 1px solid var(--line); }
  .risk-card:first-child { border-top: 0; }
  .actual, dl div { flex-wrap: wrap; }
  dd { margin-left: auto; }
}

/* Compact risk results in the main output panel. */
.risk-row dt { color: #edf4fd; }
.risk-value {
  color: #ffaaaa;
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.result-assumption {
  color: #e6d6b4;
  font-size: 13px;
  line-height: 1.85;
  margin: 16px 0 6px;
}
.result .risk-status {
  color: #d2e1f2;
  font-size: 13px;
  line-height: 1.85;
  margin: 0;
}

.metric-note { display: block; font-size: 13px; color: #cadbef; font-weight: 400; margin-top: 5px; line-height: 1.75; }

/* Contract stepper follows the existing dark blue result surface. */
.contract-controls { display: inline-flex; align-self: center; gap: 8px; }
.contract-controls button { width: 42px; height: 42px; padding: 0; border: 1px solid #6584a5; border-radius: 8px; background: linear-gradient(#2d5277, #1c3b5c); color: #f4f8ff; font-size: 25px; line-height: 1; cursor: pointer; box-shadow: inset 0 1px 0 #ffffff18, 0 2px 5px #0003; }
.contract-controls button:hover:not(:disabled) { background: #365f89; }
.contract-controls button:focus-visible { outline: 3px solid #91caff; outline-offset: 3px; }
.contract-controls button:disabled { opacity: .4; cursor: not-allowed; }
