.demo-review-marker {
  display: none;
}

.demo-review-enabled .demo-review-anchor {
  position: relative;
}

.demo-review-enabled .demo-review-marker {
  position: absolute;
  z-index: 80;
  top: 6px;
  right: 6px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #892220;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-touch-callout: none;
}

.demo-review-enabled .demo-review-marker[data-review-placement="lower"] {
  top: 44px;
}

.demo-review-marker-dot {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(34, 29, 25, 0.14);
  transition:
    width 150ms ease,
    height 150ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.demo-review-marker-dot::after {
  width: 7px;
  height: 4px;
  border-bottom: 1.7px solid #fff;
  border-left: 1.7px solid #fff;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.5);
  transition: opacity 120ms ease, transform 180ms ease;
}

.demo-review-marker.is-selected .demo-review-marker-dot {
  width: 24px;
  height: 24px;
  background: currentColor;
  transform: scale(1);
}

.demo-review-marker.is-selected .demo-review-marker-dot::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.demo-review-marker.is-collecting .demo-review-marker-dot {
  animation: demo-review-select 180ms ease-out;
}

.demo-review-marker-ring {
  position: absolute;
  inset: 3px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.demo-review-marker.is-holding .demo-review-marker-ring {
  opacity: 1;
  animation: demo-review-hold 420ms linear forwards;
}

.demo-review-marker-tip {
  position: absolute;
  z-index: 2;
  top: calc(100% + 2px);
  right: 2px;
  width: max-content;
  max-width: min(230px, calc(100vw - 28px));
  padding: 7px 9px;
  border: 1px solid #892220;
  background: #fffdfb;
  color: #251f1b;
  box-shadow: 0 5px 14px rgba(34, 29, 25, 0.12);
  font: 600 12px/1.4 system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.demo-review-marker:focus-visible {
  outline: 2px solid #892220;
  outline-offset: 1px;
}

.demo-review-confirmation {
  position: fixed;
  z-index: 120;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid;
  box-sizing: border-box;
  width: min(248px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  gap: 8px;
  padding: 11px;
  overflow: auto;
  border: 1px solid #892220;
  background: #fffdfb;
  color: #251f1b;
  box-shadow: 0 8px 22px rgba(34, 29, 25, 0.16);
  font-family: system-ui, sans-serif;
}

.demo-review-confirmation[hidden] {
  display: none;
}

.demo-review-confirmation > strong {
  padding-right: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.demo-review-confirmation > p {
  margin: 0;
  color: #625b54;
  font-size: 12px;
  line-height: 1.45;
}

.demo-review-confirmation > small {
  color: #756d65;
  font-size: 12px;
  line-height: 1.35;
}

.demo-review-confirmation-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.demo-review-confirmation-actions button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #892220;
  border-radius: 0;
  background: #fffdfb;
  color: #892220;
  font: 700 12px/1.2 system-ui, sans-serif;
}

.demo-review-confirmation-actions .demo-review-confirmation-add {
  background: #892220;
  color: #fff;
}

.demo-review-confirmation-actions button:focus-visible {
  outline: 2px solid #892220;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .demo-review-marker:hover .demo-review-marker-dot,
  .demo-review-marker:focus-visible .demo-review-marker-dot {
    width: 26px;
    height: 26px;
  }

  .demo-review-marker:hover .demo-review-marker-tip,
  .demo-review-marker:focus-visible .demo-review-marker-tip {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes demo-review-select {
  0% { transform: scale(1); }
  45% { transform: scale(0.72); }
  100% { transform: scale(1); }
}

@keyframes demo-review-hold {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .demo-review-marker-dot,
  .demo-review-marker-dot::after,
  .demo-review-marker-tip {
    transition: none;
  }

  .demo-review-marker.is-collecting .demo-review-marker-dot {
    animation: none;
  }

  .demo-review-marker.is-holding .demo-review-marker-ring {
    border-color: currentColor;
    animation: none;
  }
}

/* In the small review viewport, give the input priority over repeated framing. */
@media (max-width: 760px) {
  .demo-review-enabled body:has(.chat-panel) .topbar { gap: 10px; margin-bottom: 12px; padding-bottom: 12px; }
  .demo-review-enabled body:has(.chat-panel) .topbar h1 { font-size: 24px; margin: 4px 0; }
  .demo-review-enabled body:has(.chat-panel) .topbar p { display: none; }
  .demo-review-enabled body:has(.chat-panel) .notice { padding: 8px 10px; gap: 3px; }
  .demo-review-enabled body:has(.chat-panel) .notice strong { font-size: 13px; }
  .demo-review-enabled body:has(.chat-panel) .notice span { font-size: 12px; }
  .demo-review-enabled body:has(.chat-panel) .process-strip { grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 12px; }
  .demo-review-enabled body:has(.chat-panel) .process-strip li { padding: 8px 6px; font-size: 12px; line-height: 1.5; }
  .demo-review-enabled .chat-panel .panel-header { padding: 12px; }
  .demo-review-enabled .chat-panel .messages { flex: 0 0 auto; max-height: 100px; }
  .demo-review-enabled .chat-panel .messages:not(:has(.empty)) + .samples { display: flex; overflow-x: auto; }
  .demo-review-enabled .chat-panel .messages:not(:has(.empty)) + .samples button { flex: 0 0 180px; }
  .demo-review-enabled .chat-panel .messages:has(.empty) { display: none; }
  .demo-review-enabled .chat-panel .samples { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; padding: 8px 12px; }
  .demo-review-enabled .chat-panel .samples button { min-height: 44px; padding: 5px 8px; font-size: 12px; line-height: 1.4; white-space: normal; text-overflow: clip; overflow: visible; }
  .demo-review-enabled .chat-panel .composer { padding: 12px; }
}
