:root {
  color-scheme: light;
  --page: #f8faf4;
  --paper: #fff;
  --text: #192e23;
  --muted: #46594e;
  --green: #245738;
  --deep: #20452f;
  --line: #dce5d8;
  --soft: #edf4e7;
  --radius: 22px;
  --shell: 1160px;
  font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--page); color: var(--text); }
h1, h2, p, figure { margin: 0; }
h1, h2, .brand { letter-spacing: -.035em; }
h1, h2 { line-height: 1.12; }
h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .63; }
:where(button, a, input, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 3px solid #225be1;
  outline-offset: 3px;
}
h1:focus, main:focus { outline: none; }
.shell { width: min(var(--shell), calc(100% - 64px)); margin-inline: auto; }
.icon { width: 23px; height: 23px; flex: none; vertical-align: middle; }
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 3;
  transform: translateY(-150%);
  background: white;
  border: 1px solid var(--green);
  border-radius: 9px;
  padding: 10px 16px;
}
.skip-link:focus { transform: none; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.23rem; font-weight: 750; text-decoration: none; line-height: 1.15; }
.brand-icon {
  width: 39px;
  height: 39px;
  flex: none;
  display: grid;
  place-items: center;
  color: #e8f4cd;
  background: var(--deep);
  border-radius: 12px;
}
.brand-icon svg { width: 25px; height: 25px; }
.nav-link, .quiet, .primary {
  min-height: 46px;
  padding: .55rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #cddacc;
  border-radius: 11px;
  background: var(--paper);
  color: var(--deep);
}
.nav-link svg { width: 19px; height: 19px; }
.nav-link:hover, .quiet:hover { background: var(--soft); border-color: #9baa9c; }
.primary { background: var(--green); color: white; border-color: var(--green); padding: .7rem 1.45rem; }
.primary:hover:enabled, a.primary:hover { background: #193e29; }
main { flex: 1; padding-block: 35px 52px; }
.site-footer { color: var(--muted); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding-block: 19px 22px; font-size: .92rem; }
.footer-inner span:first-child { font-weight: 700; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1fr);
  min-height: 355px;
  overflow: hidden;
  border-radius: 29px;
  background: #edf2e4;
  border: 1px solid #e0ead5;
}
.hero-copy { align-self: center; padding: 32px clamp(24px, 4.4vw, 61px); }
.hero h1 {
  font-size: clamp(3rem, 5.65vw, 5.1rem);
  line-height: .96;
  letter-spacing: -.075em;
  font-weight: 790;
}
.hero h1 em { font-style: normal; color: #337249; }
.hero-copy p { margin-top: 21px; max-width: 32ch; color: #354e3e; font-size: clamp(1rem, 1.65vw, 1.25rem); }
.hero-sections { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 23px; }
.hero-sections span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f9fbf5;
  border: 1px solid #d5e0cb;
  color: #244831;
  padding: .29rem .72rem;
  border-radius: 20px;
  font-weight: 680;
}
.hero-sections .icon { width: 19px; height: 19px; }
.hero-photo { width: 100%; height: 100%; aspect-ratio: 1.58; object-fit: cover; object-position: center; }
.school-picker { margin-top: 35px; }
.school-picker > p { margin-top: 6px; color: var(--muted); font-size: 1.1rem; }
.school-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-top: 17px; }
.school-card {
  padding: 16px 15px 15px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 2px #1f412608;
}
.school-card:hover { background: #f3f8ed; border-color: #84a18a; }
.school-card strong { font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.2; margin-top: 5px; }
.school-description { font-size: .92rem; line-height: 1.34; color: var(--muted); }
.school-icon, .feature-icon { display: grid; place-items: center; border-radius: 13px; width: 43px; height: 43px; }
.amber { background: #fff1ce; color: #79500a; }
.leaf { background: #e1efda; color: #255332; }
.blue { background: #e3eefc; color: #285184; }
.lilac { background: #eee7fa; color: #5e4281; }
.peach { background: #ffe9db; color: #8d3f25; }
.how-to { display: flex; gap: 10px; align-items: center; margin-top: 21px; border-radius: 12px; background: #edf3e6; padding: 12px 15px; color: #344e3d; }

.flow { width: min(100%, 790px); margin-inline: auto; }
.quiz-top, .progress-row, .quiz-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-label, .school-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 18px;
  padding: .25rem .74rem;
}
.section-label { background: #e8f2dc; color: var(--deep); }
.school-tag { color: var(--muted); background: white; border: 1px solid var(--line); }
.section-label .icon { width: 19px; height: 19px; }
.progress-row { margin-top: 12px; font-weight: 700; color: var(--muted); }
.progress-row span { flex: none; }
progress { display: block; width: 100%; height: 9px; border-radius: 10px; background: #e3ebdf; border: none; appearance: none; color: var(--green); }
progress::-webkit-progress-bar { background: #e3ebdf; border-radius: 10px; }
progress::-webkit-progress-value { background: #4a8556; border-radius: 10px; }
progress::-moz-progress-bar { background: #4a8556; border-radius: 10px; }
.food-card, .center-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px #21422909;
}
.food-card { padding: clamp(13px, 3vw, 26px); margin-top: 15px; }
.food-heading { text-align: center; margin-bottom: 14px; }
.food-heading p { color: var(--muted); font-size: 1.1rem; font-weight: 650; }
.food-heading h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); margin-top: 1px; overflow-wrap: anywhere; }
.food-photos { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(6px, 2vw, 13px); }
.food-photos figure { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #f7faf4; }
.food-photos img { background: #e7efdf; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
.food-photos figcaption { padding: 7px 8px; text-align: center; font-weight: 650; line-height: 1.24; min-height: 2.45em; }
.rating-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.positive { --rate-bg: #e6f4df; --rate-border: #b6d6ad; --rate-ink: #235430; }
.neutral { --rate-bg: #fff2d6; --rate-border: #e5ca86; --rate-ink: #704b0b; }
.negative { --rate-bg: #fce8e4; --rate-border: #e5bcb4; --rate-ink: #833b32; }
.rating {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 8px;
  min-height: 68px;
  font-size: 1.1rem;
  font-weight: 750;
  line-height: 1.18;
  border: 2px solid var(--rate-border);
  border-radius: 13px;
  background: var(--rate-bg);
  color: var(--rate-ink);
}
.rating:hover, .rating[aria-pressed="true"] { border-color: var(--rate-ink); }
.rating[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--rate-ink); }
.rating .icon { width: 32px; height: 32px; }
.quiz-actions { margin-top: 14px; }

.center-card { margin: 25px auto; max-width: 650px; text-align: center; padding: clamp(23px, 6vw, 54px); }
.feature-icon { width: 68px; height: 68px; margin: 0 auto 17px; border-radius: 20px; }
.feature-icon .icon { width: 36px; height: 36px; }
.center-card h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.center-card > p { color: var(--muted); font-size: 1.15rem; margin-top: 12px; }
.center-actions { display: flex; gap: 11px; flex-wrap: wrap; justify-content: center; margin-top: 23px; }
.center-actions .form-error { width: 100%; }
.suggestion-form { margin: 20px auto 0; max-width: 470px; text-align: left; }
.suggestion-form label { display: block; font-size: 1.08rem; font-weight: 700; }
.suggestion-form p { margin: 3px 0 12px; color: var(--muted); }
.suggestion-form textarea {
  display: block;
  width: 100%;
  min-height: 102px;
  resize: vertical;
  padding: 9px 12px;
  border: 1px solid #aebdae;
  border-radius: 10px;
  color: var(--text);
  background: #f9fbf7;
  font-size: 1.125rem;
}
.pin-form { margin: 23px auto 0; max-width: 292px; display: grid; gap: 9px; text-align: left; }
.pin-form label { font-weight: 700; }
.pin-form input {
  min-height: 50px;
  min-width: 0;
  padding: 7px 12px;
  background: #f9fbf7;
  border: 1px solid #aebdae;
  border-radius: 9px;
  letter-spacing: .3em;
  font-size: 1.3rem;
}
.pin-form button { margin-top: 4px; }
.form-error { color: #8d2b24; font-weight: 650; }
.form-error:empty { margin: 0; }

.dashboard h1 { font-size: clamp(2rem, 5.5vw, 3.45rem); }
.report-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.report-heading p, .report-guide { margin-top: 8px; color: var(--muted); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 18px 12px; }
.filters button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  color: var(--deep);
  font-weight: 700;
  background: white;
  border: 1px solid #cddacc;
  border-radius: 11px;
  padding: .36rem .7rem;
}
.filters button span { min-width: 1.5em; padding-inline: 5px; border-radius: 6px; background: var(--soft); color: var(--deep); font-weight: 700; }
.filters button:hover { border-color: var(--green); }
.filters button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: white; }
.empty-state { background: #f5edce; color: #59451a; border-radius: 10px; padding: 10px 14px; margin-block: 12px; }
.suggestion-results { background: white; border: 1px solid var(--line); border-radius: 12px; margin-block: 14px; }
.suggestion-results summary { cursor: pointer; min-height: 46px; padding: 10px 14px; border-radius: 12px; color: var(--deep); font-weight: 700; }
.suggestion-results summary:hover { background: var(--soft); }
.suggestion-results summary span { margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--soft); }
.suggestion-results > p { padding: 0 14px 12px; color: var(--muted); }
.suggestion-results ul { list-style: none; margin: 0; padding: 0; }
.suggestion-results li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.suggestion-results .school-tag { font-size: .9rem; }
.suggestion-results li p { flex: 1 1 16ch; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 2px; }
.report-panel { background: white; border: 1px solid var(--line); border-radius: 17px; margin-top: 18px; }
.report-panel h2 { padding: 14px 18px; font-size: 1.52rem; display: flex; align-items: center; gap: 8px; }
.table-wrap { overflow: auto; border-radius: 0 0 17px 17px; }
table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.table-wrap > table { min-width: 520px; }
thead th:first-child { width: 25%; }
thead th:last-child { width: 14%; }
th, td { padding: 7px 12px; border-top: 1px solid var(--line); }
thead th { background: #edf3e8; color: var(--deep); }
thead button, .food-detail {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 4px 2px;
  text-align: left;
  font: inherit;
  font-weight: 700;
  border: 0;
  background: transparent;
  color: inherit;
}
thead button:hover, .food-detail:hover { text-decoration: underline; }
thead button span { font-size: .95rem; color: #436a4d; }
.food-detail .icon { width: 17px; height: 17px; }
.food-detail[aria-expanded="true"] .icon { transform: rotate(180deg); }
.metric { min-width: 72px; font-variant-numeric: tabular-nums; color: var(--rate-ink, var(--text)); }
.metric small { display: block; color: var(--muted); font-size: .85rem; }
.breakdown > td { background: #f5f8f2; padding: 10px 15px 14px; }
.breakdown th, .breakdown td { padding-block: 5px; }
.breakdown tbody { background: white; }

@media (max-width: 870px) {
  .shell { width: calc(100% - 42px); }
  .hero { min-height: 0; }
  .hero-photo { aspect-ratio: auto; }
  .school-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .school-card { min-height: 126px; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .masthead-inner { min-height: 58px; }
  .brand { font-size: 1rem; gap: 6px; letter-spacing: -.02em; }
  .brand-icon { width: 32px; height: 32px; border-radius: 9px; }
  .brand-icon svg { width: 22px; height: 22px; }
  .nav-link { padding-inline: 8px; font-size: .91rem; gap: 4px; }
  .nav-link svg { width: 17px; height: 17px; }
  main { padding-block: 15px 32px; }
  .hero { grid-template-columns: 1fr; border-radius: 19px; }
  .hero-copy { padding: 22px 19px 20px; }
  .hero h1 { font-size: clamp(2.65rem, 10.1vw, 4rem); }
  .hero-copy p { margin-top: 12px; }
  .hero-sections { margin-top: 13px; }
  .hero-photo { aspect-ratio: 2.08; height: auto; object-position: 50% 49%; }
  .school-picker { margin-top: 24px; }
  .school-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
  .school-card { padding: 10px; min-height: 108px; border-radius: 12px; }
  .school-icon { width: 33px; height: 33px; border-radius: 9px; }
  .school-icon .icon { width: 20px; height: 20px; }
  .how-to { align-items: flex-start; }
  .food-card { margin-top: 10px; padding: 10px; border-radius: 16px; }
  .food-heading { margin-bottom: 10px; }
  .food-photos figure { border-radius: 10px; }
  .food-photos figcaption { font-size: .875rem; padding: 6px 3px; }
  .rating-grid { gap: 5px; margin-top: 11px; }
  .rating { flex-direction: column; min-height: 79px; gap: 5px; font-size: .96rem; padding: 5px 2px; border-radius: 9px; }
  .rating .icon { width: 26px; height: 26px; }
  .quiz-actions .quiet { padding-inline: .62rem; }
  .footer-inner { padding-block: 13px; }
  th, td { padding-inline: 8px; }
}
