:root {
  --bg: #f7f8f5;
  --paper: #ffffff;
  --ink: #162019;
  --muted: #5d675f;
  --line: #d9ded7;
  --line-strong: #b6c1b7;
  --green: #1f6f4a;
  --green-soft: #e7f2eb;
  --blue: #255f85;
  --blue-soft: #e8f1f6;
  --amber: #946418;
  --amber-soft: #f4ecd9;
  --danger: #9d3d35;
  --shadow: 0 14px 40px rgba(18, 32, 25, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.site-header {
  align-items: center;
  background: rgba(247, 248, 245, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 32px;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 15px;
  font-weight: 750;
  gap: 10px;
  white-space: nowrap;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.top-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.top-nav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  padding: 10px 12px;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.top-nav a[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green);
  outline: none;
}

main {
  display: grid;
  gap: 28px;
  margin: 0 auto;
  max-width: 1220px;
  padding: 32px;
}

.decision-hero {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  min-height: 320px;
  min-width: 0;
}

.hero-copy {
  align-content: center;
  display: grid;
  min-width: 0;
  padding: 28px 0;
}

.section-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  font-size: 48px;
  letter-spacing: 0;
  line-height: 1.04;
  margin-bottom: 18px;
  max-width: 780px;
}

h2 {
  font-size: 28px;
  letter-spacing: 0;
  line-height: 1.16;
  margin-bottom: 12px;
}

h3 {
  font-size: 24px;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 18px;
}

p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-copy p:last-child {
  font-size: 18px;
  max-width: 640px;
}

.decision-map {
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: grid;
}

.decision-map a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  gap: 8px;
  padding: 28px;
}

.decision-map a:last-child {
  border-bottom: 0;
}

.decision-map a:hover,
.decision-map a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.decision-map strong {
  font-size: 21px;
}

.decision-map span {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
}

.planner-shell {
  align-items: stretch;
  display: grid;
  gap: 0;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  min-width: 0;
}

.planner-rail,
.tool-panel,
.result-panel,
.decision-brief,
.decision-map {
  box-shadow: var(--shadow);
}

.planner-rail {
  background: #eef1ed;
  border: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
  padding: 30px;
}

.planner-rail h2 {
  font-size: 24px;
}

.planner-rail ol {
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.planner-rail li {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 10px;
  line-height: 1.4;
}

.planner-rail li span {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  display: inline-flex;
  flex: 0 0 30px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
}

.tool-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 30px;
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 20px;
}

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

label {
  color: var(--ink);
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
}

input,
select {
  background: #fbfcfa;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 95, 133, 0.16);
  outline: none;
}

.result-panel {
  background: #fdfbf5;
  border: 1px solid #d7c79e;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  padding: 30px;
}

.result-stack,
.decision-brief dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.result-stack div,
.decision-brief dl div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 16px 0;
}

.result-stack div:first-child,
.decision-brief dl div:first-child {
  border-top: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  line-height: 1.5;
  margin: 0;
}

.priority-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.supporting-tools {
  display: grid;
  gap: 8px;
}

.supporting-tools a {
  color: var(--green);
  font-weight: 800;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.decision-table,
.tool-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 34px;
}

.action-layer,
.monetization-layer {
  background: #fbfcfa;
}

.action-grid,
.tool-recommendation-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-recommendation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-grid article,
.tool-recommendation-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.action-grid article span {
  align-items: center;
  background: var(--green-soft);
  border-radius: 6px;
  color: var(--green);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.action-grid article strong,
.tool-recommendation-grid article strong {
  color: var(--ink);
  line-height: 1.35;
}

.action-grid article p,
.tool-recommendation-grid article p {
  font-size: 14px;
  margin: 0;
}

.section-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 24px;
  max-width: 780px;
}

.section-heading p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

th,
td {
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
  padding: 16px 14px;
  text-align: left;
  vertical-align: top;
}

thead th {
  border-top: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody th {
  color: var(--ink);
  font-weight: 800;
  min-width: 150px;
}

.tool-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  min-width: 0;
}

.tool-layout.wide {
  grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.05fr);
}

.tool-panel.compact {
  border-radius: 8px;
  display: grid;
  gap: 18px;
}

.decision-brief {
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
}

.decision-brief h3 {
  color: var(--green);
}

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

.debt-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 0.8fr 0.6fr;
  padding: 14px;
}

.secondary-button {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  width: fit-content;
}

.secondary-button:hover {
  background: var(--green);
}

.inline-link {
  color: var(--green);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.subpage-main {
  gap: 28px;
}

.decision-page-hero {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-width: 0;
}

.intent-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.intent-panel ul {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.intent-panel li {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding-top: 12px;
}

.intent-panel li:first-child {
  border-top: 0;
  padding-top: 0;
}

.focused-planner {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.focused-planner .tool-panel {
  border-radius: 8px 0 0 8px;
}

.decision-result {
  border-left: 0;
}

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

.metric-grid div {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid #e1d6ba;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.metric-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid strong {
  color: var(--ink);
  font-size: 20px;
}

.interpretation-card {
  border-top: 1px solid #dacda9;
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.interpretation-card p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}

.next-step-box {
  background: var(--green-soft);
  border: 1px solid #b8d7c4;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
}

.next-step-box span {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.next-step-box strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}

.target-grid,
.faq-grid,
.rule-list {
  display: grid;
  gap: 14px;
}

.target-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.faq-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.target-grid article,
.faq-grid article,
.rule-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 20px;
}

.target-grid h3,
.faq-grid h3 {
  font-size: 19px;
  margin: 0;
}

.target-grid p,
.faq-grid p {
  font-size: 14px;
  margin: 0;
}

.target-grid strong {
  color: var(--green);
  font-size: 24px;
}

.rule-list article {
  align-items: start;
  grid-template-columns: 260px minmax(0, 1fr);
}

.rule-list strong {
  color: var(--ink);
}

.rule-list span {
  color: var(--muted);
  line-height: 1.5;
}

.hub-hero {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 280px;
  padding: 48px 0 12px;
}

.hub-hero h1 {
  margin-bottom: 16px;
}

.primary-action,
.text-action {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  width: fit-content;
}

.primary-action {
  background: var(--ink);
  color: #fff;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--green);
  outline: none;
}

.text-action {
  background: var(--green-soft);
  color: var(--green);
}

.hub-answer-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.hub-answer-grid article,
.journey-section,
.link-engine {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.hub-answer-grid span {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.hub-answer-grid h2 {
  font-size: 20px;
  margin: 10px 0;
}

.hub-answer-grid p {
  font-size: 14px;
  margin: 0;
}

.journey-list {
  counter-reset: journey;
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.journey-list li {
  counter-increment: journey;
}

.journey-list a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 14px;
}

.journey-list a::before {
  align-items: center;
  background: var(--green-soft);
  border-radius: 6px;
  color: var(--green);
  content: counter(journey);
  display: inline-flex;
  flex: 0 0 30px;
  font-weight: 850;
  height: 30px;
  justify-content: center;
}

.journey-list a:hover,
.journey-list a:focus-visible {
  border-color: var(--green);
  outline: none;
}

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

.tool-section > .link-grid {
  margin-top: 24px;
}

.link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.link-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.link-card strong {
  font-size: 18px;
  line-height: 1.3;
}

.link-card p {
  font-size: 14px;
  margin: 0;
}

.link-card:hover,
.link-card:focus-visible {
  border-color: var(--green);
  outline: none;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 20px auto 0;
  max-width: 1220px;
  padding: 28px 32px 42px;
}

.site-footer p {
  font-size: 14px;
  margin: 0;
}

.site-footer a {
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .decision-hero,
  .decision-page-hero,
  .planner-shell,
  .tool-layout,
  .tool-layout.wide,
  .focused-planner {
    grid-template-columns: 1fr;
  }

  .planner-rail,
  .result-panel,
  .focused-planner .tool-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .planner-rail ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel {
    border-color: #d7c79e;
  }

  .target-grid,
  .faq-grid,
  .hub-answer-grid,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    position: static;
  }

  .top-nav {
    justify-content: flex-start;
  }

  main {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100vw;
    overflow: hidden;
    padding: 18px;
    width: 100%;
  }

  .hero-copy,
  .decision-table,
  .tool-section,
  .tool-panel,
  .result-panel,
  .planner-rail,
  .decision-brief {
    padding: 22px;
  }

  .hero-copy {
    max-width: calc(100vw - 36px);
    padding: 6px 0 0;
    width: 100%;
  }

  h1 {
    font-size: 32px;
    line-height: 1.08;
    max-width: calc(100vw - 72px);
  }

  h2 {
    font-size: 24px;
    max-width: calc(100vw - 96px);
  }

  h3 {
    font-size: 21px;
    max-width: calc(100vw - 96px);
  }

  p,
  dd,
  label {
    max-width: calc(100vw - 96px);
  }

  .form-grid,
  .planner-rail ol,
  .debt-row {
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-button {
    width: 100%;
  }

  .decision-map,
  .decision-hero,
  .decision-page-hero,
  .planner-shell,
  .tool-layout,
  .tool-layout.wide,
  .tool-panel,
  .result-panel,
  .decision-brief,
  .decision-table,
  .tool-section {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .target-grid,
  .faq-grid,
  .metric-grid,
  .hub-answer-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .decision-page-hero .intent-panel {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 18px 34px;
  }
}

@media (max-width: 520px) {
  .site-header,
  main,
  .site-footer {
    max-width: 390px;
    width: 100%;
  }

  .hero-copy,
  .hub-hero,
  .decision-map,
  .decision-hero,
  .decision-page-hero,
  .planner-shell,
  .tool-layout,
  .tool-layout.wide,
  .tool-panel,
  .result-panel,
  .decision-brief,
  .decision-table,
  .tool-section {
    max-width: 354px;
  }

  h1 {
    max-width: 318px;
  }

  h2,
  h3,
  p,
  dd,
  label {
    max-width: 294px;
  }

  .hero-copy p:last-child {
    max-width: 294px;
  }
}
