:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2430;
  --text: #e6edf3;
  --muted: #93a1b2;
  --line: #2b3442;
  --accent: #4da3ff;
  --accent-2: #1f6feb;
  --ok: #3fb950;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.35;
}

a { color: inherit; }

.page {
  width: min(1040px, 100% - 1rem);
  margin: 0 auto;
  padding: 0.7rem 0 1rem;
}

/* compact app shells for /list and /menu */
.app {
  display: grid;
  gap: 0.7rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0.45rem;
  z-index: 40;
}

.brand {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c7d2de;
}

.topnav {
  display: flex;
  gap: 0.4rem;
}

.nav-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #111720;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.nav-link.is-current {
  background: #122338;
  color: #d7ecff;
  border-color: #234567;
}

.panel,
.card,
.day-card,
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.panel { padding: 0.75rem; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

h1, h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.stamp,
.subtle,
.save-status,
.day-short,
.meal-note,
.lede {
  color: var(--muted);
  font-size: 0.86rem;
}

.subtle { margin: 0.35rem 0 0.65rem; }
.stamp { margin: 0; white-space: nowrap; }

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.check-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.check-item label {
  display: grid;
  grid-template-columns: 1.4rem minmax(0,1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.72rem;
  min-height: 52px;
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--ok);
}

.item-name { font-weight: 600; }
.item-qty { color: #bad0e5; font-weight: 600; }

.check-item.is-checked .item-name,
.check-item.is-checked .item-qty {
  text-decoration: line-through;
  opacity: 0.55;
}

.status-row {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.save-status { margin: 0; }

.menu-calendar {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.day-card { padding: 0.65rem; }

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.day-name {
  margin: 0;
  font-size: 0.82rem;
  color: #d3deea;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.day-short { margin: 0; font-size: 0.78rem; }

.day-card h2 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.meal-items {
  margin: 0 0 0.5rem;
  padding-left: 1rem;
  font-size: 0.9rem;
}

.meal-items li { margin: 0.15rem 0; }
.meal-note { margin: 0; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  color: var(--muted);
}

/* keep root index acceptable */
.hero {
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.eyebrow,
.card-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: #aec3d9;
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.button {
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid var(--line);
  padding: 0 0.8rem;
}

.button-primary { background: var(--accent-2); color: #fff; border-color: #2a65b6; }
.button-secondary { background: #111720; color: var(--text); }

.grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card { padding: 0.8rem; }
.card p { margin: 0.45rem 0 0; color: var(--muted); }

@media (max-width: 820px) {
  .page { width: min(100% - 0.65rem, 1040px); }
  .menu-calendar,
  .grid { grid-template-columns: 1fr; }

  .topbar {
    flex-wrap: wrap;
    position: static;
  }

  .topnav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-link {
    justify-content: center;
    min-height: 44px;
  }

  .check-item label { grid-template-columns: 1.4rem minmax(0,1fr); align-items: center; }
  .item-line { gap: .5rem; }
  .item-name { overflow-wrap: anywhere; }
  .item-qty { font-size: .82rem; }
}


.meal-slot {
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
  margin-top: 0.55rem;
}

.meal-slot:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.1rem;
}

.slot-label {
  margin: 0 0 0.25rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8fb7de;
  font-weight: 700;
}

.item-line {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}
.item-name {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.item-qty {
  color: #bad0e5;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
  flex: 0 0 auto;
}
.meal-slot {
  border-top: 1px solid var(--line);
  padding-top: .55rem;
  margin-top: .55rem;
  border-radius: 8px;
}
.meal-slot:first-of-type { border-top: 0; padding-top: 0; margin-top: .1rem; }
.meal-slot-top { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.meal-actions { display:flex; align-items:center; gap:.35rem; flex-wrap:wrap; }
.mini-btn, .tag-btn { background:#111720; color:var(--muted); border:1px solid var(--line); border-radius:7px; padding:.3rem .45rem; font-size:.75rem; }
.tag-btn.is-active { background:#17304b; color:#d7ecff; border-color:#2d5b89; }
.done-toggle { font-size:.78rem; color:var(--muted); display:inline-flex; align-items:center; gap:.3rem; }
.meal-slot.is-done h2, .meal-slot.is-done .meal-items, .meal-slot.is-done .meal-note { opacity:.58; text-decoration: line-through; }
.slot-label { margin:0 0 .25rem; font-size:.74rem; text-transform:uppercase; letter-spacing:.06em; color:#8fb7de; font-weight:700; }

.manual-form {
  display:grid;
  grid-template-columns: minmax(0,1.5fr) 88px 90px auto;
  gap:.45rem;
  margin:0 0 .75rem;
}
.manual-form input {
  min-width:0;
  background:#111720;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:8px;
  padding:.65rem .7rem;
}
.item-tools {
  display:flex;
  gap:.35rem;
  padding:.1rem .72rem .65rem 2.8rem;
}
@media (max-width: 820px) {
  .manual-form { grid-template-columns: minmax(0,1fr) 72px 78px auto; }
  .item-line { width:100%; justify-content:space-between; gap:.45rem; }
  .item-name { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .item-qty { flex:0 0 auto; white-space:nowrap; margin-left:.45rem; }
  .item-tools { padding-left:2.8rem; }
}
