:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #1d1f23;
  --muted: #6b6f76;
  --line: #e2e2de;
  --accent: #1f6feb;
  --todo: #e8e8e4;
  --progress: #dbe8ff;
  --done: #dcf3e2;
  --error: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --panel: #1d2024; --ink: #e8e9eb; --muted: #9aa0a8; --line: #31353b;
    --accent: #5b9dff; --todo: #2c3036; --progress: #1f3354; --done: #1d3a29; --error: #ff8a80;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: .4em 0; }
h2 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.muted { color: var(--muted); }
.error { color: var(--error); }
.pre { white-space: pre-wrap; }

.top { display: flex; align-items: center; gap: 20px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); }
.top nav { display: flex; gap: 14px; flex: 1; }
.signout { display: flex; gap: 10px; align-items: center; }
.who { color: var(--muted); font-size: .9em; }

button, .button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .button { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); max-width: 100%; }
label { display: block; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; }
form.inline { display: inline; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 12px 0; }
.narrow { max-width: 460px; margin: 40px auto; }
.form .field { margin-bottom: 14px; }
.form .field > label { font-weight: 600; margin-bottom: 4px; }
.form input[type=text], .form input[type=email], .form textarea, .form select { width: 100%; }
.form .checks { display: flex; flex-wrap: wrap; gap: 4px 0; }
.help { color: var(--muted); font-size: .9em; margin: 4px 0 0; }
.req { color: var(--error); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

table.issues { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.issues th, .issues td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.issues th { font-size: .85em; color: var(--muted); font-weight: 600; }
.issues tr:last-child td { border-bottom: 0; }

.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .85em; white-space: nowrap; background: var(--todo); }
.status.in_progress { background: var(--progress); }
.status.done { background: var(--done); }

.projects, .request-types { list-style: none; padding: 0; }
.projects li, .request-types li { padding: 8px 0; border-bottom: 1px solid var(--line); }

.crumbs { color: var(--muted); margin: 0; font-size: .9em; }
.issue-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.issue-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
@media (max-width: 800px) { .issue-grid { grid-template-columns: 1fr; } }
.issue-side dl { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0; }
.issue-side dt { font-size: .8em; color: var(--muted); margin-top: 8px; }
.issue-side dd { margin: 0; overflow-wrap: anywhere; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 4px 0; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.tick { border: 0; background: none; padding: 0 6px 0 0; font-size: 1.1em; }
.action { font-size: .75em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; text-decoration: none; display: inline-block; }
.comment { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.comment p { margin: 4px 0 0; }
.history ul { font-size: .9em; padding-left: 18px; }
.comment.internal { border-style: dashed; }
.tag { font-size: .75em; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--muted); }
.attachments { list-style: none; padding: 0; margin: 0 0 8px; }
.attachments li { padding: 3px 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
