:root {
  --bg: #0f1218;
  --panel: #161a22;
  --panel2: #1d222c;
  --line: #262c38;
  --text: #d5d9e0;
  --dim: #7d8594;
  --accent: #33c3a0;
  --up: #26a69a;
  --down: #ef5350;
  --hover: #232935;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.3 var(--font); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* вход */
.login { position: fixed; inset: 0; display: grid; place-items: center; }
.login-box { width: 280px; display: flex; flex-direction: column; gap: 10px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.login-box input { font: inherit; padding: 9px 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; outline: none; }
.login-box input:focus { border-color: var(--accent); }
.login-box button { padding: 9px; background: var(--accent); color: #06140f; font-weight: 600; border-radius: 6px; }
.login-err { color: var(--down); min-height: 1.3em; font-size: 12px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .5px; color: var(--accent); }
.brand svg { stroke-width: 2.2; width: 20px; height: 20px; }
.brand.big { font-size: 20px; justify-content: center; margin-bottom: 8px; }

/* раскладка */
.app { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: 42px 1fr; height: 100vh; }
.top { grid-column: 1 / 3; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tools { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; background: var(--panel); border-right: 1px solid var(--line); }
.stage { position: relative; overflow: hidden; }
.chart { position: absolute; inset: 0; }

.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.grow { flex: 1; }
.brand + .sym-btn { margin-left: 8px; }

.sym-btn { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; font-weight: 600; font-size: 14px; }
.sym-btn svg { width: 10px; height: 10px; stroke-width: 1.6; }
.sym-btn:hover, .tbtn:hover, .tfs button:hover, .tools button:hover { background: var(--hover); }

.tfs { display: flex; gap: 1px; }
.tfs button { padding: 5px 8px; border-radius: 5px; color: var(--dim); }
.tfs button.on { color: var(--accent); background: rgba(51, 195, 160, .1); }
.tbtn { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; }
.tbtn.user { color: var(--dim); }
.status { color: var(--dim); font-size: 12px; margin-right: 8px; }
.status.bad { color: var(--down); }

.tools button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: #aab1bd; }
.tools button.on { color: var(--accent); background: rgba(51, 195, 160, .12); }
.tools svg { width: 20px; height: 20px; }
.tools-sep { width: 24px; height: 1px; background: var(--line); margin: 6px 0; }

/* легенда */
.legend { position: absolute; left: 10px; top: 8px; z-index: 3; pointer-events: none; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.legend .row { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.legend .title { font-weight: 600; font-size: 13px; color: var(--text); }
.legend .k { color: var(--dim); }
.ind { pointer-events: auto; display: flex; gap: 6px; align-items: center; padding: 1px 4px; margin-left: -4px; border-radius: 4px; }
.ind:hover { background: rgba(29, 34, 44, .9); }
.ind .acts { display: none; gap: 2px; }
.ind:hover .acts { display: flex; }
.ind .acts button { color: var(--dim); padding: 0 3px; font-size: 13px; }
.ind .acts button:hover { color: var(--text); }
.pane-legend { position: absolute; left: 10px; z-index: 3; font-size: 12px; pointer-events: none; }
.pane-legend .ind { pointer-events: auto; }
.up { color: var(--up); }
.down { color: var(--down); }

.hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 4; padding: 5px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--dim); font-size: 12px; pointer-events: none; }

/* всплывающие */
.pop { position: fixed; z-index: 20; min-width: 150px; padding: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.pop button { display: flex; width: 100%; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 5px; text-align: left; }
.pop button:hover { background: var(--hover); }
.pop button.on { color: var(--accent); }
.pop .px { color: var(--dim); font-variant-numeric: tabular-nums; }

.dlg-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0, 0, 0, .45); }
.dlg { width: 380px; max-height: 80vh; display: flex; flex-direction: column; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 36px rgba(0, 0, 0, .5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.dlg-head .x { font-size: 20px; color: var(--dim); line-height: 1; }
.dlg-body { padding: 8px; overflow: auto; }
.dlg-body .item { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 10px; border-radius: 6px; text-align: left; }
.dlg-body .item:hover { background: var(--hover); }
.dlg-body .item .px { color: var(--dim); font-size: 12px; }
.form { display: grid; grid-template-columns: 1fr 120px; gap: 10px 12px; align-items: center; padding: 8px; }
.form input[type=number] { font: inherit; padding: 6px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 5px; width: 100%; }
.form input[type=color] { width: 100%; height: 30px; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; }
.form-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 8px; }
.form-acts button { padding: 7px 14px; border-radius: 6px; background: var(--hover); }
.form-acts button.main { background: var(--accent); color: #06140f; font-weight: 600; }
