:root {
  color-scheme: light;
  --ink: #153331;
  --muted: #5e706e;
  --brand: #0b5c5a;
  --brand-dark: #074744;
  --mint: #dff4ef;
  --paper: #fffdfa;
  --line: #cfdfdc;
  --warning: #8a4b08;
  --danger: #9c2f2f;
  --shadow: 0 20px 60px rgba(20, 57, 54, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f4f8f7;
  line-height: 1.55;
}

a {
  color: var(--brand);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: white;
  background: var(--brand-dark);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.planner-shell {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.planner-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.95);
}

.header-inner,
.planner-footer .planner-shell {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--brand);
  letter-spacing: -0.04em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

nav a {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.planner-hero {
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(circle at 80% 15%, rgba(46, 154, 137, 0.18), transparent 30%),
    linear-gradient(135deg, #f8fffd, #edf6f4);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 750px;
  margin-bottom: 1rem;
  font-size: clamp(2.35rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.privacy-note {
  padding: 1.4rem;
  border: 1px solid rgba(11, 92, 90, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.privacy-note strong {
  display: block;
  margin-bottom: 0.4rem;
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1.5rem;
  padding-top: 2rem;
}

.entry-card,
.summary-card,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.entry-card,
.summary-card {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.summary-card {
  align-self: start;
  background: var(--ink);
  color: white;
}

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

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #abc1bd;
  border-radius: 10px;
  color: var(--ink);
  background: white;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 145, 128, 0.35);
  outline-offset: 2px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.money-input {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding-left: 0.8rem;
  border: 1px solid #abc1bd;
  border-radius: 10px;
  background: white;
}

.money-input:focus-within {
  outline: 3px solid rgba(37, 145, 128, 0.35);
  outline-offset: 2px;
}

.money-input input {
  min-height: 46px;
  border: 0;
  outline: 0;
}

.assumption-note,
.legal-note,
.range-note,
.status-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.assumption-note {
  margin: 1rem 0;
}

.form-actions,
.table-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.table-button {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--brand);
  color: white;
  background: var(--brand);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  border: 1px solid var(--brand);
  color: var(--brand);
  background: white;
}

.danger-button {
  border: 1px solid #d9a2a2;
  color: var(--danger);
  background: white;
}

.text-button,
.table-button {
  min-height: auto;
  padding: 0.35rem 0.5rem;
  border: 0;
  color: var(--brand);
  background: transparent;
}

.table-button.remove {
  color: var(--danger);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.summary-grid div {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.summary-grid span {
  display: block;
  margin-bottom: 0.35rem;
  color: #b9d3d0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.1;
}

.summary-card .range-note,
.summary-card .status-note {
  margin: 1rem 0 0;
  color: #c7d9d7;
}

.summary-card .summary-cta {
  display: inline-flex;
  margin-top: 1rem;
  color: white;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.summary-card .summary-cta:hover {
  background: rgba(255, 255, 255, 0.16);
}

.plan-card {
  overflow: hidden;
  margin-top: 1.5rem;
  margin-bottom: 4rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.table-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.5rem;
}

.empty-state {
  padding: 2.5rem 1rem;
  border: 1px dashed #abc1bd;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-size: 1.15rem;
}

.empty-state p {
  margin-bottom: 0;
}

.table-scroll {
  contain: inline-size paint;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

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

th,
td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #eef6f4;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  max-width: 260px;
  text-align: left;
  white-space: normal;
}

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

.row-actions {
  justify-content: flex-end;
}

.warning-stack {
  margin-top: 1rem;
}

.warning-note {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid #e5bd83;
  border-radius: 10px;
  color: var(--warning);
  background: #fff7e9;
  font-size: 0.88rem;
}

.legal-note {
  margin: 1.25rem 0 0;
}

.planner-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.planner-footer .planner-shell {
  justify-content: flex-start;
}

.planner-footer p {
  margin: 0 auto 0 0;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 800px) {
  .header-inner {
    min-height: 64px;
  }

  nav a:not(:first-child) {
    display: none;
  }

  .planner-hero {
    padding: 3rem 0;
  }

  .hero-grid,
  .planner-layout {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 1.5rem;
  }

  .table-heading {
    display: grid;
  }
}

@media (max-width: 520px) {
  .field-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .planner-shell {
    width: min(100% - 1rem, 1180px);
  }

  .entry-card,
  .summary-card,
  .plan-card {
    border-radius: 16px;
  }

  .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
