/* virtdev.chromoshub.ru — virtual ModbusTCP devices + assay tools */
:root {
    --bg: #0d1117; --bg-2: #161b22; --bg-3: #1c2430; --card: #10151d;
    --line: #26303c; --line-2: #313d4d;
    --txt: #e6edf3; --txt-2: #9aa7b4; --txt-3: #6b7684;
    --accent: #3fb950; --accent-2: #2ea043;
    --ok: #3fb950; --bad: #f85149;
    --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "DejaVu Sans Mono", "Consolas", monospace;
    --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] {
    --bg: #f4f6fa; --bg-2: #ffffff; --bg-3: #eef1f6; --card: #ffffff;
    --line: #dde3ec; --line-2: #c8d1de;
    --txt: #16202f; --txt-2: #52617a; --txt-3: #808d9b;
    --accent: #1a7f37; --accent-2: #116329;
    --ok: #1a7f37; --bad: #cf222e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--ui); background: var(--bg); color: var(--txt); min-height: 100vh; }
a { color: var(--accent); }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.brand__mark { font-size: 18px; }
.actions { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang__btn { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 0 9px; border: 0; background: var(--bg-3); color: var(--txt-2); cursor: pointer; }
.lang__btn + .lang__btn { border-left: 1px solid var(--line-2); }
.lang__btn:hover { color: var(--accent); }
.lang__btn.is-active { background: var(--accent-2); color: #fff; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-3); color: var(--txt-2); cursor: pointer; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-moon { display: block; }

.wrap { max-width: 980px; margin: 0 auto; padding: 22px 18px 40px; display: flex; flex-direction: column; gap: 20px; }

.hero h1 { font-size: 24px; margin-bottom: 8px; }
.lead { color: var(--txt-2); max-width: 70ch; line-height: 1.55; }
.devices { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.device { flex: 1 1 220px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 14px 16px; }
.device__title { font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.device dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.device dt { color: var(--txt-3); }
.device dd { text-align: right; }

.cmd { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--txt); overflow-x: auto; line-height: 1.5; }
.cmd__c { color: var(--txt-3); }

.card { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 18px 18px 20px; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.hint { color: var(--txt-3); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--txt-2); font-weight: 600; }
.tbl td.num, .tbl th.num { text-align: right; }
.mono { font-family: var(--mono); }
.tbl tbody tr:hover { background: var(--bg-3); }

.cmp input { width: 96px; font-family: var(--mono); font-size: 12.5px; text-align: right; padding: 5px 7px; background: var(--bg-2); color: var(--txt); border: 1px solid var(--line-2); border-radius: 7px; outline: none; }
.cmp input:focus { border-color: var(--accent); }
.cmp td.res { font-weight: 600; }
.cmp tr.pass td.res { color: var(--ok); }
.cmp tr.fail td.res { color: var(--bad); }
.cmp tr.pass { background: color-mix(in srgb, var(--ok) 8%, transparent); }
.cmp tr.fail { background: color-mix(in srgb, var(--bad) 8%, transparent); }

.btn-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn { font-family: var(--ui); font-size: 13px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-3); color: var(--txt-2); cursor: pointer; }
.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn--primary { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.btn--primary:hover { color: #fff; filter: brightness(1.08); }
.cmp__summary { font-size: 13px; color: var(--txt-2); }

details summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--txt); user-select: none; }
details[open] summary { margin-bottom: 12px; }

.foot { max-width: 980px; margin: 0 auto; padding: 18px; display: flex; justify-content: space-between; gap: 12px; color: var(--txt-3); font-size: 12.5px; border-top: 1px solid var(--line); flex-wrap: wrap; }

@media (max-width: 620px) {
    .device dd { text-align: left; }
    .cmp input { width: 78px; }
}
