:root {
  --bg: #17181c; --panel: #22242b; --panel2: #1c1e24; --text: #e8e6df;
  --muted: #9a988f; --accent: #e8b34b; --ok: #57a95c; --bad: #d05555;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, sans-serif; }
header { position: sticky; top: 0; z-index: 10; background: var(--panel);
  padding: 12px 18px; border-bottom: 2px solid #000; }
h1 { margin: 0 0 4px; font-size: 19px; }
.sub { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.sub a { color: var(--accent); }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
#progress { font-weight: 600; color: var(--accent); }
#search, #group-filter {
  background: var(--panel2); color: var(--text); border: 1px solid #3a3d47;
  border-radius: 6px; padding: 5px 10px; font-size: 13px; width: 240px;
}
#group-filter { width: auto; }
button { background: #33363f; color: var(--text); border: 1px solid #4a4d58;
  border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
button:hover { background: #40434e; }
button.danger { border-color: var(--bad); color: var(--bad); }
button.flt.active { background: var(--accent); color: #20180a; border-color: var(--accent); }

main { padding: 14px 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid #33363f; border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.card.ok { border-color: var(--ok); }
.card.problem { border-color: var(--bad); }
.card h3 { margin: 0; font-size: 12px; font-weight: 600; word-break: break-word; }
.stage { background: repeating-conic-gradient(#2a2c33 0% 25%, #1f2127 0% 50%) 0 0 / 16px 16px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  min-height: 120px; cursor: zoom-in; }
.stage canvas { image-rendering: pixelated; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: #33363f; color: var(--muted); }
.chip.used { background: #24452a; color: #7fd18a; }
.chip.warn { background: #4d3d17; color: #f0c85a; }
.note { margin: 0; font-size: 11px; color: var(--muted); }
.row { display: flex; gap: 6px; }
.row button { flex: 1; font-size: 12px; padding: 4px 6px; }
.row button.ok-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.row button.bad-btn.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.card textarea { width: 100%; min-height: 34px; background: var(--panel2); color: var(--text);
  border: 1px solid #3a3d47; border-radius: 6px; padding: 5px 7px;
  font: 12px/1.4 system-ui, sans-serif; resize: vertical; }
.card textarea::placeholder { color: #6a6c75; }

#lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,14,.92);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox[hidden] { display: none; }
#lightbox img { image-rendering: pixelated; max-width: 96vw; max-height: 96vh;
  background: repeating-conic-gradient(#2a2c33 0% 25%, #1f2127 0% 50%) 0 0 / 16px 16px; }
.empty { color: var(--muted); padding: 40px; text-align: center; }
