:root {
  color-scheme: light;
  --ink: #241c14;
  --muted: #6d6256;
  --paper: #f4efe6;
  --card: #fffaf3;
  --line: #e2d5c3;
  --accent: #8c3d2f;
  --ok: #2f6b4f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Sarabun", "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
header, main { padding: 1rem; }
header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
nav { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: center; }
a { color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-bottom: 1rem; }
.filters a.active,
nav a.active {
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.card, form.card, table {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card, form.card { padding: 1.15rem 1.2rem 1.25rem; margin-bottom: 1rem; }
h2, h3 { margin: 0 0 0.95rem; }
h3 { margin-top: 1.35rem; }
label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  margin: 0 0 1.05rem;
}
label:has(> input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}
input, select, button {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}
label input:not([type="checkbox"]),
label select {
  width: 100%;
  max-width: 28rem;
}
label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
}
button, .button {
  background: var(--accent);
  color: white;
  border: 0;
  cursor: pointer;
}
form.card > button { margin-top: 0.35rem; }
form.card > button + button { margin-left: 0.6rem; }
.status {
  background: #efe4c4;
  border: 1px solid #e2d3a4;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}
.status.ok {
  background: #d9f2e3;
  border-color: #8dceb0;
  color: #145c32;
}
.status.bad {
  background: #fde2dc;
  border-color: #e7b2a8;
  color: #8c2f24;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th a { color: inherit; font-weight: 700; text-decoration: none; }
th a:hover, th a.active { color: var(--accent); }
button.danger {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
h1 { font-size: 1.4rem; margin: 0; }
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 20;
  pointer-events: none;
  opacity: 1;
}
#progress.on { width: 70%; transition: width 0.45s ease; }
#progress.done { width: 100%; opacity: 0; transition: width 0.15s ease, opacity 0.25s ease 0.15s; }
main.entering { animation: screen-in 180ms ease; }
@keyframes screen-in {
  from { opacity: 0.4; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  main.entering { animation: none; }
  #progress.on, #progress.done { transition: none; }
}
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.actions form { margin: 0; }
