.feedback {
  --feedback-ink: #261535;
  --feedback-accent: #ecd7ff;
  --feedback-border: #705984;
  position: fixed;
  z-index: 10;
  right: max(.75rem, env(safe-area-inset-right));
  bottom: max(.75rem, env(safe-area-inset-bottom));
  width: min(26rem, calc(100% - 1.5rem));
  color: #faf4ff;
  font: 400 .9rem/1.4 system-ui, sans-serif;
  pointer-events: none;
}

.feedback button,
.feedback textarea {
  font: inherit;
}

#duet-dialog > .feedback {
  position: sticky;
  right: auto;
  bottom: 0;
  margin-inline: auto;
  padding-block: .5rem max(.5rem, env(safe-area-inset-bottom));
}

#duet-dialog > .feedback .feedback-panel {
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  max-height: min(52vh, 26rem);
}

.feedback button {
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--feedback-border);
  border-radius: .6rem;
  background: #291f34;
  color: #faf4ff;
  font-weight: 600;
  cursor: pointer;
}

.feedback .feedback-primary {
  border-color: var(--feedback-accent);
  background: var(--feedback-accent);
  color: var(--feedback-ink);
}

.feedback button:focus-visible,
.feedback textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.feedback-launchers {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.feedback-launchers button {
  pointer-events: auto;
  box-shadow: 0 2px 18px #100d0ccc;
}

.feedback-pointer {
  display: flex;
  align-items: center;
  gap: .35rem;
  justify-content: flex-end;
}

.feedback-pointer p {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid var(--feedback-border);
  border-radius: .6rem;
  background: #24192d;
  box-shadow: 0 2px 18px #100d0ccc;
  color: #faf4ff;
  font-size: .8rem;
  font-weight: 650;
}

.feedback-crosshair {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--feedback-accent);
  background:
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

.feedback .feedback-cancel {
  pointer-events: auto;
  font-size: .8rem;
}

.feedback-marker {
  position: fixed;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid #f8e2ff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #251633;
  pointer-events: none;
}

.feedback-marker::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #f8e2ff;
}

.feedback-marker-placed {
  width: 24px;
  height: 24px;
  border-color: #ffcf7b;
  box-shadow: 0 0 0 2px #251633;
}

.feedback-marker-placed::after {
  inset: 7px;
  background: #ffcf7b;
}

.feedback-marker span {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: .2rem .35rem;
  border-radius: .25rem;
  background: #251633;
  color: #f8e2ff;
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
}

.feedback-marker-right span {
  left: auto;
  right: calc(100% + 8px);
}

body:has(.feedback) .gallery,
body:has(.feedback) .detail-inner {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.feedback-panel {
  max-height: min(67vh, 34rem);
  overflow: auto;
  padding: .875rem;
  margin-bottom: .5rem;
  border: 1px solid var(--feedback-border);
  border-radius: .8rem;
  background: #1e1825;
  box-shadow: 0 8px 38px #100d0ccc;
  pointer-events: auto;
}

.feedback-header,
.feedback-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.feedback-header {
  justify-content: space-between;
  margin-bottom: .5rem;
}

.feedback-header h2 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.2;
}

.feedback .feedback-close {
  width: 44px;
  flex: 0 0 44px;
  padding: 0;
  font-size: 1.4rem;
}

.feedback label {
  display: block;
  margin: .625rem 0 .3rem;
  font-weight: 600;
}

.feedback textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: .5rem;
  border: 1px solid var(--feedback-border);
  border-radius: .35rem;
  background: #141019;
  color: #faf4ff;
  color-scheme: dark;
}

.feedback textarea {
  font-size: 1rem;
  resize: vertical;
}

.feedback-actions {
  flex-wrap: wrap;
  margin-top: .625rem;
}

.feedback-status {
  color: var(--feedback-accent);
}

.feedback-status:not(:empty) {
  margin-top: .625rem;
}

.feedback-selected {
  margin: 0;
  color: var(--feedback-accent);
  overflow-wrap: anywhere;
}

.feedback-list {
  padding-inline-start: 1.5rem;
  margin: .5rem 0;
}

.feedback-list li {
  padding: .4rem 0;
  overflow-wrap: anywhere;
}

.feedback-list li + li {
  border-top: 1px solid var(--feedback-border);
}

.feedback-list p {
  white-space: pre-wrap;
}

.feedback-export button,
.feedback-add {
  margin-top: .625rem;
}

body.feedback-picking,
body.feedback-picking :is(main, .masthead),
body.feedback-picking :is(main, .masthead) * {
  cursor: crosshair !important;
}

body.feedback-picking :is(.product-visual, .product-bottle, .product-sigil, .detail-art, .sigil-image) {
  pointer-events: auto;
}

body :is(.feedback-hover, .feedback-highlight) {
  outline: 2px solid #f8e2ff !important;
  outline-offset: -2px;
}

body .feedback-highlight {
  outline: 3px solid #f8e2ff !important;
}

body :is(.detail-bottle, .product-bottle, .detail-art, .product-sigil):is(.feedback-hover, .feedback-highlight) {
  --feedback-image-outline:
    drop-shadow(1px 0 0 #f8e2ff) drop-shadow(-1px 0 0 #f8e2ff)
    drop-shadow(0 1px 0 #f8e2ff) drop-shadow(0 -1px 0 #f8e2ff);
  outline: none !important;
}

body :is(.detail-bottle, .product-bottle):is(.feedback-hover, .feedback-highlight) {
  filter: var(--feedback-image-outline) drop-shadow(0 11px 11px rgb(0 0 0 / .6));
}

body :is(.detail-art, .product-sigil):is(.feedback-hover, .feedback-highlight) .sigil-image {
  filter: brightness(1.4) saturate(.82) var(--feedback-image-outline);
}
