:root {
  --ink: #07142a;
  --muted: #526176;
  --line: #dce4ec;
  --line-strong: #b8c9d8;
  --green: #0f5d35;
  --green-dark: #0a4528;
  --green-soft: #eaf6ef;
  --blue: #0a55ad;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(10, 30, 50, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  min-height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(14px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-size: 23px;
  font-weight: 850;
  text-decoration: none;
}

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

.nav-links {
  gap: 34px;
}

.nav-links a,
.text-link,
.site-footer a {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.nav-links a:hover,
.text-link:hover,
.site-footer a:hover {
  text-decoration: underline;
}

.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 42px 28px 28px;
  display: grid;
  grid-template-columns: minmax(290px, 0.72fr) minmax(660px, 1.28fr);
  gap: 42px;
  align-items: start;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(40px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 850;
}

.hero-copy,
.planner,
.meal-totals,
.planner-body,
.people-panel,
.results-panel {
  min-width: 0;
}

.hero-copy p {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.55;
  max-width: 460px;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

.primary-action,
.secondary-button {
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 24px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  cursor: pointer;
}

.primary-action {
  background: linear-gradient(180deg, #11693c 0%, #0a522f 100%);
  color: var(--white);
  box-shadow: 0 14px 28px rgba(15, 93, 53, 0.22);
  min-width: 280px;
}

.primary-action:hover {
  background: linear-gradient(180deg, #0e5b35 0%, #083f25 100%);
}

.primary-action.small {
  min-width: 0;
  min-height: 46px;
}

.primary-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button {
  background: var(--white);
  color: var(--green);
  border-color: var(--line-strong);
  min-height: 42px;
}

.planner {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.planner h2 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.2;
}

.totals-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(110px, 1fr));
  gap: 16px;
}

label,
.row-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--white);
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(10, 85, 173, 0.22);
  outline-offset: 3px;
}

.planner-body {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(320px, 1.2fr);
  gap: 26px;
  margin-top: 22px;
  align-items: start;
}

.person-rows {
  display: grid;
  gap: 8px;
}

.person-row {
  display: grid;
  grid-template-columns: 1fr 92px 34px;
  gap: 10px;
  align-items: end;
}

.remove-person {
  min-height: 39px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

.people-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.share-total {
  color: var(--green);
  font-weight: 850;
}

.share-total.warning {
  color: #9d4216;
}

.meal-image {
  display: block;
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.results-panel {
  margin-top: 22px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

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

thead th {
  background: var(--green);
  color: var(--white);
  font-weight: 850;
}

tbody tr:last-child td {
  border-bottom: 0;
  background: #f6faf8;
  font-weight: 850;
}

.result-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.result-actions p {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 14px;
}

.summary {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.resources {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 42px;
}

.resource-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 34px;
}

.resource-intro {
  margin: 0 0 16px;
}

.resource-intro h2 {
  margin: 0;
  font-size: 28px;
}

.resource-intro p {
  color: var(--muted);
  margin: 8px 0 0;
}

.resource-row {
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.resource-row:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.resource-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 850;
}

.resource-row strong,
.resource-row small {
  display: block;
}

.resource-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.trust-box {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #acd3bd;
  border-radius: 8px;
  background: #f7fcf9;
  color: var(--green-dark);
}

.trust-box svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-box p {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 28px;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

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

  .hero-copy h1,
  .hero-copy p {
    max-width: 780px;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: flex-start;
    padding: 18px 20px;
  }

  .brand {
    font-size: 18px;
    align-items: flex-start;
  }

  .nav-links {
    gap: 18px;
    font-size: 15px;
  }

  .hero {
    padding: 32px 18px 28px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-copy p {
    font-size: 18px;
  }

  .primary-action {
    width: 100%;
    min-width: 0;
  }

  .planner {
    padding: 18px;
  }

  .totals-grid,
  .planner-body,
  .resource-list {
    grid-template-columns: 1fr;
  }

  .meal-image {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .resource-list {
    padding: 18px;
  }

  .resource-row:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .resource-row:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 460px) {
  .site-header {
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .person-row {
    grid-template-columns: 1fr 80px 30px;
  }

  .people-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions p {
    margin: 0;
  }

  .trust-box {
    grid-template-columns: 1fr;
  }
}
