:root {
  color-scheme: light;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f4f1e8;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 35rem),
    #f4f1e8;
}

button, input { font: inherit; }

button { touch-action: manipulation; }

.app-shell {
  width: min(100% - 2rem, 42rem);
  margin: 0 auto;
  padding: 3rem 0 2rem;
}

header { margin-bottom: 2rem; }

.eyebrow {
  margin: 0 0 0.25rem;
  color: #276749;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.intro { margin-bottom: 0; color: #59636e; }

form, .list-section, .history-panel {
  border: 1px solid rgba(31, 41, 51, 0.09);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1rem 3rem rgba(64, 55, 36, 0.08);
}

form { position: relative; z-index: 2; padding: 1.25rem; }

label {
  display: block;
  margin-bottom: 0.55rem;
  font-weight: 750;
}

.add-row { display: flex; gap: 0.65rem; }

input {
  min-width: 0;
  flex: 1;
  border: 2px solid #cfd5d1;
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: #fff;
  color: #17201b;
  outline: none;
}

input:focus { border-color: #2f855a; box-shadow: 0 0 0 3px rgba(47, 133, 90, 0.16); }

.primary-button {
  border: 0;
  border-radius: 0.8rem;
  padding: 0.85rem 1.2rem;
  background: #276749;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover { background: #1f573c; }

.suggestions {
  position: absolute;
  top: calc(100% - 0.85rem);
  right: 1.25rem;
  left: 1.25rem;
  overflow: hidden;
  border: 1px solid #d7ddd8;
  border-radius: 0.75rem;
  background: white;
  box-shadow: 0 0.8rem 2rem rgba(31, 41, 51, 0.16);
}

.suggestion-button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0ed;
  padding: 0.75rem 1rem;
  background: white;
  color: #1f2933;
  text-align: left;
  cursor: pointer;
}

.suggestion-button:last-child { border-bottom: 0; }
.suggestion-button:hover, .suggestion-button:focus { background: #eef8f1; outline: none; }

.list-section { margin-top: 1rem; padding: 1.25rem; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

h2 { margin-bottom: 1rem; font-size: 1.15rem; }

#item-count, #history-count { color: #6b747d; font-size: 0.9rem; font-weight: 500; }

.shopping-list { margin: 0; padding: 0; list-style: none; }

.shopping-item { border-top: 1px solid #e8ece9; }
.shopping-item:first-child { border-top: 0; }

.complete-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.9rem;
  border: 0;
  padding: 0.85rem 0;
  background: transparent;
  color: #1f2933;
  text-align: left;
  cursor: pointer;
}

.checkbox {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border: 2px solid #8a958e;
  border-radius: 0.45rem;
  background: #fff;
}

.complete-button:hover .checkbox, .complete-button:focus .checkbox { border-color: #276749; background: #e6f4ea; }
.complete-button:focus { outline: 2px solid #2f855a; outline-offset: 3px; }

.empty-state { padding: 1.25rem 0 0.5rem; color: #707a73; text-align: center; }
.empty-state span { display: inline-grid; width: 2.4rem; height: 2.4rem; place-items: center; border-radius: 50%; background: #e2f1e6; color: #276749; font-weight: 900; }
.empty-state p { margin: 0.55rem 0 0; }

.history-panel { margin-top: 1rem; padding: 1.1rem 1.25rem; }
.history-panel summary { cursor: pointer; font-weight: 750; }
.history-help { margin: 0.9rem 0 0.7rem; color: #6b747d; font-size: 0.9rem; }
.history-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.history-button {
  border: 1px solid #cbd4cd;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  background: #f7faf8;
  color: #244c35;
  cursor: pointer;
}

.history-button:hover { border-color: #276749; background: #e9f5ec; }
.site-footer {
  margin-top: 1rem;
  color: #6d746f;
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer a, .footer-link { color: #276749; text-underline-offset: 0.16em; }
.site-footer a:hover, .footer-link:hover { text-decoration-thickness: 2px; }
.footer-link {
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}
.footer-link:focus-visible { outline: 2px solid #2f855a; outline-offset: 3px; }
.site-footer .share-status { margin-top: 0.5rem; color: #3e4942; font-weight: 650; }

.privacy-page { padding-block: 2rem 3rem; }
.privacy-page header { margin-bottom: 1.5rem; }
.privacy-card {
  border: 1px solid rgba(31, 41, 51, 0.09);
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 5vw, 2rem);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1rem 3rem rgba(64, 55, 36, 0.08);
}
.privacy-card h2 { margin-top: 1.6rem; margin-bottom: 0.5rem; }
.privacy-card h2:first-child { margin-top: 0; }
.privacy-card p, .privacy-card li { line-height: 1.65; }
.privacy-card ul, .privacy-card ol { padding-left: 1.25rem; }
.back-link { color: #276749; font-weight: 750; text-underline-offset: 0.16em; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] { display: none !important; }

@media (max-width: 32rem) {
  .app-shell { width: min(100% - 1rem, 42rem); padding-top: 1.5rem; }
  .add-row { align-items: stretch; }
  .primary-button { padding-inline: 1rem; }
}
