/* household-ops — mobile-first, big tap targets */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #1a1d24; --muted: #6b7280;
  --accent: #2e6f40; --accent-ink: #fff; --line: #e5e7eb;
  --done: #16a34a; --pending: #d97706;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161b; --card: #1f232b; --ink: #eef0f4; --muted: #9aa2af; --line: #2e3340; }
}
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.view { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
.hidden { display: none !important; }
.sub { color: var(--muted); font-size: 0.85rem; }
.error { color: #dc2626; text-align: center; margin-top: 12px; }
.empty { color: var(--muted); padding: 20px; text-align: center; list-style: none; }

/* login */
.logo { text-align: center; margin: 40px 0 8px; font-size: 1.9rem; }
.hint { text-align: center; color: var(--muted); margin-bottom: 20px; }
.avatar-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.avatar {
  width: 96px; height: 96px; border-radius: 24px; border: none; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.avatar-letter { font-size: 2rem; font-weight: 700; }
.pin-area { margin-top: 28px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 16px 0 24px; }
.pin-dots span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--muted); display: inline-block;
}
.pin-dots span.filled { background: var(--accent); border-color: var(--accent); }
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center;
}
.pin-pad button {
  height: 76px; font-size: 1.6rem; border-radius: 18px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
}
.pin-pad button:active { background: var(--accent); color: var(--accent-ink); }

/* layout */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.stat-row { display: flex; gap: 10px; margin-bottom: 20px; }
.stat {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; text-align: center; display: flex; flex-direction: column;
}
.stat span { font-size: 1.6rem; font-weight: 700; }
.stat label { color: var(--muted); font-size: 0.75rem; }

/* task list */
.tasklist { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.task {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.task.done { opacity: 0.65; }
.task.inactive { opacity: 0.5; }
.task-body { flex: 1; display: flex; flex-direction: column; }
.task-title { font-weight: 600; }
.task-meta { color: var(--muted); font-size: 0.8rem; }
.check {
  width: 46px; height: 46px; min-width: 46px; border-radius: 50%;
  border: 2px solid var(--pending); background: transparent;
  font-size: 1.4rem; color: var(--done); cursor: pointer;
}
.check.checked { border-color: var(--done); background: rgba(22,163,74,.12); }
.rank { font-size: 1.3rem; width: 34px; text-align: center; }
.points { font-weight: 700; }

/* buttons + tabs */
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 12px; padding: 12px 16px; font-size: 0.95rem; cursor: pointer;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 10px 14px; cursor: pointer;
}
.btn-ghost.active { border-color: var(--accent); color: var(--accent); }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.tab {
  flex: 1; padding: 12px 8px; border: none; border-radius: 12px; white-space: nowrap;
  background: var(--card); color: var(--muted); cursor: pointer; font-size: 0.9rem;
}
.tab.active { background: var(--accent); color: var(--accent-ink); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; }

/* assignment grid */
.grid-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 12px 0; }
.grid-col { min-width: 170px; }
.grid-col h4 { border-left: 4px solid; padding-left: 8px; margin-bottom: 8px; }
.grid-cell {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--pending);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 0.85rem;
}
.grid-cell.done { border-left-color: var(--done); }
.grid-cell.approved { border-left-color: var(--done); background: rgba(22,163,74,.08); }

/* task editor */
.task-editor {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin: 12px 0; display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.task-editor input, .task-editor select {
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 0.95rem; width: 100%;
}
.task-editor #te-title, .task-editor #te-desc, .task-editor .row-gap { grid-column: 1 / -1; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 50;
}
