:root {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f8f9fb; --fg: #16181d; --muted: #5b6370;
  --line: #dde1e7; --accent: #4f5bd5; --accent-fg: #ffffff; --focus: #4f5bd555;
  --s-unconfirmed: #8a5a00; --s-unconfirmed-bg: #fff3d6;
  --s-open: #b42318; --s-open-bg: #fde7e5;
  --s-testing: #1f5fbf; --s-testing-bg: #e3edfc;
  --s-fixed: #1b7a3d; --s-fixed-bg: #e2f5e8;
  --s-closed: #5b6370; --s-closed-bg: #eceef2;
  --shadow: 0 10px 30px rgba(15, 20, 30, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1a1d22; --surface-2: #20242a; --fg: #e7e9ed; --muted: #9aa2ae;
    --line: #2e333a; --accent: #7c86ff; --accent-fg: #0d0f14; --focus: #7c86ff55;
    --s-unconfirmed: #f2c25b; --s-unconfirmed-bg: #3a2e12;
    --s-open: #ff8a7f; --s-open-bg: #3d1c1a;
    --s-testing: #8cb6ff; --s-testing-bg: #1a2a45;
    --s-fixed: #6fd696; --s-fixed-bg: #15331f;
    --s-closed: #a3aab5; --s-closed-bg: #262a31;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #1a1d22; --surface-2: #20242a; --fg: #e7e9ed; --muted: #9aa2ae;
  --line: #2e333a; --accent: #7c86ff; --accent-fg: #0d0f14; --focus: #7c86ff55;
  --s-unconfirmed: #f2c25b; --s-unconfirmed-bg: #3a2e12;
  --s-open: #ff8a7f; --s-open-bg: #3d1c1a;
  --s-testing: #8cb6ff; --s-testing-bg: #1a2a45;
  --s-fixed: #6fd696; --s-fixed-bg: #15331f;
  --s-closed: #a3aab5; --s-closed-bg: #262a31;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

.demo-banner { background: var(--s-unconfirmed-bg); color: var(--s-unconfirmed); font-size: 13px; padding: 6px 16px; text-align: center; }

header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1200px; margin: auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--fg); letter-spacing: .2px; }
.brand span { color: var(--muted); font-weight: 500; }
.spacer { flex: 1; }
.tabs { max-width: 1200px; margin: auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; white-space: nowrap; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--fg); border-color: var(--accent); font-weight: 600; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

main { max-width: 1200px; margin: auto; padding: 16px; }
.map-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 14px; }
.map-head h1 { margin: 0; font-size: 26px; }
.map-head .from { color: var(--muted); margin: 2px 0 0; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.count { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; min-width: 84px; }
.count b { display: block; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.count small { color: var(--muted); }

.toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 220px; min-width: 0; }
.field { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 7px 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.list { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--surface-2); cursor: pointer; user-select: none; white-space: nowrap; }
th[aria-sort="ascending"]::after { content: " ▲"; }
th[aria-sort="descending"]::after { content: " ▼"; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num { color: var(--muted); font-variant-numeric: tabular-nums; width: 56px; }
td .t { font-weight: 600; }
td .sub { color: var(--muted); font-size: 13px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.unconfirmed { color: var(--s-unconfirmed); background: var(--s-unconfirmed-bg); }
.badge.open { color: var(--s-open); background: var(--s-open-bg); }
.badge.testing { color: var(--s-testing); background: var(--s-testing-bg); }
.badge.fixed { color: var(--s-fixed); background: var(--s-fixed-bg); }
.badge.closed { color: var(--s-closed); background: var(--s-closed-bg); }

/* Phone layout: table rows become cards. */
@media (max-width: 720px) {
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 2px 0; }
  td.num { width: auto; display: inline; }
  td.col-map, td.col-ver { display: inline-block; width: auto; margin-right: 10px; color: var(--muted); font-size: 13px; }
  .map-head .counts { margin-left: 0; }
}

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(10, 12, 16, .55); }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { margin: 0; font-size: 18px; flex: 1; }
.dlg-body { padding: 16px; display: grid; gap: 14px; }
.dlg-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
label.f { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
label.f small, .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
label.f input, label.f select, label.f textarea { font-weight: 400; }
textarea.field { min-height: 90px; resize: vertical; }
.xy { display: flex; gap: 8px; }
.xy input { width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.check input { margin-top: 4px; }
.shot-preview { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.panel h3 { margin: 0 0 8px; font-size: 14px; }
.admin { border-color: var(--accent); }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.history { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }
footer { max-width: 1200px; margin: 0 auto; padding: 8px 16px 32px; color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
footer button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 13px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 220px; z-index: 20; }
.menu-pop button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop small { display: block; color: var(--muted); }

/* Report form quick picks, screenshots and similar-bug check */
fieldset.f { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.f legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-block; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font-size: 13.5px; font-weight: 500; }
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); }
.tag { display: inline-block; font-size: 11.5px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-right: 4px; color: var(--muted); background: var(--surface-2); }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.drop.over { border-color: var(--accent); background: var(--surface-2); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; }
.thumb img { height: 72px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumb button { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); cursor: pointer; line-height: 1; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.shots img { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.similar { background: var(--s-unconfirmed-bg); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; font-size: 14px; }
.sim { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.m0 { margin: 0; }
.pre { margin: 4px 0 0; white-space: pre-wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 14px; }
button.count { text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.count:hover { border-color: var(--accent); }
th.sel, td.sel { width: 36px; padding-right: 0; }
input.dup { width: 64px; padding: 4px 8px; }
.admin .row { margin-top: 10px; }
.admin .form-grid { margin-top: 8px; }
.notes-out { width: 100%; font: 13.5px/1.5 ui-monospace, Consolas, monospace; }
.bulk { position: sticky; bottom: 12px; margin-top: 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) { td.sel { display: inline-block; width: auto; } }
td.col-ver { white-space: nowrap; }
@media (max-width: 720px) { td.col-ver { white-space: normal; } }

/* "Still happening" votes on fixed bugs */
.badge.still { color: var(--s-unconfirmed); background: var(--s-unconfirmed-bg); margin-top: 4px; }
.still-panel { border-color: var(--s-unconfirmed); }
button.count.warn { border-color: var(--s-unconfirmed); }
button.count.warn b { color: var(--s-unconfirmed); }
.discord-panel { border-color: #5865f2; }
.shots figure { margin: 0; }
.shots figcaption { font-size: 12px; margin-top: 2px; }
.discord-panel { border-color: #5865f2; }
.shots figure { margin: 0; }
.shots figcaption { font-size: 12px; margin-top: 2px; }
.videos { display: grid; gap: 8px; }
.videos iframe { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 8px; background: #000; }
.badge.held { color: #7a3e00; background: #ffe9cc; }
.btn.danger { border-color: #c0392b; color: #c0392b; }
img.avatar { width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; } .brand img.logo { width: 28px; height: 28px; }
