:root {
  --paper: #f3efe6;
  --ink: #1c1915;
  --muted: #6d6458;
  --card: #fffdf8;
  --line: #e4dccf;
  --accent: #b8502e;
  --accent-dark: #8d3b20;
  --moss: #246246;
  --gold: #8a5a12;
  --sky: #1d4e89;
  --alert: #9f2d2d;
  --shadow: 0 16px 40px rgba(60, 42, 20, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(184, 80, 46, 0.08), transparent 32rem),
    var(--paper);
  font-family: "Noto Sans Myanmar", "Segoe UI", sans-serif;
  line-height: 1.55;
}

a { color: var(--accent-dark); }

h1, h2, .brand {
  font-family: Fraunces, "Noto Sans Myanmar", serif;
  font-weight: 560;
  letter-spacing: -0.02em;
}

h1 { margin: 0.15rem 0 0.35rem; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.25; }
h2 { margin: 0; font-size: 1.15rem; line-height: 1.35; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 6vw;
  background: #231e19;
  color: #f6f1e7;
}

.brand, .account, .form-actions, .task-line, .task-actions, .pager {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand {
  color: inherit;
  text-decoration: none;
  font-size: 1.35rem;
}

.mark {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.45rem;
  background: var(--accent);
  color: white;
  font-family: Fraunces, serif;
}

.who { color: #d9d0c3; }

.text-button, .text-link {
  background: none;
  border: 0;
  padding: 0;
  color: #f0c7b8;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.text-link { color: var(--accent-dark); }

.wrap {
  width: min(980px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.hero, .panel, .task, .stats article, .empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.lede { margin: 0; color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--accent-dark); }
.button-quiet { background: #231e19; }
.button-danger { background: var(--alert); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin: 0.9rem 0;
}

.stats article { padding: 0.9rem 1rem; }
.stats span { display: block; color: var(--muted); font-size: 0.86rem; }
.stats strong { font-family: Fraunces, serif; font-size: 1.8rem; }
.stats .is-alert strong { color: var(--alert); }

.filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid #d9d0c3;
  border-radius: 0.8rem;
  padding: 0.72rem 0.85rem;
  background: white;
  color: var(--ink);
  font: inherit;
}

.input:focus {
  outline: 2px solid rgba(184, 80, 46, 0.35);
  border-color: var(--accent);
}

.messages { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.messages li {
  padding: 0.75rem 1rem;
  border-radius: 0.8rem;
  background: #e7f3ec;
  color: var(--moss);
  font-weight: 700;
}

.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }

.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem;
}

.task.is-done h2 { color: var(--muted); text-decoration: line-through; }
.task.is-overdue { border-color: #efc4c4; }

.check {
  width: 1.7rem;
  height: 1.7rem;
  margin-top: 0.15rem;
  border: 1.5px solid #b7aa99;
  border-radius: 0.45rem;
  background: white;
  color: var(--moss);
  font-weight: 700;
  cursor: pointer;
}

.task.is-done .check { background: var(--moss); color: white; border-color: var(--moss); }

.task-body p { margin: 0.35rem 0 0; color: var(--muted); }
.meta { font-size: 0.86rem; }
.task.is-overdue .meta { color: var(--alert); font-weight: 700; }

.pill {
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  background: #efe7da;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-high { background: #fde8e4; color: var(--alert); }
.pill-medium { background: #f8efd8; color: var(--gold); }
.pill-low { background: #e5f2ea; color: var(--moss); }

.task-actions { flex-direction: column; align-items: flex-end; font-size: 0.92rem; }

.pager { justify-content: flex-end; margin-top: 0.9rem; color: var(--muted); }

.panel { width: min(560px, 100%); margin: 1rem auto; padding: 1.5rem; }
.stack { display: grid; gap: 0.85rem; margin-top: 1rem; }
.field { display: grid; gap: 0.35rem; font-weight: 700; }
.field small, .form-error { color: var(--alert); font-weight: 600; }
.form-error { padding: 0.7rem 0.8rem; border-radius: 0.7rem; background: #fdecec; }
.switch { color: var(--muted); }

.empty { padding: 2rem 1.2rem; text-align: center; }

@media (max-width: 760px) {
  .hero, .task { display: grid; }
  .hero { align-items: start; }
  .stats, .filters { grid-template-columns: 1fr 1fr; }
  .filters .button, .filters .text-link { grid-column: 1 / -1; }
  .task { grid-template-columns: auto 1fr; }
  .task-actions { grid-column: 2; flex-direction: row; align-items: center; }
}
