* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fafaf9;
  color: #1c1917;
  font: 16px/1.4 system-ui, sans-serif;
}

.wrap {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
}

header.wrap { padding: 28px 0 4px; }

main.wrap { padding-bottom: 80px; }

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

h2 {
  margin: 28px 0 8px;
  font-size: 18px;
}

.sub { margin: 4px 0 0; color: #57534e; }

.scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #e7e5e4;
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 13px;
  font-weight: 650;
  color: #57534e;
  background: #fafaf9;
}

th.check {
  white-space: nowrap;
  min-width: 10.5rem;
  padding: 12px 16px;
  line-height: 1.3;
}

td:has(input[data-save="household"]),
td:has(input[data-save="meal-label"]) {
  min-width: 13rem;
}

td:has(input[data-save="person"]) {
  min-width: 8rem;
}

td:has(input[data-field="item"]),
td:has(input[data-field="idea"]),
td:has(input[data-field="assignee"]),
td:has(input[data-save="new-who"]) {
  min-width: 14rem;
}

tr:last-child td { border-bottom: none; }

td.check, th.check { text-align: center; }

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #1c1917;
}

input[type="text"], .cell {
  width: 100%;
  min-width: 0;
  border: 1px solid #44403c;
  border-radius: 8px;
  background: #fff;
  color: #1c1917;
  font: inherit;
  padding: 7px 8px;
}

input[type="text"]::placeholder {
  color: #57534e;
}

input[type="text"]:focus {
  border-color: #1c1917;
  background: #fff;
  outline: 2px solid #1c1917;
  outline-offset: 1px;
}

.add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.add input[type="text"] {
  width: auto;
  flex: 1 1 140px;
  border: 1px solid #44403c;
  background: #fff;
}

button {
  font: inherit;
  border: 1px solid #d6d3d1;
  background: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  cursor: pointer;
}

button.primary {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

button.link {
  border: none;
  background: none;
  color: #9f1239;
  padding: 0 4px;
  min-height: 32px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: #9f1239;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  max-width: calc(100% - 24px);
}

#toast[hidden] { display: none; }
