/* ── Pulse header accent (purple→blue, differs from walls orange→pink) ─────── */
.p-pulse-header {
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
}

/* ── Pulse directory card accent ──────────────────────────────────────────── */
.p-card-pulse:hover { border-color: #7c3aed; box-shadow: 0 3px 12px rgba(124,58,237,0.15); }
.p-card-pulse .w-card-title { color: #1e1b4b; }

/* ── Options builder ──────────────────────────────────────────────────────── */
.p-options-list { display: flex; flex-direction: column; gap: 0.5rem; }
.p-option-row { display: flex; align-items: center; gap: 0.5rem; }
.p-option-input {
  flex: 1; padding: 0.55rem 0.8rem;
  border: 1.5px solid #e5e7eb; border-radius: 8px;
  font-size: 0.92rem; font-family: inherit; transition: border-color 0.15s;
}
.p-option-input:focus { outline: none; border-color: #7c3aed; }
.p-remove-option {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  color: #d1d5db; padding: 0.25rem 0.4rem; border-radius: 6px; line-height: 1;
}
.p-remove-option:hover { color: #e1306c; background: #fef2f2; }

.p-add-btn {
  background: none; border: 1.5px dashed #c4b5fd; color: #7c3aed;
  border-radius: 8px; padding: 0.5rem 1rem; font-size: 0.85rem;
  cursor: pointer; font-family: inherit; font-weight: 600; width: 100%;
  transition: background 0.15s;
}
.p-add-btn:hover { background: #f5f3ff; }

/* ── Pulse view layout ────────────────────────────────────────────────────── */
.p-view-layout {
  max-width: 560px; margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* ── Poll card ────────────────────────────────────────────────────────────── */
.p-card {
  background: #fff; border-radius: 14px; padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.p-question-display {
  font-size: 1.25rem; font-weight: 700; color: #1e1b4b;
  margin-bottom: 1.25rem; line-height: 1.4;
}

/* ── Cover image on pulse detail page ─────────────────────────────────────── */
.p-cover-img {
  display: block;
  width: 100%; max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* ── Media embed (YouTube / TikTok / Vimeo / Facebook) ───────────────────── */
.p-media-embed {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  margin-bottom: 1rem;
}
.p-media-embed--vertical {
  max-width: 315px;
  aspect-ratio: 9 / 16;
  margin-left: auto;
  margin-right: auto;
}
.p-media-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.p-media-img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.p-media-link {
  padding: 0.5rem 0.75rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  word-break: break-all;
  margin-bottom: 1rem;
}
.p-media-link a { color: #7c3aed; }

/* ── Link preview wrapper in the create form ─────────────────────────────── */
.p-link-preview-wrap {
  margin-top: 0.5rem;
  border-radius: 10px;
  overflow: hidden;
}

/* ── Vote buttons ─────────────────────────────────────────────────────────── */
.p-vote-options { display: flex; flex-direction: column; gap: 0.6rem; }
.p-vote-btn {
  display: block; width: 100%;
  padding: 0.9rem 1.1rem; border: 2px solid #e5e7eb;
  background: #fafafa; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600; text-align: left;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.p-vote-btn:hover:not(:disabled) { border-color: #7c3aed; background: #f5f3ff; transform: translateY(-1px); }
.p-vote-btn:active:not(:disabled) { transform: none; }
.p-vote-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Creator hint ─────────────────────────────────────────────────────────── */
.p-creator-hint {
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 8px; padding: 0.6rem 0.9rem;
  font-size: 0.82rem; color: #92400e; margin-bottom: 1rem;
}

/* ── Results bars ─────────────────────────────────────────────────────────── */
.p-results-title {
  font-size: 1rem; font-weight: 700; color: #7c3aed; margin-bottom: 1rem;
}
.p-bars { display: flex; flex-direction: column; gap: 0.9rem; }
.p-bar-row { display: flex; flex-direction: column; gap: 0.3rem; }
.p-bar-label {
  font-size: 0.9rem; font-weight: 600; color: #374151;
  display: flex; justify-content: space-between; align-items: center;
}
.p-bar-voted .p-bar-label { color: #7c3aed; }
.p-voted-check { font-size: 0.8rem; color: #7c3aed; font-weight: 700; }
.p-bar-track {
  height: 26px; background: #f3f4f6; border-radius: 8px; overflow: hidden;
}
.p-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #a5b4fc, #818cf8);
  border-radius: 8px; transition: width 0.7s ease;
  min-width: 4px;
}
.p-bar-voted .p-bar-fill {
  background: linear-gradient(90deg, #7c3aed, #4f46e5);
}
.p-bar-stats { font-size: 0.78rem; color: #6b7280; }
.p-total {
  font-size: 0.85rem; color: #9ca3af; margin-top: 1rem;
  text-align: right; border-top: 1px solid #f3f4f6; padding-top: 0.75rem;
}

/* ── Attach button (pulse variant — text label, not icon-only) ────────────── */
.w-attach-btn--pulse {
  width: auto; height: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem; font-weight: 600;
  background: #f5f3ff; color: #5b21b6;
  border: 1px solid #c4b5fd; border-radius: 8px;
}
.w-attach-btn--pulse:hover { background: #ede9fe; }

/* ── Cover image attachment UI (pulse create form) ────────────────────────── */
.w-pulse-img-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-top: 0.35rem;
}
.w-pulse-img-hint {
  font-size: 0.78rem; color: #6b7280;
}
.w-pulse-img-preview {
  position: relative; display: inline-block; margin-top: 0.5rem;
}
.w-pulse-img-preview img {
  display: block; max-width: 100%; max-height: 200px;
  border-radius: 8px; border: 1px solid #e5e7eb;
}
.w-img-clear-btn {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── Initial link on poll detail page ────────────────────────────────────── */
.p-initial-link {
  font-size: 0.88rem; margin-bottom: 1rem;
  padding: 0.5rem 0.75rem; background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: 8px;
}
.p-initial-link a { color: #065f46; word-break: break-all; }

/* ── Share / QR section ───────────────────────────────────────────────────── */
.p-share { text-align: center; }
.p-share h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; color: #374151; }
.p-qr-img { border-radius: 10px; border: 1px solid #e5e7eb; display: block; margin: 0 auto 0.75rem; }
.p-share-label { font-size: 0.78rem; color: #9ca3af; margin-bottom: 0.5rem; }
.p-share-link {
  display: block; font-size: 0.78rem; color: #7c3aed;
  word-break: break-all; text-decoration: underline;
  background: #f5f3ff; border-radius: 6px; padding: 0.4rem 0.6rem;
}

/* ── Map ──────────────────────────────────────────────────────────────────── */
.p-map {
  width: 100%; height: 200px; border-radius: 12px;
  border: 1px solid #e5e7eb; overflow: hidden; position: relative; z-index: 0;
}

/* ── Pulse badge in header ────────────────────────────────────────────────── */
.w-badge-location { background: #ede9fe; color: #5b21b6; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .p-view-layout { padding: 1rem 0.75rem 3rem; }
  .p-card { padding: 1.1rem; }
  .p-question-display { font-size: 1.1rem; }
}
