:root {
  --paper: #efece4;
  --ink: #1c1916;
  --muted: #5a554c;
  --rule: #9a3d1a;
  --space: clamp(1.5rem, 4vw, 3rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space);
  padding-bottom: calc(var(--space) + 2.5rem);
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

main {
  width: min(36rem, 100%);
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 4vw + 1.4rem, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.98;
}

.lede {
  margin: 0;
  max-width: 22rem;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

hr {
  display: block;
  width: 2.25rem;
  height: 0;
  margin: 2rem 0 1.15rem;
  border: 0;
  border-top: 1.5px solid var(--rule);
}

.status {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--muted);
}

body.app {
  display: block;
  place-items: unset;
  padding: 0;
  padding-bottom: 3rem;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--space);
}

.mark {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.narrow {
  width: min(28rem, 100%);
  margin: 2rem auto 0;
  padding: 0 var(--space);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.stack input {
  font: inherit;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  border: 1px solid #c9c2b4;
  border-radius: 2px;
  background: #fff;
}

.stack button,
button.text {
  font: inherit;
  cursor: pointer;
}

.stack button {
  margin-top: 0.25rem;
  padding: 0.6rem 1rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
}

button.text {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
}

.err {
  margin: -0.4rem 0 0;
  font-size: 0.8125rem;
  color: #8a2b16;
}

.meta {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.toast {
  width: min(36rem, calc(100% - 2rem));
  margin: 0.75rem auto 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
}

.toast-success { color: #1d4a28; }
.toast-error { color: #8a2b16; }

a {
  color: inherit;
}

body.app main.wide {
  width: min(52rem, 100%);
  margin: 0 auto;
  padding: 0 var(--space);
}

body.app h1 {
  font-size: clamp(1.75rem, 2vw + 1.2rem, 2.4rem);
  margin-bottom: 0.4rem;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.9rem;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #c9c2b4;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.nav { display: flex; gap: 1rem; font-size: 0.9rem; }
.nav a { text-decoration: none; color: var(--muted); }
.top { gap: 1rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.filters select,
.stack select {
  font: inherit;
  color: var(--ink);
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9c2b4;
  background: #fff;
}

.filters button {
  font: inherit;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
}

.tablewrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.6rem 0.55rem 0;
  border-bottom: 1px solid #ddd6c8;
  vertical-align: top;
}

th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty { color: var(--muted); max-width: 28rem; }

.due-overdue { color: #8a2b16; font-weight: 600; }
.due-soon { color: #8a3b12; }
.due-ok { color: var(--muted); }

.crumb { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.75rem; }
.crumb a { text-decoration: none; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid #ddd6c8;
  padding-bottom: 0.6rem;
}

.tabs a { text-decoration: none; color: var(--muted); font-size: 0.9rem; }
.tabs a.on { color: var(--ink); font-weight: 600; }
