/* ===== ShopKitty Vote App - Mobile First CSS ===== */

:root {
  --pink: #ff6b9d;
  --pink-light: #ff8fb8;
  --pink-dark: #e8527a;
  --purple: #c084fc;
  --purple-dark: #9333ea;
  --green: #22c55e;
  --green-light: #bbf7d0;
  --red: #ef4444;
  --red-light: #fecaca;
  --yellow: #fbbf24;
  --bg: #fdf2f8;
  --bg-card: #ffffff;
  --text: #1e1e2e;
  --text-muted: #6b7280;
  --border: #f3e8ff;
  --shadow: 0 4px 24px rgba(236, 72, 153, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px 40px;
}

.header {
  text-align: center;
  padding: 24px 0 8px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo .cat {
  font-size: 32px;
  -webkit-text-fill-color: initial;
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Cards ===== */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Forms ===== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #faf5ff;
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--pink);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Single-line comment fields in multi-item vote forms */
#pickComment,
.rate-item-comment {
  min-height: unset;
  height: auto;
  resize: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #c4b5d0;
}

/* ===== Input with Action Button ===== */

.input-with-action {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-with-action input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.btn-preview {
  flex-shrink: 0;
  width: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #faf5ff;
  font-size: 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-preview:hover {
  border-color: var(--purple);
  background: #f3e8ff;
}

.btn-preview:active {
  transform: scale(0.95);
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: white;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--pink-light);
  background: #fdf2f8;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
}

/* ===== Vote Buttons ===== */

.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}

.vote-btn .emoji {
  font-size: 48px;
  transition: transform 0.25s;
}

.vote-btn .label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.vote-btn:active {
  transform: scale(0.95);
}

.vote-btn.selected-up {
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.2);
}

.vote-btn.selected-up .emoji {
  transform: scale(1.2);
}

.vote-btn.selected-up .label {
  color: var(--green);
}

.vote-btn.selected-down {
  border-color: var(--red);
  background: var(--red-light);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.vote-btn.selected-down .emoji {
  transform: scale(1.2);
}

.vote-btn.selected-down .label {
  color: var(--red);
}

/* ===== Comment Chips ===== */

.comment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-chips.hidden {
  display: none;
}

.comment-chip {
  background: var(--border-color, #f3e8ff);
  color: #9333ea;
  border: 1.5px solid #e9d5ff;
  border-radius: 16px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.comment-chip.selected {
  background: #9333ea;
  color: #fff;
  border-color: #9333ea;
}

/* ===== Results ===== */

.results-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.bar-container {
  flex: 1;
  height: 32px;
  border-radius: 16px;
  background: #f1f5f9;
  overflow: hidden;
  display: flex;
}

.bar-up {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #4ade80);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.bar-down {
  height: 100%;
  background: linear-gradient(90deg, #f87171, var(--red));
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.bar-label {
  font-size: 12px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

.vote-count {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 12px 0;
}

.vote-count-item {
  text-align: center;
}

.vote-count-item .count {
  font-size: 36px;
  font-weight: 800;
}

.vote-count-item .count.up {
  color: var(--green);
}

.vote-count-item .count.down {
  color: var(--red);
}

.vote-count-item .count-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Comments ===== */

.comments-section {
  margin-top: 20px;
}

.comments-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-card {
  background: #faf5ff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.comment-vote-icon {
  font-size: 16px;
}

.comment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.comment-text {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
}

.no-comments {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Product Preview ===== */

.product-preview {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  margin-bottom: 16px;
}

.product-preview .product-url-bar {
  background: #faf5ff;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.product-preview .product-url-bar .url-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-preview .product-frame {
  width: 100%;
  height: 360px;
  border: none;
  background: white;
}

.product-context {
  background: linear-gradient(135deg, #fdf2f8, #f3e8ff);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.product-context .context-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== Feedback focus tags (vote + results context cards) ===== */
.feedback-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.feedback-tags-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  align-self: center;
}

.feedback-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #fdf4ff, #f0f5ff);
  color: var(--purple);
  border: 1.5px solid #e9d5ff;
  white-space: nowrap;
}

/* Feedback categories with per-category context notes (vertical list) */
.feedback-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.feedback-note-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.feedback-note {
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  padding-left: 4px;
}

/* ===== Structured Feedback rating cards ===== */
.sf-product-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--purple);
  text-decoration: none;
  font-weight: 500;
}
.sf-product-link:hover { text-decoration: underline; }

.sf-category-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.sf-category-card.sf-category-rated { border-color: var(--purple); }

.sf-category-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.sf-category-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: -4px 0 10px;
  padding: 8px 10px;
  background: var(--surface-alt, #f7f7fb);
  border-left: 3px solid var(--purple);
  border-radius: 6px;
}

.sf-rating-buttons {
  display: flex;
  gap: 8px;
}

.sf-rating-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sf-rating-btn:hover { border-color: var(--purple); }

.sf-rating-btn[data-val="no"].selected    { background: #fee2e2; border-color: #f87171; color: #b91c1c; }
.sf-rating-btn[data-val="maybe"].selected { background: #fef9c3; border-color: #fbbf24; color: #92400e; }
.sf-rating-btn[data-val="100%"].selected  { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #4ade80; color: #166534; }

/* Structured rate-each — per-product category ratings inside the stepper */
.rate-sf-ratings { margin-top: 10px; text-align: left; }

/* Structured feedback — results display */
.sf-result-category {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.sf-result-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sf-result-category-name { font-size: 14px; font-weight: 700; color: var(--text); }
.sf-result-category-total { font-size: 12px; color: var(--text-muted); }
.sf-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sf-result-row:last-child { margin-bottom: 0; }
.sf-result-label { font-size: 13px; width: 78px; flex-shrink: 0; }
.sf-result-bar-wrap {
  flex: 1;
  height: 18px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  overflow: hidden;
}
.sf-result-bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s ease; min-width: 2px; }
.sf-bar-no    { background: #f87171; }
.sf-bar-maybe { background: #fbbf24; }
.sf-bar-yes   { background: #4ade80; }
.sf-result-count { font-size: 13px; font-weight: 600; color: var(--text-muted); width: 22px; text-align: right; flex-shrink: 0; }

/* ===== Share Link Box ===== */

.link-box {
  background: #faf5ff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px dashed var(--purple);
}

.link-box .link-text {
  flex: 1;
  font-size: 13px;
  color: var(--purple-dark);
  word-break: break-all;
  font-weight: 500;
}

.link-box .copy-btn {
  flex-shrink: 0;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.link-box .copy-btn:active {
  transform: scale(0.95);
}

/* ===== Success State ===== */

.success-state {
  text-align: center;
  padding: 20px 0;
}

.success-state .checkmark {
  font-size: 64px;
  margin-bottom: 12px;
}

.success-state h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.success-state p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 4px;
}

/* ===== App Download Buttons ===== */

.app-download-section {
  margin-top: 24px;
  text-align: center;
}

.app-download-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.app-open-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  margin-bottom: 0;
}

.app-download-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.app-store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  min-width: 140px;
  transition: opacity 0.15s;
}

.app-store-btn:hover { opacity: 0.85; }

.app-store-btn--android { background: #2d6a2d; }

.app-store-btn--disabled,
.app-store-btn--disabled.app-store-btn--android {
  background: #c0c0c0;
  color: #888;
  pointer-events: none;
  cursor: default;
  opacity: 1;
}
.app-store-btn--disabled:hover { opacity: 1; }

.app-store-btn .store-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.app-store-btn .store-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.app-store-btn .store-sub {
  font-size: 10px;
  opacity: 0.75;
  line-height: 1.2;
}

.app-store-btn .store-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

/* ===== Test Banner ===== */

.test-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.test-banner:active {
  transform: scale(0.98);
}

/* ===== Verdict ===== */

.verdict {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.verdict.positive {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.verdict.negative {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
}

.verdict.neutral {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.verdict .verdict-emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

.verdict .verdict-text {
  font-size: 16px;
  font-weight: 700;
}

/* ===== Waiting state ===== */

.waiting-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.waiting-state .waiting-emoji {
  font-size: 48px;
  margin-bottom: 12px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== Utility ===== */

.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-purple {
  background: #f3e8ff;
  color: var(--purple-dark);
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */

@media (max-width: 430px) {
  .app {
    padding: 0 16px 32px;
  }
}

/* ===== Product link fallback ===== */

.product-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #faf5ff;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
}

.product-link-card:hover {
  border-color: var(--pink-light);
}

.product-link-card .link-icon {
  font-size: 32px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.thumb-tap-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.thumb-hint {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.product-link-card .link-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-link-card .link-info .link-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.product-link-card .link-info .link-url {
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-link-card .link-info .link-product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 2px;
  line-height: 1.3;
}

.product-link-card .link-info .link-product-price {
  font-size: 13px;
  color: var(--purple);
  font-weight: 600;
  margin-top: 1px;
}

.product-link-card .arrow {
  font-size: 18px;
  color: var(--text-muted);
}

.product-link-card .link-arrow {
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.product-link-card .link-arrow:hover {
  background: rgba(0,0,0,0.06);
}

.product-thumb-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* ===== Product image card ===== */
.product-image-card {
  padding: 0;
  overflow: hidden;
}

.product-image-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 14px 16px 10px;
  line-height: 1.3;
  text-align: center;
}

.product-image-full {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 320px;
  background: #f8f8f8;
}

.product-brand-box {
  margin: 12px 12px 0;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: var(--bg-soft, #f7f6fb);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.product-url-under {
  display: block;
  padding: 10px 16px 14px;
  font-size: 13px;
  color: var(--purple);
  text-align: center;
  text-decoration: none;
  word-break: break-all;
}

.product-url-under:hover { text-decoration: underline; }

.image-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.product-description {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-soft, #f7f6fb);
  border-radius: 10px;
}

/* ===== Image popup ===== */

.image-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-popup.hidden {
  display: none;
}

.image-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.image-popup-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  max-width: min(90vw, 480px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.image-popup-content img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
}

.image-popup-close {
  position: absolute;
  top: -18px;
  right: -12px;
  height: 36px;
  padding: 0 12px 0 14px;
  border-radius: 18px;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  white-space: nowrap;
}

.image-popup-close-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pink-dark);
}

.image-popup-close-x {
  font-size: 15px;
}

.image-popup-close:hover {
  color: var(--text);
}

/* ===== Name input ===== */

.inline-name {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.inline-name input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: #faf5ff;
}

.inline-name input:focus {
  outline: none;
  border-color: var(--pink);
  background: white;
}

/* ===== Request List (homepage) ===== */

.request-list-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.request-list-row .request-list-item {
  flex: 1;
  margin-bottom: 0;
}

.btn-delete-request {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: #fff0f0;
  border: 2px solid #ffd0d0;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.btn-delete-request:hover {
  background: #ffe0e0;
  border-color: #ff9999;
}

.btn-delete-request:active {
  transform: scale(0.95);
}

.request-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #faf5ff;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
}

.request-list-item:hover {
  border-color: var(--pink-light);
}

.request-list-item:active {
  transform: scale(0.98);
}

.request-list-item .request-item-info {
  flex: 1;
  min-width: 0;
}

/* ===== Request list thumbnails ===== */

.request-item-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.request-item-thumb--img {
  object-fit: cover;
}

.request-item-thumb--icon {
  font-size: 22px;
  background: #f3e8ff;
}

.request-item-thumb--multi {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  font-size: 16px;
  font-weight: 800;
  flex-direction: column;
  gap: 0;
  text-align: center;
  line-height: 1.1;
}

.request-list-item .request-item-context {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-list-item .request-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.request-list-item .arrow {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Multi-item Request Form ===== */

.form-section-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.items-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.items-count-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.item-row {
  margin-bottom: 10px;
}

.item-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-row-top .input-with-action {
  flex: 1;
}

.item-number-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-item {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 2px solid #fecaca;
  background: #fff5f5;
  border-radius: 8px;
  font-size: 13px;
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-remove-item:hover {
  background: var(--red-light);
  border-color: var(--red);
}

.btn-add-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--purple-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
  margin-top: 4px;
}

.btn-add-item:hover {
  border-color: var(--purple);
  background: #f3e8ff;
}

.item-meta-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-left: 34px;
  padding: 6px 10px;
  background: #f9f5ff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.item-meta-preview.hidden { display: none; }

.meta-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.meta-thumb-ph {
  font-size: 20px;
  flex-shrink: 0;
}

.meta-preview-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.item-meta-loading {
  display: flex;
  align-items: center;
  margin-top: 4px;
  margin-left: 34px;
}

.item-meta-loading.hidden { display: none; }

.meta-loading-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Vote Type Selector ===== */

.vote-type-section {
  margin-bottom: 16px;
  padding: 16px;
  background: #faf5ff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.vote-type-section.hidden { display: none; }

.vote-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vote-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: left;
  font-family: inherit;
}

.vote-type-option:hover {
  border-color: var(--purple);
  background: #f9f5ff;
}

.vote-type-option.selected {
  border-color: var(--pink);
  background: linear-gradient(135deg, #fff0f5, #f5f0ff);
  box-shadow: 0 2px 12px rgba(236, 72, 153, 0.15);
}

.vote-type-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

.vote-type-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vote-type-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.vote-type-text span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ===== Multi-vote hint ===== */

.multi-vote-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  margin-top: -8px;
}

/* ===== Pick One Carousel (vote.html) ===== */

.pick-carousel-section { overflow: hidden; }

.pick-carousel-wrap {
  margin: 0 -20px;
  overflow: hidden;
}

.pick-carousel {
  display: flex;
  gap: 12px;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 20px 12px;
}
.pick-carousel::-webkit-scrollbar { display: none; }

.pick-carousel-card {
  scroll-snap-align: center;
  flex-shrink: 0;
  width: calc(72vw - 20px);
  max-width: 280px;
  min-width: 170px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pick-carousel-card:active { transform: scale(0.97); }

.pick-carousel-card.selected {
  border-color: var(--pink);
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.28);
}

.pick-carousel-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pick-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pick-carousel-ph { font-size: 48px; }

.pick-carousel-num {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,0.92);
  color: var(--purple-dark);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.pick-carousel-card.selected .pick-carousel-num {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
}

.pick-carousel-ext {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.92);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: background 0.12s, color 0.12s;
}
.pick-carousel-ext:hover { background: white; color: var(--purple); }

.pick-carousel-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: var(--pink);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(236, 72, 153, 0.45);
}
.pick-carousel-check.hidden { display: none; }

.pick-carousel-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pick-carousel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-carousel-price {
  font-size: 13px;
  color: var(--purple);
  font-weight: 600;
}

/* Carousel dots */
.pick-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 2px 0 10px;
}

.pick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, width 0.18s;
}

.pick-dot.active {
  background: var(--pink);
  width: 20px;
  border-radius: 4px;
}

/* None of the above option */
.pick-none-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, opacity 0.18s;
  text-align: left;
  font-family: inherit;
  margin-top: 8px;
  opacity: 0.72;
  -webkit-tap-highlight-color: transparent;
}
.pick-none-card:hover { opacity: 1; border-color: var(--text-muted); }
.pick-none-card.selected {
  opacity: 1;
  border-style: solid;
  border-color: var(--pink);
  background: linear-gradient(135deg, #fff0f5, #f5f0ff);
}
.pick-none-num { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }

/* Shared: pick info / check used by none card */
.pick-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pick-item-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item-url { font-size: 12px; color: var(--text-muted); }
.pick-item-price { font-size: 13px; color: var(--purple); font-weight: 600; }

.pick-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--pink);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pick-check.hidden { display: none; }



/* ===== Rate Each Vote (vote.html) ===== */

.rate-item-block {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.rate-item-image {
  border-radius: 10px;
  margin-top: 6px;
}

.rate-item-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rate-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rate-item-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.rate-item-thumb-ph {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

.rate-item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rate-item-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rate-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-item-url { font-size: 12px; color: var(--text-muted); }

.rate-item-link {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--text-muted);
  padding: 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.rate-item-link:hover { background: rgba(0, 0, 0, 0.05); }

.rate-item-comment {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: unset;
  background: #faf5ff;
  color: var(--text);
  transition: border-color 0.2s;
}

.rate-item-comment:focus {
  outline: none;
  border-color: var(--pink);
  background: white;
}

.rate-item-comment::placeholder { color: #c4b5d0; }

/* ===== Rate Each — per-item vote buttons ===== */

.rate-vote-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.rate-vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  color: var(--text-muted);
}

.rate-vote-btn:hover { border-color: var(--pink-light); }

.rate-vote-btn.rate-vote-selected-up {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.18);
}

.rate-vote-btn.rate-vote-selected-down {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.18);
}

/* ===== Pick One Results (results.html) ===== */

.pick-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.pick-result-row:last-child { border-bottom: none; }

.pick-result-row.winner {
  background: linear-gradient(90deg, #fffbeb, transparent);
  margin: 0 -24px;
  padding: 12px 24px;
  border-radius: 4px;
}

.pick-result-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: #f3e8ff;
  color: var(--purple-dark);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pick-result-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.pick-result-thumb-ph {
  font-size: 26px;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

.pick-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pick-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-result-url { font-size: 11px; color: var(--text-muted); }

.pick-bar-wrap {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 3px;
}

.pick-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.pick-result-count-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 32px;
}

.pick-result-count {
  font-size: 22px;
  font-weight: 800;
  color: var(--pink-dark);
}

.pick-trophy { font-size: 14px; }

.pick-result-link {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--text-muted);
  padding: 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.pick-result-link:hover { background: rgba(0, 0, 0, 0.05); }

/* ===== Rate Each Results (results.html) ===== */

.rate-result-item {
  margin-bottom: 12px;
  padding: 16px;
  background: #faf5ff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rate-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rate-result-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.rate-result-thumb-ph {
  font-size: 26px;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

.rate-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rate-result-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rate-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-result-url { font-size: 12px; color: var(--text-muted); }

/* Product brand labels */
.pick-result-brand,
.rate-result-brand,
.pick-carousel-brand,
.rate-item-brand,
.link-product-brand {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--purple-dark, #7c3aed);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-result-link {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--text-muted);
  padding: 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.rate-result-link:hover { background: rgba(0, 0, 0, 0.05); }

.rate-result-no-comments {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

/* ===== Vote wizard: intro screen ===== */
.intro-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  background: #f3e8ff;
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 14px;
}

.intro-asker {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.25;
}

.intro-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.intro-context {
  margin-bottom: 14px;
}

.intro-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ===== Vote wizard: rate-each stepper ===== */
.rate-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rate-step-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.rate-step-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.rate-step-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  transition: width 0.25s ease;
}

.rate-step-nav {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

