:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --text: #1f2937;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 20% 20%, #dbeafe, var(--bg));
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.app {
  width: min(99vw, 1700px);
  background: var(--panel);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.top-bar h1 {
  margin: 0;
}

.person-manage {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.new-person-input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
  width: 120px;
  height: 30px;
}

.manage-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.32rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  height: 30px;
}

.delete-btn {
  border-color: #fca5a5;
  background: #fee2e2;
}

.person-filter-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.person-filter {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
  background: #fff;
  height: 30px;
}

.week-picker-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.week-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.week-field-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.week-display {
  border: 1px solid #0f766e;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  background: #0f766e;
  text-align: center;
  min-width: 170px;
  height: 30px;
}

.calendar-controls {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.calendar-select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.15rem 0.2rem;
  font-size: 0.68rem;
  background: #fff;
  min-width: 72px;
  height: 30px;
}

.planner-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.day-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.45rem;
}

.day-card h2 {
  margin: 0 0 0.25rem;
  font-size: 0.86rem;
  text-align: center;
}

.planner-area {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem;
}
.planner-area + .planner-area { margin-top: 0.3rem; }

.planner-area h3 {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  text-align: center;
}

.person-fields {
  display: grid;
  gap: 0.2rem;
}

.person-row {
  width: 100%;
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.2rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.person-row.status-no {
  background: #fecaca;
  border: 1px solid #fca5a5;
}

.person-row.status-yes {
  background: #bbf7d0;
  border: 1px solid #86efac;
}

.person-row.hidden-by-filter {
  display: none;
}

.cook-row {
  margin-top: 0.24rem;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.2rem;
  align-items: center;
}

.cook-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.cook-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.14rem 0.2rem;
  font-size: 0.68rem;
  background: #fff;
}

.app.single-person-mode {
  width: min(95vw, 1260px);
}

.app.single-person-mode .planner-grid {
  grid-template-columns: repeat(7, minmax(105px, 1fr));
}
