:root { --bg: #f2f6fb; --card: #fff; --ink: #1d2a3a; --muted: #6b7a8c; --line: #e3e9f1; --blue: #0a8fd8; --ok: #16a34a; --bad: #dc2626; --warn: #d97706; --accent: #ff7a45; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0f1722; --card: #182231; --ink: #e6edf5; --muted: #93a3b6; --line: #263244; } }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(120deg, #0a8fd8, #19c3c8); color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 18px; flex: 1; }
.brand span { font-weight: 500; opacity: .85; font-size: 14px; margin-left: 6px; }
.bar select { font-size: 15px; padding: 6px 10px; border-radius: 10px; border: 0; }
.link { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px rgba(0, 30, 60, .06); border: 1px solid var(--line); }
.card.wide { grid-column: 1 / -1; }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.row label { flex: 1; min-width: 180px; }
.row .muted, .muted { color: var(--muted); font-size: 13px; }
input[type=number], input[type=text], input[type=password] { font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 110px; }
input[type=text], input[type=password] { width: 100%; }
.btn { border: 0; border-radius: 10px; padding: 9px 14px; font-size: 15px; font-weight: 700; cursor: pointer; background: var(--blue); color: #fff; }
.btn.sec { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: var(--accent); }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.status { display: flex; gap: 12px; align-items: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #9aa7b5; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin-top: 8px; }
.kv b { font-weight: 600; }
.warnbox { background: rgba(217, 119, 6, .1); color: var(--warn); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.lvl { display: flex; gap: 4px; }
.lvl button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 700; cursor: pointer; }
.lvl button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: #c6d0dc; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(18px); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; margin-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; min-width: 0; }
.bars .ok { background: var(--ok); border-radius: 3px 3px 0 0; }
.bars .bad { background: var(--bad); }
.bars .lab { font-size: 10px; color: var(--muted); text-align: center; margin-top: 3px; white-space: nowrap; overflow: hidden; }
.bars .col:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 12px; padding: 4px 6px; border-radius: 6px; white-space: pre; z-index: 3; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.acc { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; min-width: 80px; }
.acc i { display: block; height: 100%; }
.code { font-size: 44px; font-weight: 800; letter-spacing: 6px; text-align: center; margin: 10px 0; font-family: ui-monospace, Consolas, monospace; }
.login { max-width: 360px; margin: 60px auto; grid-column: 1 / -1; }
.err { color: var(--bad); font-size: 14px; margin-top: 6px; }
.samples li { margin: 6px 0; }
.samples .pic { max-width: 220px; display: block; }
.pic .cell-on { fill: #ffd2e0; stroke: #ff5e8a; } .pic .cell-off { fill: #f6f8fb; stroke: #d6dde6; } .pic .shape { fill: #fff3c4; stroke: #f5a700; stroke-width: 3; } .pic .lbl { font: 700 14px system-ui; fill: #6b4e00; }
.modal { position: fixed; inset: 0; background: rgba(0, 20, 40, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal .card { max-width: 560px; width: 100%; max-height: 85vh; overflow: auto; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .3s; pointer-events: none; z-index: 30; }
#toast.show { opacity: 1; }
@media (max-width: 500px) { main { padding: 10px; grid-template-columns: 1fr; } .brand span { display: none; } }
