:root {
  --bg: #f7f7f5;
  --fg: #24292f;
  --muted: #6a737d;
  --accent: #2456a4;
  --border: #d8dce0;
  --panel: #ffffff;
  --high: #b3261e;
  --low: #6a737d;
  --open: #2456a4;
  --in-progress: #8a5a00;
  --done: #1a7f37;
  --cancelled: #6a737d;
}

* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 52rem;
  padding: 0 1rem 4rem;
  font: 16px/1.5 system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 1.1rem; }

h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }
a { color: var(--accent); }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.flash { padding: 0.5rem 0.8rem; border-radius: 6px; margin-bottom: 0.8rem; }
.flash-info { background: #e2ecf9; }
.flash-error { background: #fbe4e2; }

.breadcrumbs { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--muted); }

.project-tree { padding-left: 1.2rem; }
.project-tree li { margin: 0.25rem 0; }
.count {
  display: inline-block; min-width: 1.4rem; text-align: center;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 0.75rem; padding: 0.05rem 0.4rem; margin-left: 0.3rem;
}

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; text-transform: uppercase; color: var(--muted); }
tr.closed td a { color: var(--muted); text-decoration-line: line-through; }

.badge {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
  font-size: 0.78rem; border: 1px solid currentColor; white-space: nowrap;
}
.status-open { color: var(--open); }
.status-in_progress { color: var(--in-progress); }
.status-done { color: var(--done); }
.status-cancelled { color: var(--cancelled); }
.prio-high { color: var(--high); font-weight: 600; }
.prio-normal { color: var(--muted); }
.prio-low { color: var(--low); border-style: dashed; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.6rem 0.9rem; margin: 1rem 0;
}
.panel summary { cursor: pointer; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.8rem; max-width: 28rem; }
.stack label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
input[type="text"], input[type="email"], textarea, select {
  font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
  background: #fff;
}
button {
  font: inherit; padding: 0.45rem 0.9rem; border: none; border-radius: 6px;
  background: var(--accent); color: #fff; cursor: pointer; align-self: flex-start;
}
button:hover { filter: brightness(1.1); }
button.linklike {
  background: none; color: var(--accent); padding: 0; text-decoration: underline;
}

.status-actions { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; align-items: center; }
.status-btn.to-done { background: var(--done); }
.status-btn.to-cancelled { background: var(--cancelled); }
.status-btn.to-in_progress { background: var(--in-progress); }
.button-secondary {
  padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--fg); text-decoration: none;
}

.description pre, .diff pre {
  white-space: pre-wrap; font: inherit; background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem;
}
.diff h4 { margin: 0.5rem 0 0.2rem; font-size: 0.8rem; color: var(--muted); }

.history { font-size: 0.9rem; }
.history details summary { color: var(--accent); cursor: pointer; font-size: 0.85rem; }

.login-box { max-width: 22rem; margin: 4rem auto; }
.login-box form { display: flex; flex-direction: column; gap: 0.8rem; }
.login-box .resend { margin-top: 1rem; }
