:root {
  --accent: #69813b;
  --accent-dark: #4f6329;
  --bg: #ffffff;
  --bg-card: #f6f7f2;
  --text: #1f2417;
  --muted: #6b7263;
  --border: #dfe3d6;
  --danger: #b3261e;
  --pill-bg: #e7ecdc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8fb15c;
    --accent-dark: #6f9143;
    --bg: #14170f;
    --bg-card: #1c2116;
    --text: #eef1e7;
    --muted: #a3a996;
    --border: #333a28;
    --danger: #ff6b60;
    --pill-bg: #29321f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.site-header-bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-title {
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.who-switch {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 12px;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.flash {
  max-width: 960px;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--pill-bg);
  color: var(--text);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.overdue {
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: var(--border);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--accent-dark);
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .site-nav {
    width: 100%;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

textarea {
  width: 100%;
  resize: vertical;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.inline-form {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.stacked-form {
  margin-top: 12px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-row-main, .task-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notes {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.notes > li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.notes > li:first-child {
  border-top: none;
}

@media (max-width: 600px) {
  .task-row {
    flex-direction: column;
    align-items: stretch;
  }

  .task-row-main, .task-row-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.board-preview-frame {
  width: 100%;
  height: 60vh;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
