.uv-stage {
  padding: 12px;
  border: var(--border-width) solid var(--line);
  background: #0f1419;
  border-radius: 0px;
  overflow: auto;
  min-height: 0;
  height: 100%;
}

#uvCanvas {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 450px);
  width: auto;
  height: auto;
  background:
    linear-gradient(45deg, #1b232c 25%, transparent 25%),
    linear-gradient(-45deg, #1b232c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1b232c 75%),
    linear-gradient(-45deg, transparent 75%, #1b232c 75%);
  background-size: 32px 32px;
  background-position: 0 0, 0 16px, 16px -16px, -16px 0;
  border: var(--border-width) solid #2b3642;
}

.uv-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.uv-workspace {
  display: grid;
  grid-template-columns: minmax(400px, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  height: 100%;
}

.uv-controls {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.uv-control-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.uv-control-tab {
  min-height: 36px;

  &.active {
    border-color: rgba(var(--accent-2-rgb), 0.72);
    background: rgba(var(--accent-2-rgb), 0.2);
    color: #fff;
  }

  &.active:hover,
  &.active:focus-visible {
    background: rgba(var(--accent-2-rgb), 0.3);
  }
}

.uv-control-panel {
  display: none;
  gap: 12px;
  align-content: start;

  &.active {
    display: grid;
  }
}

.uv-control-panel[data-uv-panel="setup"] > .form-row:has(#useUvSlot) {
  grid-template-columns: minmax(0, 1fr) auto;

  label {
    min-width: 0;
  }

  .output-hint {
    grid-column: 1;
    margin: 0;
    align-self: center;
  }

  #exportUvTemplate {
    grid-column: 2;
    min-width: 170px;
  }
}

.uv-display {
  min-width: 0;
  min-height: 0;
  display: flex;
}

.uv-preset-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: var(--border-width) solid var(--line);
  border-radius: 0px;
  background: #11171d;
}

.uv-preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.uv-group-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;

  strong {
    font-size: 15px;
    color: #fff;
  }
}

.uv-group-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap; 
}

.uv-group-filter {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;

  label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #cbd5e1;
  }

  input[type="number"] {
    width: 92px;
  }
}

.uv-material-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;

  button {
    min-height: 30px;
    padding: 4px 9px;

    &.active {
      border-color: rgba(var(--accent-2-rgb), 0.72);
      background: rgba(var(--accent-2-rgb), 0.2);
      color: #fff;
    }
  }
}

.uv-group-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  align-content: start;
  height: 680px;
  overflow: auto;
  margin-top: 10px;  
  padding: 10px;
  border: var(--border-width) solid var(--line);
  border-radius: 0px;
  background: #0f1419;
}

.uv-group-empty {
  grid-column: 1 / -1;
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 14px;
}

.uv-group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 0px;
  cursor: pointer;
  border: var(--border-width) solid transparent;

  &.is-hovered {
    background: rgba(88, 166, 255, 0.12);
    border-color: rgba(88, 166, 255, 0.45);
  }

  &.is-focused {
    background: rgba(255, 184, 77, 0.12);
    border-color: rgba(255, 184, 77, 0.55);
  }

  input, select {
    width: auto;
  }

  span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.uv-glass-diagnostics {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.uv-glass-empty,
.uv-glass-card {
  border: var(--border-width) solid var(--line);
  background: #0f1419;
  border-radius: 0px;
  padding: 10px;
}

.uv-glass-empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.025);
  color: #94a3b8;
  font-size: 14px;
}

.uv-glass-card {
  display: grid;
  gap: 8px;

  strong {
    color: #fff;
  }
}

.uv-glass-list {
  display: grid;
  gap: 4px;

  div {
    display: grid;
    grid-template-columns: minmax(120px, 0.6fr) minmax(0, 1fr);
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
  }

  span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  span:first-child {
    color: #94a3b8;
  }
}

