:root {
  color-scheme: light;
  --bg: #f6faf8;
  --surface: #ffffff;
  --ink: #13202d;
  --muted: #5d6b78;
  --line: #d8e3df;
  --green: #228653;
  --green-dark: #17623e;
  --blue: #256bd6;
  --warm: #f2b84b;
  --soft-green: #e9f7ef;
  --soft-blue: #edf4ff;
  --shadow: 0 28px 70px rgba(20, 42, 48, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(135deg, rgba(34, 134, 83, 0.1), transparent 32rem),
    linear-gradient(225deg, rgba(37, 107, 214, 0.08), transparent 30rem),
    var(--bg);
  color: var(--ink);
  margin: 0;
}

a {
  color: inherit;
}

.site-header {
  align-items: center;
  background: rgba(246, 250, 248, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 850;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  border: 2px solid var(--green);
  border-radius: 14px;
  color: var(--green);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.brand-mark svg {
  fill: none;
  height: 28px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 28px;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.site-header a,
.site-footer a {
  font-weight: 780;
  text-decoration-color: rgba(37, 107, 214, 0.28);
  text-underline-offset: 6px;
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(380px, 0.57fr) minmax(700px, 1.43fr);
  padding: clamp(44px, 6vw, 86px) clamp(20px, 5vw, 72px) 42px;
}

.hero > * {
  min-width: 0;
}

.hero-copy {
  max-width: 500px;
}

.section-tag {
  background: var(--soft-green);
  border-radius: 999px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 850;
  margin-bottom: 20px;
  padding: 8px 12px;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.9rem, 4.7vw, 4.7rem);
  line-height: 0.98;
  margin-bottom: 24px;
}

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

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

p {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-actions {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 850;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  text-decoration: none;
}

.button-primary {
  background: var(--green);
  box-shadow: 0 16px 34px rgba(34, 134, 83, 0.25);
  color: white;
}

.button-secondary,
.button-light {
  background: white;
  border: 1px solid #b9cce8;
  color: var(--blue);
}

.button-light {
  min-height: 42px;
}

.note {
  border-left: 3px solid var(--line);
  font-size: 0.94rem;
  padding-left: 14px;
}

.calculator-card {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: clamp(20px, 2.2vw, 28px);
}

.calculator-head,
.split-toolbar,
.calculator-actions,
.handoff {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.calculator-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.calculator-head h2 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.calculator-head p,
.split-toolbar h3,
.calculator-actions p {
  margin: 0;
}

.text-button {
  background: var(--soft-green);
  border: 1px solid #b9dec8;
  border-radius: 8px;
  color: var(--green-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 10px 13px;
}

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

label {
  color: var(--ink);
  display: grid;
  font-size: 0.86rem;
  font-weight: 780;
  gap: 8px;
}

label span {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  padding: 0 10px;
}

input,
select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  min-height: 42px;
  padding: 0 10px;
  width: 100%;
}

label span input {
  border: 0;
  min-width: 0;
  padding-inline: 0;
}

.split-toolbar {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 22px;
}

.split-toolbar label {
  align-items: center;
  display: flex;
  gap: 10px;
}

.table-wrap {
  max-width: 100%;
  margin-top: 14px;
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--ink);
  font-size: 0.82rem;
}

td {
  color: var(--muted);
  font-size: 0.95rem;
}

tfoot th,
tfoot td {
  border-bottom: 0;
  color: var(--ink);
  font-weight: 850;
}

.person-label {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px minmax(110px, 1fr);
}

.person-dot {
  background: var(--green);
  border-radius: 999px;
  display: block;
  height: 14px;
  width: 14px;
}

tbody tr:nth-child(2) .person-dot {
  background: var(--blue);
}

tbody tr:nth-child(3) .person-dot {
  background: var(--warm);
}

.person-name,
.person-share {
  min-height: 38px;
}

.remove-button {
  background: transparent;
  border: 0;
  color: #8a98a6;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.calculator-actions {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 18px;
}

.status-good,
.status-warn {
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 760;
  padding: 12px 14px;
}

.status-good {
  background: var(--soft-green);
  color: var(--green-dark);
}

.status-warn {
  background: #fff6df;
  color: #7c5814;
}

.handoff,
.how,
.resources,
.boundaries {
  margin-inline: clamp(20px, 5vw, 72px);
  scroll-margin-top: 96px;
}

.handoff {
  background: linear-gradient(135deg, #ffffff, var(--soft-blue));
  border: 1px solid #cbdcf5;
  border-radius: 8px;
  margin-top: 10px;
  padding: 22px;
}

.handoff h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.handoff p {
  margin-bottom: 0;
}

.how,
.resources,
.boundaries {
  border-top: 1px solid var(--line);
  padding: clamp(44px, 6vw, 72px) 0;
}

.steps,
.resource-grid,
.boundary-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 24px;
}

.steps article {
  text-align: center;
}

.steps span {
  align-items: center;
  background: var(--green);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  margin-bottom: 18px;
  width: 30px;
}

.steps p,
.resource-link span,
.boundary-grid p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

.resources > div:first-child {
  max-width: 760px;
}

.resource-link {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 20px;
  text-decoration: none;
}

.resource-link strong {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.25;
}

.resource-link span {
  color: var(--muted);
  line-height: 1.62;
}

.resource-link:hover,
.resource-link:focus-visible {
  border-color: #9dc4b0;
  box-shadow: 0 16px 34px rgba(34, 134, 83, 0.12);
  outline: none;
}

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

.boundary-grid article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.site-footer {
  background: #112233;
  color: white;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  padding: 34px clamp(20px, 5vw, 72px);
}

.site-footer p,
.site-footer a {
  color: #d7e3ef;
}

.site-footer strong {
  font-size: 1.35rem;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

@media (max-width: 1240px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 760px;
  }
}

@media (max-width: 760px) {
  .site-header,
  .calculator-head,
  .split-toolbar,
  .calculator-actions,
  .handoff {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    font-size: 1.05rem;
  }

  .totals-grid,
  .steps,
  .resource-grid,
  .boundary-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.6rem, 13vw, 3.55rem);
  }

  .button,
  .handoff .button {
    width: 100%;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tfoot,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
  }

  tbody tr,
  tfoot tr {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
  }

  tbody td,
  tfoot td,
  tfoot th {
    align-items: center;
    border-bottom: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(84px, 0.7fr) minmax(0, 1fr);
    padding: 8px 0;
  }

  tbody td::before,
  tfoot td::before,
  tfoot th::before {
    color: var(--ink);
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  tfoot td:last-child {
    display: none;
  }

  .person-label {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .remove-button {
    background: var(--soft-blue);
    border: 1px solid #cbdcf5;
    border-radius: 8px;
    color: var(--blue);
    font-size: 0.9rem;
    font-weight: 850;
    min-height: 38px;
    width: 100%;
  }
}
