:root {
  color-scheme: light;
  --ink: #17231d;
  --muted: #607064;
  --line: #d7e6dc;
  --paper: #fbfdf9;
  --panel: #ffffff;
  --leaf: #2d6a4f;
  --leaf-dark: #1b4332;
  --mint: #d8f3dc;
  --mint-strong: #95d5b2;
  --sun: #f7c948;
  --danger: #b23a48;
  --shadow: 0 14px 34px rgba(31, 64, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(216, 243, 220, 0.85), rgba(251, 253, 249, 0) 310px),
    var(--paper);
}

button,
input {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 12px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(251, 253, 249, 0.92);
  border-bottom: 1px solid rgba(215, 230, 220, 0.72);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 8vw, 2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.progress-ring {
  width: 58px;
  min-width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--leaf-dark);
  font-weight: 900;
  background: conic-gradient(var(--leaf) var(--progress, 0%), #e6f2ea 0);
  box-shadow: inset 0 0 0 7px var(--paper);
}

main {
  width: min(940px, 100%);
  margin: 0 auto;
  padding: 12px 14px 28px;
}

.search-shell {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.search-shell label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#searchInput {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
  box-shadow: 0 10px 24px rgba(31, 64, 45, 0.08);
}

#searchInput:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.14);
}

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(92px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--leaf-dark);
  background: var(--panel);
  font-weight: 800;
  white-space: nowrap;
}

.tab.active {
  color: white;
  background: var(--leaf);
  border-color: var(--leaf);
}

.content {
  display: grid;
  gap: 12px;
}

.section-title {
  margin: 8px 2px 0;
  font-size: 1rem;
  color: var(--leaf-dark);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.store-card,
.recipe-card,
.avoid-card,
.item-card {
  padding: 14px;
}

.store-head,
.item-head,
.recipe-head,
.avoid-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h2,
h3 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: 0;
}

h2 {
  font-size: 1.18rem;
}

h3 {
  font-size: 1rem;
}

.badge {
  min-width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--leaf-dark);
  background: var(--mint);
  font-size: 0.76rem;
  font-weight: 900;
}

.danger-badge {
  color: #fff;
  background: var(--danger);
}

.meta {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.strong {
  color: var(--ink);
  font-weight: 800;
}

.checklist-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--leaf-dark);
  background: var(--panel);
  font-weight: 800;
}

.check-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

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

.check-row input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--leaf);
}

.check-row.done .check-main {
  opacity: 0.55;
  text-decoration: line-through;
}

.check-main {
  min-width: 0;
}

.check-title {
  font-weight: 900;
}

.check-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef8f1;
}

.item-grid {
  display: grid;
  gap: 10px;
}

.item-card {
  display: grid;
  gap: 9px;
}

.item-detail {
  display: grid;
  gap: 5px;
  color: var(--muted);
  line-height: 1.38;
}

.recipe-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.recipe-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(92px, 0.9fr);
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.recipe-row span {
  color: var(--muted);
}

.instructions {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff9df;
  color: #564600;
  line-height: 1.42;
}

.tips {
  display: grid;
  gap: 8px;
}

.tip {
  padding: 12px 14px;
  border-left: 4px solid var(--sun);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

@media (min-width: 720px) {
  .content.two-col,
  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checklist {
    grid-column: 1 / -1;
  }
}
