:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #627184;
  --line: #d9e0e8;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --lunch: #fff4cc;
  --salad: #ddf7df;
  --dinner: #e8efff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f8;
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

.topbar p,
.hint {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}

.actions,
.sheet-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: #dbe3ec;
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

button:hover {
  background: var(--brand-dark);
}

button.secondary {
  background: #dbe3ec;
  color: var(--ink);
}

main {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.sheet-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

input {
  flex: 1 1 320px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

.planner {
  display: grid;
  grid-template-columns: 92px repeat(7, minmax(132px, 1fr));
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.corner,
.day,
.meal-label,
.dropzone {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.corner,
.day,
.meal-label {
  padding: 12px;
  font-weight: 800;
  background: #f8fafc;
}

.day {
  text-align: center;
}

.day span,
.day small {
  display: block;
}

.day small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.meal-label {
  display: flex;
  align-items: center;
}

.dropzone {
  min-height: 104px;
  padding: 8px;
  background: #ffffff;
}

.dropzone[data-category="Lunch"] {
  background: var(--lunch);
}

.dropzone[data-category="Salad"] {
  background: var(--salad);
}

.dropzone[data-category="Dinner"] {
  background: var(--dinner);
}

.dropzone.drag-over {
  outline: 3px solid var(--brand);
  outline-offset: -5px;
}

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

.option-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.option-group h2 {
  font-size: 17px;
  margin-bottom: 10px;
}

.option-list,
.dropzone {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 11px;
  line-height: 1.1;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.chip:active {
  cursor: grabbing;
}

.chip.dragging {
  opacity: 0.45;
}

.chip .remove {
  margin-left: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  min-height: 0;
  padding: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #17202a;
  color: #ffffff;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .options {
    grid-template-columns: 1fr;
  }

  .planner {
    grid-template-columns: 84px repeat(7, 132px);
  }
}

@media print {
  .sheet-panel,
  .options,
  .actions {
    display: none;
  }

  body {
    background: #ffffff;
  }

  main {
    padding: 0;
  }

  .planner {
    overflow: visible;
  }
}
