:root {
  --bg: #17110e; --panel: #201813; --panel2: #2a1f18; --line: #4a382b; --line2: #6b513d;
  --text: #f2e6d0; --quiet: #a8957c; --gold: #f0c84a; --red: #e05a4a; --green: #8ad07a; --blue: #6fb3ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
mark { background: #f0c84a55; color: inherit; border-radius: 2px; }
.quiet { color: var(--quiet); }
.small { font-size: 12px; }
.pad { padding: 16px; }
.boot { padding: 40px; color: var(--quiet); }
.error { color: var(--red); padding: 0 16px; }

input, select, textarea, button {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px;
}
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f0c84a66; border-color: var(--gold); }
button { cursor: pointer; background: #33261f; }
button:hover { border-color: var(--gold); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: #3a5a2a; border-color: var(--green); }
button.ghost, a.ghost { background: transparent; border: 1px solid transparent; color: var(--quiet); padding: 4px 8px; border-radius: 6px; }
button.ghost:hover, a.ghost:hover { border-color: var(--line2); color: var(--text); text-decoration: none; }
button.bad { color: var(--red); }
input.short { width: 110px; }

header { display: flex; align-items: center; gap: 24px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand b { color: var(--gold); font-size: 16px; }
.brand { color: var(--quiet); white-space: nowrap; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--quiet); }
nav a.on { background: var(--panel2); color: var(--text); }
nav a:hover { text-decoration: none; color: var(--text); }
.me { display: flex; gap: 4px; }
.count { display: inline-block; margin-left: 6px; background: var(--gold); color: #1a120c; border-radius: 9px; padding: 0 7px; font-size: 12px; font-weight: 600; }
.count.quiet { background: var(--line); color: var(--text); }

.login { max-width: 320px; margin: 12vh auto; display: flex; flex-direction: column; gap: 10px; background: var(--panel); padding: 28px; border: 1px solid var(--line); border-radius: 12px; }
.login h1 { margin: 0; color: var(--gold); }

.inbox { display: grid; grid-template-columns: 1fr; height: calc(100vh - 53px); }
.inbox.with-detail { grid-template-columns: minmax(380px, 44%) 1fr; }
.left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.filters input[type=search] { flex: 1 1 220px; }
.check { display: flex; align-items: center; gap: 4px; color: var(--quiet); }
.list { overflow-y: auto; flex: 1; }
.row { display: block; padding: 9px 12px 9px 14px; border-bottom: 1px solid #2c211a; color: var(--text); border-left: 3px solid transparent; }
.row:hover { background: #221a15; text-decoration: none; }
.row.on { background: var(--panel2); border-left-color: var(--gold); }
.row.unread .title { font-weight: 650; }
.row.unread { border-left-color: #f0c84a99; }
.row.severe { border-left-color: var(--red); }
.row-top { display: flex; gap: 6px; align-items: center; min-width: 0; }
.row-top .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: var(--quiet); font-size: 12px; align-items: center; }
.row-meta .when { margin-left: auto; }
.row-meta .gh { color: var(--blue); }
.build-playtest { color: #e8a05a; }
.build-dev { color: #777; }

.badge { flex: none; font-size: 11px; padding: 1px 7px; border-radius: 9px; background: color-mix(in srgb, var(--c) 25%, transparent); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); white-space: nowrap; }
.sev { flex: none; font-size: 11px; padding: 1px 6px; border-radius: 9px; background: #ffffff10; white-space: nowrap; }
.sev-7, .sev-6 { background: #e05a4a40; }
.sev-5, .sev-4 { background: #e8a05a33; }
.status { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #ffffff12; }
.st-new { background: #f0c84a33; color: var(--gold); }
.st-planned, .st-in_progress { background: #6fb3ff26; color: var(--blue); }
.st-done { background: #8ad07a26; color: var(--green); }

.detail { overflow-y: auto; padding: 16px 22px 40px; }
.detail-head { position: relative; }
.detail-head .close { position: absolute; right: 0; top: 0; }
.detail h2 { margin: 0 32px 8px 0; font-size: 20px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--text); font-size: 13px; margin-bottom: 14px; }
.answers h4, .edit h4, .contacts h4, .perf h4 { margin: 14px 0 4px; color: var(--gold); font-size: 13px; font-weight: 600; }
.answers p { margin: 0; white-space: pre-wrap; }
.media { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.media a { display: flex; flex-direction: column; gap: 4px; color: var(--quiet); font-size: 12px; max-width: 100%; }
.media img { max-width: min(100%, 560px); max-height: 340px; border: 1px solid var(--line); border-radius: 6px; image-rendering: pixelated; background: #000; }
.files .file { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.files .file span { flex: 1; color: var(--quiet); }
pre.log { max-height: 360px; overflow: auto; background: #0e0a08; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 12px; white-space: pre-wrap; }
details.info { margin: 12px 0; }
details.info summary { cursor: pointer; color: var(--gold); }
details.info table { border-collapse: collapse; margin-top: 6px; font-size: 12px; }
details.info th { text-align: left; color: var(--quiet); font-weight: normal; padding: 2px 14px 2px 0; vertical-align: top; }
.copy { background: transparent; border: 1px dashed var(--line2); padding: 1px 8px; margin: 2px 0; }
.edit { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.inline input:not(.short) { flex: 1 1 200px; }
.gh-box p { margin: 6px 0; }
.danger { margin-top: 26px; text-align: right; }

.page { max-width: 1280px; margin: 0 auto; padding: 18px 20px 60px; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; margin-bottom: 10px; }
.page-head h2 { margin: 0; }
.page-head p { margin: 0; flex: 1; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; color: var(--quiet); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
table.grid th.sorted { color: var(--gold); }
table.grid td { padding: 7px 8px; border-bottom: 1px solid #2c211a; vertical-align: top; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: #221a15; }
table.grid tr.closed td { color: var(--quiet); }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.wide { width: 34%; }
table.grid.small tr { cursor: default; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 110px; }
.stat b { font-size: 16px; }
.manual { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.manual label { display: flex; flex-direction: column; gap: 4px; color: var(--quiet); }
.manual label.grow { flex: 1; }
.manual .inline label input:not(.short), .manual label input, .manual label select { flex: none; }
.manual .inline label { flex-direction: column; }
.manual button { align-self: flex-start; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--gold); border-radius: 8px; padding: 8px 16px; z-index: 20; }
.toast.bad { border-color: var(--red); color: #ffb4a8; }

@media (max-width: 900px) {
  header { flex-wrap: wrap; gap: 8px; }
  .inbox.with-detail { grid-template-columns: 1fr; height: auto; }
  .inbox.with-detail .left { display: none; }
  .inbox { height: auto; }
  .list { overflow: visible; }
  table.grid td:nth-child(n+8), table.grid th:nth-child(n+8) { display: none; }
}
