/*
  Q Light Controller Plus
  webaccess-v5.css

  Copyright (c) Massimo Callegari

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0.txt

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/

:root {
  --bg-stronger: #161616;
  --bg-strong: #232323;
  --bg-medium: #333;
  --bg-control: #555;
  --bg-light: #6f6f6f;
  --bg-lighter: #8f8f8f;
  --fg-main: #fff;
  --fg-medium: #888;
  --fg-light: #aaa;
  --highlight: #0978ff;
  --highlight-pressed: #044089;
  --selection: #ff0;
  --active-drop: #9dff52;
  --toolbar-start: #333;
  --toolbar-end: #111;
  --toolbar-hover-start: #444;
  --toolbar-hover-end: #171717;
  --font-main: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --font-mono: "Courier New", "Lucida Console", monospace;
  --text-size-default: 12px;
  --icon-size-default: 28px;
  --icon-size-medium: 24px;
  --list-item-height: 28px;
  --medium-item-height: 60px;
  --big-item-height: 96px;
  --toolbar-height: var(--icon-size-medium);
}

@font-face {
  font-family: "Font Awesome 7 Free";
  font-style: normal;
  font-weight: 900;
  src: url("/qrc/FontAwesome7-Free-Solid-900.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Roboto Condensed";
  font-style: normal;
  font-weight: 400;
  src: url("/qrc/RobotoCondensed-Regular.ttf") format("truetype");
  font-display: swap;
}

.fa-icon {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: var(--text-size-default);
  color: var(--fg-main);
  background: var(--bg-medium);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#loadForm {
  position: absolute;
  top: -200vh;
  left: -200vw;
}

.topbar {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  background: linear-gradient(to bottom, var(--toolbar-start), var(--toolbar-end));
  border-bottom: 1px solid var(--bg-stronger);
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-size-default);
  font-weight: 600;
}

.brand-sub {
  color: var(--fg-medium);
  font-size: calc(var(--text-size-default) * 0.9);
}

.actions {
  display: flex;
  gap: 4px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  height: calc(var(--toolbar-height) - 4px);
  padding: 0 8px;
  border: 1px solid #5b5f66;
  border-radius: 4px;
  background: linear-gradient(to bottom, #5f636b, #3a3d42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.35);
  color: #f1f2f4;
  font-size: var(--text-size-default);
  font-weight: 600;
  font-family: var(--font-main);
  text-decoration: none;
  cursor: pointer;
}

.nav-btn:hover {
  background: linear-gradient(to bottom, #70757e, #4a4f56);
  border-color: #7a7f87;
}

.nav-btn:active {
  transform: translateY(1px);
  background: linear-gradient(to bottom, #3a3d42, #2b2e33);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.status {
  width: calc(var(--toolbar-height) - 10px);
  height: calc(var(--toolbar-height) - 10px);
  border-radius: 50%;
  background: #ff3b30;
  border: 1px solid #7a1210;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4), 0 0 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.status.connected {
  background: #34c759;
  border-color: #0f6a29;
}

.pages-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.pages {
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(var(--toolbar-height) - 4px);
  padding: 0 4px;
  background: transparent;
  border: 0;
  overflow-x: hidden;
}

.pages::-webkit-scrollbar {
  height: 0;
}

.page-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  font-size: var(--text-size-default);
  color: var(--fg-main);
  cursor: pointer;
  white-space: nowrap;
}

.page-tab:hover {
  background: linear-gradient(to bottom, var(--toolbar-hover-start), var(--toolbar-hover-end));
}

.page-tab.active::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--selection);
}

.pages-select {
  display: none;
  height: calc(var(--toolbar-height) - 4px);
  padding: 0 26px 0 8px;
  border: 1px solid #5b5f66;
  border-radius: 4px;
  background-color: #3a3d42;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23f1f2f4' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"),
    linear-gradient(to bottom, #5f636b, #3a3d42);
  background-repeat: no-repeat, no-repeat;
  background-position: right 8px center, center;
  background-size: 10px 6px, auto;
  color: #f1f2f4;
  font-size: var(--text-size-default);
  font-weight: 600;
  font-family: var(--font-main);
  appearance: none;
}

.pages-select option {
  background: #2f3237;
  color: #f1f2f4;
}

.pages-wrap.is-compact .pages {
  display: none;
}

.pages-wrap.is-compact .pages-select {
  display: inline-flex;
}

.vc-stage {
  flex: 1;
  position: relative;
  overflow: auto;
}

.vc-page {
  position: relative;
  background: var(--bg-medium);
  outline: 2px solid var(--bg-light);
}

.vc-widget {
  position: absolute;
  border: 0;
  outline: 2px solid var(--bg-light);
  background-color: var(--bg-medium);
  background-image: var(--vc-bg-image, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.vc-widget.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.3);
  color: #a0a0a0;
  pointer-events: none;
}


.vc-button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  line-height: 0.8;
  white-space: pre-wrap;
  user-select: none;
  outline: none;
  box-sizing: border-box;
  background-image: var(--vc-bg-image, none),
    linear-gradient(to bottom, var(--vc-bg-light, #6f6f6f), var(--vc-bg, #333));
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-size: contain, cover;
}

.vc-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: var(--vc-inner-border-width, 2px) solid var(--vc-active-border-color, #a0a0a0);
  border-radius: 2px;
  pointer-events: none;
}

.vc-button::after {
  content: "";
  position: absolute;
  inset: calc(1px + var(--vc-inner-border-width, 2px));
  border: 1px solid #111;
  border-radius: 1px;
  pointer-events: none;
}

.vc-button.state-active {
  --vc-active-border-color: #0f0;
}

.vc-button.state-monitoring {
  --vc-active-border-color: #fa0;
}

.vc-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  line-height: 0.8;
  white-space: pre-wrap;
}

.vc-slider {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  justify-items: center;
  gap: 2px;
  padding: 2px;
  height: 100%;
}

.vc-slider .slider-value,
.vc-slider .slider-caption {
  width: 100%;
  text-align: center;
}

.vc-slider .slider-caption {
}

.vc-slider .slider-track {
  width: 100%;
  min-height: 40px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.vc-slider.knob .slider-track {
  width: 100%;
  height: 100%;
}

.vc-slider.knob .slider-knob {
  width: var(--knob-size, 80px);
  height: var(--knob-size, 80px);
}

.vc-slider .slider-reset-btn {
  width: var(--icon-size-default);
  height: var(--icon-size-default);
  background: var(--bg-light);
  border: 2px solid #1d1d1d;
  color: var(--bg-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  appearance: none;
}

.vc-slider .slider-reset-btn.is-overriding {
  background: #f00;
  color: var(--bg-control);
}

.vc-slider input[type="range"] {
  appearance: none;
  background: transparent;
}

.vc-matrix input[type="range"] {
  appearance: none;
  background: transparent;
}

.vc-slider .range-vertical {
  display: block;
  width: 5px;
  height: var(--slider-length, 120px);
  background: transparent;
  writing-mode: vertical-lr;
  direction: rtl;
}

.vc-slider .range-vertical::-webkit-slider-runnable-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--slider-fill-color, #38b0ff) 0,
    var(--slider-fill-color, #38b0ff) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-slider .range-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--slider-thumb-width, 20px);
  height: var(--slider-thumb-height, 20px);
  background: var(--slider-thumb-gradient,
    linear-gradient(180deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-left: calc((5px - var(--slider-thumb-width, 20px)) / 2);
}

.vc-slider .range-vertical::-moz-range-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--slider-fill-color, #38b0ff) 0,
    var(--slider-fill-color, #38b0ff) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-slider .range-vertical::-moz-range-thumb {
  width: var(--slider-thumb-width, 20px);
  height: var(--slider-thumb-height, 20px);
  background: var(--slider-thumb-gradient,
    linear-gradient(180deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-left: calc((5px - var(--slider-thumb-width, 20px)) / 2);
}

.vc-matrix .range-vertical {
  display: block;
  width: 5px;
  height: var(--slider-length, 120px);
  background: transparent;
  writing-mode: vertical-lr;
  direction: rtl;
}

.vc-matrix .range-vertical::-webkit-slider-runnable-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--slider-fill-color, #38b0ff) 0,
    var(--slider-fill-color, #38b0ff) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-matrix .range-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--slider-thumb-width, 20px);
  height: var(--slider-thumb-height, 20px);
  background: var(--slider-thumb-gradient,
    linear-gradient(180deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-left: calc((5px - var(--slider-thumb-width, 20px)) / 2);
}

.vc-matrix .range-vertical::-moz-range-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--slider-fill-color, #38b0ff) 0,
    var(--slider-fill-color, #38b0ff) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-matrix .range-vertical::-moz-range-thumb {
  width: var(--slider-thumb-width, 20px);
  height: var(--slider-thumb-height, 20px);
  background: var(--slider-thumb-gradient,
    linear-gradient(180deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-left: calc((5px - var(--slider-thumb-width, 20px)) / 2);
}

.vc-frame {
  overflow: hidden;
}

.vc-soloframe {
  overflow: hidden;
  outline: 2px solid #e00;
}

.vc-frame-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: var(--list-item-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  background: linear-gradient(to bottom, #666, #000);
  border-bottom: 1px solid #000;
  pointer-events: auto;
}

.vc-soloframe .vc-frame-header {
  background: linear-gradient(to bottom, #bc0a0a, #370303);
}

.frame-title {
  display: flex;
  align-items: center;
  gap: calc(var(--list-item-height) * 0.2);
  font-size: var(--text-size-default);
  font-weight: 600;
  margin-right: auto;
}

.frame-title.is-empty {
  min-width: 1px;
  margin-right: auto;
}

.frame-controls {
  display: flex;
  align-items: center;
  gap: calc(var(--list-item-height) * 0.15);
}

.frame-btn {
  border: 0;
  background: var(--bg-light);
  color: var(--fg-main);
  padding: 0 calc(var(--list-item-height) * 0.15);
  height: var(--list-item-height);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--list-item-height);
  line-height: 1;
  margin: 0;
  border: 1px solid #1d1d1d;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
}

.frame-btn:hover {
  background: var(--highlight);
}

.frame-btn .fa-icon {
  font-size: calc(var(--list-item-height) * 0.7);
  line-height: 1;
  color: inherit;
  display: block;
  margin: 0;
}

.frame-enable .fa-icon {
  color: #0f0;
}

.vc-slider .slider-reset-btn .fa-icon {
  font-size: calc(var(--icon-size-default) * 0.6);
}

.frame-enable.is-disabled .fa-icon {
  color: #666;
}

.frame-enable {
  background: var(--highlight);
}

.frame-enable.is-disabled {
  background: var(--bg-light);
}

.frame-select {
  height: var(--list-item-height);
  width: var(--big-item-height);
  background: var(--bg-light);
  color: var(--fg-main);
  border: 1px solid #1d1d1d;
  padding: 0 calc(var(--list-item-height) * 0.15);
  font-size: calc(var(--text-size-default) * 0.9);
  margin: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
}

.vc-button-icon {
  position: absolute;
  right: calc(var(--list-item-height) * 0.1);
  top: calc(var(--list-item-height) * 0.1);
  width: calc(var(--list-item-height) * 0.7);
  height: calc(var(--list-item-height) * 0.7);
  pointer-events: none;
}

.vc-frame-content {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 1;
}

.vc-cuelist,
.vc-audio,
.vc-xypad,
.vc-matrix,
.vc-speed,
.vc-clock {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.vc-cuelist {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px;
}

.vc-cuelist .cue-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  height: 100%;
}


.cue-steps {
  overflow: auto;
  border: 1px solid var(--bg-stronger);
  font-size: calc(var(--text-size-default) * 0.85);
  flex: 1;
}

.vc-cuelist .cue-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.vc-cuelist .cue-table thead th {
  height: var(--list-item-height);
  padding: 0 4px;
  background: var(--bg-light);
  border: 1px solid var(--bg-stronger);
  font-size: calc(var(--text-size-default) * 0.75);
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-cuelist .cue-table tbody td {
  height: var(--list-item-height);
  padding: 0 4px;
  border: 1px solid var(--bg-stronger);
  color: var(--fg-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-cuelist .cue-table tbody tr.cue-step {
  cursor: pointer;
  background: transparent;
}

.vc-cuelist .cue-table tbody tr.cue-step.active td {
  background: var(--highlight);
}

.vc-cuelist .cue-table td.cue-index,
.vc-cuelist .cue-table td.cue-name,
.vc-cuelist .cue-table td.cue-time {
  text-align: center;
}

.vc-cuelist .cue-table td.cue-time {
  font-variant-numeric: tabular-nums;
}

.vc-cuelist .cue-table td.cue-note-cell {
  padding: 0 2px;
}

.vc-cuelist .cue-note {
  width: 100%;
  height: calc(var(--list-item-height) - 4px);
  background: var(--bg-strong);
  border: 1px solid var(--bg-stronger);
  color: var(--fg-main);
  font-size: calc(var(--text-size-default) * 0.85);
  padding: 0 4px;
  margin: 0;
  box-sizing: border-box;
}

.vc-cuelist .cue-controls-row {
  display: flex;
  align-items: center;
  height: var(--icon-size-medium);
  gap: 0;
  border: 1px solid var(--bg-stronger);
}

.vc-cuelist .cue-control-btn {
  flex: 1;
  height: 100%;
  background: var(--bg-light);
  border: 0;
  border-right: 1px solid var(--bg-stronger);
  color: var(--fg-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  appearance: none;
}

.vc-cuelist .cue-control-btn:last-child {
  border-right: 0;
}

.vc-cuelist .cue-control-btn .fa-icon {
  font-size: calc(var(--icon-size-medium) * 0.6);
}

.vc-cuelist .cue-sidefader {
  width: calc(var(--icon-size-default) * 1.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: transparent;
  border: 1px solid var(--bg-stronger);
}

.vc-cuelist .cue-side-value {
  height: var(--list-item-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-size-default);
}

.vc-cuelist .cue-side-label {
  height: var(--list-item-height);
  width: var(--icon-size-default);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fg-main);
  background: transparent;
  color: var(--fg-main);
}

.vc-audio {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  height: 100%;
}

.audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--list-item-height);
  gap: 6px;
}

.audio-title {
  font-weight: 600;
  color: var(--fg-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-enable {
  padding: 0;
}

.vc-audio input[type="range"] {
  appearance: none;
  background: transparent;
}

.audio-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.audio-bars {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6px, 1fr));
  gap: 3px;
  padding: 4px;
  align-items: flex-end;
  background: var(--bg-strong);
  border: 1px solid var(--bg-medium);
}

.audio-bar {
  background:
    linear-gradient(180deg, rgba(33, 190, 43, 0.9), rgba(33, 190, 43, 0.1)),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.35) 0 2px,
      rgba(0, 0, 0, 0) 2px 6px
    );
  border-radius: 2px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.35);
}

.audio-fader {
  width: calc(var(--list-item-height) * 1.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: var(--bg-medium);
  border: 1px solid var(--bg-stronger);
}

.vc-audio .range-vertical {
  display: block;
  width: 5px;
  height: 100%;
  background: transparent;
  writing-mode: vertical-lr;
  direction: rtl;
}

.vc-audio .range-vertical::-webkit-slider-runnable-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--slider-fill-color, #21be2b) 0,
    var(--slider-fill-color, #21be2b) var(--slider-fill, 0%),
    var(--slider-empty-color, #555) var(--slider-fill, 0%),
    var(--slider-empty-color, #555) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-audio .range-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--slider-thumb-width, 16px);
  height: var(--slider-thumb-height, 20px);
  background: var(--slider-thumb-gradient,
    linear-gradient(180deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-left: calc((5px - var(--slider-thumb-width, 16px)) / 2);
}

.vc-audio .range-vertical::-moz-range-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--slider-fill-color, #21be2b) 0,
    var(--slider-fill-color, #21be2b) var(--slider-fill, 0%),
    var(--slider-empty-color, #555) var(--slider-fill, 0%),
    var(--slider-empty-color, #555) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-audio .range-vertical::-moz-range-thumb {
  width: var(--slider-thumb-width, 16px);
  height: var(--slider-thumb-height, 20px);
  background: var(--slider-thumb-gradient,
    linear-gradient(180deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-left: calc((5px - var(--slider-thumb-width, 16px)) / 2);
}

.vc-xypad {
  display: flex;
  width: 100%;
  height: 100%;
  --xypad-track: calc(var(--list-item-height) * 0.15);
  --xypad-handle: calc(var(--list-item-height) * 0.8);
  --xypad-pad: calc((var(--list-item-height) / 7) * 2);
}

.xypad-grid {
  display: grid;
  grid-template-columns: var(--list-item-height) 1fr var(--list-item-height);
  grid-template-rows: var(--list-item-height) 1fr var(--list-item-height);
  width: 100%;
  height: 100%;
  gap: 0;
  box-sizing: border-box;
}

.xypad-spacer {
  width: 100%;
  height: 100%;
}

.xypad-range,
.xypad-slider {
  border: 1px solid var(--bg-stronger);
  position: relative;
  padding: var(--xypad-pad);
  box-sizing: border-box;
  overflow: visible;
  background: var(--bg-light);
}

.xypad-range-top {
  grid-column: 2;
  grid-row: 1;
}

.xypad-range-left {
  grid-column: 1;
  grid-row: 2;
}

.xypad-slider-right {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}

.xypad-slider-bottom {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}

.xypad-range-top::before,
.xypad-range-top::after,
.xypad-slider-bottom::before,
.xypad-slider-bottom::after {
  content: "";
  position: absolute;
  left: var(--xypad-pad);
  right: var(--xypad-pad);
  top: 50%;
  height: var(--xypad-track);
  transform: translateY(-50%);
  border-radius: calc(var(--xypad-track) / 2);
  pointer-events: none;
  z-index: 0;
}

.xypad-range-left::before,
.xypad-range-left::after,
.xypad-slider-right::before,
.xypad-slider-right::after {
  content: "";
  position: absolute;
  top: var(--xypad-pad);
  bottom: var(--xypad-pad);
  left: 50%;
  width: var(--xypad-track);
  transform: translateX(-50%);
  border-radius: calc(var(--xypad-track) / 2);
  pointer-events: none;
  z-index: 0;
}

.xypad-range-top::before,
.xypad-range-left::before,
.xypad-slider-bottom::before,
.xypad-slider-right::before {
  background: var(--bg-light);
  border: 1px solid #8e8a86;
  box-sizing: border-box;
}

.xypad-range-top::after {
  background: #1abc9c;
  left: calc(var(--xypad-pad) + var(--range-min, 0%));
  right: calc(var(--xypad-pad) + (100% - var(--range-max, 100%)));
  z-index: 1;
}

.xypad-range-left::after {
  background: #1abc9c;
  bottom: calc(var(--xypad-pad) + var(--range-min, 0%));
  top: calc(var(--xypad-pad) + (100% - var(--range-max, 100%)));
  z-index: 1;
}

.xypad-slider-bottom::after {
  background: #0978ff;
  right: calc(var(--xypad-pad) + (100% - var(--slider-fill, 0%)));
  z-index: 1;
}

.xypad-slider-right::after {
  background: #0978ff;
  top: calc(var(--xypad-pad) + (100% - var(--slider-fill, 0%)));
  z-index: 1;
}

.xypad-area {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: 100%;
  position: relative;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--bg-strong);
  box-sizing: border-box;
}

.xypad-range-window {
  position: absolute;
  border: 1px solid #00bcd4;
  background: rgba(0, 188, 212, 0.2);
  pointer-events: none;
}

.xypad-handle {
  position: absolute;
  width: calc(var(--icon-size-medium) * 0.5);
  height: calc(var(--icon-size-medium) * 0.5);
  border-radius: 50%;
  background: #0f0;
  border: 1px solid var(--bg-strong);
  box-shadow: 0 0 0 4px rgba(0, 255, 0, 0.2);
  transform: translate(-50%, -50%);
}

.vc-xypad input[type="range"] {
  appearance: none;
  background: transparent;
}

.xypad-range input[type="range"] {
  pointer-events: none;
}

.xypad-slider .range-horizontal,
.xypad-range .range-horizontal {
  position: absolute;
  left: var(--xypad-pad);
  right: var(--xypad-pad);
  top: 50%;
  transform: translateY(-50%);
  height: var(--xypad-handle);
  z-index: 2;
}

.xypad-slider .range-vertical,
.xypad-range .range-vertical {
  position: absolute;
  top: var(--xypad-pad);
  bottom: var(--xypad-pad);
  left: 50%;
  transform: translateX(-50%);
  transform-origin: center;
  width: var(--xypad-handle);
  writing-mode: vertical-lr;
  direction: rtl;
  z-index: 2;
}

.xypad-range input[type="range"].is-active {
  z-index: 3;
}

.xypad-range-left .range-vertical {
  transform: translateX(-50%) rotate(180deg);
}

.xypad-range .range-horizontal::-webkit-slider-runnable-track,
.xypad-slider .range-horizontal::-webkit-slider-runnable-track {
  height: var(--xypad-track);
  background: transparent;
  border: 0;
  border-radius: calc(var(--xypad-track) / 2);
}

.xypad-range .range-horizontal::-webkit-slider-thumb,
.xypad-slider .range-horizontal::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--xypad-handle);
  height: var(--xypad-handle);
  background: var(--fg-main);
  border: 0;
  border-radius: calc(var(--xypad-handle) / 5);
  margin-top: calc((var(--xypad-track) - var(--xypad-handle)) / 2);
}

.xypad-range .range-horizontal::-moz-range-track,
.xypad-slider .range-horizontal::-moz-range-track {
  height: var(--xypad-track);
  background: transparent;
  border: 0;
  border-radius: calc(var(--xypad-track) / 2);
}

.xypad-range .range-horizontal::-moz-range-thumb,
.xypad-slider .range-horizontal::-moz-range-thumb {
  width: var(--xypad-handle);
  height: var(--xypad-handle);
  background: var(--fg-main);
  border: 0;
  border-radius: calc(var(--xypad-handle) / 5);
}

.xypad-range .range-vertical::-webkit-slider-runnable-track,
.xypad-slider .range-vertical::-webkit-slider-runnable-track {
  width: var(--xypad-track);
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: calc(var(--xypad-track) / 2);
}

.xypad-range .range-vertical::-webkit-slider-thumb,
.xypad-slider .range-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--xypad-handle);
  height: var(--xypad-handle);
  background: var(--fg-main);
  border: 0;
  border-radius: calc(var(--xypad-handle) / 5);
  margin-left: calc((var(--xypad-track) - var(--xypad-handle)) / 2);
}

.xypad-range .range-vertical::-moz-range-track,
.xypad-slider .range-vertical::-moz-range-track {
  width: var(--xypad-track);
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: calc(var(--xypad-track) / 2);
}

.xypad-range .range-vertical::-moz-range-thumb,
.xypad-slider .range-vertical::-moz-range-thumb {
  width: var(--xypad-handle);
  height: var(--xypad-handle);
  background: var(--fg-main);
  border: 0;
  border-radius: calc(var(--xypad-handle) / 5);
}


.vc-cuelist .cue-side-slider {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc-cuelist .cue-side-slider .range-vertical {
  transform: rotate(-90deg);
  transform-origin: center;
  width: var(--slider-length, 120px);
  height: 5px;
  background: transparent;
}

.vc-cuelist .cue-side-slider input[type="range"] {
  appearance: none;
  background: transparent;
}

.vc-cuelist .cue-side-slider .range-vertical::-webkit-slider-runnable-track {
  height: 5px;
  background: linear-gradient(
    to right,
    var(--slider-fill-color, #38b0ff) 0,
    var(--slider-fill-color, #38b0ff) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-cuelist .cue-side-slider .range-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--slider-thumb-width, 18px);
  height: var(--slider-thumb-height, 18px);
  background: var(--slider-thumb-gradient,
    linear-gradient(270deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
  margin-top: calc((var(--slider-thumb-height, 18px) - 5px) / -2);
}

.vc-cuelist .cue-side-slider .range-vertical::-moz-range-track {
  height: 5px;
  background: linear-gradient(
    to right,
    var(--slider-fill-color, #38b0ff) 0,
    var(--slider-fill-color, #38b0ff) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) var(--slider-fill, 0%),
    var(--slider-empty-color, #888) 100%
  );
  border: 1px solid #8e8a86;
  border-radius: 2px;
}

.vc-cuelist .cue-side-slider .range-vertical::-moz-range-thumb {
  width: var(--slider-thumb-width, 18px);
  height: var(--slider-thumb-height, 18px);
  background: var(--slider-thumb-gradient,
    linear-gradient(90deg, #ccc 0%, #555 45%, #000 50%, #555 55%, #888 100%));
  border: 1px solid #5c5c5c;
  border-radius: 4px;
}

.vc-matrix {
  padding: 2px 4px;
  height: 100%;
}

.animation-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 6px;
  row-gap: 4px;
  align-items: center;
  height: 100%;
}

.animation-grid.no-fader {
  grid-template-columns: 1fr;
}

.animation-fader {
  grid-row: 1 / span 3;
  grid-column: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: calc(var(--icon-size-default) * 0.9);
}

.animation-label {
  grid-column: 2;
  text-align: center;
  line-height: 0.8;
}

.animation-colors {
  grid-column: 2;
  display: flex;
  gap: 4px;
  align-items: center;
  height: var(--icon-size-default);
  overflow: hidden;
  flex-wrap: nowrap;
}

.animation-color {
  width: var(--icon-size-default);
  height: var(--icon-size-default);
  border-radius: 5px;
  border: 2px solid var(--bg-light);
  padding: 0;
  background: transparent;
  appearance: none;
}

.animation-combo {
  grid-column: 2;
  height: var(--list-item-height);
  background: var(--bg-control);
  border: 1px solid var(--bg-strong);
  color: var(--fg-main);
  padding: 0 4px;
  font-size: calc(var(--text-size-default) * 0.9);
  appearance: none;
}

.animation-grid.no-fader .animation-label,
.animation-grid.no-fader .animation-colors,
.animation-grid.no-fader .animation-combo {
  grid-column: 1;
}

.vc-speed {
  padding: 2px;
  overflow: hidden;
}

.speed-grid {
  display: grid;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.speed-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 4px;
  height: var(--list-item-height);
  text-align: center;
}

.speed-btn {
  border: 2px solid var(--bg-strong);
  background: var(--bg-control);
  color: var(--fg-main);
  padding: 0 6px;
  height: 100%;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: var(--text-size-default);
  font-weight: 500;
  border-radius: 2px;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.speed-btn:hover {
  background: var(--highlight);
  border-color: var(--highlight);
}

.speed-btn:active {
  background: var(--highlight-pressed);
  border-color: var(--highlight-pressed);
}

.speed-beat.is-active,
.speed-preset.is-active {
  background: #21be2b;
  border-color: #1a9522;
}

.speed-tap {
  border-color: var(--bg-strong);
  font-weight: 700;
  font-size: calc(var(--text-size-default) * 1.1);
}

.speed-tap.is-blink {
  border-color: #0f0;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.speed-dial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 2px;
}

.speed-dial-knob {
  aspect-ratio: 1 / 1;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 50%;
  position: relative;
  background: linear-gradient(145deg, #a3a3a3 0%, #505050 100%);
  border: 1px solid #434343;
  box-shadow:
    inset 0 3px 6px rgba(255, 255, 255, 0.35),
    inset 0 -4px 8px rgba(0, 0, 0, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  touch-action: none;
}

.speed-dial-knob::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: linear-gradient(325deg, #9d9d9d 0%, #5c5c5c 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  z-index: 0;
}

.speed-dial-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12%;
  height: 12%;
  background: var(--dial-color, #21be2b);
  border: 1px solid var(--dial-border, var(--bg-strong));
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--dial-angle, 130deg)) translateY(calc(-50% - 150%));
  transform-origin: center;
  z-index: 2;
}

.speed-time-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: var(--list-item-height);
}

.speed-spin {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-control);
  border: 2px solid var(--bg-strong);
  padding: 0 4px;
  height: 100%;
}

.speed-spin input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--fg-main);
  text-align: right;
  outline: none;
  padding: 0 4px 0 0;
  font-size: calc(var(--text-size-default) * 0.9);
}

.speed-spin span {
  color: var(--fg-light);
  font-size: calc(var(--text-size-default) * 0.85);
}

.speed-multi-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: var(--list-item-height);
}

.speed-multi-row .speed-btn {
  min-width: var(--list-item-height);
}

.speed-reset {
  min-width: calc(var(--list-item-height) * 2);
  padding: 0;
}

.speed-multi-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-control);
  border: 2px solid var(--bg-strong);
  line-height: 1.1;
}

.speed-apply {
  height: var(--list-item-height);
}

.speed-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.speed-presets .speed-btn {
  height: var(--list-item-height);
  min-width: calc(var(--icon-size-default) * 3);
}

.vc-clock {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 4px 6px;
  }
  .actions {
    margin-left: 0;
  }
  .pages {
    height: auto;
    padding: 4px 6px;
  }
}
