:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: #1a1d24;
  --text: #eaecef;
  --muted: #9aa1ac;
  --accent: #f0c43a;
  --good: #3ecf8e;
  --border: #2b2f38;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

input[type="email"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #10131a;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

button {
  background: var(--accent);
  color: #1a1300;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

#auth-status,
#save-status {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.top-bar .whoami {
  color: var(--muted);
  font-size: 0.9rem;
}

#day-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

#day-banner {
  color: var(--good);
  font-weight: 600;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.task-row:last-child {
  border-bottom: none;
}

.task-row input {
  width: 1.15rem;
  height: 1.15rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.group-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.poke-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.group-row:last-child {
  border-bottom: none;
}

.group-row.complete .group-progress {
  color: var(--good);
  font-weight: 600;
}

.group-name {
  flex: 1;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  margin-bottom: 1.25rem;
}

.history-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--border);
}

.history-cell.complete {
  background: var(--good);
}

.history-cell.partial {
  background: #c0392b;
}

.history-cell.missed {
  background: #3a2020;
}

.history-cell.pending {
  background: var(--border);
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}

.task-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.mood-block {
  margin-bottom: 1rem;
}

.mood-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.mood-picker {
  display: flex;
  gap: 0.5rem;
}

.mood-btn {
  background: #10131a;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.mood-btn.selected {
  border-color: var(--accent);
  background: rgba(240, 196, 58, 0.15);
}

.mood-hint {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin: 1rem 0 0;
}
