/* Items editor — shared by overlay drawer and setup (OBS-safe, no popups) */

.items-editor-set-bar {
  margin-bottom: 12px;
}

.items-editor-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.items-editor-set-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.items-editor-set-picker label {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.items-editor-set-picker select {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #3a3a48;
  background: #0e0e14;
  color: #fff;
  font: inherit;
}

.items-editor-set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.items-editor-set-actions button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(243, 206, 19, 0.4);
  background: rgba(0, 0, 0, 0.5);
  color: var(--accent, #f3ce13);
  font: inherit;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
}

.items-editor-set-actions button.is-active {
  background: rgba(243, 206, 19, 0.28);
  border-color: rgba(243, 206, 19, 0.65);
}

.items-editor-expand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(243, 206, 19, 0.4);
  background: rgba(0, 0, 0, 0.35);
}

.items-editor-expand-row[hidden] {
  display: none !important;
}

.items-editor-expand-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #3a3a48;
  background: #0e0e14;
  color: #fff;
  font: inherit;
  box-sizing: border-box;
}

.items-editor-expand-row .expand-msg {
  flex: 1 1 100%;
  margin: 0 0 4px;
  font-size: 0.88rem;
}

.items-editor-expand-row .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.items-editor-status {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.items-editor-status[hidden] {
  display: none !important;
}

.items-editor-status.is-error {
  background: rgba(120, 40, 40, 0.45);
}

.items-editor-status.is-ok {
  background: rgba(40, 100, 50, 0.35);
}

.items-editor-list-meta {
  margin: 0 0 8px;
  font-size: 0.82rem;
  opacity: 0.8;
}

.items-editor-list-wrap {
  position: relative;
  margin: 0 0 12px;
  --list-scroll-fade: var(--bg, #121218);
  border: 2px solid rgba(243, 206, 19, 0.55);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(243, 206, 19, 0.12);
}

.items-editor-list-wrap::before {
  content: "Scrollable options";
  display: block;
  padding: 8px 12px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent, #f3ce13);
  border-bottom: 1px solid rgba(243, 206, 19, 0.25);
  opacity: 0;
}

.items-editor-list-wrap.is-scrollable::before {
  opacity: 1;
}

.side-drawer-body .items-editor-list-wrap {
  --list-scroll-fade: #0e0e14;
}

.items-editor-list {
  list-style: none;
  margin: 0;
  padding: 4px 4px 4px 8px;
  max-height: min(50vh, 22rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 206, 19, 0.75) rgba(255, 255, 255, 0.08);
  outline: none;
}

.items-editor-list:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(243, 206, 19, 0.45);
}

.items-editor-list-fade {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.5rem;
  background: linear-gradient(
    to top,
    var(--list-scroll-fade) 12%,
    color-mix(in srgb, var(--list-scroll-fade) 80%, transparent) 45%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.items-editor-list-wrap.is-scrollable:not(.at-scroll-end) .items-editor-list-fade {
  opacity: 1;
}

.items-editor-list::-webkit-scrollbar {
  width: 10px;
}

.items-editor-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  margin: 4px 0;
}

.items-editor-list::-webkit-scrollbar-thumb {
  background: rgba(243, 206, 19, 0.7);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.items-editor-list::-webkit-scrollbar-thumb:hover {
  background: rgba(243, 206, 19, 0.95);
  background-clip: padding-box;
}

.items-editor-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a34;
}

.items-editor-row.is-disabled input:not([type="checkbox"]) {
  opacity: 0.55;
}

.items-editor-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.items-editor-enable {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.items-editor-enable input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent, #f3ce13);
  cursor: pointer;
}

.items-editor-row input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #3a3a48;
  background: #0e0e14;
  color: #fff;
  font: inherit;
  box-sizing: border-box;
}

.items-editor-row button {
  justify-self: start;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #f88;
  border: 1px solid rgba(255, 100, 100, 0.4);
  background: rgba(0, 0, 0, 0.5);
  font: inherit;
  cursor: pointer;
}

.items-editor .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.items-editor .row .primary,
.items-editor-expand-row .primary {
  background: var(--accent, #f3ce13);
  color: #121218;
  font-weight: 600;
  border-color: var(--accent, #f3ce13);
}

.items-editor .hint {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 8px;
}

button.danger {
  border-color: rgba(232, 93, 93, 0.65) !important;
  color: #f8a0a0 !important;
}

button.danger:hover {
  background: rgba(120, 40, 40, 0.45) !important;
}
