
.vm-wrap {
  display: flex; justify-content: center; width: 788px; max-width: 100%;
  margin: 0 auto; padding: 0; overflow: visible;
  transform-origin: top center;
}

.vm {
  position: relative; flex-shrink: 0;
  width: 788px; height: 418px; max-width: none;
  display: grid; grid-template-columns: 136px 1fr;
  border-radius: 6px; overflow: hidden;
  background: rgba(8, 8, 11, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px; line-height: 1.35; color: #ececf0;
}

.vm-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}


.vm-side {
  position: relative; z-index: 2; height: 100%;
  padding: 10px 6px 8px; overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.vm-logo {
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 12px; font-weight: 600; font-size: 12px; color: #fff;
}
.vm-logo-img { height: 16px; width: auto; object-fit: contain; }
.vm-cat {
  display: block; font-size: 9px; font-weight: 600; letter-spacing: 0.11em;
  color: #45454f; padding: 6px 10px 3px; text-transform: uppercase;
}
.vm-nav {
  display: flex; align-items: center; gap: 7px; width: calc(100% - 4px);
  padding: 6px 8px; margin: 1px 2px;
  border: 0; border-radius: 4px;
  background: none; color: #5e5e68; font: inherit; font-size: 11px;
  cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.vm-nav svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.5; }
.vm-nav:hover { color: #b8b8c0; background: rgba(255, 255, 255, 0.03); }
.vm-nav.active {
  color: #fff; background: rgba(139, 92, 246, 0.18);
}
.vm-nav.active svg { opacity: 1; color: #a855f7; stroke: #a855f7; }


.vm-main {
  position: relative; z-index: 2; height: 100%;
  padding: 5px 12px 8px; overflow-x: hidden; overflow-y: auto;
}
.vm-main::-webkit-scrollbar { width: 3px; }
.vm-main::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.35); border-radius: 3px; }
.vm-panel { display: none; }
.vm-panel.active { display: block; }


.vm-tabs {
  display: flex; gap: 2px; margin-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.vm-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px 6px; margin-bottom: -1px;
  border: 0; background: none; color: #52525c; font: inherit; font-size: 11px;
  cursor: pointer; border-radius: 4px 4px 0 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.vm-tab svg { width: 12px; height: 12px; opacity: 0.45; }
.vm-tab:hover { color: #9a9aa2; }
.vm-tab.active {
  color: #fff; background: rgba(139, 92, 246, 0.12);
  border-bottom-color: #8b5cf6;
}
.vm-tab.active svg { color: #a855f7; opacity: 1; }
.vm-sub { display: none; }
.vm-sub.active { display: block; }


.vm-cols-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 318px;
}
.vm-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; min-height: 318px; }
.vm-cols-4 { display: grid; grid-template-columns: 1.05fr 1.15fr 0.9fr 0.9fr; gap: 0; }
.vm-cols-gap { margin-top: 10px; }

.vm-cols-2 > .vm-box:first-child,
.vm-cols-config > .vm-box:first-child,
.vm-cols-3 > .vm-box:not(:last-child),
.vm-cols-4 > .vm-box:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.035);
  padding-right: 16px;
}
.vm-cols-2 > .vm-box:last-child,
.vm-cols-3 > .vm-box:last-child,
.vm-cols-4 > .vm-box:last-child {
  padding-left: 16px;
}
.vm-cols-config > .vm-stack {
  padding-left: 16px;
  border-right: 0;
}
.vm-stack {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.vm-stack .vm-box { padding-left: 0 !important; border-right: 0 !important; }

.vm-box {
  background: transparent; border: none; border-radius: 0;
  padding: 0 0 0 1px; min-width: 0;
}
.vm-col-alt[hidden] { display: none !important; }
.vm-col-standard[hidden] { display: none !important; }
.vm-box-single { max-width: 340px; padding-left: 1px !important; border-right: 0 !important; }
.vm-box-tall .vm-players { max-height: 298px; }
.vm-players-compact { max-height: 108px; margin-top: 2px; }

.vm-box-head {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 11px; margin-bottom: 6px;
  padding-bottom: 0; border-bottom: none; color: #f0f0f4;
}
.vm-box-head svg { width: 13px; height: 13px; color: #a855f7; flex-shrink: 0; }


.vm-check {
  display: flex; align-items: center; gap: 7px; padding: 2.5px 0;
  cursor: pointer; user-select: none; color: #c4c4cc; font-size: 11px;
  transition: color 0.12s;
}
.vm-check:hover { color: #fff; }
.vm-check:not(.on) { color: #585860; }
.vm-check.disabled { opacity: 0.28; cursor: not-allowed; pointer-events: none; }
.vm-check-box {
  width: 13px; height: 13px; border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.vm-check.on { color: #ddd; }
.vm-check.on .vm-check-box { background: #8b5cf6; border-color: #8b5cf6; }
.vm-check.on .vm-check-box::after {
  content: ""; width: 3px; height: 7px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-0.5px, -1px);
}
.vm-warn { color: #eab308; margin-left: 3px; font-size: 10px; }


.vm-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px; gap: 10px;
}
.vm-toggle-info strong { display: block; font-size: 11px; font-weight: 600; color: #eee; }
.vm-toggle-info span { font-size: 9.5px; color: #484850; margin-top: 1px; display: block; }
.vm-toggle {
  width: 34px; height: 17px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); position: relative;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.vm-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.vm-toggle.on { background: #8b5cf6; }
.vm-toggle.on::after { transform: translateX(17px); }


.vm-slider { padding: 3px 0 2px; }
.vm-slider-head {
  display: flex; align-items: center; margin-bottom: 3px;
  font-size: 11px; color: #686870;
}
.vm-slider-head span:first-child::after { content: " • "; color: #a855f7; }
.vm-slider-head .vm-val { color: #a855f7; font-weight: 600; margin-left: 1px; }
.vm-slider input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 2px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); cursor: pointer; outline: none;
}
.vm-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  margin-top: 0;
}


.vm-select {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  margin-top: 5px; padding: 0; background: none; border: none;
  font-size: 11px; cursor: pointer;
}
.vm-select > span:first-child { font-size: 10px; color: #484850; }
.vm-select > span:last-child {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px; background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 3px; color: #c8c8d0;
}
.vm-select svg { width: 10px; height: 10px; opacity: 0.55; color: #a855f7; flex-shrink: 0; }


.vm-color-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4.5px 0; font-size: 11px; color: #909098;
}
.vm-color-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
  background: transparent;
}
.vm-color-dot:hover { transform: scale(1.08); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3); }
.vm-color-dot.active { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.55); }


.vm-radio {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4.5px 0; cursor: pointer; color: #909098; font-size: 11px;
}
.vm-radio:hover { color: #fff; }
.vm-radio-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18); flex-shrink: 0;
}
.vm-radio.on .vm-radio-dot { border-color: #8b5cf6; background: #8b5cf6; box-shadow: inset 0 0 0 2.5px #0a0812; }


.vm-key-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 4px; font-size: 10.5px; color: #686870;
}
.vm-key-row .vm-key { margin-top: 0; }
.vm-key {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; min-width: 52px; justify-content: center;
  background: rgba(0, 0, 0, 0.48); border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 3px; font-size: 9.5px; color: #c084fc;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.vm-key:hover { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
.vm-key.open { border-color: #a855f7; background: rgba(139, 92, 246, 0.16); }
.vm-kb-icon { width: 14px; height: 10px; flex-shrink: 0; opacity: 0.85; }
.vm-key-val { font-weight: 600; letter-spacing: 0.04em; }


.vm-btn {
  display: block; width: 100%; padding: 7px 8px; margin-bottom: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 3px;
  background: rgba(255, 255, 255, 0.02); color: #787880; font: inherit; font-size: 10.5px;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.vm-btn:hover { background: rgba(139, 92, 246, 0.1); color: #ccc; border-color: rgba(139, 92, 246, 0.22); }
.vm-btn.danger:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); color: #fca5a5; }


.vm-players { max-height: 248px; overflow-y: auto; }
.vm-players::-webkit-scrollbar { width: 3px; }
.vm-players::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.4); border-radius: 3px; }
.vm-player {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 4px; border-radius: 2px; cursor: pointer;
  font-size: 10.5px; color: #ddd; transition: background 0.12s;
}
.vm-player:hover { background: rgba(255, 255, 255, 0.04); }
.vm-player.ctx-active { background: rgba(139, 92, 246, 0.12); }
.vm-box:has(.vm-players) { position: relative; }
.vm-player-tag { font-size: 9px; color: #424248; }
.vm-ctx {
  position: absolute; background: rgba(10, 8, 16, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 4px;
  padding: 2px 0; min-width: 132px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); z-index: 10; display: none;
}
.vm-ctx.show { display: block; }
.vm-ctx button {
  display: block; width: 100%; padding: 6px 12px; border: 0; background: none;
  color: #aaa; font: inherit; font-size: 10.5px; text-align: left; cursor: pointer;
}
.vm-ctx button:hover { background: rgba(139, 92, 246, 0.12); color: #fff; }


.vm-pop {
  position: fixed; z-index: 9999; display: none;
  background: rgba(10, 8, 14, 0.98); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}
.vm-pop.show { display: block; }
.vm-color-pop { width: 210px; padding: 10px; }
.vm-cp-sv {
  position: relative; width: 100%; height: 120px; border-radius: 3px;
  cursor: crosshair; overflow: hidden; margin-bottom: 8px; touch-action: none;
}
.vm-cp-sv-white, .vm-cp-sv-black { position: absolute; inset: 0; pointer-events: none; }
.vm-cp-sv-white { background: linear-gradient(to right, #fff, transparent); }
.vm-cp-sv-black { background: linear-gradient(to top, #000, transparent); }
.vm-cp-cursor {
  position: absolute; width: 11px; height: 11px;
  border: 2px solid #fff; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
}
.vm-cp-hue {
  -webkit-appearance: none; width: 100%; height: 7px; border-radius: 999px; margin-bottom: 8px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.vm-cp-hue::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2px solid rgba(0, 0, 0, 0.2);
}
.vm-cp-hex {
  display: flex; align-items: center; gap: 3px; padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 3px; font-size: 10px; color: #666;
}
.vm-cp-hex input {
  flex: 1; border: 0; background: none; color: #ececf0;
  font: inherit; font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; outline: none;
}
.vm-cp-hex input.invalid { color: #f87171; }

.vm-key-pop { width: min(260px, calc(100vw - 24px)); padding: 6px; max-height: 200px; overflow-y: auto; }
.vm-key-pop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 3px; }
.vm-key-pop-grid.wide { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
.vm-key-opt {
  padding: 5px 3px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 2px;
  background: rgba(255, 255, 255, 0.02); color: #aaa; font: inherit; font-size: 9.5px;
  font-weight: 600; cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.vm-key-opt:hover { background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.32); color: #fff; }
.vm-key-opt.active { background: rgba(139, 92, 246, 0.26); border-color: #8b5cf6; color: #fff; }

@media (max-width: 820px) {
  .vm-wrap { width: 100%; }
}

@media (max-width: 760px) {
  .vm-wrap { transform: none !important; height: auto !important; }
  .vm {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 1fr);
  }
  .vm-side {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    height: auto;
    padding: 8px 8px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .vm-side::-webkit-scrollbar { display: none; }
  .vm-logo { display: none; }
  .vm-cat { display: none; }
  .vm-nav {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 7px 11px;
    margin: 0;
    border-radius: 6px;
    font-size: 10.5px;
    white-space: nowrap;
  }
  .vm-nav svg { width: 13px; height: 13px; }
  .vm-nav.active { background: rgba(139, 92, 246, 0.18); }
  .vm-main {
    height: auto;
    min-height: 360px;
    max-height: min(62vh, 520px);
    padding: 8px 10px 10px;
  }
  .vm-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .vm-tabs::-webkit-scrollbar { display: none; }
  .vm-tab { flex-shrink: 0; }
  .vm-check, .vm-key, .vm-tab, .vm-nav, .vm-btn { min-height: 32px; }
  .vm-slider input[type="range"] { height: 4px; }
  .vm-slider input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; }
}

@media (max-width: 800px) {
  .vm-cols-2, .vm-cols-3, .vm-cols-4, .vm-cols-config { grid-template-columns: 1fr; min-height: 0; }
  .vm-cols-2 > .vm-box:first-child,
  .vm-cols-config > .vm-box:first-child,
  .vm-cols-3 > .vm-box:not(:last-child),
  .vm-cols-4 > .vm-box:not(:last-child) {
    border-right: 0; padding-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 12px; margin-bottom: 12px;
  }
  .vm-cols-2 > .vm-box:last-child,
  .vm-cols-3 > .vm-box:last-child,
  .vm-cols-4 > .vm-box:last-child,
  .vm-cols-config > .vm-stack {
    padding-left: 0; border-left: 0;
  }
}
