:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1b2230; --muted: #667085; --line: #e3e6ec;
  --accent: #0069ff; --ok: #12805c; --warn: #b54708; --bad: #c0261d; --chip: #eef2f7;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151c; --panel: #1a2029; --text: #e7ebf2; --muted: #98a2b3; --line: #2b3441; --accent: #4d94ff;
          --ok: #4ac99b; --warn: #f0a04b; --bad: #ff7b72; --chip: #252d3a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, system-ui, sans-serif; }
header { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
h1 { font-size: 16px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
nav button { background: none; border: 0; padding: 8px 12px; color: var(--muted); cursor: pointer; border-radius: 6px; font: inherit; }
nav button.active { background: var(--chip); color: var(--text); font-weight: 600; }
#statusbar { margin-left: auto; color: var(--muted); font-size: 13px; }
main { padding: 16px 20px; max-width: 1500px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
button.btn, select, input[type=text], input[type=number], input[type=search], input[type=password] {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px;
}
button.btn { cursor: pointer; }
button.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.btn.danger { color: var(--bad); border-color: var(--bad); }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 9px; font-size: 12px; margin-right: 4px; }
.chip.ok { color: var(--ok); } .chip.bad { color: var(--bad); } .chip.warn { color: var(--warn); }
#banner > div { padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--chip); }
#banner .bad { color: var(--bad); }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; background: var(--panel); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; z-index: 1; }
td.mono, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-word; }
.scroll { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.list { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.list div { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.list div:hover { background: var(--chip); }
.list div.sel { background: var(--chip); border-left: 3px solid var(--accent); }
.bar { height: 10px; background: var(--chip); border-radius: 999px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .s { background: var(--ok); } .bar .f { background: var(--bad); } .bar .r { background: var(--accent); }
.diff { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.log { max-height: 220px; overflow: auto; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--chip); padding: 8px; border-radius: 6px; white-space: pre-wrap; }
.log .error { color: var(--bad); } .log .warn { color: var(--warn); }
label.inline { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
td:first-child.mono { white-space: nowrap; }
td.mono.plan, td .plan { white-space: nowrap; }

.gridtable { width: max-content; min-width: 100%; }
.gridtable th, .gridtable td { padding: 3px 6px; white-space: nowrap; }
.gridtable th.gh { text-align: center; font-size: 11px; line-height: 1.2; border-top: 3px solid var(--line); }
.gridtable td.gc { text-align: center; cursor: pointer; position: relative; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.gridtable td.gc:hover { outline: 1px solid var(--accent); }
.sticky0, .sticky1 { position: sticky; background: var(--panel); z-index: 2; }
.sticky0 { left: 0; width: 28px; min-width: 28px; }
.sticky1 { left: 28px; min-width: 240px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
thead .sticky0, thead .sticky1 { z-index: 3; }
.gflags { min-width: 140px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: 4px; vertical-align: middle; }
.fam-basic { border-top-color: #4d94ff !important; } .fam-general_purpose { border-top-color: #4ac99b !important; }
.fam-storage_optimized { border-top-color: #f0a04b !important; } .fam-legacy_dedicated { border-top-color: #98a2b3 !important; }
.fam-cpu_optimized { border-top-color: #c084fc !important; }

.ok-text { color: var(--ok); }

tr.na td { opacity: .55; }
tr.na td:first-child { opacity: 1; }

/* read-only (team) mode */
body.read .write-only { display: none; }
body.read .sticky0 { display: none; }
body.read .sticky1 { left: 0; }
