/* R13.2.F+G — floating, movable image preview window. */

.fp-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  max-height: min(88vh, 88dvh);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  z-index: 9900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.fp-window.fp-dragging {
  user-select: none;
  transition: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.fp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #faf8ff, #f3f0ff);
  border-bottom: 1px solid #e5e7eb;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.fp-header:active { cursor: grabbing; }
.fp-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-close {
  background: transparent;
  border: 0;
  color: #6b7280;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fp-close:hover { background: rgba(0, 0, 0, 0.06); color: #111827; }
.fp-close:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }

.fp-imgwrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: repeating-conic-gradient(#f8fafc 0% 25%, #ffffff 0% 50%) 0 / 20px 20px;
  overflow: auto;
}
.fp-img {
  max-width: 100%;
  max-height: 52vh;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: block;
}

.fp-meta {
  padding: 10px 14px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  background: #fafafa;
  max-height: 22vh;
  overflow-y: auto;
}
.fp-meta-row {
  display: grid;
  grid-template-columns: 66px 1fr 28px;
  align-items: center;
  gap: 8px;
}
.fp-meta-label {
  font-weight: 600;
  color: #4b5563;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.fp-meta-value {
  color: #1f2937;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}
.fp-copy-btn {
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 100ms ease;
}
.fp-copy-btn:hover { background: rgba(192, 132, 252, 0.14); }
.fp-copy-btn:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }

.fp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 14px 14px;
  border-top: 1px solid #f3f4f6;
}
.fp-action {
  flex: 1 1 120px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 100ms ease, transform 100ms ease;
}
.fp-action:hover { background: #f9fafb; transform: translateY(-1px); }
.fp-action:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }
.fp-action-primary {
  background: #c084fc;
  border-color: #a855f7;
  color: #fff;
}
.fp-action-primary:hover { background: #a855f7; }

/* Toast */
.fp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1f2937;
  color: #f9fafb;
  padding: 9px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9999;
  max-width: min(86vw, 480px);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}
.fp-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .fp-window { width: 96vw; max-height: 90dvh; }
  .fp-meta-row { grid-template-columns: 56px 1fr 28px; }
}
