:root {
  --bg: #071511;
  --bg-deep: #030b09;
  --text: #effff7;
  --muted: #9fb5ac;
  --muted-soft: #738a80;
  --glass: rgba(255, 255, 255, 0.075);
  --glass-soft: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(8, 28, 22, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --line-bright: rgba(255, 255, 255, 0.24);
  --green: #65f6a7;
  --green-deep: #22b96f;
  --mint: #cffff0;
  --coral: #ff826d;
  --violet: #a99aff;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  --blur: blur(26px) saturate(145%);
  --content-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 6%, rgba(60, 238, 142, .22), transparent 29rem),
    radial-gradient(circle at 93% 15%, rgba(169, 154, 255, .19), transparent 30rem),
    radial-gradient(circle at 64% 68%, rgba(20, 148, 110, .18), transparent 36rem),
    linear-gradient(145deg, #06100d 0%, #0a2119 52%, #050d0b 100%);
  background-attachment: fixed;
  font-family: "Manrope", sans-serif;
}
body::before,
body::after {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  content: "";
  filter: blur(12px);
  pointer-events: none;
}
body::before {
  top: 28%;
  left: -13rem;
  width: 31rem;
  height: 31rem;
  background: radial-gradient(circle at 58% 42%, rgba(101, 246, 167, .23), rgba(35, 132, 92, .04) 66%, transparent 72%);
}
body::after {
  right: -11rem;
  bottom: 7%;
  width: 27rem;
  height: 27rem;
  background: radial-gradient(circle at 40% 45%, rgba(169, 154, 255, .18), rgba(77, 64, 140, .03) 68%, transparent 73%);
}
button, input { font: inherit; }
::selection { color: #071511; background: var(--green); }
.app-shell[hidden], .auth-screen[hidden], .auth-state[hidden] { display: none; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-card {
  position: relative;
  width: min(100%, 510px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 38px;
  border: 1px solid var(--line-bright);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.035));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.13);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.auth-card::before { position: absolute; top: -120px; right: -100px; width: 320px; height: 320px; border-radius: 50%; background: rgba(101,246,167,.15); filter: blur(40px); content: ""; pointer-events: none; }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-state { position: relative; z-index: 1; margin-top: 70px; }
.auth-state h1 { margin: 0 0 18px; font-size: clamp(36px, 8vw, 54px); line-height: .98; letter-spacing: -.065em; }
.auth-state h1 em { color: transparent; background: linear-gradient(100deg, var(--green), #cffff0 55%, var(--violet)); background-clip: text; -webkit-background-clip: text; font-style: normal; }
.auth-state > p:not(.eyebrow) { margin: 0 0 28px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.auth-state > p strong { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.google-button, .secondary-auth-button { width: 100%; min-height: 56px; border-radius: 16px; cursor: pointer; font-weight: 800; transition: .2s ease; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid rgba(255,255,255,.24); color: #15231d; background: #fff; box-shadow: 0 14px 35px rgba(0,0,0,.22); }
.google-button:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0,0,0,.29); }
.google-icon { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #dde3e0; border-radius: 50%; color: #4285f4; font: 700 15px/1 Arial, sans-serif; }
.secondary-auth-button { border: 1px solid rgba(101,246,167,.45); color: var(--green); background: rgba(101,246,167,.08); }
.secondary-auth-button:hover { background: rgba(101,246,167,.14); transform: translateY(-1px); }
.auth-legal { display: block; margin-top: 17px; color: var(--muted-soft); font-size: 11px; line-height: 1.6; text-align: center; }
.auth-legal a, footer a { color: inherit; text-decoration-color: rgba(101,246,167,.45); text-underline-offset: 3px; }
#auth-loading { margin: auto 0; text-align: center; }
#auth-loading p { margin: 17px 0 0; font-size: 13px; }
.auth-spinner { width: 34px; height: 34px; display: inline-block; border: 3px solid rgba(101,246,167,.14); border-top-color: var(--green); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 18, 14, .52);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-copy { display: grid; gap: 2px; font-size: 18px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.brand-copy small { color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 12px;
  color: var(--green);
  background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 9px 24px rgba(0,0,0,.24);
  font-family: "DM Mono", monospace;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: #c8d9d1;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  font-size: 12px;
  font-weight: 700;
}
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(101,246,167,.12), 0 0 16px var(--green); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.logout-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); background: var(--glass-soft); cursor: pointer; font-size: 11px; font-weight: 700; transition: .2s ease; }
.logout-button:hover { border-color: rgba(101,246,167,.45); color: var(--green); background: rgba(101,246,167,.08); }

main { position: relative; max-width: var(--content-width); margin: 0 auto; padding: 0 32px 80px; }
.intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); align-items: end; gap: clamp(38px, 5vw, 72px); padding: 64px 0 48px; }
.eyebrow { margin: 0 0 17px; color: var(--green); font: 500 12px/1 "DM Mono", monospace; letter-spacing: .17em; }
.intro h1 { margin: 0; font-size: clamp(52px, 5.25vw, 74px); font-weight: 800; line-height: .94; letter-spacing: -.075em; text-shadow: 0 16px 50px rgba(0,0,0,.3); }
.intro h1 > span { white-space: nowrap; }
.intro h1 em { color: transparent; background: linear-gradient(100deg, var(--green) 6%, #bfffdc 48%, var(--violet) 100%); background-clip: text; -webkit-background-clip: text; font-style: normal; }
.intro-copy { max-width: 390px; margin: 0 0 7px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.input-panel,
.result-panel,
.scenario-card,
.table-card {
  position: relative;
  border: 1px solid var(--line-bright);
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.scenario-card::before,
.table-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,.09), transparent 23%, transparent 75%, rgba(101,246,167,.035));
  content: "";
  pointer-events: none;
}
.workspace { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 20px; }
.input-panel, .result-panel { position: relative; z-index: 1; overflow: hidden; padding: 42px; border-radius: 28px; }
.result-panel[hidden], .return-section[hidden] { display: none; }
.input-panel { background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035)); }
.panel-heading { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 34px; }
.panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 18px; }
.field { display: grid; gap: 8px; }
.optional-control, .optional-field { grid-column: 1 / -1; }
.optional-control { display: flex; align-items: center; gap: 12px; margin: -4px 0 0; }
.optional-control p { margin: 0; color: var(--muted-soft); font-size: 11px; }
.optional-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid rgba(101,246,167,.28); border-radius: 100px; color: var(--green); background: rgba(101,246,167,.07); cursor: pointer; font-size: 11px; font-weight: 800; transition: .2s ease; }
.optional-toggle:hover { border-color: rgba(101,246,167,.55); background: rgba(101,246,167,.12); transform: translateY(-1px); }
.optional-toggle:focus-visible { outline: 3px solid rgba(101,246,167,.2); outline-offset: 3px; }
.optional-toggle span { font: 500 16px/1 "DM Mono", monospace; }
.optional-toggle[aria-expanded="true"] { color: #dff9eb; background: rgba(101,246,167,.13); }
.optional-field[hidden] { display: none; }
.optional-field { padding: 16px; border: 1px solid rgba(101,246,167,.16); border-radius: 18px; background: rgba(101,246,167,.045); animation: reveal-field .22s ease both; }
@keyframes reveal-field { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.field > span { color: #dcece5; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.field small { color: var(--muted-soft); font-size: 11px; }
.money-input {
  min-height: 60px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 15px;
  background: rgba(4, 18, 14, .34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.money-input:hover { border-color: rgba(255,255,255,.24); }
.money-input:focus-within { border-color: rgba(101,246,167,.65); background: rgba(8,32,24,.62); box-shadow: 0 0 0 4px rgba(101,246,167,.10), inset 0 1px 0 rgba(255,255,255,.08); }
.money-input b { padding-left: 16px; color: var(--green); font: 500 13px/1 "DM Mono", monospace; }
.money-input input { width: 100%; min-width: 0; padding: 14px 16px 13px 10px; border: 0; outline: 0; color: #fff; background: transparent; caret-color: var(--green); font: 500 20px/1 "DM Mono", monospace; }
.money-input.no-prefix input { padding-left: 16px; }
.money-input.no-prefix b { padding: 0 16px 0 0; color: var(--muted); white-space: nowrap; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.submit-button, .reset-button { padding: 12px 18px; border-radius: 100px; cursor: pointer; font-size: 12px; font-weight: 800; transition: .2s ease; }
.submit-button { border: 1px solid rgba(101,246,167,.6); color: #062017; background: var(--green); box-shadow: 0 10px 28px rgba(101,246,167,.16); }
.submit-button:hover { background: #8affbd; box-shadow: 0 13px 32px rgba(101,246,167,.22); transform: translateY(-1px); }
.submit-button:focus-visible, .reset-button:focus-visible { outline: 3px solid rgba(101,246,167,.2); outline-offset: 3px; }
.reset-button { border: 1px solid var(--line); color: #b8ccc3; background: var(--glass-soft); }
.reset-button:hover { border-color: rgba(101,246,167,.48); color: var(--green); background: rgba(101,246,167,.08); transform: translateY(-1px); }

.result-panel { display: flex; flex-direction: column; color: #f5fff9; background: linear-gradient(145deg, rgba(14,62,45,.64), rgba(3,18,14,.8)); }
.result-panel::after { position: absolute; top: -100px; right: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(101,246,167,.12); filter: blur(32px); content: ""; pointer-events: none; }
.result-header { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; }
.result-header > div { display: flex; align-items: center; gap: 13px; }
.result-header p { margin: 0; color: #afc5bb; font: 500 11px/1 "DM Mono", monospace; letter-spacing: .14em; }
.health-badge { position: relative; z-index: 1; padding: 7px 11px; border: 1px solid rgba(101,246,167,.3); border-radius: 100px; color: var(--green); background: rgba(101,246,167,.1); box-shadow: 0 0 24px rgba(101,246,167,.08); font: 500 10px/1 "DM Mono", monospace; }
.health-badge.loss { border-color: rgba(255,130,109,.35); color: var(--coral); background: rgba(255,130,109,.11); }
.main-profit { position: relative; z-index: 1; margin-top: 50px; color: var(--green); font: 500 clamp(38px, 5vw, 64px)/1 "DM Mono", monospace; letter-spacing: -.06em; text-shadow: 0 0 36px rgba(101,246,167,.16); word-break: break-word; }
.main-profit.loss { color: var(--coral); text-shadow: 0 0 30px rgba(255,130,109,.13); }
.profit-note { position: relative; z-index: 1; margin: 12px 0 32px; color: #92a99f; font-size: 12px; }
.metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metrics article { min-height: 116px; display: flex; flex-direction: column; padding: 17px; border: 1px solid rgba(255,255,255,.10); border-radius: 16px; background: rgba(255,255,255,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.metrics span { color: #92a99f; font-size: 11px; }
.metrics strong { margin-top: 9px; color: #fff; font: 500 22px/1 "DM Mono", monospace; }
.metrics small { margin-top: auto; color: #70877d; font-size: 9px; }
.formula-box { position: relative; z-index: 1; margin-top: auto; padding-top: 26px; }
.formula-box p { margin: 0 0 9px; color: #8ba198; font-size: 10px; }
.formula-box code { display: block; padding: 12px 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; color: #d1e5dc; background: rgba(0,0,0,.16); font: 400 11px/1.6 "DM Mono", monospace; }

.return-section { padding-top: 104px; }
.section-heading { display: grid; grid-template-columns: 1fr .7fr; align-items: end; gap: 40px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.06em; }
.section-heading > p { max-width: 470px; margin: 0 0 4px auto; color: var(--muted); line-height: 1.65; }
.scenario-card { padding: 38px; border-radius: 27px; }
.scenario-card > * { position: relative; z-index: 1; }
.range-label { display: flex; align-items: flex-end; justify-content: space-between; }
.range-label label { color: #dfeee8; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.range-label output { color: var(--green); text-shadow: 0 0 28px rgba(101,246,167,.16); font: 500 42px/1 "DM Mono", monospace; }
input[type="range"] { width: 100%; height: 6px; margin: 28px 0 12px; border-radius: 100px; appearance: none; background: linear-gradient(90deg, var(--green) var(--range-progress, 20%), rgba(255,255,255,.13) var(--range-progress, 20%)); box-shadow: inset 0 1px 3px rgba(0,0,0,.3); }
input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; border: 5px solid #143428; border-radius: 50%; appearance: none; background: var(--green); box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 0 22px rgba(101,246,167,.38); cursor: grab; }
.range-ticks { display: flex; justify-content: space-between; color: var(--muted-soft); font: 400 10px/1 "DM Mono", monospace; }
.scenario-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 38px; }
.scenario-results article { min-height: 128px; display: flex; flex-direction: column; padding: 19px; border: 1px solid rgba(255,255,255,.1); border-radius: 17px; background: rgba(255,255,255,.047); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.scenario-results article:last-child { background: linear-gradient(145deg, rgba(101,246,167,.12), rgba(101,246,167,.045)); }
.scenario-results .scenario-break-even { border-color: rgba(101,246,167,.18); background: rgba(3,18,14,.5); }
.scenario-results .scenario-break-even strong { color: var(--green); }
.scenario-results span { color: var(--muted); font-size: 11px; }
.scenario-results strong { margin-top: 12px; color: #fff; font: 500 23px/1 "DM Mono", monospace; }
.scenario-results small { margin-top: auto; color: var(--muted-soft); font-size: 10px; }
.scenario-results .negative { color: var(--coral); }
.bar-chart { display: flex; height: 11px; margin-top: 30px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 100px; background: rgba(255,255,255,.08); }
.bar-success { background: linear-gradient(90deg, #28c878, var(--green)); box-shadow: 0 0 16px rgba(101,246,167,.2); transition: width .2s ease; }
.bar-return { background: linear-gradient(90deg, #ff9d89, var(--coral)); transition: width .2s ease; }
.bar-legend { display: flex; justify-content: flex-end; gap: 18px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.bar-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.dot-success { background: var(--green); box-shadow: 0 0 8px rgba(101,246,167,.4); }
.dot-return { background: var(--coral); }

.table-card { margin-top: 38px; overflow: hidden; border-radius: 25px; }
.table-toolbar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.table-toolbar h3 { margin: 0; font-size: 17px; }
.table-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.search-field { width: 145px; height: 42px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,18,14,.32); transition: .2s ease; }
.search-field:focus-within { border-color: rgba(101,246,167,.55); box-shadow: 0 0 0 4px rgba(101,246,167,.08); }
.search-field input { width: 100%; border: 0; outline: 0; padding: 9px 4px 9px 12px; color: #fff; background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #71877e; }
.search-field b { padding-right: 11px; color: var(--green); font: 500 11px/1 "DM Mono", monospace; }
.table-scroll { position: relative; z-index: 1; max-height: 480px; overflow: auto; }
.table-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 100px; background: rgba(255,255,255,.18); background-clip: padding-box; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
thead { position: sticky; top: 0; z-index: 1; color: #dceddf; background: rgba(5,25,19,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
th { padding: 14px 16px; text-align: right; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
th:first-child, td:first-child { text-align: left; }
td { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.075); color: #dceae4; text-align: right; font-family: "DM Mono", monospace; }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover, tbody tr.active { background: rgba(101,246,167,.085); }
tbody tr.active td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.profit-cell { color: var(--green); font-weight: 500; }
.break-even-cell { color: var(--mint); font-weight: 500; background: rgba(101,246,167,.035); }
.profit-cell.loss { color: var(--coral); }
.status { display: inline-flex; padding: 6px 8px; border: 1px solid rgba(101,246,167,.16); border-radius: 100px; color: var(--green); background: rgba(101,246,167,.08); font: 500 9px/1 "DM Mono", monospace; }
.status.loss { border-color: rgba(255,130,109,.18); color: var(--coral); background: rgba(255,130,109,.08); }
.assumption-note { display: flex; gap: 14px; max-width: 920px; margin: 28px auto 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.assumption-note > span { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--green); background: var(--glass-soft); font: 500 11px/1 "DM Mono", monospace; }
.assumption-note p { margin: 1px 0 0; }

footer { display: flex; align-items: center; justify-content: space-between; min-height: 112px; padding: 0 max(32px, calc((100vw - var(--content-width))/2 + 32px)); border-top: 1px solid var(--line); color: #fff; background: rgba(3,12,9,.58); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
footer span { font-weight: 800; }
footer span small { margin-left: 8px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
footer p { margin: 0; color: var(--muted-soft); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.legal-page { width: min(100%, 880px); padding-top: 44px; }
.legal-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 34px; color: var(--text); text-decoration: none; }
.legal-card { padding: clamp(26px, 6vw, 58px); border: 1px solid var(--line-bright); border-radius: 28px; background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.legal-card h1 { max-width: 680px; margin: 0 0 20px; font-size: clamp(36px, 7vw, 62px); line-height: 1; letter-spacing: -.06em; }
.legal-card h2 { margin: 34px 0 8px; font-size: 18px; }
.legal-card p { color: var(--muted); font-size: 16px; line-height: 1.72; }
.legal-back { display: inline-flex; margin-top: 30px; color: var(--green); font-weight: 800; text-decoration: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .input-panel, .result-panel, .scenario-card, .table-card { background: #10251d; }
  .topbar, footer, thead { background: #071511; }
}

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

@media (max-width: 920px) {
  .intro { grid-template-columns: 1fr; gap: 28px; padding-top: 58px; }
  .intro h1 > span { white-space: normal; }
  .intro-copy { margin-left: 0; }
  .workspace { grid-template-columns: 1fr; }
  .workspace { gap: 18px; }
  .section-heading { grid-template-columns: 1fr; gap: 20px; }
  .section-heading > p { margin-left: 0; }
}

@media (max-width: 620px) {
  .auth-screen { padding: 14px; }
  .auth-card { min-height: calc(100vh - 28px); padding: 26px 22px; border-radius: 24px; }
  .topbar, main { padding-left: 18px; padding-right: 18px; }
  .topbar { height: 67px; }
  .status-pill { display: none; }
  .logout-button { padding: 8px 11px; }
  .intro { padding: 47px 0 35px; }
  .intro h1 { font-size: 49px; }
  .input-panel, .result-panel, .scenario-card { padding: 25px 20px; }
  .input-panel, .result-panel { border-radius: 23px; }
  .field-grid { grid-template-columns: 1fr; }
  .optional-control { align-items: flex-start; flex-direction: column; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .submit-button, .reset-button { width: 100%; }
  .main-profit { margin-top: 38px; font-size: 41px; }
  .scenario-results { grid-template-columns: 1fr; }
  .scenario-results article { min-height: 104px; }
  .table-toolbar { align-items: flex-start; gap: 18px; flex-direction: column; }
  .search-field { width: 100%; }
  footer { align-items: flex-start; gap: 10px; flex-direction: column; justify-content: center; padding-left: 18px; padding-right: 18px; }
}
