:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #16181d; --muted: #667085; --border: #e3e6eb;
  --accent: #2f6fed; --accent-text: #fff;
  --ready: #12a150; --ready-bg: #e6f6ed; --paused: #c27803; --paused-bg: #fdf3e1;
  --off: #667085; --off-bg: #eef0f3; --danger: #d92d20; --danger-bg: #fdecea;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --panel: #171a21; --text: #e7e9ee; --muted: #98a2b3; --border: #2a2f3a;
    --accent: #5b8cff; --ready: #3ccf7f; --ready-bg: #12301f; --paused: #f5b14c; --paused-bg: #33270f;
    --off: #98a2b3; --off-bg: #232833; --danger: #ff6b5e; --danger-bg: #3a1714;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 18px; } h2 { font-size: 15px; } h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 8px 14px; cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.ready { background: var(--ready); border-color: var(--ready); color: #fff; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: 13px; }
input, select, textarea { border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { font-family: var(--mono); font-size: 12px; min-height: 160px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); display: inline-block; }
.dot.on { background: var(--ready); } .dot.warn { background: var(--paused); } .dot.err { background: var(--danger); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: var(--off-bg); color: var(--off); white-space: nowrap; }
.pill.ready { background: var(--ready-bg); color: var(--ready); }
.pill.paused { background: var(--paused-bg); color: var(--paused); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 10; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
