:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a3040;
  --txt: #e8ecf3;
  --muted: #9aa5b8;
  --accent: #4c8dff;
  --accent-2: #2f6fe0;
  --ok: #38c172;
  --warn: #ffb020;
  --err: #ff5c5c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }

header.top { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
header.top h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.4px; }
header.top p { margin: 0; color: var(--muted); max-width: 900px; }
.badges { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: #245c3c; background: #12241a; }
.badge.err { color: var(--err); border-color: #5c2424; background: #241212; }
.badge.warn { color: var(--warn); border-color: #5c4a1c; background: #241f12; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

.search {
  width: 100%; padding: 11px 13px; margin-bottom: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--txt); font-size: 15px;
}
.search:focus { outline: none; border-color: var(--accent); }

section.group { margin-bottom: 30px; }
section.group > h2 { margin: 0 0 6px; font-size: 20px; }
section.group > .lead { color: var(--txt); margin: 0 0 4px; }
section.group > .details { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.count { color: var(--muted); font-size: 13px; margin-left: 8px; font-weight: 400; }

.board {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 8px; overflow: hidden;
}
.board > summary {
  cursor: pointer; padding: 11px 14px; display: flex; align-items: center; gap: 10px;
  list-style: none; font-weight: 600;
}
.board > summary::-webkit-details-marker { display: none; }
.board > summary::before { content: "▸"; color: var(--muted); font-size: 12px; }
.board[open] > summary::before { content: "▾"; }
.board > summary:hover { background: var(--panel-2); }
.board .roles { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: auto; }

.files { border-top: 1px solid var(--line); }
.file {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid #20242e;
}
.file:last-child { border-bottom: none; }
.file .name { font-family: ui-monospace, Consolas, monospace; font-size: 13px; flex: 1; min-width: 0; }
.file .name .role { display: block; font-family: inherit; color: var(--txt); font-size: 13.5px; }
.file .name .fname { color: var(--muted); word-break: break-all; }
.file .size { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.tag { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.merged { color: #7fd1a4; border-color: #245c3c; }
.tag.app { color: #9db8ff; border-color: #2b3f6b; }
.tag.uf2 { color: #e0b978; border-color: #5c4a1c; }
.tag.zip { color: #c9a0ff; border-color: #432c6b; }

button {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--txt); padding: 7px 13px; transition: .15s;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.danger { color: #ffd9d9; border-color: #5c2424; background: #241212; }
button.danger:hover:not(:disabled) { border-color: var(--err); }
button.small { padding: 5px 10px; font-size: 13px; }
.selected { outline: 2px solid var(--accent); outline-offset: -2px; }

aside.panel {
  position: sticky; top: 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
aside.panel h3 { margin: 0 0 12px; font-size: 16px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed #232838; }
.kv:last-of-type { border-bottom: none; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; word-break: break-all; }

.row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row button { flex: 1; }

label.check { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
label.check input { margin-top: 3px; }
label.check b { color: var(--warn); font-weight: 600; }

.progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .12s; }
.progress-label { font-size: 12.5px; color: var(--muted); min-height: 18px; }

.log {
  margin-top: 12px; height: 168px; overflow: auto; background: #0b0d11; border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; font: 12px/1.45 ui-monospace, Consolas, monospace; color: #b9c4d6;
  white-space: pre-wrap; word-break: break-word;
}
.log .ok { color: var(--ok); }
.log .err { color: var(--err); }
.log .warn { color: var(--warn); }

aside.panel select {
  width: 100%; margin-top: 4px; padding: 7px 9px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; color: var(--txt);
}

.notes { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 20px; }
.notes h2 { font-size: 19px; margin: 0 0 12px; }
.notes .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.notes .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.notes .card h4 { margin: 0 0 6px; font-size: 14.5px; }
.notes .card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.notes .card code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
footer { margin-top: 28px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; }
