/* ============================================================
   PCSUnited Analysis
   Home Buying Financial Analysis Dashboard
   style.css
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  --font-ui:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --page-bg: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #fafbff;

  --text-primary: #11172d;
  --text-secondary: #4f586d;
  --text-muted: #7a8295;
  --text-faint: #9aa1b1;

  --border: #e5e8f0;
  --border-soft: #eef0f5;
  --border-strong: #d7dce7;

  --navy: #0d153d;
  --navy-light: #172157;
  --navy-soft: #222d69;

  --purple: #6f37df;
  --purple-dark: #4e1fb4;
  --purple-light: #8d5be9;
  --purple-soft: #f3efff;

  --blue: #3e73e5;
  --blue-soft: #edf4ff;

  --green: #39a85b;
  --green-dark: #278848;
  --green-light: #61d16b;
  --green-soft: #edf9f0;

  --orange: #f78b0b;
  --orange-soft: #fff4e7;

  --red: #ed3e58;
  --red-soft: #fff0f3;

  --gold: #c89f44;
  --gold-light: #e4c66f;

  --shadow-xs:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 1px 3px rgba(16, 24, 40, 0.04);

  --shadow-sm:
    0 4px 14px rgba(30, 37, 62, 0.05),
    0 1px 4px rgba(30, 37, 62, 0.04);

  --shadow-md:
    0 10px 30px rgba(30, 37, 62, 0.07),
    0 2px 8px rgba(30, 37, 62, 0.04);

  --shadow-lg:
    0 20px 55px rgba(25, 31, 56, 0.1),
    0 4px 14px rgba(25, 31, 56, 0.05);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}


/* ============================================================
   2. RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(
      circle at 78% 0%,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0) 32%
    ),
    linear-gradient(
      180deg,
      #fbfcff 0%,
      #f7f8fc 100%
    );
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(111, 55, 223, 0.22);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* ============================================================
   3. APPLICATION SHELL
   ============================================================ */

.analysis-app {
  width: min(100%, 1536px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  padding:
    18px
    25px
    90px;
}

.analysis-main {
  display: flex;
  flex-direction: column;
  gap: 17px;
}


/* ============================================================
   4. TOP HEADER
   ============================================================ */

.analysis-header {
  min-height: 102px;
  display: grid;
  grid-template-columns:
    155px
    1px
    minmax(300px, 1fr)
    302px
    285px
    145px;
  gap: 22px;
  align-items: center;
  margin-bottom: 15px;
}

.analysis-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.analysis-brand__mark {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--gold);
}

.analysis-brand__star {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.analysis-brand__star svg {
  width: 23px;
  height: 23px;
  fill: var(--gold);
  stroke: var(--gold);
}

.analysis-brand__wing {
  width: 38px;
  height: 15px;
  position: relative;
  border-top: 4px solid var(--gold);
  transform: skewX(-25deg);
}

.analysis-brand__wing::before,
.analysis-brand__wing::after {
  content: "";
  position: absolute;
  height: 3px;
  background: var(--gold);
}

.analysis-brand__wing::before {
  width: 31px;
  top: 4px;
}

.analysis-brand__wing::after {
  width: 24px;
  top: 11px;
}

.analysis-brand__wing--left,
.analysis-brand__wing--left::before,
.analysis-brand__wing--left::after {
  border-radius: 999px 0 0 999px;
}

.analysis-brand__wing--left::before,
.analysis-brand__wing--left::after {
  right: 0;
}

.analysis-brand__wing--right {
  transform: scaleX(-1) skewX(-25deg);
}

.analysis-brand__copy {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.analysis-brand__name {
  color: #17203b;
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: 0.18em;
}

.analysis-brand__tagline {
  margin-top: 2px;
  color: #252d43;
  font-size: 0.54rem;
  font-weight: 720;
  letter-spacing: 0.22em;
}

.analysis-header__divider {
  width: 1px;
  height: 70px;
  background: var(--border);
}

.analysis-header__title-group {
  min-width: 0;
}

.analysis-header__title {
  color: var(--text-primary);
  font-size: clamp(1.65rem, 2vw, 2.1rem);
  font-weight: 740;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.analysis-header__subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}


/* ============================================================
   5. SELECTED HOME CARD
   ============================================================ */

.selected-home-card {
  min-height: 90px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.selected-home-card__image-wrap {
  width: 104px;
  height: 70px;
  overflow: hidden;
  border-radius: 8px;
}

.selected-home-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-home-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.selected-home-card__eyebrow {
  color: #414a5f;
  font-size: 0.72rem;
  font-weight: 590;
}

.selected-home-card__price {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 750;
}

.selected-home-card__details {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.69rem;
  white-space: nowrap;
}

.selected-home-card__separator {
  color: #b4bac7;
}

.selected-home-card__location {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ============================================================
   6. USER PROFILE HEADER
   ============================================================ */

.analysis-user {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.analysis-user__avatar-wrap {
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 3px solid #eee7dc;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.analysis-user__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analysis-user__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.analysis-user__greeting {
  margin-bottom: 5px;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 680;
}

.analysis-user__detail {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.analysis-user__detail + .analysis-user__detail {
  margin-top: 4px;
}

.analysis-user__detail svg {
  width: 14px;
  height: 14px;
  color: #64708a;
}

.ask-amy-button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  color: #ffffff;
  background:
    linear-gradient(
      140deg,
      #080f32 0%,
      #101a4d 100%
    );
  box-shadow:
    0 9px 24px rgba(11, 19, 58, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 0.98rem;
  font-weight: 650;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.ask-amy-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 13px 29px rgba(11, 19, 58, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ask-amy-button__icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: #ffffff;
}

.ask-amy-button__icon svg {
  width: 15px;
  height: 15px;
}


/* ============================================================
   7. AFFORDABILITY HERO
   ============================================================ */

.affordability-hero {
  min-height: 204px;
  display: grid;
  grid-template-columns:
    224px
    1.2fr
    1fr
    0.92fr
    0.92fr
    1fr;
  overflow: hidden;
  border: 1px solid #202c68;
  border-radius: 15px;
  color: #ffffff;
  background:
    radial-gradient(
      circle at 45% 0%,
      rgba(90, 102, 190, 0.18),
      rgba(90, 102, 190, 0) 38%
    ),
    linear-gradient(
      135deg,
      #0a1239 0%,
      #111c54 52%,
      #0d1744 100%
    );
  box-shadow:
    0 14px 36px rgba(12, 19, 55, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.affordability-verdict {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 15px 17px;
}

.affordability-verdict::after {
  content: "";
  position: absolute;
  top: 29px;
  right: 0;
  bottom: 29px;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.affordability-verdict__title {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 620;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.affordability-verdict__ring {
  width: 135px;
  height: 135px;
  margin-top: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(
      from -8deg,
      #58d267 0deg,
      #62d36d 288deg,
      rgba(255, 255, 255, 0.12) 288deg,
      rgba(255, 255, 255, 0.12) 360deg
    );
  box-shadow:
    0 0 25px rgba(83, 211, 105, 0.13);
}

.affordability-verdict__ring::before {
  content: "";
  width: 110px;
  height: 110px;
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #111c50 0%,
      #0c153f 80%
    );
}

.affordability-verdict__ring-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.affordability-verdict__answer {
  font-size: 1.8rem;
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1;
}

.affordability-verdict__message {
  margin-top: 7px;
  font-size: 0.7rem;
  line-height: 1.35;
}

.hero-metric {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 31px 18px 22px;
}

.hero-metric::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 0;
  bottom: 28px;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.hero-metric__label,
.affordability-score__label {
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 620;
  text-transform: uppercase;
  line-height: 1.3;
}

.hero-metric__value-row {
  margin-top: 13px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hero-metric__value {
  margin-top: 13px;
  color: #ffffff;
  font-size: 1.84rem;
  font-weight: 730;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hero-metric__value-row .hero-metric__value {
  margin-top: 0;
}

.hero-metric__suffix {
  color: rgba(255, 255, 255, 0.77);
  font-size: 0.72rem;
}

.hero-metric__description {
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 0.74rem;
  line-height: 1.35;
}

.hero-metric__note {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
}

.hero-status {
  width: max-content;
  min-height: 25px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 620;
}

.hero-status--healthy,
.hero-status--strong,
.hero-status--good {
  color: #d9ffe0;
  background: rgba(54, 155, 87, 0.26);
}

.affordability-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 17px;
  text-align: center;
}

.affordability-score__ring {
  width: 124px;
  height: 124px;
  margin-top: 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      #66d66f 0deg,
      #44b45f 331deg,
      rgba(255, 255, 255, 0.14) 331deg,
      rgba(255, 255, 255, 0.14) 360deg
    );
}

.affordability-score__ring::before {
  content: "";
  width: 99px;
  height: 99px;
  position: absolute;
  border-radius: 50%;
  background: #121d51;
}

.affordability-score__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.affordability-score__value {
  font-size: 2rem;
  font-weight: 760;
  letter-spacing: -0.05em;
  line-height: 1;
}

.affordability-score__rating {
  margin-top: 6px;
  font-size: 0.66rem;
}


/* ============================================================
   8. PRIMARY CONTENT GRID
   ============================================================ */

.analysis-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 18px;
  align-items: start;
}

.analysis-content-grid__main {
  min-width: 0;
  display: grid;
  grid-template-columns: 43% minmax(0, 57%);
  gap: 18px;
}

.analysis-content-grid__sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.analysis-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 19px 21px 8px;
}

.analysis-card__title,
.summary-card__title,
.price-scenarios-card__title {
  color: #20273a;
  font-size: 0.83rem;
  font-weight: 690;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.analysis-card__title-note {
  color: #83899a;
  font-weight: 450;
  text-transform: none;
}

.analysis-card__subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.74rem;
}


/* ============================================================
   9. PAYMENT BREAKDOWN CARD
   ============================================================ */

.payment-breakdown-card {
  min-height: 378px;
}

.payment-breakdown-card__body {
  display: grid;
  grid-template-columns: 195px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  padding: 8px 20px 17px;
}

.payment-donut {
  width: 188px;
  height: 188px;
  position: relative;
  margin: 0 auto;
}

.payment-donut__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.payment-donut__track,
.payment-donut__segment {
  fill: none;
  stroke-width: 24;
}

.payment-donut__track {
  stroke: #eff1f6;
}

.payment-donut__segment {
  stroke-linecap: butt;
}

.payment-donut__segment--principal {
  stroke: #6838db;
}

.payment-donut__segment--taxes {
  stroke: #4c85ea;
}

.payment-donut__segment--insurance {
  stroke: #f5a018;
}

.payment-donut__segment--hoa {
  stroke: #46b866;
}

.payment-donut__segment--pmi {
  stroke: #ed5d76;
}

.payment-donut__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.payment-donut__value {
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.045em;
}

.payment-donut__label {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.payment-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.payment-breakdown-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto 31px;
  gap: 9px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.69rem;
}

.payment-breakdown-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.payment-breakdown-item__dot--principal {
  background: #6838db;
}

.payment-breakdown-item__dot--taxes {
  background: #4c85ea;
}

.payment-breakdown-item__dot--insurance {
  background: #f5a018;
}

.payment-breakdown-item__dot--hoa {
  background: #46b866;
}

.payment-breakdown-item__dot--pmi {
  background: #ed5d76;
}

.payment-breakdown-item__amount {
  color: #333b50;
  font-size: 0.7rem;
  font-weight: 610;
}

.payment-breakdown-item__percentage {
  color: #81889a;
  font-size: 0.67rem;
  text-align: right;
}

.payment-breakdown-card__footer {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 21px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.68rem;
}

.payment-breakdown-card__footer strong {
  color: #5a6173;
  font-weight: 500;
}


/* ============================================================
   10. MONTHLY FLOW CARD
   ============================================================ */

.monthly-flow-card {
  min-height: 378px;
}

.monthly-flow-card__header {
  align-items: center;
}

.analysis-select {
  width: 108px;
  height: 37px;
  position: relative;
}

.analysis-select select {
  width: 100%;
  height: 100%;
  appearance: none;
  padding: 0 34px 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #4f586d;
  background: #ffffff;
  font-size: 0.73rem;
}

.analysis-select svg {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  color: #465168;
  pointer-events: none;
  transform: translateY(-50%);
}

.waterfall-chart {
  height: 236px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(60px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 5px 16px 9px;
}

.waterfall-column {
  height: 205px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.waterfall-column__value {
  color: #1b2236;
  font-size: 0.72rem;
  font-weight: 680;
  white-space: nowrap;
}

.waterfall-column__bar {
  width: 52px;
  margin: 5px 0 8px;
  border-radius: 4px 4px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.waterfall-column__label {
  min-height: 31px;
  color: #656d80;
  font-size: 0.66rem;
  line-height: 1.25;
  text-align: center;
}

.waterfall-column--income .waterfall-column__bar {
  height: 165px;
  background:
    linear-gradient(
      180deg,
      #55c66c,
      #39a856
    );
}

.waterfall-column--housing {
  padding-bottom: 79px;
}

.waterfall-column--housing .waterfall-column__bar {
  height: 55px;
  background:
    linear-gradient(
      180deg,
      #8154e5,
      #6834d6
    );
}

.waterfall-column--expenses {
  padding-bottom: 53px;
}

.waterfall-column--expenses .waterfall-column__bar {
  height: 38px;
  background:
    linear-gradient(
      180deg,
      #d9d3f5,
      #c4bee9
    );
}

.waterfall-column--debt {
  padding-bottom: 38px;
}

.waterfall-column--debt .waterfall-column__bar {
  height: 17px;
  background: #d9d4ef;
}

.waterfall-column--savings {
  padding-bottom: 13px;
}

.waterfall-column--savings .waterfall-column__bar {
  height: 29px;
  background: #d8d3ed;
}

.waterfall-column--remaining .waterfall-column__bar {
  height: 62px;
  background:
    linear-gradient(
      180deg,
      #5bc96e,
      #3ca958
    );
}

.waterfall-chart__connector {
  position: absolute;
  inset: 0 0 32px;
  z-index: 1;
  width: 100%;
  height: calc(100% - 32px);
  pointer-events: none;
}

.waterfall-chart__connector path {
  fill: none;
  stroke: #e2e0ef;
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

.monthly-flow-insight {
  min-height: 47px;
  margin: 0 17px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid #e8e3f3;
  border-radius: 10px;
  color: #50596e;
  background: #faf9fe;
  font-size: 0.7rem;
}

.monthly-flow-insight__icon {
  color: var(--green);
}

.monthly-flow-insight__icon svg {
  width: 20px;
  height: 20px;
}

.monthly-flow-insight strong {
  color: var(--green-dark);
  font-weight: 660;
}


/* ============================================================
   11. LOWER SUMMARY GRID
   ============================================================ */

.analysis-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.summary-card,
.reserves-card,
.key-takeaways-card {
  min-height: 191px;
}

.summary-card__header {
  padding: 16px 17px 10px;
}

.summary-card__heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.info-button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #687187;
  background: transparent;
}

.info-button:hover {
  background: #f0f2f6;
}

.info-button svg {
  width: 14px;
  height: 14px;
}

.summary-list {
  margin: 0 17px;
  border-top: 1px solid var(--border-soft);
}

.summary-list__row {
  min-height: 37px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  color: #555e72;
  font-size: 0.7rem;
}

.summary-list__row strong {
  color: #20273a;
  font-size: 0.72rem;
  font-weight: 650;
}

.compact-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 600;
}

.compact-status--excellent,
.compact-status--good {
  color: #2b8c48;
  background: #eaf7ed;
}

.summary-card__link,
.key-takeaways-card__link {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  color: var(--purple-dark);
  background: transparent;
  font-size: 0.67rem;
  font-weight: 560;
}

.summary-card__link:hover,
.key-takeaways-card__link:hover {
  background: #fbf9ff;
}

.summary-card__link svg,
.key-takeaways-card__link svg {
  width: 14px;
  height: 14px;
}

.upfront-total {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 17px;
  color: var(--purple-dark);
  font-size: 0.72rem;
  font-weight: 620;
}

.upfront-total strong {
  font-size: 1rem;
}

.reserves-card__content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 20px 6px;
}

.reserves-card__icon {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-dark);
  background:
    radial-gradient(
      circle,
      #edf8f0,
      #e5f6ea
    );
}

.reserves-card__icon svg {
  width: 39px;
  height: 39px;
}

.reserves-card__value-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.reserves-card__value {
  color: var(--text-primary);
  font-size: 1.18rem;
  font-weight: 730;
}

.reserves-card__label {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.reserves-card__value-group .compact-status {
  margin-top: 8px;
}

.reserves-card__description {
  padding: 9px 18px 15px;
  color: var(--text-muted);
  font-size: 0.67rem;
}


/* ============================================================
   12. AFFORDABILITY RESULT CARD
   ============================================================ */

.affordability-result-card {
  min-height: 381px;
  padding-bottom: 17px;
}

.affordability-result-card__header {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 19px 18px 8px;
}

.affordability-result-card__icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--purple);
  background: var(--purple-soft);
}

.affordability-result-card__icon svg {
  width: 23px;
  height: 23px;
}

.affordability-result-card__title {
  color: #222a3e;
  font-size: 0.78rem;
  font-weight: 680;
  text-transform: uppercase;
}

.affordability-result-card__headline {
  margin-top: 7px;
  display: block;
  color: #263047;
  font-size: 0.78rem;
  font-weight: 620;
}

.affordability-result-card__copy {
  padding: 4px 18px 0;
  color: var(--text-secondary);
  font-size: 0.73rem;
  line-height: 1.65;
}

.affordability-gauge {
  width: 100%;
  height: 184px;
  position: relative;
  margin-top: 7px;
}

.affordability-gauge__svg {
  width: 100%;
  height: 100%;
}

.affordability-gauge__segment {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
}

.affordability-gauge__segment--danger {
  stroke: #eb4055;
}

.affordability-gauge__segment--warning {
  stroke: #f19a16;
}

.affordability-gauge__segment--healthy {
  stroke:
    url("#healthyGradient");
  stroke: #46b95e;
}

.affordability-gauge__pivot {
  fill: #ffffff;
  stroke: var(--purple);
  stroke-width: 8;
}

.affordability-gauge__needle {
  stroke: var(--purple);
  stroke-width: 7;
  stroke-linecap: round;
  transform-origin: 160px 150px;
}

.affordability-gauge__value {
  position: absolute;
  left: 50%;
  bottom: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.affordability-gauge__value strong {
  color: var(--purple);
  font-size: 1.75rem;
  font-weight: 740;
  line-height: 1;
}

.affordability-gauge__value span {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.affordability-result-card__status {
  width: max-content;
  max-width: calc(100% - 36px);
  margin: 0 auto;
  display: block;
  padding: 5px 12px;
  border-radius: 6px;
  color: #2f8d4c;
  background: #eaf7ed;
  font-size: 0.66rem;
  text-align: center;
}


/* ============================================================
   13. PRICE SCENARIOS
   ============================================================ */

.price-scenarios-card {
  overflow: hidden;
}

.price-scenarios-card__header {
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--border-soft);
}

.price-scenarios-card__toggle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #354057;
  background: transparent;
}

.price-scenarios-card__toggle:hover {
  background: #f2f4f8;
}

.price-scenarios-card__toggle svg {
  width: 15px;
  height: 15px;
}

.price-scenario {
  min-height: 43px;
  display: grid;
  grid-template-columns: 1fr 92px 86px 39px;
  gap: 8px;
  align-items: center;
  padding: 8px 17px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.66rem;
}

.price-scenario--selected {
  color: #343d54;
  background: #fbf9ff;
  font-weight: 620;
}

.price-scenario__price {
  color: var(--purple-dark);
  font-size: 0.7rem;
}

.price-scenario__payment {
  color: #3c455d;
  font-size: 0.7rem;
}

.price-scenario__payment span {
  font-weight: 450;
}

.price-scenario__ratio {
  text-align: right;
}

.price-scenario__ratio--healthy {
  color: var(--green-dark);
}

.price-scenario__ratio--caution {
  color: #d78a0a;
}

.price-scenarios-card__footer {
  margin: 10px 12px 12px;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--text-muted);
  background: #faf9fd;
  font-size: 0.63rem;
}


/* ============================================================
   14. KEY TAKEAWAYS
   ============================================================ */

.key-takeaways-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 5px 17px 8px;
}

.key-takeaway {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #555e72;
  font-size: 0.67rem;
  line-height: 1.4;
}

.key-takeaway__icon {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
}

.key-takeaway__icon svg {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}


/* ============================================================
   15. BOTTOM NAVIGATION
   ============================================================ */

.analysis-footer {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(100%, 1536px);
  min-height: 69px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 246px;
  gap: 23px;
  align-items: center;
  padding:
    8px
    max(25px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(25px, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 -10px 30px rgba(35, 40, 62, 0.06),
    0 -1px 4px rgba(35, 40, 62, 0.04);
  backdrop-filter: blur(22px);
  transform: translateX(-50%);
}

.analysis-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.analysis-progress__step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 0;
  color: #252c40;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 560;
  white-space: nowrap;
}

.analysis-progress__number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2e3548;
  background: #edf0f4;
  font-size: 0.69rem;
  font-weight: 670;
}

.analysis-progress__step--complete .analysis-progress__number {
  color: #ffffff;
  background: var(--green);
}

.analysis-progress__step--active .analysis-progress__number {
  color: #ffffff;
  background:
    linear-gradient(
      140deg,
      #6f37df,
      #823cdd
    );
}

.analysis-progress__check {
  width: 16px;
  height: 16px;
  display: none;
  place-items: center;
  color: var(--green);
}

.analysis-progress__check svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.analysis-progress__step--complete .analysis-progress__check {
  display: grid;
}

.analysis-progress__connector {
  width: 55px;
  height: 1px;
  background: #dfe2e9;
}

.analysis-next-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #6e36d9,
      #873ae2
    );
  box-shadow:
    0 9px 22px rgba(111, 55, 223, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  font-weight: 630;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.analysis-next-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(111, 55, 223, 0.29),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.analysis-next-button svg {
  width: 18px;
  height: 18px;
}


/* ============================================================
   16. AMY PANEL
   ============================================================ */

.amy-panel-backdrop,
.analysis-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 16, 42, 0.38);
  backdrop-filter: blur(8px);
}

.amy-panel-backdrop {
  display: flex;
  justify-content: flex-end;
}

.amy-panel {
  width: min(100%, 440px);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #ffffff;
  box-shadow: -20px 0 60px rgba(15, 20, 48, 0.18);
}

.amy-panel__header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

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

.amy-panel__avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.amy-panel__eyebrow {
  color: var(--purple);
  font-size: 0.65rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.amy-panel__title {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 720;
}

.amy-panel__close,
.analysis-modal__close {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #657086;
  background: #f3f5f8;
}

.amy-panel__close:hover,
.analysis-modal__close:hover {
  color: #252d42;
  background: #eceff4;
}

.amy-panel__close svg,
.analysis-modal__close svg {
  width: 18px;
  height: 18px;
}

.amy-panel__conversation {
  overflow-y: auto;
  padding: 20px;
  background:
    linear-gradient(
      180deg,
      #fbfcff,
      #f7f8fc
    );
}

.amy-message {
  max-width: 88%;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.amy-message--assistant {
  border: 1px solid #e9e4f6;
  color: #384057;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.amy-panel__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 43px;
  gap: 10px;
  align-items: end;
  padding: 14px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.amy-panel__composer textarea {
  min-height: 47px;
  max-height: 130px;
  resize: none;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-primary);
  background: #fbfcfe;
  outline: 0;
}

.amy-panel__composer textarea:focus {
  border-color: #ae91e7;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(111, 55, 223, 0.08);
}

.amy-panel__send {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #6e36d9,
      #873ae2
    );
}

.amy-panel__send svg {
  width: 18px;
  height: 18px;
}


/* ============================================================
   17. REPORT MODAL
   ============================================================ */

.analysis-modal-backdrop {
  display: grid;
  place-items: center;
  padding: 20px;
}

.analysis-modal {
  width: min(100%, 720px);
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(224, 227, 235, 0.95);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(18, 24, 56, 0.24);
}

.analysis-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 23px 17px;
  border-bottom: 1px solid var(--border);
}

.analysis-modal__eyebrow {
  color: var(--purple);
  font-size: 0.68rem;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analysis-modal__title {
  margin-top: 3px;
  font-size: 1.4rem;
  font-weight: 730;
  letter-spacing: -0.03em;
}

.analysis-modal__body {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 20px 23px 25px;
}

.analysis-report-section + .analysis-report-section {
  margin-top: 22px;
}

.analysis-report-section h3 {
  color: #252c42;
  font-size: 0.93rem;
  font-weight: 680;
}

.analysis-report-section p {
  margin-top: 7px;
  color: #5a6275;
  font-size: 0.82rem;
  line-height: 1.65;
}


/* ============================================================
   18. LARGE SCREEN REFINEMENTS
   ============================================================ */

@media (min-width: 1450px) {
  .analysis-app {
    padding-left: 28px;
    padding-right: 28px;
  }

  .analysis-content-grid {
    grid-template-columns: minmax(0, 1fr) 392px;
  }
}


/* ============================================================
   19. DESKTOP COMPRESSION
   ============================================================ */

@media (max-width: 1300px) {
  .analysis-header {
    grid-template-columns:
      130px
      1px
      minmax(260px, 1fr)
      270px
      245px
      130px;
    gap: 14px;
  }

  .selected-home-card {
    grid-template-columns: 91px minmax(0, 1fr);
  }

  .selected-home-card__image-wrap {
    width: 91px;
  }

  .analysis-content-grid {
    grid-template-columns: minmax(0, 1fr) 345px;
  }

  .affordability-hero {
    grid-template-columns:
      205px
      1.15fr
      0.95fr
      0.9fr
      0.9fr
      0.95fr;
  }

  .hero-metric {
    padding-left: 14px;
    padding-right: 14px;
  }

  .payment-breakdown-card__body {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .payment-donut {
    width: 165px;
    height: 165px;
  }

  .analysis-progress__connector {
    width: 34px;
  }
}


/* ============================================================
   20. TABLET
   ============================================================ */

@media (max-width: 1100px) {
  .analysis-app {
    padding-left: 18px;
    padding-right: 18px;
  }

  .analysis-header {
    grid-template-columns: 120px 1px minmax(250px, 1fr) 260px 125px;
  }

  .analysis-user {
    display: none;
  }

  .analysis-content-grid {
    grid-template-columns: 1fr;
  }

  .analysis-content-grid__sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .affordability-result-card {
    grid-row: span 2;
  }

  .key-takeaways-card {
    min-height: auto;
  }

  .analysis-progress__label {
    display: none;
  }

  .analysis-progress__connector {
    width: 50px;
  }
}


/* ============================================================
   21. SMALL TABLET
   ============================================================ */

@media (max-width: 900px) {
  .analysis-header {
    grid-template-columns: 105px minmax(0, 1fr) 120px;
    gap: 12px;
  }

  .analysis-header__divider,
  .selected-home-card {
    display: none;
  }

  .analysis-header__title {
    font-size: 1.55rem;
  }

  .affordability-hero {
    grid-template-columns: repeat(2, 1fr);
  }

  .affordability-verdict {
    grid-column: span 2;
  }

  .affordability-verdict::after {
    display: none;
  }

  .hero-metric,
  .affordability-score {
    min-height: 170px;
  }

  .hero-metric:nth-of-type(2n)::after {
    display: none;
  }

  .analysis-content-grid__main {
    grid-template-columns: 1fr;
  }

  .analysis-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reserves-card {
    grid-column: 1 / -1;
  }

  .analysis-content-grid__sidebar {
    grid-template-columns: 1fr;
  }

  .affordability-result-card {
    grid-row: auto;
  }

  .analysis-footer {
    grid-template-columns: minmax(0, 1fr) 210px;
  }
}


/* ============================================================
   22. MOBILE
   ============================================================ */

@media (max-width: 680px) {
  .analysis-app {
    padding:
      12px
      11px
      92px;
  }

  .analysis-header {
    min-height: 80px;
    grid-template-columns: 1fr auto;
  }

  .analysis-brand {
    display: none;
  }

  .analysis-header__title-group {
    min-width: 0;
  }

  .analysis-header__title {
    font-size: 1.35rem;
  }

  .analysis-header__subtitle {
    margin-top: 5px;
    font-size: 0.78rem;
  }

  .ask-amy-button {
    min-width: 106px;
    min-height: 47px;
    font-size: 0.82rem;
  }

  .affordability-hero {
    grid-template-columns: 1fr;
    border-radius: 14px;
  }

  .affordability-verdict {
    grid-column: auto;
  }

  .hero-metric,
  .affordability-score {
    min-height: 145px;
    padding: 22px 20px 18px;
  }

  .hero-metric::after {
    top: auto;
    left: 18px;
    right: 18px;
    bottom: 0;
    width: auto;
    height: 1px;
  }

  .affordability-score__ring {
    width: 112px;
    height: 112px;
  }

  .payment-breakdown-card__body {
    grid-template-columns: 1fr;
  }

  .payment-breakdown-list {
    width: 100%;
  }

  .payment-breakdown-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .monthly-flow-card {
    overflow-x: auto;
  }

  .waterfall-chart {
    min-width: 650px;
  }

  .analysis-summary-grid {
    grid-template-columns: 1fr;
  }

  .reserves-card {
    grid-column: auto;
  }

  .analysis-content-grid__sidebar {
    display: flex;
  }

  .price-scenario {
    grid-template-columns: 1fr 82px 75px 35px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .analysis-footer {
    grid-template-columns: 1fr;
    min-height: 72px;
    padding:
      9px
      11px
      max(9px, env(safe-area-inset-bottom));
  }

  .analysis-progress {
    display: none;
  }

  .analysis-next-button {
    width: 100%;
  }

  .amy-panel {
    width: 100%;
  }
}


/* ============================================================
   23. VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 430px) {
  .analysis-header {
    grid-template-columns: 1fr 92px;
  }

  .analysis-header__title {
    font-size: 1.18rem;
  }

  .analysis-header__subtitle {
    font-size: 0.71rem;
  }

  .ask-amy-button {
    min-width: 92px;
    padding: 0 10px;
  }

  .ask-amy-button__icon {
    display: none;
  }

  .analysis-card__header,
  .summary-card__header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .payment-breakdown-card__body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .affordability-result-card__header,
  .affordability-result-card__copy {
    padding-left: 14px;
    padding-right: 14px;
  }

  .price-scenario {
    grid-template-columns: 1fr 78px 67px 33px;
    gap: 5px;
    font-size: 0.61rem;
  }

  .reserves-card__content {
    padding-left: 15px;
    padding-right: 15px;
  }
}


/* ============================================================
   24. REDUCED MOTION
   ============================================================ */

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