:root {
  --bg: #0f1418; --panel: #171e25; --panel2: #1e2730; --border: #2a3541; --text: #e6edf3;
  --muted: #8b9aab; --accent: #3b82f6; --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.screen { min-height: 100vh; }
#login { display: flex; align-items: center; justify-content: center; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.login-card { width: 360px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
label { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 12px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: 13px; }
input, select { width: 100%; padding: 8px 10px; margin-top: 4px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font: inherit; }
label.inline input { width: auto; margin: 0; }
.row input, .row select { width: auto; margin-top: 0; }
.row input.grow { flex: 1; }
button { padding: 8px 14px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font: inherit; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.danger { background: #7f1d1d; border-color: #991b1b; }
button.link { background: none; border: none; color: var(--accent); padding: 0 6px; }
button.small { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); margin-top: 8px; min-height: 1em; }
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 16px; }
.brand span { color: var(--accent); }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; padding: 14px 18px; }
aside h3, main h3 { margin: 0 0 8px; font-size: 14px; }
h2 { margin: 0; font-size: 17px; }
.ecu-list, .did-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.ecu-list li, .did-list li { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.ecu-list li:hover, .did-list li:hover { background: var(--panel2); }
.ecu-list li.active, .did-list li.active { background: #1d3557; }
.ecu-list .addr, .did-list .addr { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--panel2); color: var(--muted); }
.badge.bad { background: #7f1d1d; color: #fecaca; }
.badge.ok { background: #14532d; color: #bbf7d0; }
.badge.warn { background: #78350f; color: #fde68a; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.mono, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.result:empty::before { content: "—"; color: var(--muted); }
code.block { display: block; padding: 8px; background: var(--panel2); border-radius: 6px; word-break: break-all; margin: 6px 0; }
.console { background: #0b0f13; border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 200px; max-height: 60vh; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2937; border: 1px solid var(--border); padding: 10px 16px; border-radius: 8px; z-index: 10; }
.toast.bad { border-color: var(--bad); }
.nrc { color: var(--warn); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .split { grid-template-columns: 1fr; } }
