:root {
  --navy: #071d37;
  --navy-2: #0d2b4a;
  --steel: #587086;
  --teal: #2e776f;
  --teal-soft: #e8f3f1;
  --amber: #a76f2e;
  --amber-soft: #fbf3e8;
  --red: #a04444;
  --red-soft: #f9eded;
  --ink: #102235;
  --muted: #60717e;
  --line: #dbe3e8;
  --paper: #f4f7f8;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(7, 29, 55, 0.1);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 13px;
  color: var(--white);
  background: var(--navy);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 28px;
  color: var(--navy);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.product-brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-symbol {
  position: relative;
  display: block;
  width: 34px;
  height: 38px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--white);
}
.brand-symbol img {
  position: absolute;
  width: 116px;
  max-width: none;
  transform: translate(-41px,-23px);
}
.brand-copy { line-height: 1; }
.brand-copy strong { display: block; font-size: 17px; font-weight: 760; }
.brand-copy small {
  display: block;
  margin-top: 5px;
  color: var(--steel);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.header-context { display: flex; align-items: center; gap: 18px; }
.local-status { display: inline-flex; align-items: center; gap: 7px; color: var(--teal); font-size: 13px; font-weight: 680; }
.local-status svg { width: 17px; height: 17px; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--steel);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.icon-button:hover, .icon-button:focus-visible { color: var(--navy); border-color: var(--steel); }
.icon-button svg { width: 18px; }

.app-layout { display: grid; grid-template-columns: 254px minmax(0,1fr); min-height: 100vh; padding-top: 66px; }
.process-sidebar {
  position: fixed;
  top: 66px;
  bottom: 0;
  left: 0;
  width: 254px;
  display: flex;
  flex-direction: column;
  padding: 34px 24px 24px;
  color: var(--white);
  background: var(--navy);
}
.sidebar-label { margin-bottom: 24px; color: #9eb1c2; font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.step-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.step-list li {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  min-height: 70px;
  padding: 12px 10px;
  border-radius: var(--radius);
  opacity: .46;
  transition: background 180ms ease, opacity 180ms ease;
}
.step-list li:not(:last-child)::after {
  position: absolute;
  top: 47px;
  bottom: -17px;
  left: 25px;
  width: 1px;
  background: rgba(255,255,255,.2);
  content: "";
}
.step-list li.is-active { background: rgba(255,255,255,.09); opacity: 1; }
.step-list li.is-complete { opacity: .78; }
.step-list li > span {
  display: grid;
  place-items: center;
  align-self: start;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 750;
}
.step-list li.is-active > span { color: var(--navy); background: var(--white); border-color: var(--white); }
.step-list li.is-complete > span { color: var(--white); background: var(--teal); border-color: var(--teal); }
.step-list strong, .step-list small { display: block; }
.step-list strong { margin: 2px 0 2px; font-size: 14px; }
.step-list small { color: #b9c7d2; font-size: 11px; line-height: 1.35; }
.app-main { grid-column: 2; min-width: 0; padding: 48px clamp(28px, 5vw, 78px) 72px; }
#app-view { width: min(1120px, 100%); margin: 0 auto; outline: none; }
.app-legal-footer {
  display: flex;
  gap: 18px;
  width: min(1120px, 100%);
  margin: 52px auto 0;
  padding-top: 18px;
  color: var(--steel);
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.app-legal-footer a:hover,
.app-legal-footer a:focus-visible { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.view { animation: view-in 300ms ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { margin-bottom: 10px; color: var(--teal); font-size: 11px; font-weight: 780; letter-spacing: .13em; text-transform: uppercase; }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.view-heading > div:first-child { max-width: 740px; }
.view-heading h1 { margin-bottom: 12px; color: var(--navy); font-size: clamp(32px, 4vw, 52px); line-height: 1.06; font-weight: 740; }
.view-heading h2 { margin-bottom: 10px; color: var(--navy); font-size: clamp(27px, 3vw, 38px); line-height: 1.1; }
.view-heading p:not(.eyebrow) { max-width: 680px; margin-bottom: 0; color: var(--muted); font-size: 16px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 45px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 720;
  white-space: nowrap;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(46,119,111,.22); outline-offset: 2px; }
.button.primary { color: var(--white); background: var(--navy); }
.button.primary:hover { background: var(--navy-2); }
.button.secondary { color: var(--navy); background: var(--white); border-color: var(--line); }
.button.secondary:hover { border-color: var(--steel); }
.button.teal { color: var(--white); background: var(--teal); }
.button.text-button { min-height: 34px; padding: 0; color: var(--teal); background: transparent; }
.button[disabled] { cursor: not-allowed; opacity: .45; transform: none; }
.button svg { width: 17px; height: 17px; }
.view-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.right-actions { display: flex; gap: 10px; }

.choice-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; }
.choice-grid-single { grid-template-columns: minmax(0, 780px); justify-content: center; }
.choice-panel { min-width: 0; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 34px rgba(7,29,55,.05); }
.choice-panel.featured { border-top: 3px solid var(--teal); }
.panel-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.panel-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--teal); background: var(--teal-soft); border-radius: var(--radius); }
.panel-icon svg { width: 21px; }
.recommended { padding: 4px 8px; color: var(--teal); background: var(--teal-soft); border-radius: 3px; font-size: 10px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.choice-panel h2 { margin-bottom: 9px; color: var(--navy); font-size: 24px; line-height: 1.2; }
.choice-panel > p { color: var(--muted); font-size: 14px; }
.sample-documents { display: grid; gap: 8px; margin: 22px 0; }
.sample-document { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper); border: 1px solid #e8edef; border-radius: 4px; }
.sample-document svg { width: 18px; color: var(--steel); }
.sample-document strong { display: block; font-size: 12px; }
.sample-document small { display: block; color: var(--muted); font-size: 10px; }
.sample-document > span { color: var(--teal); font-size: 10px; font-weight: 720; }

.impact-strip { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 22px; padding: 18px 22px; color: var(--white); background: var(--navy); border-radius: var(--radius); }
.impact-strip div { min-width: 0; }
.impact-strip span, .impact-strip small { display: block; color: #b8c6d2; font-size: 10px; }
.impact-strip strong { display: block; margin: 2px 0; font-size: 19px; }
.impact-strip svg { width: 18px; color: #82b5ae; }

.analysis-overlay { display: grid; place-items: center; min-height: calc(100vh - 190px); }
.analysis-card { width: min(660px,100%); padding: 38px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.analysis-mark { position: relative; display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 24px; color: var(--teal); background: var(--teal-soft); border-radius: 50%; }
.analysis-mark::after { position: absolute; inset: -7px; border: 1px solid #b9d4d0; border-radius: 50%; content: ""; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(.86); opacity: 1; } to { transform: scale(1.28); opacity: 0; } }
.analysis-mark svg { width: 29px; height: 29px; }
.analysis-card h1 { margin-bottom: 9px; color: var(--navy); font-size: 31px; }
.analysis-card > p { color: var(--muted); }
.progress-track { height: 6px; margin: 26px 0 20px; overflow: hidden; background: #e5eaed; border-radius: 3px; }
.progress-track span { display: block; height: 100%; background: var(--teal); transition: width 260ms ease; }
.analysis-status { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.analysis-status strong { color: var(--navy); }
.analysis-status span { color: var(--muted); }

.review-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; min-width: 430px; }
.summary-stat { padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.summary-stat span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.summary-stat strong { display: block; margin-top: 3px; color: var(--navy); font-size: 18px; }
.review-grid { display: grid; gap: 16px; }
.offer-review { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.offer-review-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.offer-letter { display: grid; place-items: center; width: 34px; height: 34px; color: var(--white); background: var(--navy); border-radius: 4px; font-size: 12px; font-weight: 780; }
.offer-review-head h3 { margin: 0; color: var(--navy); font-size: 16px; }
.offer-review-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.review-badge { padding: 5px 8px; color: var(--teal); background: var(--teal-soft); border-radius: 3px; font-size: 10px; font-weight: 730; }
.review-badge.warning { color: var(--amber); background: var(--amber-soft); }
.review-fields { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; background: var(--line); }
.field { position: relative; padding: 14px 16px; background: var(--white); }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .04em; text-transform: uppercase; }
.field-value { display: block; color: var(--ink); font-size: 12px; font-weight: 660; }
.uncertainty-list { padding: 14px 20px 18px; background: #fffaf3; border-top: 1px solid #f1e1c9; }
.uncertainty-title { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--amber); font-size: 11px; font-weight: 740; }
.uncertainty-title svg { width: 15px; }
.uncertainty-item { padding: 10px 0; border-top: 1px solid #f1e5d3; }
.uncertainty-item:first-of-type { border-top: 0; }
.uncertainty-item strong { display: block; color: var(--ink); font-size: 12px; }
.source-snippet { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-style: normal; }
.weight-panel { margin-bottom: 20px; padding: 20px 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.weight-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.weight-head h2 { margin-bottom: 4px; font-size: 18px; }
.weight-head p { margin: 0; color: var(--muted); font-size: 11px; }
.weight-total { min-width: 94px; padding: 7px 10px; text-align: center; background: var(--paper); border-radius: 3px; font-size: 11px; font-weight: 720; }
.weight-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.weight-control { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; }
.weight-control > span { font-size: 12px; font-weight: 680; }
.weight-control > strong { color: var(--teal); font-size: 12px; }
.weight-meter { grid-column: 1 / -1; height: 5px; overflow: hidden; background: #dfe7e5; border-radius: 3px; }
.weight-meter span { display: block; height: 100%; background: var(--teal); }

.comparison-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.comparison-table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; }
.comparison-table th, .comparison-table td { padding: 13px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.comparison-table tr:last-child td { border-bottom: 0; }
.comparison-table th:last-child, .comparison-table td:last-child { border-right: 0; }
.comparison-table thead th { position: relative; padding-top: 18px; padding-bottom: 18px; color: var(--navy); background: #fbfcfc; font-size: 12px; }
.comparison-table thead th:first-child { width: 190px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.offer-th span { display: block; margin-bottom: 3px; color: var(--teal); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.comparison-table tbody td:first-child { color: var(--muted); background: #fbfcfc; font-size: 10px; font-weight: 690; }
.comparison-table tbody td:not(:first-child) { font-size: 12px; font-weight: 620; }
.table-value-main { display: block; color: var(--navy); font-size: 15px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 3px; font-size: 9px; font-weight: 730; }
.status-chip.included { color: var(--teal); background: var(--teal-soft); }
.status-chip.excluded { color: var(--red); background: var(--red-soft); }
.status-chip.optional { color: var(--amber); background: var(--amber-soft); }
.score-row td { padding-top: 18px; padding-bottom: 18px; background: #f8fbfa; }
.score-number { display: flex; align-items: baseline; gap: 4px; color: var(--navy); font-size: 22px; font-weight: 780; }
.score-number small { color: var(--muted); font-size: 9px; }
.score-bar { height: 4px; margin-top: 7px; overflow: hidden; background: #dfe7e5; border-radius: 2px; }
.score-bar span { display: block; height: 100%; background: var(--teal); animation: grow 700ms ease both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.result-hero { display: grid; grid-template-columns: 1fr 330px; gap: 20px; margin-bottom: 20px; }
.recommendation { padding: 30px; color: var(--white); background: var(--navy); border-radius: var(--radius); }
.recommendation .eyebrow { color: #84bbb4; }
.recommendation h1 { margin-bottom: 10px; font-size: clamp(30px,4vw,48px); line-height: 1.04; }
.recommendation > p { max-width: 620px; color: #c3cfd8; font-size: 14px; }
.reason-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 22px; }
.reason { padding: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 4px; }
.reason span { display: block; color: #aebfcb; font-size: 9px; text-transform: uppercase; }
.reason strong { display: block; margin-top: 3px; font-size: 12px; }
.final-score { display: grid; place-items: center; padding: 28px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.score-ring { display: grid; place-items: center; width: 130px; height: 130px; margin-bottom: 16px; border-radius: 50%; background: conic-gradient(var(--teal) var(--score), #e4eaed 0); }
.score-ring::before { grid-area: 1/1; width: 104px; height: 104px; background: var(--white); border-radius: 50%; content: ""; }
.score-ring strong { z-index: 1; grid-area: 1/1; color: var(--navy); font-size: 29px; }
.final-score > strong { font-size: 13px; }
.final-score > span { color: var(--muted); font-size: 10px; }

.result-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.result-panel { padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.result-panel h2 { margin-bottom: 16px; font-size: 19px; }
.rank-list { display: grid; gap: 8px; }
.rank-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px; background: var(--paper); }
.rank-item > span { display: grid; place-items: center; width: 29px; height: 29px; color: var(--white); background: var(--steel); border-radius: 3px; font-size: 11px; font-weight: 760; }
.rank-item:first-child > span { background: var(--teal); }
.rank-item strong, .rank-item small { display: block; }
.rank-item strong { font-size: 12px; }
.rank-item small { color: var(--muted); font-size: 9px; }
.rank-score { color: var(--navy); font-size: 15px; font-weight: 760; }
.saving-visual { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.time-block { padding: 14px; background: var(--paper); }
.time-block span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.time-block strong { display: block; margin-top: 3px; color: var(--navy); font-size: 24px; }
.saving-visual svg { width: 18px; color: var(--teal); }
.saving-note { margin: 13px 0 0; color: var(--muted); font-size: 9px; }
.disclaimer { margin-top: 16px; padding: 12px 14px; color: var(--muted); background: #f7f8f8; border-left: 2px solid var(--steel); font-size: 9px; }

.empty-state { padding: 52px; text-align: center; background: var(--white); border: 1px solid var(--line); }
.empty-state svg { width: 30px; color: var(--steel); }
.empty-state h2 { margin: 12px 0 7px; font-size: 21px; }
.empty-state p { color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(390px,calc(100vw - 44px));
  padding: 12px 15px;
  color: var(--white);
  background: var(--navy);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 12px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .app-layout { grid-template-columns: 1fr; align-content: start; }
  .process-sidebar { position: sticky; top: 66px; z-index: 20; grid-row: 1; width: auto; height: auto; padding: 10px 22px; }
  .sidebar-label, .step-list small { display: none; }
  .step-list { grid-template-columns: repeat(4,1fr); }
  .step-list li { grid-template-columns: 28px 1fr; min-height: 50px; padding: 8px; }
  .step-list li > span { width: 28px; height: 28px; }
  .step-list li:not(:last-child)::after { top: 24px; right: -10px; bottom: auto; left: auto; width: 20px; }
  .app-main { grid-column: 1; padding-top: 34px; }
  .choice-grid, .result-hero, .result-grid { grid-template-columns: 1fr; }
  .review-summary { min-width: 0; }
  .review-fields { grid-template-columns: repeat(2,1fr); }
  .final-score { grid-template-columns: auto 1fr; justify-content: center; text-align: left; }
  .score-ring { grid-row: span 2; margin: 0; }
}

@media (max-width: 680px) {
  .app-header { height: 58px; padding: 0 16px; }
  .local-status { font-size: 0; }
  .local-status svg { width: 19px; height: 19px; }
  .app-layout { width: 100%; max-width: 100vw; padding-top: 58px; overflow-x: clip; }
  .process-sidebar { top: 58px; width: 100%; max-width: 100vw; min-width: 0; padding: 8px 10px; overflow-x: auto; contain: inline-size; }
  .step-list { width: 510px; min-width: 510px; }
  .app-main { width: 100%; max-width: 100vw; min-width: 0; padding: 26px 16px 50px; overflow-x: clip; }
  .view-heading { display: block; margin-bottom: 24px; }
  .view-heading h1 { font-size: 32px; }
  .view-heading p:not(.eyebrow) { font-size: 14px; }
  .view-heading .review-summary { margin-top: 18px; }
  .choice-panel { padding: 21px; }
  .impact-strip { grid-template-columns: 1fr auto 1fr; padding: 16px; }
  .impact-strip div:last-child, .impact-strip svg:nth-of-type(2) { display: none; }
  .review-summary { grid-template-columns: repeat(3,1fr); }
  .summary-stat { padding: 9px; }
  .summary-stat strong { font-size: 15px; }
  .review-fields { grid-template-columns: 1fr; }
  .offer-review-head { grid-template-columns: auto 1fr; }
  .review-badge { grid-column: 1/-1; justify-self: start; }
  .weight-grid { grid-template-columns: 1fr; gap: 16px; }
  .reason-list { grid-template-columns: 1fr; }
  .view-actions { align-items: stretch; }
  .right-actions { flex: 1; justify-content: flex-end; }
  .right-actions .button { flex: 1; }
  .button-label-mobile { display: none; }
  .saving-visual { grid-template-columns: 1fr; }
  .saving-visual > svg { transform: rotate(90deg); }
  .final-score { grid-template-columns: 1fr; text-align: center; }
  .score-ring { grid-row: auto; margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .app-header, .process-sidebar, .view-actions, .app-legal-footer { display: none !important; }
  .app-layout { display: block; padding: 0; }
  .app-main { padding: 0; }
  body { background: var(--white); }
}
