:root {
  --bg: #0f1216;
  --panel: #121821;
  --panel2: #0e141c;
  --fg: #e8eef6;
  --muted: #9aa7b5;
  --line: rgba(255,255,255,.10);
  --accent: #00aaff;
  --radius: 12px;
  --footerH: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: ui-sans-serif, system-ui; background: var(--bg); color: var(--fg); height: 100vh; overflow: hidden; }

.app { height: calc(100% - var(--footerH)); display: flex; position: relative; }

.sidebar {
  width: 174px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 10px; gap: 10px;
}

/* Компактная правая панель */
.sidebar__section--minimap.stage-overlay {
  position: fixed; right: 0; top: 24px; /* Сдвиг вниз от линейки */
  width: 170px; background: #0f1a26;
  border: 1px solid var(--line); border-radius: 12px 0 0 12px;
  padding: 10px; z-index: 200; box-shadow: -4px 0 20px rgba(0,0,0,.35);
}

.sidebar__spacer { flex: 1; }
.sidebar__section { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }

/* Ползунки */
.drop { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 8px; }
.drop__summary { list-style: none; display: flex; justify-content: space-between; padding: 6px 10px; cursor: pointer; font-size: 11px; }
.drop input[type="range"] { width: calc(100% - 20px); margin: 0 10px 8px; }

.stage { flex: 1; display: flex; overflow: hidden; background: #222; }
.viewport { position: relative; flex: 1; }
#canvas { width: 100%; height: 100%; display: block; }

/* Узкий футер */
.footer {
  height: var(--footerH); background: var(--panel2); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end; padding: 0 14px;
  font-size: 10px; color: var(--muted);
}

.btn { background: var(--line); border: 1px solid var(--line); color: var(--fg); border-radius: 8px; cursor: pointer; }
.btn--icon { width: 34px; height: 34px; display: grid; place-items: center; }
.btn--tool { width: 44px; height: 44px; display: grid; place-items: center; }
.btn--active { border-color: var(--accent); background: rgba(0, 170, 255, 0.2); }
.toolrow, .zoomrow { display: flex; gap: 8px; justify-content: center; }
.btncol, .btnrow { display: flex; gap: 6px; }
.minimap { background: #fff; border-radius: 4px; display: block; width: 100%; }
.minimap__title { font-size: 11px; color: var(--muted); margin-bottom: 4px; }