/* The Rusting Dead — plugin panel v1. Plain CSS, no framework.
   Refresh 2026-11-07: logo-orange accent #f2762e (matches the wiki theme),
   roomier type and spacing, hero/section images from the base. */
:root {
  --bg: #14171c; --bg2: #1b1f26; --bg3: #232833;
  --text: #e6e9ee; --muted: #9aa3b0; --line: #2e3542;
  --accent: #f2762e; --accent-hover: #ff8a3d; --accent2: #7fb069;
  --red: #e5534b; --amber: #d29922; --blue: #58a6ff; --green: #3fb950; --grey: #8b949e;
  --sidebar-w: 232px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.35);
}
body.light {
  --bg: #f4f5f7; --bg2: #ffffff; --bg3: #e8ebef;
  --text: #1c2330; --muted: #5b6572; --line: #d5dae1;
  --shadow: 0 1px 3px rgba(28,35,48,.12);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
::selection { background: rgba(242,118,46,.35); }
a { color: var(--blue); }
a:hover { color: var(--accent-hover); }
code { background: var(--bg3); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
aside { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg2);
  border-right: 1px solid var(--line); border-top: 3px solid var(--accent);
  padding: 16px 12px 18px; position: sticky; top: 0; height: 100vh; }
.brand-img { display: block; width: 100%; height: 104px; object-fit: cover;
  border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--line); }
aside h1 { font-size: 18px; margin: 0 0 2px; letter-spacing: -.01em; }
aside .sub { color: var(--muted); font-size: 12px; margin: 0 0 16px; line-height: 1.5; }
aside nav a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text);
  text-decoration: none; margin-bottom: 2px; transition: background .12s ease; }
aside nav a:hover { background: var(--bg3); }
aside nav a.active { background: var(--bg3); font-weight: 600; border-left: 3px solid var(--accent); }
aside nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 14px 10px 4px; }
aside .foot { margin-top: 20px; font-size: 12px; color: var(--muted); padding: 0 10px; line-height: 1.55; }

/* ---------- main / type ---------- */
main { flex: 1; padding: 24px 30px 40px; max-width: 1100px; }
h2 { margin-top: 0; margin-bottom: 10px; font-size: 24px; letter-spacing: -.01em; line-height: 1.25; }
h3 { margin: 26px 0 10px; font-size: 17px; letter-spacing: -.01em; }
h4 { margin: 0 0 4px; }
p.muted, .muted { color: var(--muted); }

/* ---------- hero + section images ---------- */
.hero { position: relative; margin: 0 0 20px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero img { display: block; width: 100%; height: 230px; object-fit: cover; }
.hero-cap { position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 18px 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); font-weight: 600; font-size: 15px; }
.hero-cap span { display: block; font-weight: 400; font-size: 13px; opacity: .85; margin-top: 2px; }
.view-banner { margin: 0 0 18px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.view-banner img { display: block; width: 100%; height: 130px; object-fit: cover; }

/* ---------- banners / notices ---------- */
.banner { border: 1px solid var(--red); background: rgba(229,83,75,.12);
  border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; }
.banner strong { color: var(--red); }
.notice { border: 1px solid var(--amber); background: rgba(210,153,34,.1);
  border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); transition: border-color .12s ease, transform .12s ease; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card .num { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card .lbl { color: var(--muted); font-size: 13px; }

/* ---------- controls / buttons ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: center; }
.controls input[type="search"], .controls select {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.controls input[type="search"] { flex: 1; min-width: 220px; }
button { background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 14px;
  transition: border-color .12s ease, background .12s ease; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { cursor: pointer; transition: background .1s ease; }
tbody tr:hover { background: var(--bg3); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-needs-update { background: rgba(229,83,75,.18); color: #ff9d97; }
.b-up-to-date { background: rgba(63,185,80,.18); color: #7ee2a0; }
.b-needs-check { background: rgba(210,153,34,.18); color: #e8b93e; }
.b-map-file { background: rgba(88,166,255,.18); color: #9cc8ff; }
.b-not-a-plugin { background: rgba(139,148,158,.2); color: #b7bec8; }
.b-staged { background: rgba(127,176,105,.2); color: #a8d18d; }
.b-not-tracked { background: rgba(139,148,158,.12); color: #9aa3b0; }
.b-downloaded { background: rgba(63,185,80,.15); color: #7ee2a0; }
.b-pending { background: rgba(210,153,34,.15); color: #e8b93e; }
.b-none { background: rgba(139,148,158,.15); color: #b7bec8; }
body.light .b-needs-update { color: #b3261e; } body.light .b-up-to-date { color: #1a7f37; }
body.light .b-needs-check { color: #9a6700; } body.light .b-map-file { color: #0969da; }
body.light .b-staged { color: #3a6b22; } body.light .b-downloaded { color: #1a7f37; }
body.light .b-pending { color: #9a6700; } body.light .b-not-tracked { color: #5b6572; }
.b-open { background: rgba(229,83,75,.18); color: #ff9d97; }
.b-investigating { background: rgba(210,153,34,.18); color: #e8b93e; }
.b-known { background: rgba(88,166,255,.18); color: #9cc8ff; }
.b-answered { background: rgba(139,148,158,.2); color: #b7bec8; }
.b-fixed { background: rgba(63,185,80,.18); color: #7ee2a0; }
.b-stale { background: rgba(139,148,158,.12); color: #8b949e; }
body.light .b-open { color: #b3261e; } body.light .b-investigating { color: #9a6700; }
body.light .b-known { color: #0969da; } body.light .b-fixed { color: #1a7f37; }
.src { font-size: 12px; color: var(--muted); }
.ver { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ver .arrow { color: var(--muted); }
.flag { color: var(--red); font-weight: 600; }

/* drawer */
#drawer-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; z-index: 50; }
#drawer-wrap.open { display: block; }
#drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 94vw);
  background: var(--bg); border-left: 1px solid var(--line); overflow-y: auto; padding: 22px 26px; }
#drawer .close { float: right; }
#drawer dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 14px 0; }
#drawer dt { color: var(--muted); font-size: 13px; }
#drawer dd { margin: 0; }
.changelog { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.changelog.clamped { max-height: 220px; overflow: hidden; position: relative; }

/* diagnostics */
.diag { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px;
  background: var(--bg2); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.diag.blocker { border-left-color: var(--red); }
.diag.config { border-left-color: var(--amber); }
.diag.verify { border-left-color: var(--blue); }
.diag.info, .diag.stale, .diag.gap { border-left-color: var(--grey); }
.diag.manual { border-left-color: var(--accent2); }
.diag h4 { margin: 0 0 4px; font-size: 15px; }
.diag p { margin: 0; color: var(--muted); }
.diag .sev { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* update sets */
.set { border: 1px solid var(--line); border-radius: 8px; background: var(--bg2);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.set h4 { margin: 0 0 4px; }
.set .order { font-size: 12px; color: var(--muted); }
.set ul { list-style: none; padding: 0; margin: 10px 0 0; }
.set li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.set li input { transform: scale(1.2); }
.set li.done span { text-decoration: line-through; color: var(--muted); }

/* downloads */
.zip { border: 1px solid var(--line); border-radius: 8px; background: var(--bg2);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.zip h4 { margin: 0 0 4px; word-break: break-all; }
.zip .sha { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
table.plain tbody tr { cursor: default; }
table.plain tbody tr:hover { background: none; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* push progress + eugene */
details#push-progress { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0 18px; box-shadow: var(--shadow); }
details#push-progress summary { cursor: pointer; font-weight: 600; }
details#push-progress summary:hover { color: var(--accent-hover); }
details#push-progress table { margin-top: 12px; }
.b-done { background: rgba(63,185,80,.18); color: #7ee2a0; }
.b-issue { background: rgba(229,83,75,.18); color: #ff9d97; }
.b-updating { background: rgba(210,153,34,.18); color: #e8b93e; }
.b-pending { background: rgba(139,148,158,.2); color: #b7bec8; }
body.light .b-done { color: #1a7f37; } body.light .b-issue { color: #b3261e; }
body.light .b-updating { color: #9a6700; }
.composer { display: grid; gap: 12px; max-width: 640px; }
.composer label { font-size: 13px; color: var(--muted); }
.composer textarea, .composer select { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 14px; font-family: inherit; }
.composer button[disabled] { opacity: .55; cursor: not-allowed; }
.feed { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; background: var(--bg2); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.feed.done { border-left-color: var(--green); }
.feed.doing { border-left-color: var(--blue); }
.feed.blocked { border-left-color: var(--red); }
.feed.todo { border-left-color: var(--grey); }
.feed p { margin: 4px 0 0; color: var(--muted); }

/* metrics */
.spark { width: 100%; height: 56px; display: block; margin-top: 8px; }

/* plugin-health charts */
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 12px 0 18px; }
.chart-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.chart-box.wide { grid-column: 1 / -1; }
.chart-box h4 { margin: 0 0 8px; }
.chart-box p:last-child { margin-bottom: 0; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-total { font-size: 30px; font-weight: 700; fill: var(--text); }
.donut-sub { font-size: 12px; fill: var(--muted); }
.donut-legend { list-style: none; padding: 0; margin: 0; }
.donut-legend li { padding: 3px 0; font-size: 14px; }
.donut-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; }
.sankey { display: block; margin-top: 8px; }
.sankey-label { font-size: 12px; fill: var(--text); }
.flow-table { font-size: 13px; margin-top: 10px; }
.flow-table td { padding: 4px 10px 4px 0; }
.health-strip { display: flex; gap: 16px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.health-strip-text { font-size: 14px; }
.hbar { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 90px; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hbar .track { display: block; background: var(--bg3); border-radius: 4px; height: 12px; overflow: hidden; }
.hbar .fill { display: block; background: var(--accent); height: 100%; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 760px) {
  #app { flex-direction: column; }
  aside { width: auto; height: auto; position: static; border-top-width: 3px; }
  .brand-img { height: 140px; }
  main { padding: 16px; }
  .hero img { height: 170px; }
  .view-banner img { height: 100px; }
  #drawer dl, .kv { grid-template-columns: 1fr; }
}
