:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f5f0;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f5f0;
}

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

button,
.section-heading a {
  min-height: 38px;
  border: 1px solid #97b7a5;
  border-radius: 8px;
  background: #ffffff;
  color: #14533d;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
  text-decoration: none;
}

button:hover,
.section-heading a:hover {
  background: #edf8f1;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(20, 83, 61, 0.2);
  outline-offset: 2px;
}

.loading {
  margin: 3rem auto;
  text-align: center;
}

.site-shell {
  width: min(100% - 28px, 1440px);
  margin: 0 auto;
  padding: 18px 0 48px;
}

.planner-shell,
.analysis-section {
  border: 1px solid #d5decd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(41, 54, 37, 0.08);
}

.planner-shell {
  padding: 16px;
}

.planner-header {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 980px) {
  .planner-header {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.55fr);
  }
}

.eyebrow {
  margin: 0 0 7px;
  color: #9a4d19;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: #526174;
  font-size: 1rem;
  line-height: 1.55;
}

.plan-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid #d5decd;
  border-radius: 8px;
  background: #fbfcf8;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #42526a;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field input,
.field select,
.number-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #c9d3c2;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
}

.field input,
.field select {
  padding: 8px 9px;
}

.number-input {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.number-input b {
  padding-left: 9px;
  color: #667085;
}

.number-input input {
  border: 0;
  min-height: 36px;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 980px) {
  .planner-grid {
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  }

  .pantry-panel,
  .shopping-panel {
    grid-column: span 1;
  }
}

.panel {
  min-width: 0;
  border: 1px solid #d9e1d4;
  border-radius: 8px;
  background: #fbfcf8;
  padding: 14px;
}

.panel-label {
  display: block;
  margin-bottom: 7px;
  color: #6b7280;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.money-row {
  display: grid;
  gap: 8px;
  align-items: start;
}

.money-row strong {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: fit-content;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #ffffff;
  color: #42526a;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 9px;
}

.status-pill.is-good {
  border-color: #9dd4b5;
  background: #edf8f1;
  color: #14533d;
}

.status-pill.is-warn {
  border-color: #efc58a;
  background: #fff7e8;
  color: #8a4b0f;
}

.summary-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
}

.summary-facts div,
.category-breakdown div {
  min-width: 0;
  border-top: 1px solid #d9e1d4;
  padding-top: 9px;
}

.summary-facts dt,
.category-breakdown span {
  color: #667085;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-facts dd,
.category-breakdown b {
  margin: 4px 0 0;
  display: block;
  color: #172033;
  font-weight: 900;
}

.recommendation-panel h2 {
  max-width: 760px;
  margin-bottom: 14px;
  color: #243047;
  line-height: 1.35;
}

.recommendation-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recommendation-list li {
  display: grid;
  gap: 3px;
  border: 1px solid #d9e1d4;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.recommendation-list span,
.shopping-list small,
.check-row small,
.copy-status {
  color: #667085;
  font-size: 0.83rem;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid #d9e1d4;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #157347;
}

.check-row span,
.shopping-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shopping-layout {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .shopping-layout {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.36fr);
  }
}

.shopping-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shopping-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid #d9e1d4;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.category-breakdown {
  display: grid;
  align-content: start;
  gap: 9px;
}

.copy-status {
  margin: -4px 0 10px;
}

.analysis-section {
  margin-top: 16px;
  padding: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 14px;
}

.analysis-frame {
  display: block;
  width: 100%;
  min-height: 920px;
  border: 1px solid #d9e1d4;
  border-radius: 8px;
  background: #ffffff;
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 18px, 1440px);
    padding: 10px 0 36px;
  }

  .plan-controls,
  .summary-facts {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .analysis-frame {
    min-height: 760px;
  }
}
