.image-adjust-panel {
  position: fixed;
  z-index: 2100;
  box-sizing: border-box;
  width: min(346px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid var(--white-12, #39404b);
  border-radius: 14px;
  background: var(--bg-panel-card, #1c1e28);
  color: var(--text-primary, #f4f5fb);
  box-shadow: var(--shadow-toolbar, 0 12px 32px #0007);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}

.image-adjust-header,
.image-adjust-footer,
.image-adjust-save-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.image-adjust-header {
  justify-content: space-between;
  margin-bottom: 7px;
}

.image-adjust-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.image-adjust-controls {
  display: grid;
  gap: 8px;
}

.image-adjust-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  min-height: 28px;
  border: 1px solid var(--white-12, #3b3e49);
  border-radius: 7px;
  background: var(--white-04, #ffffff0b);
  color: inherit;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.image-adjust-panel button:not(:disabled):hover,
.image-adjust-panel button[aria-pressed="true"],
.ftb-btn.image-adjust-active {
  background: var(--white-12, #41495b);
}

.image-adjust-panel button:focus-visible,
.image-adjust-light:focus-visible,
.image-adjust-panel input:focus-visible {
  outline: 2px solid #8ca6ff;
  outline-offset: 2px;
}

.image-adjust-panel button:disabled {
  opacity: .48;
  cursor: default;
}

.image-adjust-panel .image-adjust-close {
  width: 28px;
  border-color: transparent;
  background: transparent;
  padding: 0;
}

.image-adjust-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
}

.image-adjust-slider output {
  color: var(--text-secondary, #b2b9c8);
  font-variant-numeric: tabular-nums;
}

.image-adjust-slider input {
  grid-column: 1 / -1;
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #8498fa;
}

.image-adjust-transforms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.image-adjust-footer {
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--white-08, #fff2);
}

.image-adjust-save-actions {
  margin-left: auto;
}

.image-adjust-panel .image-adjust-primary {
  border-color: #8295ef;
  background: #5c70ca;
  color: #fff;
}

.image-adjust-panel .image-adjust-primary:not(:disabled):hover {
  background: #7085df;
}

.image-adjust-status {
  margin-top: 8px;
  color: var(--text-secondary, #b2b9c8);
}

.image-adjust-preview {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  overflow: hidden;
  background: #111217;
  pointer-events: none;
}

.image-adjust-preview[hidden],
.image-adjust-light[hidden] {
  display: none;
}

.image-adjust-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-adjust-preview.is-lighting {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}

.image-adjust-light {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #282318df;
  color: #ffe6a4;
  box-shadow: 0 0 0 3px #171b2c65, 0 2px 7px #0008;
  transform: translate(-50%, -50%) scale(var(--zoom-inv, 1));
  cursor: grab;
}

.image-adjust-preview:active .image-adjust-light {
  cursor: grabbing;
}
