.commentary-color-controls {
  position: fixed;
  right: 14px;
  top: calc(55% + 52px);
  display: none;
  align-items: flex-end;
  z-index: 1000;
}

.commentary-color-controls[data-visible="true"] {
  display: flex;
}

.commentary-color-controls__toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(3, 20, 45, 0.9);
  color: #ff6a6a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.commentary-color-controls__toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.92;
}

.commentary-color-controls__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: none;
  width: min(320px, calc(100vw - 80px));
  padding: 10px;
  background: rgba(3, 20, 45, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f4f8ff;
  font-family: Inter, "Segoe UI", sans-serif;
}

.commentary-color-controls[data-expanded="true"] .commentary-color-controls__panel {
  display: block;
}

.commentary-color-controls__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}

.commentary-color-controls__reset {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f8ff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
}

.commentary-color-controls__list {
  display: grid;
  gap: 6px;
  max-height: min(56vh, 420px);
  overflow: auto;
  padding-right: 4px;
}

.commentary-color-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.commentary-color-row[data-active="false"] {
  opacity: 0.72;
}

.commentary-color-row__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.commentary-color-row__toggle input {
  margin: 0;
  accent-color: #ff5d5d;
  cursor: pointer;
}

.commentary-color-row__label {
  color: rgba(244, 248, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
}

.commentary-color-row__input {
  width: 42px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}

.commentary-color-row__input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .commentary-color-controls {
    right: 10px;
    top: 212px !important;
  }

  .commentary-color-controls__panel {
    width: min(240px, calc(100vw - 20px));
    right: 0;
    bottom: calc(100% + 8px);
  }
}
