:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #5e6b64;
  --line: #d9e1dc;
  --paper: #fbfdfb;
  --soft: #eef5f1;
  --teal: #0f766e;
  --teal-dark: #0a4d49;
  --green: #2f8f46;
  --amber: #b7791f;
  --red: #b42318;
  --blue: #2456a6;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(23, 33, 28, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(217, 225, 220, 0.85);
  background: rgba(251, 253, 251, 0.92);
  backdrop-filter: blur(14px);
}

.topbar.compact {
  position: static;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: var(--white);
  font-size: 0.82rem;
}

.main-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.main-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover,
.site-footer a:hover {
  color: var(--teal-dark);
}

.section-band {
  padding: clamp(36px, 7vw, 88px) clamp(16px, 4vw, 44px);
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  align-content: center;
  gap: 30px;
  background:
    linear-gradient(140deg, rgba(238, 245, 241, 0.94), rgba(251, 253, 251, 0.72)),
    radial-gradient(circle at 82% 18%, rgba(183, 121, 31, 0.14), transparent 34%);
}

.hero-copy,
.section-heading,
.hero-grid,
.advisor-layout,
.metric-grid,
.watchlist,
.page-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.hero-copy {
  display: grid;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.lead,
.section-heading p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.hero-grid,
.advisor-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 24px;
  align-items: start;
}

.tool-panel,
.result-panel,
.recommendation-card,
.metric-card,
.watch-item,
.insight-strip,
.page-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.tool-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.panel-heading,
.recommendation-top,
.factor-heading,
.watch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h2 {
  margin: 0;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: #e6f4ef;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.field,
.field-row {
  display: grid;
  gap: 8px;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c8d4ce;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 116px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.money-input {
  position: relative;
}

.money-input input {
  padding-right: 34px;
}

.money-input span {
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.segmented label {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  text-align: center;
}

.segmented input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  border-color: var(--teal);
  background: #dff3ec;
  color: var(--teal-dark);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.check-row input {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.primary-action,
.secondary-action,
.icon-action {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  min-height: 50px;
  background: var(--teal);
  color: var(--white);
  padding: 12px 18px;
}

.primary-action:hover,
.primary-action:focus {
  background: var(--teal-dark);
}

.secondary-action {
  min-height: 42px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: #e6f4ef;
  color: var(--teal-dark);
  padding: 10px 14px;
}

.icon-action {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  background: #f7ece8;
  color: var(--red);
  font-size: 1.3rem;
}

.form-note,
.confidence {
  min-height: 1.3em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-panel {
  overflow: hidden;
}

.result-panel picture {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--soft);
}

.result-panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-result,
.score-shell,
.factor-list,
.warning-box,
.merchant-box,
.forecast-box,
.alternative-box,
.watch-save {
  padding: 20px;
}

.empty-result {
  display: grid;
  gap: 8px;
}

.empty-result p {
  color: var(--muted);
}

.score-shell {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 20px;
  align-items: center;
}

.score-ring {
  display: grid;
  gap: 4px;
  width: 128px;
  min-height: 128px;
  align-content: center;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4faf6;
}

.score-number {
  font-size: 2.25rem;
  font-weight: 850;
}

.score-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.score-progress {
  width: 92px;
  height: 8px;
  appearance: none;
}

.score-progress::-webkit-progress-bar,
.bar::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5ece8;
}

.score-progress::-webkit-progress-value,
.bar::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.score-progress::-moz-progress-bar,
.bar::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.score-copy h2 {
  margin-bottom: 8px;
}

.score-copy p {
  color: var(--muted);
  line-height: 1.52;
}

.factor-list {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.factor-row {
  display: grid;
  gap: 8px;
}

.factor-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.warning-box,
.merchant-box,
.forecast-box,
.alternative-box,
.watch-save {
  border-top: 1px solid var(--line);
}

.warning-box {
  background: #fff8eb;
}

.warning-box p,
.merchant-box p,
.forecast-box p {
  color: var(--muted);
  line-height: 1.5;
}

.merchant-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.mini-result {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.mini-result:first-of-type {
  border-top: 0;
}

.mini-result span {
  color: var(--muted);
}

.watch-save {
  display: grid;
  gap: 10px;
  background: #f6fbf8;
}

.watch-save-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.advisor-band {
  background: var(--white);
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.recommendation-list {
  display: grid;
  gap: 14px;
}

.recommendation-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.recommendation-card .factor-list {
  padding: 0;
  border-top: 0;
}

.trust-band {
  background: #f4f8f5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 20px;
}

.metric-value {
  color: var(--amber);
  font-size: 2rem;
  font-weight: 850;
}

.metric-card p {
  color: var(--muted);
  line-height: 1.5;
}

.watch-band {
  background: var(--paper);
}

.watchlist {
  display: grid;
  gap: 12px;
}

.watch-item {
  padding: 14px;
}

.watch-item div {
  display: grid;
  gap: 4px;
}

.watch-item span,
.insight-strip span {
  color: var(--muted);
}

.insight-strip {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 44px);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.site-footer div {
  display: grid;
  gap: 2px;
}

.site-footer span {
  color: var(--muted);
}

.simple-page {
  min-height: 100vh;
  background: var(--paper);
}

.page-shell {
  margin-top: 38px;
  padding: clamp(20px, 4vw, 36px);
}

.page-shell h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.page-shell p,
.page-shell li,
.page-shell dd {
  color: var(--muted);
  line-height: 1.65;
}

.page-shell section {
  margin-top: 28px;
}

.legal-warning {
  padding: 12px;
  border: 1px solid #efd49b;
  border-radius: 8px;
  background: #fff8eb;
  color: #7b4f0a;
}

.legal-list {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legal-list dt {
  font-weight: 800;
}

.legal-list dd {
  margin: 0;
}

@media (max-width: 980px) {
  .hero-grid,
  .advisor-layout,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    align-content: start;
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .topbar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-row,
  .segmented,
  .score-shell,
  .watch-save-row {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 112px;
    height: 112px;
  }

  .metric-grid {
    gap: 12px;
  }

  .legal-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
