:root {
    --bg: #f6f6f3; --panel: #ffffff; --ink: #1d1f1c; --muted: #6b6f68; --line: #dcdcd5;
    --accent: #1f6f4a; --accent-ink: #ffffff; --warn: #a15c00; --bad: #b3261e; --row: #f0f0eb;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #151714; --panel: #1d201c; --ink: #e8e9e4; --muted: #9a9e96; --line: #333630;
            --accent: #4fae7f; --accent-ink: #0d1a13; --warn: #e0a24a; --bad: #f0857d; --row: #252923; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
header h1 { font-size: 18px; margin: 0; font-weight: 700; }
header .patch { color: var(--muted); font-size: 13px; margin-left: auto; }
nav { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
nav button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; }
nav button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
h2 { font-size: 20px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bar input[type=search] { min-width: 240px; }
button.btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 4px; padding: 6px 12px; cursor: pointer; }
button.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.btn:hover { filter: brightness(.96); }
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--panel); }
tbody tr:hover { background: var(--row); }
tbody tr.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td img { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; }
.tag.sim { color: var(--accent); border-color: var(--accent); }
.tag.est { color: var(--warn); border-color: var(--warn); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.drop { border: 2px dashed var(--line); border-radius: 6px; padding: 48px 24px; text-align: center; background: var(--panel); }
.drop.over { border-color: var(--accent); }
.drop p { margin: 0 0 14px; color: var(--muted); }
.drop .btn + .btn { margin-left: 8px; }
dialog { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); padding: 0; width: min(720px, 94vw); max-height: 90vh; }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { padding: 20px; }
dialog h3 { margin: 0 0 14px; font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.grid label.wide { grid-column: 1 / -1; }
.grid input, .grid select { width: 100%; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.actions .left { margin-right: auto; }
.stats { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.stats div { font-size: 13px; color: var(--muted); }
.stats b { display: block; font-size: 22px; color: var(--ink); }
ul.issues { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
ul.issues li { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
ul.issues li:last-child { border: 0; }
.err { color: var(--bad); font-weight: 600; } .warn { color: var(--warn); font-weight: 600; } .ok { color: var(--accent); font-weight: 600; }
.wiki { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.wiki aside { position: sticky; top: 16px; align-self: start; font-size: 14px; }
.wiki aside a { display: block; padding: 3px 0; text-decoration: none; color: var(--muted); }
.wiki aside a:hover { color: var(--ink); }
.wiki article { max-width: 700px; }
.wiki h3 { margin: 28px 0 6px; font-size: 18px; }
.wiki h3:first-child { margin-top: 0; }
.wiki code { background: var(--row); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.wiki table { margin: 8px 0 12px; background: var(--panel); border: 1px solid var(--line); }
.wiki td, .wiki th { white-space: normal; text-transform: none; font-size: 14px; letter-spacing: 0; cursor: default; position: static; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }
@media (max-width: 720px) { main { padding: 16px; } .wiki { grid-template-columns: 1fr; } .wiki aside { position: static; } header, nav { padding-left: 16px; padding-right: 16px; } }
.heat { display: inline-block; min-width: 38px; text-align: center; padding: 0 8px; border-radius: 3px; background: hsl(var(--h) 55% 42% / .3); }
