:root {
  --bg: #faf6f0;
  --card: #ffffff;
  --text: #2c2620;
  --muted: #8a8074;
  --border: #ece4d8;
  --green: #3f7d4f;
  --green-bg: #e7f3ea;
  --red: #b7473e;
  --red-bg: #fbebe9;
  --amber: #a8792b;
  --amber-bg: #f8f0e0;
  --accent: #d97b3f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

.hidden {
  display: none;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

.header {
  text-align: center;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 1.7rem;
  margin: 0 0 4px;
}

.week-label {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  text-transform: capitalize;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.total-card {
  text-align: center;
  padding: 22px;
}

.total-number {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 3.2rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  color: var(--accent);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.total-caption {
  color: var(--muted);
  margin-top: 4px;
  font-size: 1rem;
}

.overview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--bg);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 48px;
}

.overview-row:active {
  background: #f1e7d8;
}

.overview-name {
  font-weight: 600;
  flex: 1;
}

.overview-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.overview-chevron {
  color: var(--muted);
  font-size: 1.1rem;
}

.overview-detail {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.status-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.yes { background: var(--green-bg); color: var(--green); }
.status-pill.no { background: var(--red-bg); color: var(--red); }
.status-pill.pending { background: var(--amber-bg); color: var(--amber); }

.hint {
  color: var(--muted);
  margin: -6px 0 14px;
  font-size: 0.9rem;
}

.yes-details.hidden,
.confirm-msg.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 24, 16, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-sheet {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px 24px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  animation: slide-up 0.18s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slide-up {
  from { transform: translateY(12%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close {
  border: none;
  background: var(--bg);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toggle-btn {
  flex: 1;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}

.toggle-btn.yes.active { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.toggle-btn.no.active { background: var(--red-bg); border-color: var(--red); color: var(--red); }

.field {
  display: block;
  margin-bottom: 12px;
}

.field span {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 1.3rem;
  cursor: pointer;
}

.stepper input {
  width: 64px;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1.1rem;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.confirm-msg {
  margin-top: 12px;
  color: var(--green);
  font-weight: 600;
  text-align: center;
}

.manage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.manage-header h1 {
  font-size: 1.4rem;
  margin: 0;
}

.back-btn {
  border: none;
  background: var(--bg);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.add-member-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.add-member-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.add-member-row button {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.member-manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-manage-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
}

.member-manage-list button {
  border: none;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-size: 0.9rem;
}
