:root {
  --bg: #101522;
  --panel: #171d2e;
  --panel-2: #1d2438;
  --border: #232a3d;
  --text: #f7f8fc;
  --muted: #8b93aa;
  --accent: #ff6b8b;
  --accent-ink: #ffb0c1;
  --olive: #8fae5e;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 1.75rem 1.5rem 4rem;
}

.back {
  color: var(--muted);
  font-size: .8rem;
  text-decoration: none;
}
.back:hover { color: var(--text); }

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto 2rem;
}

h1 { font-size: 1.5rem; margin: .4rem 0 .3rem; }
.subtitle { color: var(--muted); font-size: .85rem; }

#week-picker {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .85rem;
  padding: .55rem .8rem;
}

main {
  max-width: 1000px;
  margin: 0 auto;
}

.empty-state { color: var(--muted); text-align: center; padding: 3rem 1rem; }

.section-title {
  font-size: 1.05rem;
  margin: 2rem 0 .8rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-title .hint { color: var(--muted); font-size: .78rem; font-weight: 400; }

.plan-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

table.plan { border-collapse: collapse; width: 100%; min-width: 880px; }
table.plan th, table.plan td {
  padding: .8rem .85rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  font-size: .82rem;
  text-align: left;
}
table.plan th:last-child, table.plan td:last-child { border-right: none; }
table.plan thead th {
  background: var(--panel-2);
  font-weight: 700;
  color: var(--accent-ink);
  position: sticky;
  top: 0;
}
table.plan tbody th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--panel-2);
  white-space: nowrap;
  font-weight: 600;
}
table.plan tbody tr:last-child td, table.plan tbody tr:last-child th { border-bottom: none; }
table.plan td.free { color: var(--muted); font-style: italic; }

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.cat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.2rem;
}
.cat h3 {
  font-size: .95rem;
  margin: 0 0 .7rem;
  color: var(--olive);
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}
.cat ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.cat li { display: flex; align-items: flex-start; gap: .55rem; font-size: .84rem; }
.cat li label { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; flex: 1; }
.cat li input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin-top: .15rem;
  accent-color: var(--accent);
}
.cat li .item-name { flex: 1; }
.cat li.checked .item-name { color: var(--muted); text-decoration: line-through; }
.cat li .item-qty { color: var(--muted); font-size: .76rem; white-space: nowrap; }

.notes {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 2rem;
  line-height: 1.6;
  max-width: 70ch;
}
