:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color:#171717; background:#f5f6f8; }
* { box-sizing:border-box; }
body { margin:0; }
header { display:flex; justify-content:space-between; align-items:center; padding:18px 26px; background:#fff; border-bottom:1px solid #e5e7eb; position:sticky; top:0; z-index:5; }
.brand { font-weight:800; font-size:20px; }
.muted { color:#6b7280; font-size:13px; }
.header-actions { display:flex; align-items:center; gap:12px; }
nav { display:flex; gap:6px; padding:10px 26px; background:#fff; border-bottom:1px solid #e5e7eb; overflow:auto; }
nav button { border:0; background:transparent; padding:10px 14px; border-radius:9px; cursor:pointer; white-space:nowrap; }
nav button.active { background:#111827; color:white; }
main { max-width:1500px; margin:0 auto; padding:24px; }
.tab { display:none; }
.tab.active { display:block; }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:18px; margin-bottom:18px; box-shadow:0 1px 2px rgba(0,0,0,.03); }
.grid { display:grid; gap:18px; }
.grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
h1,h2 { margin-top:0; }
h2 { font-size:17px; }
button { font:inherit; cursor:pointer; border-radius:9px; padding:9px 13px; border:1px solid #d1d5db; background:#fff; }
button.primary { background:#111827; color:#fff; border-color:#111827; }
button.ghost { background:#fff; }
button.danger { background:#9f1239; color:#fff; border-color:#9f1239; }
button:disabled { opacity:.45; cursor:not-allowed; }
input, textarea { width:100%; border:1px solid #d1d5db; border-radius:9px; padding:9px 10px; font:inherit; background:#fff; }
textarea, pre, code { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
label { display:block; font-size:13px; font-weight:650; margin:10px 0; }
label input, label textarea { margin-top:6px; font-weight:400; }
.form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.work-grid { grid-template-columns:2fr 1fr; }
.toolbar { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.toolbar.wrap { flex-wrap:wrap; }
.toolbar h2 { margin:0; margin-right:auto; }
.grow { flex:1 1 280px; }
.table-wrap { overflow:auto; }
table { border-collapse:collapse; width:100%; min-width:760px; }
th,td { text-align:left; padding:10px 8px; border-bottom:1px solid #eee; vertical-align:top; font-size:13px; }
th { color:#4b5563; font-size:12px; text-transform:uppercase; letter-spacing:.02em; }
tr:hover td { background:#fafafa; }
pre { background:#0b1020; color:#d1fae5; padding:14px; border-radius:10px; overflow:auto; max-height:620px; min-height:50px; white-space:pre-wrap; word-break:break-word; }
.badge { border-radius:999px; padding:6px 10px; font-size:12px; font-weight:800; background:#e5e7eb; }
.badge.safe { background:#dcfce7; color:#166534; }
.badge.warn { background:#fee2e2; color:#991b1b; }
.notice { padding:12px 14px; border-radius:10px; margin-bottom:16px; background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; }
.center-card { max-width:420px; margin:10vh auto; background:white; border:1px solid #e5e7eb; border-radius:16px; padding:28px; box-shadow:0 10px 35px rgba(0,0,0,.08); }
.center-card button { width:100%; margin-top:10px; }
.error { color:#b91c1c; margin-top:10px; min-height:20px; }
.hidden { display:none !important; }
.toast { position:fixed; right:20px; bottom:20px; max-width:520px; background:#111827; color:#fff; padding:12px 16px; border-radius:10px; box-shadow:0 8px 30px rgba(0,0,0,.2); z-index:20; }
.kv { display:grid; grid-template-columns:minmax(130px,1fr) 2fr; gap:8px 16px; font-size:13px; }
.kv > div:nth-child(odd) { color:#6b7280; }
.apply-box { border-top:1px solid #eee; margin-top:14px; padding-top:10px; }
.segmented { display:flex; flex-wrap:wrap; border:1px solid #d1d5db; border-radius:10px; overflow:hidden; }
.segmented button { border:0; border-radius:0; border-right:1px solid #e5e7eb; }
.segmented button:last-child { border-right:0; }
.segmented button.active { background:#111827; color:#fff; }
.state-pill { display:inline-block; padding:3px 8px; border-radius:999px; font-size:11px; font-weight:750; background:#f3f4f6; }
.state-pill.on { background:#dcfce7; color:#166534; }
.state-pill.archived { background:#e5e7eb; color:#4b5563; }
.state-pill.paused { background:#fef3c7; color:#92400e; }
.row-actions { display:flex; gap:6px; white-space:nowrap; }
.row-actions button { padding:6px 9px; font-size:12px; }
.summary-cards { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:10px; margin-bottom:16px; }
.metric { border:1px solid #e5e7eb; border-radius:12px; padding:12px; background:#fafafa; }
.metric .value { font-size:20px; font-weight:800; margin-top:4px; }
.findings { display:grid; gap:8px; margin:12px 0 18px; }
.finding { border:1px solid #e5e7eb; border-left-width:4px; border-radius:10px; padding:10px 12px; background:#fff; }
.finding.warning { border-left-color:#d97706; }
.finding.info { border-left-color:#2563eb; }
.finding.ok { border-left-color:#16a34a; }
.finding-title { font-weight:750; font-size:13px; }
.finding-detail { color:#6b7280; font-size:12px; margin-top:3px; }
.stats-strip { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:10px; margin:12px 0 18px; }
details { margin-top:12px; }
details summary { cursor:pointer; font-weight:700; margin-bottom:8px; }
.link-box { padding:10px 12px; border:1px dashed #d1d5db; border-radius:10px; margin-bottom:10px; overflow-wrap:anywhere; }
@media (max-width:900px) {
  .grid.two,.form-grid,.work-grid { grid-template-columns:1fr; }
  .summary-cards,.stats-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  main { padding:14px; }
  header { padding:14px; }
  nav { padding:8px 14px; }
}
.update-kv { margin:14px 0; }
.update-status-line { margin-top:10px; min-height:20px; }
.progress-shell { width:100%; height:16px; border-radius:999px; background:#e5e7eb; overflow:hidden; margin:10px 0; }
.progress-bar { height:100%; background:#111827; transition:width .25s ease; }
.update-progress-meta { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.update-progress-meta strong { min-width:44px; }
.update-log { min-height:180px; max-height:420px; }
.update-error-block { margin-top:16px; padding:14px; border:1px solid #fecaca; background:#fef2f2; border-radius:12px; }
.update-error-block h3 { margin-top:0; color:#991b1b; }
.update-error-block pre { background:#3f0d12; color:#fee2e2; max-height:420px; }
#updateProgressCard h3 { font-size:14px; margin:16px 0 8px; }
