.reclaim-popup {
  position: fixed;
  /* Lifted clear of the bottom of the page. At 20px the panel landed inside the
     sticky bars sites like to put there — cookie notices, CTA bars, chat
     launchers are all roughly 50-60px tall — so it overlapped them on load.
     Only the initial position: dragging sets `top`/`left` and `bottom: auto`. */
  bottom: 64px;
  right: 20px;
  width: 320px;
  max-height: 85vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 0;
  font-family:
    "SF Pro Display",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  z-index: 9999;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 13px;
  opacity: 1;
  transform: translateY(0);
  will-change: transform, opacity;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.reclaim-popup::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.reclaim-popup.dragging {
  cursor: grabbing;
  user-select: none;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  transform: scale(1.01);
}

.reclaim-popup-header {
  display: flex;
  align-items: center;
  padding: 12px 18px 8px 18px;
  margin-bottom: 0;
  cursor: grab;
  user-select: none;
  border-radius: 16px 16px 0 0;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reclaim-popup-header:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.reclaim-popup-header:active {
  cursor: grabbing;
}

/* Drag affordance: the conventional dot-grid grabber (4x2), drawn with one tiled
   radial gradient rather than eight elements. `margin: 0 auto` centres it in the
   flex header without setting justify-content, so re-enabling the commented-out
   logo and title above still lays out as it used to. */
.reclaim-drag-handle {
  margin: 0 auto;
  /* Exact multiples of background-size, or the last column/row renders as a
     clipped half-dot: 20/5 = 4 columns, 10/5 = 2 rows. */
  width: 20px;
  height: 10px;
  /* Let the mousedown land on the header, matching .reclaim-popup-logo. */
  pointer-events: none;
  background-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.55) 1px,
    transparent 1.3px
  );
  background-size: 5px 5px;
  transition: background-image 0.2s ease;
}

/* Brighten with the header's own hover, and hold it bright while dragging so the
   handle reads as the thing being held. */
.reclaim-popup-header:hover .reclaim-drag-handle,
.reclaim-popup.dragging .reclaim-drag-handle {
  background-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.9) 1px,
    transparent 1.3px
  );
}

.reclaim-popup-content {
  /* Symmetric. The gap below the header's border was 8px while the gap under the
     last card was 16px, which read as the panel sagging at the bottom. */
  padding: 12px 18px 12px 18px;
  display: flex;
  flex-direction: column;
  /* Hug the content. This used to be `center` inside a `min-height: 280px` box,
     which was fine when the info grid filled it; with only the session id and
     the status card left it padded the panel out with dead space. */
  justify-content: flex-start;
  min-height: 0;
  max-height: 400px;
  overflow-y: auto;
}

.reclaim-popup-logo {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.reclaim-popup-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

/* The Source / Description / Data Required grid that used to sit above the
   session id is gone — the popup shows the session id and the verification
   status only. `.reclaim-info-label` and `.reclaim-info-value` below are kept:
   the session-id row still uses both. */

.reclaim-info-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  margin-right: 8px;
  width: 90px;
}

.reclaim-info-value {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  line-height: 1.3;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex: 1;
}

.reclaim-info-value:hover {
  color: #3b82f6;
}

.reclaim-info-tooltip {
  position: absolute;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  max-width: 280px;
  right: 0;
  top: 100%;
  margin-top: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10001;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reclaim-info-tooltip.show {
  opacity: 1;
  pointer-events: auto;
}

.reclaim-info-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1f2937;
}

/* Session section */
.reclaim-session-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.15);
  margin-bottom: 10px;
  position: relative;
}

.reclaim-session-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.reclaim-session-content .reclaim-info-label {
  margin-bottom: 4px;
}

.reclaim-session-content .reclaim-info-value {
  text-align: left;
  font-size: 12px;
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
  word-break: break-all;
}

.reclaim-copy-icon {
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 8px;
  flex-shrink: 0;
}

.reclaim-copy-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.reclaim-copy-icon:active {
  transform: translateY(0);
}

.reclaim-copy-icon svg {
  width: 14px;
  height: 14px;
  fill: rgba(255, 255, 255, 0.8);
  transition: fill 0.2s ease;
}

.reclaim-copy-icon:hover svg {
  fill: #ffffff;
}

.reclaim-copy-feedback {
  position: absolute;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  top: -32px;
  left: 50%;
}

.reclaim-copy-feedback.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Combined verification container */
.reclaim-verification-container {
  /* Nothing follows this container, so a bottom margin here is just trailing
     space under the last card. */
  margin-bottom: 0;
  transform: translateY(0);
  opacity: 1;
  will-change: transform, opacity;
  transition: all 0.3s ease;
}

/* Compact steps */
.reclaim-steps-container {
  padding: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  transform: translateY(0);
  opacity: 1;
  will-change: transform, opacity;
  transition: all 0.3s ease;
}

.reclaim-steps-container.hidden {
  display: none;
}

.reclaim-steps-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.reclaim-steps-icon {
  font-size: 12px;
  margin-right: 6px;
}

.reclaim-steps-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.reclaim-steps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reclaim-step {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.reclaim-step:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.reclaim-step-number {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.reclaim-step-text {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Status container */
.reclaim-status-container {
  padding: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.15);
  transform: translateY(8px);
  opacity: 0;
  will-change: transform, opacity;
  transition: all 0.3s ease;
  margin-top: 10px;
  display: none;
}

.reclaim-status-container.visible {
  transform: translateY(0);
  opacity: 1;
  display: block;
}

.reclaim-status-progress {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.reclaim-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.reclaim-status-text {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.reclaim-progress-counter {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.reclaim-progress-bar-container {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.reclaim-progress-bar-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: reclaim-shimmer 2s infinite;
}

.reclaim-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.reclaim-progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: reclaim-progress-shine 2s infinite;
}

.reclaim-progress-bar.success {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.reclaim-progress-bar.error {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.reclaim-status-message {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  line-height: 1.3;
}

.reclaim-status-icon {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.reclaim-icon-circle {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  animation: reclaim-success-pulse 2s infinite;
}

.reclaim-icon-circle.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.reclaim-circular-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px 0;
}

.reclaim-circular-loader svg {
  width: 32px;
  height: 32px;
  animation: reclaim-rotate 2s linear infinite;
}

.reclaim-circular-loader circle {
  stroke: url(#progressGradient);
  stroke-width: 3;
  stroke-dasharray: 150, 200;
  stroke-dashoffset: -10;
  stroke-linecap: round;
  fill: none;
  animation: reclaim-dash 1.5s ease-in-out infinite;
}

@keyframes reclaim-rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes reclaim-dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124;
  }
}

@keyframes reclaim-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes reclaim-progress-shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes reclaim-success-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes reclaim-appear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes reclaim-success-checkmark {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.reclaim-success-checkmark {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: reclaim-success-checkmark 0.5s ease forwards;
}

/* For small screens */
@media (max-width: 400px) {
  .reclaim-popup {
    width: calc(100% - 24px);
    /* Lifted too, but less: max-height is 90vh here, so a large bottom offset
       would push the top of the panel off a short viewport. */
    bottom: 24px;
    right: 12px;
    left: 12px;
    max-width: 100%;
    max-height: 90vh;
  }

  .reclaim-popup-content {
    min-height: 0;
    max-height: calc(90vh - 80px);
  }

  .reclaim-info-value {
    max-width: 150px;
  }

  .reclaim-info-tooltip {
    max-width: calc(100vw - 60px);
    right: -20px;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  .reclaim-popup {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    border-color: rgba(255, 255, 255, 0.15);
  }
}
