/* Global Product Feedback widget — platform-wide, unobtrusive */

:root {
  --pf-accent: #0f766e;
  --pf-accent-hover: #0d9488;
  --pf-surface: #ffffff;
  --pf-ink: #0f172a;
  --pf-muted: #64748b;
  --pf-border: #e2e8f0;
  --pf-danger: #b91c1c;
  --pf-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  --pf-z: 100050;
}

/* Retired right-edge tab — kept in the DOM for older tests, never shown. */
.pf-edge-tab {
  display: none !important;
}

.pf-launcher {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: var(--pf-z);
  width: 72px;
  height: 72px;
  overflow: visible;
  pointer-events: none;
}

.pf-fab {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--pf-accent);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.4);
}

.pf-fab:focus-visible {
  outline: 2px solid #99f6e4;
  outline-offset: 2px;
}

.pf-launcher-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border: 1px solid #0f172a;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.pf-launcher-close:hover,
.pf-launcher-close:focus-visible {
  background: #f8fafc;
  outline: 2px solid #99f6e4;
  outline-offset: 1px;
}

.pf-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--pf-z) + 1);
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
}

.pf-overlay.pf-open {
  display: flex;
}

.pf-panel {
  width: min(440px, 100%);
  background: var(--pf-surface);
  color: var(--pf-ink);
  box-shadow: var(--pf-shadow);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  animation: pf-slide 160ms ease-out;
}

@keyframes pf-slide {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .pf-overlay {
    align-items: flex-end;
    justify-content: stretch;
  }
  .pf-panel {
    width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 16px 16px 0 0;
    animation: pf-sheet 180ms ease-out;
  }
  @keyframes pf-sheet {
    from {
      transform: translateY(28px);
    }
    to {
      transform: translateY(0);
    }
  }
}

.pf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--pf-border);
}

.pf-header h2 {
  margin: 0;
  font: 700 1.05rem/1.3 Georgia, "Times New Roman", serif;
}

.pf-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--pf-muted);
  padding: 4px 8px;
}

.pf-body {
  padding: 16px 18px 24px;
  overflow: auto;
  flex: 1;
}

.pf-lead {
  margin: 0 0 14px;
  color: var(--pf-muted);
  font-size: 0.95rem;
}

.pf-cats {
  display: grid;
  gap: 8px;
}

.pf-cat {
  text-align: left;
  border: 1px solid var(--pf-border);
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font: 600 0.95rem/1.3 inherit;
  color: var(--pf-ink);
}

.pf-cat:hover,
.pf-cat:focus-visible {
  border-color: var(--pf-accent);
  background: #f0fdfa;
  outline: none;
}

.pf-field {
  margin-bottom: 12px;
}

.pf-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  margin-bottom: 6px;
}

.pf-field input,
.pf-field textarea,
.pf-field select {
  width: 100%;
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.pf-field textarea {
  min-height: 110px;
  resize: vertical;
}

.pf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pf-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: 650 0.9rem/1.2 inherit;
  cursor: pointer;
}

.pf-btn-primary {
  background: var(--pf-accent);
  color: #fff;
}

.pf-btn-primary:hover,
.pf-btn-primary:focus-visible {
  background: var(--pf-accent-hover);
}

.pf-btn-secondary {
  background: #e2e8f0;
  color: var(--pf-ink);
}

.pf-btn-ghost {
  background: transparent;
  color: var(--pf-accent);
  text-decoration: underline;
  padding-left: 0;
}

.pf-error {
  color: var(--pf-danger);
  font-size: 0.85rem;
  margin: 6px 0 0;
}

.pf-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 14px;
}

.pf-success strong {
  display: block;
  margin-bottom: 6px;
}

.pf-preview {
  margin-top: 8px;
  border: 1px dashed var(--pf-border);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.85rem;
}

.pf-preview img {
  max-width: 100%;
  border-radius: 6px;
  display: block;
  margin-top: 6px;
}

.pf-selecting body,
body.pf-selecting {
  cursor: crosshair !important;
}

.pf-highlight {
  outline: 2px solid #0d9488 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.25) !important;
}

.pf-hidden {
  display: none !important;
}

/* Rate strip stays centred; launcher lives bottom-left so they do not collide. */

.pf-rate-strip {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: calc(var(--pf-z) + 2);
  width: min(640px, calc(100vw - 24px));
  transform: translateX(-50%) translateY(140%);
  opacity: 0;
  pointer-events: none;
  background: #0b1224;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.45);
  padding: 14px 16px 16px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.pf-rate-strip.pf-rate-open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.pf-rate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pf-rate-head h3 {
  margin: 0;
  font: 700 15px/1.3 "Segoe UI", system-ui, sans-serif;
  color: #f8fafc;
}

.pf-rate-head p {
  margin: 4px 0 0;
  font: 400 13px/1.4 "Segoe UI", system-ui, sans-serif;
  color: #94a3b8;
}

.pf-rate-dismiss {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.pf-rate-stars {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.pf-rate-star {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: #111827;
  color: #cbd5e1;
  font-size: 20px;
  cursor: pointer;
}

.pf-rate-star[aria-pressed="true"],
.pf-rate-star:hover,
.pf-rate-star:focus-visible {
  color: #fbbf24;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.pf-rate-more {
  display: none;
  margin-top: 12px;
}

.pf-rate-more.pf-rate-more-open {
  display: block;
}

.pf-rate-more textarea {
  width: 100%;
  min-height: 84px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #070d1f;
  color: #e2e8f0;
  padding: 10px;
  font: 400 14px/1.4 "Segoe UI", system-ui, sans-serif;
  resize: vertical;
}

.pf-rate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .pf-rate-strip {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}
