:root {
  color-scheme: light;
  --ink: #141515;
  --muted: #6f716d;
  --line: rgba(20, 21, 21, 0.1);
  --paper: #fffefa;
  --screen: #f0eee8;
  --teal: #355d57;
  --green: #2f7a55;
  --navy: #1d2224;
  --amber: #9a7445;
  --soft-teal: #e8efea;
  --shadow: 0 30px 90px rgba(33, 31, 25, 0.18);
  --surface: rgba(255, 254, 250, 0.82);
  --surface-strong: #fffefa;
  --matte: #191a1a;
  --champagne: #d8c8ac;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, #e7e3d8 0%, #f7f5ef 42%, #e8ece7 100%);
  color: var(--ink);
  font-family: "Aptos", "Avenir Next", "Montserrat", "Century Gothic", "Futura", "Trebuchet MS", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04";
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 14px;
}

.phone-frame {
  width: min(100%, 440px);
  box-sizing: border-box;
  min-height: 840px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.74), rgba(240, 238, 232, 0.92)),
    var(--screen);
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px 22px 138px;
  backdrop-filter: blur(18px);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  margin: 0 0 4px;
  color: var(--matte);
  font-family: "Avenir Next", "Montserrat", "Century Gothic", "Futura", "Aptos", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1;
  letter-spacing: 0;
}

.brand-true {
  font-weight: 820;
}

.brand-retire {
  position: relative;
  color: var(--teal);
  font-weight: 520;
}

.brand-retire::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--champagne), transparent);
}

.welcome-card .brand-wordmark {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.74rem;
  line-height: 1.05;
  font-weight: 780;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.page-tabs {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  width: min(calc(100% - 24px), 408px);
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(33, 31, 25, 0.18);
}

.tab-button {
  flex: 1 1 calc(25% - 8px);
  min-width: 76px;
  min-height: 38px;
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 999px;
  background: rgba(247, 245, 239, 0.86);
  color: var(--muted);
  padding: 0 13px;
  font-size: 0.74rem;
  font-weight: 780;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(240, 238, 232, 0.92);
  backdrop-filter: blur(18px);
}

.welcome-overlay[hidden] {
  display: none;
}

.welcome-card {
  width: min(100%, 430px);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.welcome-card h1 {
  margin-top: 3px;
  color: var(--navy);
  font-size: 2.08rem;
  line-height: 1.02;
  font-weight: 800;
}

.welcome-copy {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.welcome-fields {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.welcome-actions,
.trust-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 780;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.primary-action {
  border: 0;
  background: var(--matte);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(20, 21, 21, 0.18);
}

.secondary-action {
  border: 1px solid rgba(53, 93, 87, 0.18);
  background: #edf2ee;
  color: var(--teal);
}

.danger-action {
  border: 1px solid rgba(185, 28, 28, 0.18);
  background: #fff1f2;
  color: #b91c1c;
}

.compact-action {
  min-height: 40px;
}

.welcome-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.tab-button.active {
  background: var(--matte);
  color: #ffffff;
  border-color: var(--matte);
  box-shadow: 0 8px 22px rgba(20, 21, 21, 0.16);
}

.page-section[hidden] {
  display: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 21, 21, 0.1);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.78);
  color: var(--navy);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  background: var(--surface-strong);
  border-color: rgba(53, 93, 87, 0.28);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 168px;
  padding: 24px;
  color: #ffffff;
  background:
    linear-gradient(145deg, #111313 0%, #242725 54%, #4c473e 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 26px 60px rgba(20, 21, 21, 0.22);
  overflow: hidden;
}

.card-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 720;
}

#projectedSavings {
  display: block;
  margin-top: 8px;
  max-width: min(100%, 360px);
  font-size: clamp(1.84rem, 9vw, 3.18rem);
  line-height: 0.95;
  font-weight: 820;
  letter-spacing: 0;
  white-space: nowrap;
}

.kpi-subtext {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
  font-weight: 650;
}

.kpi-ring {
  width: 90px;
  height: 90px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.kpi-ring span {
  font-size: 1.7rem;
  font-weight: 850;
}

.kpi-ring small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
}

.buying-power-card {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(33, 31, 25, 0.08);
}

.buying-power-card span,
.data-metrics span,
.tax-summary span,
.after-tax-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.buying-power-card strong {
  display: block;
  margin-top: 5px;
  color: var(--teal);
  font-size: 1.62rem;
  line-height: 1.05;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.buying-power-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.summary-grid div {
  min-height: 74px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid rgba(20, 21, 21, 0.07);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(33, 31, 25, 0.06);
}

.summary-grid span,
.section-heading span,
.app-footer {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.panel {
  margin-top: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(33, 31, 25, 0.07);
  backdrop-filter: blur(12px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.input-stack {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.field span {
  color: var(--navy);
  font-size: 0.91rem;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 245, 239, 0.82);
  color: var(--ink);
  padding: 10px 11px;
  text-align: right;
  outline: none;
}

.input-affix {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 245, 239, 0.82);
  overflow: hidden;
}

.input-affix span {
  min-width: 34px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  text-align: center;
}

.input-affix input {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 6px;
  padding-right: 6px;
}

.input-affix:focus-within {
  border-color: rgba(53, 93, 87, 0.54);
  box-shadow: 0 0 0 4px rgba(53, 93, 87, 0.12);
}

.input-affix input:focus {
  box-shadow: none;
}

.input-affix input[readonly] {
  color: var(--muted);
  cursor: default;
}

.field select {
  appearance: none;
  text-align: left;
}

.field input:focus,
.field select:focus {
  border-color: rgba(53, 93, 87, 0.54);
  box-shadow: 0 0 0 4px rgba(53, 93, 87, 0.12);
}

.data-panel {
  border-color: rgba(15, 118, 110, 0.16);
}

.tax-panel {
  border-color: rgba(183, 121, 31, 0.2);
}

.breakdown-panel {
  border-color: rgba(35, 51, 72, 0.14);
}

.purchasing-panel {
  border-color: rgba(15, 118, 110, 0.18);
}

.spending-panel {
  border-color: rgba(22, 163, 74, 0.18);
}

.comfort-panel,
.takeaways-panel {
  border-color: rgba(22, 163, 74, 0.18);
}

.trust-panel {
  border-color: rgba(15, 118, 110, 0.18);
}

.social-security-panel {
  border-color: rgba(15, 118, 110, 0.18);
}

.assets-panel {
  border-color: rgba(15, 118, 110, 0.2);
}

.vocab-panel {
  border-color: rgba(35, 51, 72, 0.12);
}

.select-field {
  grid-template-columns: 1fr;
  gap: 8px;
}

.data-metrics,
.tax-summary,
.asset-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.data-metrics div,
.tax-summary div,
.asset-summary div {
  min-height: 74px;
  padding: 12px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-metrics strong,
.tax-summary strong,
.asset-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 0.86rem;
  line-height: 1.2;
}

.asset-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.accounts-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.account-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.76);
  box-shadow: 0 12px 28px rgba(33, 31, 25, 0.06);
}

.account-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2px;
}

.account-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.account-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
}

.account-card-header > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2ee;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 900;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.data-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--matte);
  color: #ffffff;
  font-weight: 780;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(20, 21, 21, 0.14);
}

.data-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.takeaway-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.takeaway-list li {
  padding: 11px 12px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.after-tax-card {
  padding: 14px;
  background: #f7efe2;
  border: 1px solid rgba(154, 116, 69, 0.18);
  border-radius: 8px;
}

.withdrawal-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.today-equivalent-card {
  background: var(--soft-teal);
  border-color: rgba(53, 93, 87, 0.16);
}

.after-tax-card strong {
  display: block;
  margin-top: 6px;
  color: var(--amber);
  font-size: 1.35rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.today-equivalent-card strong {
  color: var(--teal);
}

.plain-explainer {
  margin-top: 10px;
  padding: 12px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 8px;
}

.plain-explainer strong {
  display: block;
  color: var(--navy);
  font-size: 0.86rem;
  line-height: 1.2;
}

.plain-explainer p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.breakdown-list {
  display: grid;
  gap: 8px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.breakdown-row span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
}

.breakdown-row strong {
  color: var(--navy);
  font-size: 0.92rem;
  text-align: right;
  white-space: nowrap;
}

.result-row {
  background: var(--soft-teal);
  border-color: rgba(15, 118, 110, 0.18);
}

.result-row strong {
  color: var(--teal);
  font-size: 1.02rem;
}

.final-row {
  background: #f7efe2;
  border-color: rgba(154, 116, 69, 0.18);
}

.final-row strong {
  color: var(--amber);
  font-size: 1.02rem;
}

.power-meter {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.meter-track {
  height: 16px;
  display: flex;
  overflow: hidden;
  background: #dedbd2;
  border-radius: 999px;
}

.meter-track span {
  min-width: 0;
}

#inflationMeterBar {
  background: var(--teal);
}

#localMeterBar {
  background: #b7791f;
}

#taxMeterBar {
  background: #233348;
}

.meter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 12px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.meter-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meter-legend b {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
}

.legend-inflation {
  background: var(--teal);
}

.legend-local {
  background: #b7791f;
}

.legend-tax {
  background: #233348;
}

.power-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.power-grid div {
  min-height: 78px;
  padding: 12px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.power-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.power-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.power-grid strong.positive {
  color: var(--green);
}

.compact-inputs {
  margin-bottom: 12px;
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.budget-field {
  display: grid;
  gap: 6px;
}

.budget-field > span {
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.strategy-grid div {
  min-height: 78px;
  padding: 12px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.strategy-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.strategy-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.strategy-grid strong.positive {
  color: var(--green);
}

.comfort-summary,
.tier-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.comfort-summary div,
.tier-list div {
  min-height: 78px;
  padding: 12px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comfort-summary span,
.tier-list span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.comfort-summary strong,
.tier-list strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.comfort-summary strong.positive {
  color: var(--green);
}

.status-good,
.status-watch,
.status-risk {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
}

.status-good {
  color: #1f5f3f;
  background: #e3f1e8;
}

.status-watch {
  color: #7d5a28;
  background: #f5ead2;
}

.status-risk {
  color: #913333;
  background: #f4dfdd;
}

.how-to-guide {
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.how-to-guide h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 780;
  letter-spacing: 0;
}

.how-to-guide ol {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.how-to-guide li {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.42;
}

.how-to-guide strong {
  color: var(--navy);
  font-weight: 800;
}

.return-guide {
  margin-top: 14px;
  padding: 12px;
  background: var(--soft-teal);
  border: 1px solid rgba(53, 93, 87, 0.16);
  border-radius: 8px;
}

.return-guide h4 {
  margin: 0;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.return-guide p,
.return-guide li {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.return-guide p {
  margin-top: 8px;
}

.return-guide ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.vocab-list {
  display: grid;
  gap: 8px;
}

.vocab-list details {
  background: rgba(247, 245, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.vocab-list summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
}

.vocab-list p {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.chart-panel {
  padding-bottom: 10px;
}

.chart-wrap {
  height: 250px;
  border: 1px solid rgba(20, 21, 21, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 239, 234, 0.86), rgba(255, 254, 250, 0.42)),
    repeating-linear-gradient(0deg, rgba(111, 113, 109, 0.12) 0 1px, transparent 1px 52px);
  overflow: hidden;
}

.inflation-chart-wrap {
  height: 220px;
  background:
    linear-gradient(180deg, rgba(247, 239, 226, 0.86), rgba(255, 254, 250, 0.42)),
    repeating-linear-gradient(0deg, rgba(111, 113, 109, 0.12) 0 1px, transparent 1px 44px);
}

.dollar-chart-wrap {
  height: 240px;
  background:
    linear-gradient(180deg, rgba(232, 239, 234, 0.8), rgba(247, 239, 226, 0.5)),
    repeating-linear-gradient(0deg, rgba(111, 113, 109, 0.12) 0 1px, transparent 1px 48px);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.table-wrap {
  max-height: 290px;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-strong);
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(20, 21, 21, 0.07);
  font-size: 0.84rem;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f1ea;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.app-footer {
  padding: 18px 4px 2px;
  text-align: center;
}

.tab-button:hover,
.primary-action:hover,
.secondary-action:hover,
.danger-action:hover,
.data-button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.field input,
.field select,
.input-affix,
.panel,
.summary-grid div,
.buying-power-card,
.account-card,
.strategy-grid div,
.comfort-summary div,
.tier-list div,
.power-grid div,
.data-metrics div,
.tax-summary div,
.asset-summary div {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.panel:hover,
.buying-power-card:hover,
.summary-grid div:hover {
  border-color: rgba(20, 21, 21, 0.12);
}

@media (max-width: 440px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    padding: 18px 18px 138px;
    overflow-x: hidden;
  }

  .page-tabs {
    width: calc(100% - 18px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .tab-button {
    min-width: 72px;
    padding: 0 9px;
  }

  .kpi-card {
    align-items: flex-start;
  }

  .kpi-ring {
    width: 76px;
    height: 76px;
  }

  .field {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .data-metrics,
  .tax-summary,
  .asset-summary {
    grid-template-columns: 1fr;
  }

  .breakdown-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .breakdown-row strong {
    text-align: left;
    white-space: normal;
  }

  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .budget-grid,
  .comfort-summary,
  .tier-list {
    grid-template-columns: 1fr;
  }

  .power-grid {
    grid-template-columns: 1fr;
  }

  .withdrawal-comparison {
    grid-template-columns: 1fr;
  }
}
