.pill-compare-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: #fff;
  background: var(--bg, #fff);
}

.pill-compare-modal {
  --pill-compare-actionbar-content-h: 48px;
  --pill-compare-actionbar-h: calc(
    var(--app-top-safe-reserve, env(safe-area-inset-top, 0px)) +
    var(--pill-compare-actionbar-content-h)
  );
  --pill-compare-sheet-current-h: clamp(144px, 18dvh, 184px);
  --pill-compare-workspace-top: var(--pill-compare-actionbar-h);
  --pill-compare-workspace-bottom: var(--pill-compare-sheet-current-h);
  --pill-demo-bg: #e7ecf1;
  --pill-demo-bg-highlight: #f7f9fb;
  --pill-demo-outline: #1f75b5;
  --pill-demo-glow: rgba(27, 111, 174, 0.4);
  --pill-compare-modal-bg:
    radial-gradient(120% 90% at 50% -10%, rgba(185, 201, 224, 0.24), transparent 44%),
    linear-gradient(180deg, #f7f8fa 0%, #edf0f4 42%, #f8f9fb 100%);
  --pill-compare-stage-bg: #eef1f4;
  --pill-compare-surface: rgba(252, 252, 252, 0.9);
  --pill-compare-control: rgba(255, 255, 255, 0.72);
  --pill-compare-control-active: rgba(17, 24, 39, 0.1);
  --pill-compare-fg: var(--fg, #111827);
  --pill-compare-muted: color-mix(in srgb, var(--pill-compare-fg) 62%, transparent);
  --pill-compare-line: color-mix(in srgb, var(--pill-compare-fg) 14%, transparent);
  position: relative;
  width: min(100vw, 520px);
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pill-compare-modal-bg);
  color: var(--pill-compare-fg);
}

.theme-dark .pill-compare-modal,
[data-theme="dark"] .pill-compare-modal {
  --pill-demo-bg: #080d13;
  --pill-demo-bg-highlight: #111c27;
  --pill-demo-outline: #8edcff;
  --pill-demo-glow: rgba(72, 188, 242, 0.38);
  --pill-compare-modal-bg:
    radial-gradient(120% 90% at 50% -10%, rgba(140, 180, 255, 0.16), transparent 44%),
    linear-gradient(180deg, #0a0b0f 0%, #000 32%, #050608 100%);
  --pill-compare-stage-bg: #05070a;
  --pill-compare-surface: rgba(7, 9, 13, 0.9);
  --pill-compare-control: rgba(20, 24, 30, 0.58);
  --pill-compare-control-active: rgba(255, 255, 255, 0.19);
  --pill-compare-fg: #fff;
  --pill-compare-muted: rgba(255, 255, 255, 0.62);
  --pill-compare-line: rgba(255, 255, 255, 0.12);
}

.pill-compare-modal > header,
.pill-compare-modal > footer {
  display: none;
}

.pill-compare-mode-switch {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 19;
  transform: translateX(-50%);
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--pill-compare-control);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pill-compare-mode-switch button {
  -webkit-appearance: none;
          appearance: none;
  border: none;
  background: transparent;
  color: var(--pill-compare-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-compare-mode-switch button.is-active {
  background: var(--pill-compare-control-active);
  color: var(--pill-compare-fg);
}

.pill-compare-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  flex: none;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--pill-compare-stage-bg);
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.pill-compare-stage video,
.pill-compare-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill-compare-zoom {
  --pill-compare-still-center-y: calc(
    (
      100%
      - var(--pill-compare-sheet-current-h)
      + var(--pill-compare-actionbar-h)
    ) / 2
  );
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.pill-compare-interaction-workspace {
  position: absolute;
  inset:
    var(--pill-compare-workspace-top)
    0
    var(--pill-compare-workspace-bottom);
  z-index: -1;
  pointer-events: none;
}

.pill-compare-stage.is-live {
  --pill-compare-workspace-bottom:
    var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px));
}

.pill-compare-stage video,
.pill-compare-upload-source {
  position: absolute;
  inset: 0;
  z-index: 1;
}


.pill-compare-zoom > video:not(.has-live-video) {
  visibility: hidden;
}

.pill-compare-stage canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.pill-compare-zoom > img {
  object-position: 50% var(--pill-compare-still-center-y);
}


.pill-compare-zoom > img.pill-compare-match-overlay {
  object-position: center;
}

.pill-compare-demo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(70% 58% at 50% 45%, var(--pill-demo-bg-highlight), transparent 72%),
    var(--pill-demo-bg);
}

.pill-compare-demo__pill,
.pill-compare-demo__trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pill-compare-demo__pill {
  z-index: 2;
  object-fit: contain;
  object-position: 50% var(--pill-compare-still-center-y);
  -webkit-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
}

.pill-compare-demo__trace {
  z-index: 1;
  background: var(--pill-demo-outline);
  -webkit-mask: var(--pill-demo-mask) 50% var(--pill-compare-still-center-y) / contain no-repeat;
  mask: var(--pill-demo-mask) 50% var(--pill-compare-still-center-y) / contain no-repeat;
  filter:
    drop-shadow(0 0 2px var(--pill-demo-outline))
    drop-shadow(0 0 10px var(--pill-demo-glow));
  transform: scale(1.024);
  transform-origin: center;
  opacity: 0.82;
  animation: pill-compare-demo-trace 2.8s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes pill-compare-demo-trace {
  0%,
  100% {
    transform: scale(1.024);
    opacity: 0.78;
  }

  50% {
    transform: scale(1.04);
    opacity: 0.96;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pill-compare-demo__trace {
    animation: none;
    transform: scale(1.032);
    opacity: 0.9;
  }
}

.pill-compare-header-actions {
  position: absolute;
  inset: 0 0 auto;
  flex: none;
  width: 100%;
  height: var(--pill-compare-actionbar-h);
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) 12px 0;
  padding: var(--app-top-safe-reserve, env(safe-area-inset-top, 0px)) 12px 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  grid-gap: clamp(6px, 2vw, 12px);
  gap: clamp(6px, 2vw, 12px);
  background: transparent;
}

.pill-compare-header-actions__close {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.pill-compare-header-actions > .pill-compare-tool-switch {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.pill-compare-editor-context {
  position: static;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  min-width: 0;
  width: max-content;
  max-width: min(180px, calc(100vw - 174px));
  min-height: 38px;
  box-sizing: border-box;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 7px;
  border: 1px solid color-mix(in srgb, var(--pill-compare-fg) 28%, transparent);
  border-radius: 999px;
  color: var(--pill-compare-fg);
  background: var(--pill-compare-control);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px) saturate(1.22);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  animation: pill-compare-context-toast-cycle 10.8s cubic-bezier(.2, .78, .24, 1) both;
  will-change: opacity, transform;
}

.pill-compare-editor-context.is-anchor {
  border-color: color-mix(in srgb, #dcaa2e 48%, rgba(255, 255, 255, 0.18));
  border-color: color-mix(in srgb, var(--accent, #dcaa2e) 48%, rgba(255, 255, 255, 0.18));
  background: color-mix(in srgb, rgba(20, 24, 30, 0.66) 90%, #dcaa2e 10%);
  background: color-mix(in srgb, rgba(20, 24, 30, 0.66) 90%, var(--accent, #dcaa2e) 10%);
}

.pill-compare-editor-context__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--pill-compare-fg);
  background: var(--pill-compare-control-active);
  font-size: 16px;
}

.pill-compare-editor-context.is-anchor .pill-compare-editor-context__icon {
  color: #dcaa2e;
  color: var(--accent, #dcaa2e);
  background: color-mix(in srgb, #dcaa2e 14%, transparent);
  background: color-mix(in srgb, var(--accent, #dcaa2e) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #dcaa2e 30%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #dcaa2e) 30%, transparent);
}

.pill-compare-editor-context__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.08;
}

.pill-compare-editor-context__copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--pill-compare-fg);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-compare-editor-context__copy small {
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  color: var(--pill-compare-muted);
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes pill-compare-context-toast-cycle {
  0% {
    visibility: visible;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  3%, 95.6% {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pill-compare-editor-context {
    animation-name: pill-compare-context-toast-fade;
  }
}

@keyframes pill-compare-context-toast-fade {
  0% { visibility: visible; opacity: 0; }
  3%, 95.6% { visibility: visible; opacity: 1; }
  100% { visibility: hidden; opacity: 0; }
}

.pill-compare-header-actions__color {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.pill-compare-stage-cta__button--load { justify-self: start; }
.pill-compare-stage-cta__button--help { grid-column: 3; justify-self: end; }
.pill-compare-stage-cta__button:disabled { opacity: 0.42; cursor: not-allowed; }

.pill-compare-header-actions__trailing {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pill-compare-tool-switch {
  box-sizing: border-box;
  height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--pill-compare-control);
  box-shadow: inset 0 0 0 1px var(--pill-compare-line);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
}

.pill-compare-tool-switch .pill-compare-action {
  width: 44px;
  height: 40px;
  min-width: 44px;
  min-height: 40px;
  border-radius: 999px;
  opacity: 0.58;
}

.pill-compare-tool-switch .pill-compare-action.is-active {
  background: var(--pill-compare-control-active);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  color: var(--pill-compare-fg);
  opacity: 1;
}

.pill-compare-tool-switch .pill-compare-action:disabled {
  opacity: 0.28;
}

.pill-compare-stage.is-upload .pill-compare-upload-source {
  object-fit: contain;
  object-position: center;
}

.pill-compare-action,
.pill-compare-pill {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--pill-compare-fg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 22px;
  line-height: 1;
}

.pill-compare-action {
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}


.pill-compare-action > .dp-icon,
.pill-camera-mode-switch .dp-icon,
.pill-compare-stage-cta__button .dp-icon,
.pill-compare-editor-context__icon .dp-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

@media (hover: hover) and (pointer: fine) {
  .pill-compare-action:hover {
    opacity: 0.82;
  }
}

.pill-compare-action:active {
  opacity: 0.6;
}

.pill-compare-action:focus {
  outline: none;
}

.pill-compare-action:focus-visible {
  outline: 2px solid #dcaa2e;
  outline: 2px solid var(--accent, #dcaa2e);
  outline-offset: 2px;
}

.pill-compare-action:disabled {
  opacity: 0.32;
  cursor: default;
}

.pill-compare-action.is-active {
  color: var(--accent);
}

.pill-compare-action.is-unavailable,
.pill-compare-action.is-unavailable.is-active {
  color: inherit;
  opacity: 0.32;
  pointer-events: none;
}

.pill-compare-match-overlay {
  position: absolute;
  z-index: 4;
  transform:
    translate(-50%, -50%)
    translate(
      0px,
      0px
    )
    scale(1);
  transform:
    translate(-50%, -50%)
    translate(
      var(--pill-overlay-user-x, 0px),
      var(--pill-overlay-user-y, 0px)
    )
    scale(var(--pill-overlay-user-scale, 1));
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.4));
}

.pill-compare-match-overlay.is-contour-fit {
  mix-blend-mode: screen;
}

.pill-compare-match-overlay.is-reference-linework {
  
  mix-blend-mode: normal;
  filter:
    brightness(0) invert(1)
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.95))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

.pill-compare-match-overlay.is-reference-linework.is-wire-white {
  filter:
    brightness(0) invert(0.96) sepia(0.08)
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.98))
    drop-shadow(0 1px 4px rgba(0, 0, 0, 0.86)) !important;
}

.pill-compare-match-overlay.is-reference-linework.is-wire-black {
  filter:
    brightness(0) saturate(0)
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.98))
    drop-shadow(0 1px 4px rgba(255, 255, 255, 0.86)) !important;
}

:root:not(.theme-dark):not([data-theme="dark"])
  .pill-compare-match-overlay.is-reference-linework {
  
  filter:
    brightness(0)
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.98))
    drop-shadow(0 1px 3px rgba(255, 255, 255, 0.82));
}

.pill-compare-match-overlay.is-floating-preview {
  mix-blend-mode: normal;
}

.pill-compare-native-spinner {
  position: absolute;
  left: 50%;
  top: calc((100% - var(--pill-compare-sheet-current-h) + var(--pill-compare-actionbar-h)) / 2);
  z-index: 8;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
}

.pill-compare-native-spinner__glyph {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  animation: pill-compare-native-spin 0.8s linear infinite;
}

@keyframes pill-compare-native-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.pill-compare-native-debug {
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: auto;
}

.pill-compare-native-debug--toggle {
  position: absolute;
  right: 10px;
  top: calc(65% + 100px);
  z-index: 14;
}

.pill-compare-native-debug__toggle,
.pill-compare-native-debug__actions button {
  -webkit-appearance: none;
          appearance: none;
  border: 0;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
}

.pill-compare-stage-cta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--pill-compare-sheet-current-h) + 12px);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.pill-compare-stage.is-live .pill-compare-stage-cta {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  justify-content: center;
}

.pill-compare-stage-cta__button {
  -webkit-appearance: none;
          appearance: none;
  width: 40px;
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--pill-compare-control);
  color: var(--pill-compare-fg);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: auto;
}

.pill-compare-stage-cta__button:active {
  transform: scale(0.985);
}

.pill-compare-live-launch {
  position: static;
  grid-column: 2;
  z-index: 10;
  transform: none;
  pointer-events: auto;
}

.pill-compare-live-shutter {
  -webkit-appearance: none;
          appearance: none;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  background: transparent;
  color: #08090c;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.38),
    0 0 0 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill-compare-live-shutter:active {
  transform: scale(0.96);
}

.pill-compare-live-shutter:focus-visible {
  outline: 3px solid #dcaa2e;
  outline: 3px solid var(--accent, #dcaa2e);
  outline-offset: 4px;
}

.pill-compare-live-shutter:disabled {
  cursor: default;
  opacity: 0.82;
}

.pill-compare-live-shutter__face {
  display: block;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.pill-compare-live-shutter__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pill-compare-native-spin 0.8s linear infinite;
}

.pill-camera-mode-switch {
  position: absolute;
  z-index: 22;
  top: 50%;
  left: max(12px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--pill-compare-control);
  box-shadow: inset 0 0 0 1px var(--pill-compare-line), 0 8px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  transform: translateY(-50%);
}

.pill-camera-mode-switch button {
  -webkit-appearance: none;
          appearance: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--pill-compare-muted);
  background: transparent;
}

.pill-camera-mode-switch button.is-active {
  color: var(--pill-compare-fg);
  background: var(--pill-compare-control-active);
  box-shadow: inset 0 0 0 1px var(--pill-compare-line);
}

.pill-camera-zoom-indicator {
  -webkit-appearance: none;
          appearance: none;
  position: absolute;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--pill-compare-line);
  border-radius: 50%;
  color: var(--pill-compare-fg);
  background: var(--pill-compare-control);
  box-shadow: inset 0 0 0 1px var(--pill-compare-line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  font: 650 12px/1 system-ui, sans-serif;
}

.pill-camera-zoom-indicator:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.pill-camera-inspection-lens {
  position: absolute;
  z-index: 18;
  width: 144px;
  height: 144px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #05070a;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, calc(-100% - 20px));
  pointer-events: none;
}

.pill-camera-inspection-lens canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pill-camera-inspection-lens span {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.64);
  font: 650 10px/1 system-ui, sans-serif;
}

.pill-compare-overlay-nav {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.pill-compare-overlay-nav__button {
  -webkit-appearance: none;
          appearance: none;
  position: absolute;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--pill-compare-control);
  color: var(--pill-compare-fg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.pill-compare-overlay-nav__button--prev,
.pill-compare-overlay-nav__button--next {
  top: 50%;
  transform: translateY(-50%);
}

.pill-compare-overlay-nav__button--prev {
  left: 12px;
}

.pill-compare-overlay-nav__button--next {
  right: 12px;
}

.pill-compare-native-debug__panel {
  position: fixed;
  left: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  bottom: calc(var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)) + 12px);
  z-index: 2147483647;
  width: min(320px, calc(100vw - 24px));
  min-height: min(300px, calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 140px));
  min-height: min(300px, calc(100vh - var(--app-top-safe-reserve, env(safe-area-inset-top, 0px)) - var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)) - 140px));
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 110px);
  max-height: calc(100vh - var(--app-top-safe-reserve, env(safe-area-inset-top, 0px)) - var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)) - 110px);
  overflow: auto;
  padding: 8px;
  border-radius: 12px;
  background: rgba(6, 9, 13, 0.92);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  touch-action: pan-y;
}

.pill-compare-native-debug__status {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}

.pill-compare-native-debug__meta {
  margin-bottom: 8px;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.86);
}

.pill-compare-native-debug__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.pill-compare-native-debug__group {
  margin-bottom: 8px;
}

.pill-compare-native-debug__group-title {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.84);
}

.pill-compare-native-debug__row,
.pill-compare-native-debug__check {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 7px;
  font-size: 10px;
}

.pill-compare-native-debug__row span,
.pill-compare-native-debug__check span {
  color: rgba(255, 255, 255, 0.9);
}

.pill-compare-native-debug__row input[type="range"] {
  width: 100%;
}

.pill-compare-native-debug__check {
  flex-direction: row;
  align-items: center;
}

.pill-compare-native-debug__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.pill-compare-native-debug__actions--top {
  justify-content: flex-end;
  margin-top: 0;
  margin-bottom: 6px;
}

.pill-compare-native-debug__details {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
}

.pill-compare-native-debug__summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}

.pill-compare-native-debug__summary::-webkit-details-marker {
  display: none;
}

.pill-compare-native-debug__summary::after {
  content: " +";
}

.pill-compare-native-debug__details[open] .pill-compare-native-debug__summary::after {
  content: " -";
}

.pill-compare-color-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill-compare-color-dots {
  display: flex;
  gap: 5px;
}

.pill-compare-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.pill-compare-results-shell {
  --shell-handle-h: 26px;
  position: absolute;
  inset: auto 0 0;
  flex: none;
  height: var(--pill-compare-sheet-current-h);
  min-height: 112px;
  max-height: calc(100% - var(--pill-compare-actionbar-h));
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0;
  background: var(--pill-compare-surface);
  border-top: 1px solid var(--pill-compare-line);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  pointer-events: auto;
  overflow: hidden;
  transition: height 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

.pill-compare-results-shell.is-dragging {
  transition: none;
}

.pill-compare-shell-handle {
  -webkit-appearance: none;
          appearance: none;
  flex: 0 0 auto;
  width: 100%;
  height: var(--shell-handle-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.pill-compare-results-shell.is-dragging .pill-compare-shell-handle {
  cursor: grabbing;
}

.pill-compare-shell-handle__grip {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill-compare-fg) 24%, transparent);
  transition: background 140ms ease;
}

.pill-compare-shell-header {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0 12px 8px;
}

.pill-compare-shell-handle:hover .pill-compare-shell-handle__grip,
.pill-compare-shell-handle:focus-visible .pill-compare-shell-handle__grip {
  background: color-mix(in srgb, #d0872a 72%, transparent);
  background: color-mix(in srgb, var(--accent-strong, #d0872a) 72%, transparent);
}

.pill-compare-shell-handle:focus-visible {
  outline: none;
}

.pill-compare-shell-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .pill-compare-results-shell {
    transition: none;
  }
}

.pill-compare-results-rail,
.pill-compare-reagents,
.pill-compare-footer-text {
  pointer-events: auto;
}

.pill-compare-results-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 0 12px calc(12px + var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)));
  background: transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  align-content: start;
}

.pill-compare-results-rail .pill-compare-result-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 78px;
}

.pill-compare-results-rail::-webkit-scrollbar {
  display: none;
}

.pill-compare-results-window {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
}

.pill-compare-result-window-row {
  position: absolute;
  inset: 0 0 auto;
  height: 78px;
}

.pill-compare-result-card {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--pill-compare-line);
  background: color-mix(in srgb, var(--pill-compare-fg) 5.5%, transparent);
  color: var(--pill-compare-fg);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.pill-compare-result-card.has-open {
  grid-template-columns: minmax(0, 1fr) 52px;
}

.pill-compare-result-card__select {
  -webkit-appearance: none;
          appearance: none;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 26px 72px minmax(0, 1fr);
  align-items: center;
  grid-gap: 10px;
  gap: 10px;
  padding: 3px 8px 3px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.pill-compare-result-card__select.is-reference {
  grid-template-columns: 26px 112px minmax(0, 1fr);
}

.pill-compare-result-card__open {
  -webkit-appearance: none;
          appearance: none;
  width: 52px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--pill-compare-line);
  background: color-mix(in srgb, var(--pill-compare-fg) 3.5%, transparent);
  color: var(--pill-compare-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill-compare-result-card__select:hover,
.pill-compare-result-card__select:focus-visible,
.pill-compare-result-card__open:hover,
.pill-compare-result-card__open:focus-visible {
  background: color-mix(in srgb, var(--pill-compare-fg) 8%, transparent);
}

.pill-compare-result-card__select:focus-visible,
.pill-compare-result-card__open:focus-visible {
  outline: 2px solid rgba(145, 224, 255, 0.9);
  outline-offset: -3px;
}

.pill-compare-result-card.is-active {
  border-color: color-mix(in srgb, var(--pill-compare-fg) 70%, transparent);
  background: color-mix(in srgb, var(--pill-compare-fg) 9%, transparent);
}

.pill-compare-result-card__rank {
  color: var(--pill-compare-muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.pill-compare-result-card__thumb {
  width: 70px;
  height: 70px;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.11), transparent 58%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pill-compare-result-card__thumb.is-reference-pair {
  width: 112px;
  height: 70px;
  gap: 4px;
  overflow: visible;
  background: transparent;
}

.pill-compare-result-card__thumb.is-reference-pair .pill-compare-result-thumb-loader {
  position: relative;
  inset: auto;
  flex: 0 0 52px;
  width: 52px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.11), transparent 64%);
}

.pill-compare-result-thumb-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.pill-compare-result-card__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pill-compare-result-card__copy strong,
.pill-compare-result-card__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-compare-result-card__copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.pill-compare-result-card__select.is-reference .pill-compare-result-card__copy strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.25;
  max-height: 2.5em;
}

.pill-compare-result-card__copy small {
  color: var(--pill-compare-muted);
  font-size: 11px;
}

.pill-compare-rail-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  position: relative;
  z-index: 1;
  transition: opacity 180ms ease;
}

.pill-compare-results-header-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pill-compare-results-header-content.is-status {
  min-height: 62px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.pill-compare-results-header-title {
  color: var(--pill-compare-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-compare-reference-search {
  box-sizing: border-box;
  width: min(52vw, 240px);
  min-width: 120px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--pill-compare-fg) 28%, transparent);
  border-radius: 999px;
  background: var(--pill-compare-control);
  color: var(--pill-compare-fg);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pill-compare-fg) 28%, transparent);
}

.pill-compare-reference-search::placeholder {
  color: var(--pill-compare-muted);
}

.pill-compare-reference-search:focus-visible {
  border-color: color-mix(in srgb, var(--pill-compare-fg) 80%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pill-compare-fg) 18%, transparent);
}

.pill-compare-results-header-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--pill-compare-fg) 20%, transparent);
  border-top-color: var(--pill-compare-fg);
  border-radius: 50%;
  animation: pill-compare-native-spin 0.8s linear infinite;
}

.pill-compare-results-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pill-compare-results-toggle {
  -webkit-appearance: none;
          appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 1px solid var(--pill-compare-line);
  border-radius: 999px;
  background: var(--pill-compare-control);
  color: var(--pill-compare-fg);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.pill-compare-results-toggle:hover {
  background: var(--pill-compare-control-active);
  border-color: color-mix(in srgb, var(--pill-compare-fg) 32%, transparent);
}

.pill-compare-results-toggle:active {
  transform: scale(0.96);
}

.pill-compare-results-toggle.is-active {
  color: #fff;
  color: var(--bg, #fff);
  background: var(--pill-compare-fg);
  border-color: var(--pill-compare-fg);
}

.pill-compare-results-toggle:focus-visible {
  outline: 2px solid var(--pill-compare-fg);
  outline-offset: 3px;
}

.pill-compare-results-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.pill-compare-sheet-primary-select {
  display: block;
  padding: 4px 0 6px;
}

.pill-compare-sample-header {
  display: grid;
  grid-template-columns: minmax(0, 150px) auto;
  align-items: center;
  justify-content: space-between;
  grid-gap: 10px;
  gap: 10px;
}

.pill-compare-match-counter {
  color: var(--pill-compare-muted);
  font-size: 12px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill-compare-quant-summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 6px;
}

.pill-compare-quant-summary span {
  color: var(--pill-compare-muted);
  font-size: 12px;
}

.pill-compare-quant-summary strong {
  font-size: 13px;
}

.pill-compare-rail-thumb.is-loaded {
  opacity: 1;
}

.pill-compare-rail-pill-skeleton {
  position: relative;
  place-self: center;
  width: 70%;
  height: 42%;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.1) 18%, rgba(255, 255, 255, 0.28) 36%, rgba(255, 255, 255, 0.1) 54%) 0 0 / 220% 100%,
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 8px 20px rgba(0, 0, 0, 0.24);
  transform: rotate(-8deg);
  animation: pill-compare-thumb-skeleton 1.25s ease-in-out infinite;
}

.pill-compare-rail-pill-skeleton::after {
  content: "";
  position: absolute;
  top: 14%;
  bottom: 14%;
  left: 50%;
  width: 1px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.12);
}

@keyframes pill-compare-thumb-skeleton {
  0% {
    background-position: 140% 0, 0 0;
  }
  100% {
    background-position: -80% 0, 0 0;
  }
}

.pill-compare-result-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: -apple-system, "SF Pro Rounded", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.pill-compare-footer-text {
  grid-column: 1 / -1;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  padding: 10px 12px calc(10px + var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)));
  background: #000;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
}

.pill-compare-footer-text p {
  margin: 0;
}

.pill-compare-footer-text p + p {
  margin-top: 6px;
}

.pill-compare-reagents {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  grid-gap: 8px;
  gap: 8px;
  max-height: none;
  overflow: auto;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 0 12px calc(12px + var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)));
}

.pill-compare-reagent-ar-error {
  margin: 0 16px 8px;
  color: color-mix(in srgb, #ff9f0a 88%, white);
  font-size: 13px;
  line-height: 1.35;
}

.pill-compare-reagent {
  -webkit-appearance: none;
          appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  grid-gap: 8px;
  gap: 8px;
  
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--pill-compare-line);
  background: color-mix(in srgb, var(--pill-compare-surface) 92%, transparent);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.pill-compare-reagent__header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 36px;
  align-items: center;
  grid-gap: 8px;
  gap: 8px;
}

.pill-compare-reagent__details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(48px, auto);
  align-items: center;
  grid-gap: 12px;
  gap: 12px;
  min-height: 16px;
}

.pill-compare-reagent__remove,
.pill-compare-reagent__remove-spacer {
  width: 36px;
  height: 36px;
}

.pill-compare-reagent__remove {
  -webkit-appearance: none;
          appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--pill-compare-control-active);
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.pill-compare-reagent__remove:focus-visible {
  outline: 2px solid rgba(145, 224, 255, 0.9);
  outline-offset: 2px;
}

.pill-compare-reagent.has-palette-border {
  border-color: transparent;
  background:
    linear-gradient(var(--pill-compare-surface), var(--pill-compare-surface)) padding-box,
    var(--pill-compare-reagent-border) border-box;
}

.pill-compare-reagent.is-active {
  border-color: rgba(145, 224, 255, 0.56);
}

.pill-compare-reagent:focus-visible {
  outline: 2px solid rgba(145, 224, 255, 0.9);
  outline-offset: 2px;
}

.pill-compare-action:focus-visible,
.pill-compare-reagent-select:focus-visible,
.pill-compare-sample-select:focus-visible,
.pill-compare-mode-switch button:focus-visible {
  outline: 2px solid rgba(145, 224, 255, 0.9);
  outline-offset: 2px;
}

.pill-compare-reagent .reagent-name,
.pill-compare-reagent .reagent-color {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-compare-reagent-select-wrap {
  min-width: 0;
}

.pill-compare-reagent-select {
  width: 100%;
  min-width: 0;
  -webkit-appearance: auto;
          appearance: auto;
  color-scheme: inherit;
  border: 1px solid var(--pill-compare-line);
  border-radius: 10px;
  background: var(--pill-compare-surface);
  color: var(--pill-compare-fg);
  font: inherit;
  padding: 6px 10px;
}

.pill-compare-reagent-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
}

.pill-compare-reagent-select option,
.pill-compare-reagent-select optgroup {
  background: #fff;
  background: var(--card, #fff);
  color: var(--pill-compare-fg);
}

.reagent-dots {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 42px;
}

.reagent-dots--hidden {
  visibility: hidden;
}

.reagent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.reagent-dot.is-match-source {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.pill-compare-quant-type.is-disabled {
  opacity: 0.5;
  cursor: default;
}


.pill-compare-sample-row {
  display: block;
}

.pill-compare-sample-row .pill-compare-reagent-select-wrap {
  display: block;
}

.pill-compare-sample-select {
  
  width: fit-content;
  width: -webkit-fit-content;
  min-height: 42px;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-compare-sample-select option {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reagent-expected {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 48px;
}

.reagent-comparison {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  min-width: 0;
}

.reagent-comparison__row {
  display: grid;
  grid-template-columns: 58px minmax(48px, 1fr);
  align-items: center;
  grid-gap: 8px;
  gap: 8px;
  min-width: 0;
}

.reagent-comparison__label {
  color: var(--pill-compare-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.reagent-sample {
  display: inline-flex;
  align-items: center;
  min-width: 48px;
}

.reagent-sample__bar {
  display: block;
  width: 100%;
  min-width: 48px;
  height: 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.reagent-expected__bar {
  display: block;
  width: 100%;
  min-width: 48px;
  height: 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.reagent-expected__empty {
  color: rgba(255, 255, 255, 0.4);
}


.reagent-expected__bar--none {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.10),
    rgba(255, 255, 255, 0.10) 3px,
    transparent 3px,
    transparent 6px
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.30);
}

.reagent-confidence {
  align-self: center;
  font-weight: 700;
  text-align: right;
}

.pill-compare-reagent.is-match-positive {
  border-color: rgba(74, 222, 128, 0.66);
  box-shadow: 0 0 0 2px color-mix(in srgb, #4ade80 18%, transparent);
}

.pill-compare-reagent.is-match-positive .reagent-confidence {
  color: #4ade80;
}

.pill-compare-reagent.is-match-negative {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 0 2px color-mix(in srgb, #f87171 18%, transparent);
}

.pill-compare-reagent.is-match-negative .reagent-confidence {
  color: #f87171;
}

.pill-compare-reagent.is-match-negative .reagent-expected__bar {
  opacity: 0.45;
  filter: saturate(0.6);
}


.pill-compare-reagent.is-match-positive.has-palette-border,
.pill-compare-reagent.is-match-negative.has-palette-border {
  background: color-mix(in srgb, var(--pill-compare-surface) 92%, transparent);
}

.pill-compare-reagent-selection-card {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: clamp(88px, 21%, 180px);
  transform: translateX(-50%);
  min-width: min(280px, 72%);
  max-width: min(360px, calc(100% - 40px));
  display: grid;
  grid-gap: 3px;
  gap: 3px;
  padding: 10px 14px;
  border: 1px solid var(--pill-compare-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--pill-compare-surface) 92%, transparent);
  color: var(--pill-compare-fg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
  pointer-events: none;
}

.pill-compare-reagent-selection-card span {
  color: var(--pill-compare-muted);
  font-size: 12px;
}

.pill-compare-reagent.is-match-positive.has-palette-border {
  border-color: rgba(74, 222, 128, 0.66);
}

.pill-compare-reagent.is-match-negative.has-palette-border {
  border-color: rgba(248, 113, 113, 0.6);
}

@media (min-width: 761px) {
  .pill-compare-backdrop {
    background:
      radial-gradient(120% 90% at 50% 0%, rgba(130, 170, 255, 0.12), transparent 40%),
      #000;
  }

  .pill-compare-modal {
    height: min(100dvh, 920px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

}

@media (prefers-reduced-motion: reduce) {
  .pill-compare-action,
  .pill-compare-result-card,
  .pill-compare-overlay-summary,
  .pill-compare-overlay-link {
    transition: none !important;
  }
}


.pill-compare-intro {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding:
    calc(env(safe-area-inset-top, 0px) + 12px)
    12px
    calc(env(safe-area-inset-bottom, 0px) + 12px);
  padding:
    calc(var(--app-top-safe-reserve, env(safe-area-inset-top, 0px)) + 12px)
    12px
    calc(var(--app-bottom-safe-reserve, env(safe-area-inset-bottom, 0px)) + 12px);
  background: color-mix(in srgb, var(--pill-compare-stage-bg) 74%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  animation: pill-compare-intro-in 220ms cubic-bezier(.2, .78, .24, 1) both;
}


.pill-compare-intro__card:focus,
.pill-compare-intro__card:focus-visible {
  outline: none;
}

.pill-compare-intro__card {
  box-sizing: border-box;
  width: min(100%, 400px);
  max-height: 100%;
  overflow-y: auto;
  
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  border: 1px solid var(--pill-compare-line);
  border-radius: 22px;
  color: var(--pill-compare-fg);
  background: var(--pill-compare-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  text-align: start;
}

.pill-compare-intro__title {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.pill-compare-intro__rows {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pill-compare-intro__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}


.pill-compare-intro__row.is-tools {
  padding-inline-start: 50px;
}

.pill-compare-intro__icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 20px;
  color: var(--pill-compare-fg);
  background: var(--pill-compare-control-active);
}

.pill-compare-intro__icon .dp-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.pill-compare-intro__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.pill-compare-intro__copy strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.pill-compare-intro__copy p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.42;
  color: var(--pill-compare-muted);
}


.pill-compare-intro__note {
  margin-top: 6px !important;
  padding-inline-start: 9px;
  border-inline-start: 2px solid var(--pill-compare-line);
}

.pill-compare-intro__tools {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pill-compare-intro__tools li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--pill-compare-muted);
}


.pill-compare-intro__tool-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  cursor: default;
  background: var(--pill-compare-control-active);
}

.pill-compare-intro__disclaimer {
  margin: 18px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--pill-compare-muted);
}

.pill-compare-intro__start {
  margin-top: 16px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  color: #fff;
  color: var(--bg, #fff);
  background: #dcaa2e;
  background: var(--accent, #dcaa2e);
  -webkit-tap-highlight-color: transparent;
}

.pill-compare-intro__start:active {
  opacity: 0.82;
}

.pill-compare-intro__start:focus-visible {
  outline: 2px solid var(--pill-compare-fg);
  outline-offset: 2px;
}

@keyframes pill-compare-intro-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pill-compare-intro {
    animation: none;
  }
}


@media (max-height: 680px) {
  .pill-compare-intro {
    align-items: flex-start;
  }

  .pill-compare-intro__card {
    padding: 16px;
  }

  .pill-compare-intro__title {
    margin-bottom: 12px;
  }

  .pill-compare-intro__rows {
    gap: 13px;
  }

  .pill-compare-intro__icon,
  .pill-compare-intro__tool-icon {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .pill-compare-intro__row.is-tools {
    padding-inline-start: 44px;
  }

  .pill-compare-intro__start {
    margin-top: 12px;
    min-height: 42px;
  }
}

