:root {
  --bg: #fbf4e6;
  --paper: #fffdf7;
  --ink: #3b3127;
  --muted: #8a7a68;
  --line: #e8dcc6;
  --green: #2f5d50;
  --green-soft: #cfe6d6;
  --peach: #f6d7b0;
  --pink: #f2a58a;
  --lavender: #dcd3f0;
  --butter: #fbeba8;
  --bad: #a4343b;
  --ok: #2f6b4a;
  --radius: 18px;
  --chunk: 0 3px 0 var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(#e6d8bb 1px, transparent 1px);
  background-size: 18px 18px;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); margin: 8px 0 0; }
.small { font-size: 13px; }

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 8px;
}
.brand { display: flex; flex-direction: column; }
.wordmark { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--green); }
.tagline { color: var(--muted); font-size: 15px; }

.status {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
}
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

/* Layout and cards */
.layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 20px 56px;
}

.card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--chunk);
  padding: 20px;
}

h1, h2 { margin: 0; }
h2 { font-size: 19px; font-weight: 800; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* Pip's room: the hero card */
.room {
  display: flex;
  align-items: center;
  gap: 22px;
  background: linear-gradient(160deg, var(--butter), var(--peach));
}
.pip { flex: 0 0 120px; }
.pip svg { width: 120px; height: 120px; display: block; animation: bob 3.6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.room-copy { flex: 1; min-width: 0; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}
.hello { font-size: 23px; font-weight: 800; line-height: 1.25; margin-bottom: 12px; }

.window {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}
.window input {
  width: 96px;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}

.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip {
  border: 2px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--ink);
}

/* Lists and task cards */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
}
.check { margin-top: 5px; width: 20px; height: 20px; accent-color: var(--green); }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 700; overflow-wrap: anywhere; }
.item-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.bar {
  height: 10px;
  margin-top: 10px;
  background: #efe4cf;
  border-radius: 999px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}
.bar.over span { background: var(--pink); }

.overrun {
  color: #7a2e10;
  background: #fbe3d6;
  font-size: 14px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
}

/* Capture note */
.note-card { background: #fffbe9; }
.capture { display: flex; flex-direction: column; gap: 12px; }
textarea {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  resize: vertical;
  background: var(--paper);
  color: var(--ink);
}
.row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
select {
  font: inherit;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}

/* Buttons */
button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
button:hover { background: var(--butter); }
button:active { transform: translateY(2px); box-shadow: none; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
button.primary { background: var(--green); color: #fff; }
button.primary:hover { background: #3a6e5f; }
button.ghost { background: var(--paper); }

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

.log-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.log-form input {
  width: 130px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}

/* Summary stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--chunk);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.stat .num { font-size: 28px; font-weight: 800; }
.stat-open { background: var(--peach); }
.stat-fits { background: var(--green-soft); }
.stat-review { background: var(--lavender); }
.stat-done { background: var(--butter); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--chunk);
  max-width: calc(100vw - 40px);
  text-align: center;
}

/* Small screens */
@media (max-width: 620px) {
  .room { flex-direction: column; text-align: center; }
  .room-copy { width: 100%; }
  .window { justify-content: center; }
  .chips { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .pip svg { animation: none; }
  button { transition: none; }
}

/* Category headings above the to-do groups */
.category-title {
  list-style: none;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--green);
}
