/* =============================================================
   Design tokens — themes override these in holidayhack.css / upvotelist.css.
   ============================================================= */
:root {
  --color-bg: #fdf9f3;
  --color-bg-soft: #f7f2e8;
  --color-surface: #ffffff;
  --color-surface-2: #faf7f1;
  --color-text: #292524;
  --color-text-muted: #78716c;
  --color-border: #e7e5e4;
  --color-primary: #047857;
  --color-primary-hover: #065f46;
  --color-primary-soft: rgba(4, 120, 87, 0.10);
  --color-accent: #ea580c;
  --color-accent-hover: #c2410c;
  --color-danger: #dc2626;
  --color-success: #059669;

  --font-sans: 'Inter var', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;

  --size-1: 4px;
  --size-2: 8px;
  --size-3: 12px;
  --size-4: 16px;
  --size-5: 24px;
  --size-6: 32px;
  --size-7: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 2px 6px rgba(17, 24, 39, 0.06), 0 8px 16px rgba(17, 24, 39, 0.06);
  --shadow-lg: 0 8px 20px rgba(17, 24, 39, 0.08), 0 18px 40px rgba(17, 24, 39, 0.08);
  --shadow-glow: 0 0 0 4px var(--color-primary-soft);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 360ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0c0a09;
    --color-bg-soft: #18151310;
    --color-surface: #1c1917;
    --color-surface-2: #262320;
    --color-text: #fafaf9;
    --color-text-muted: #a8a29e;
    --color-border: #3f3b38;
    --color-primary: #10b981;
    --color-primary-hover: #34d399;
    --color-primary-soft: rgba(16, 185, 129, 0.16);
    --color-accent: #fb923c;
    --color-accent-hover: #fdba74;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* =============================================================
   Base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* keep utility hides from the old styling */
.alert, #login-modal, .top-bar, #existing-user-dropdown, #copy-success, #copy-success2,
.share-buttons-bottom, #new-project {
  display: none;
}
.displayBlock { display: block !important; }

/* =============================================================
   Typography
   ============================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 {
  margin: 0;
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
h2 {
  text-align: center;
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--size-2) 0;
}
h3 {
  text-align: center;
  margin: var(--size-7) var(--size-4) var(--size-3);
  font-size: 1.15rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
h4 {
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin: 0 0 var(--size-2) 0;
}
h5 { font-size: 1.1rem; }

/* The top-bar title wants a little brand feel — keep a subtle mono monogram */
.top-bar { padding: var(--size-4) 20px var(--size-2); margin: 0 0 var(--size-4); display: block; }
.top-bar h1 { font-family: var(--font-sans); font-weight: 700; }

/* =============================================================
   Layout
   ============================================================= */
.container { max-width: 880px; }

/* =============================================================
   Drop zone (paste URL)
   ============================================================= */
#drop-zone {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--color-primary-soft), transparent 60%),
    var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--size-5);
  min-height: 96px;
  line-height: 48px;
  text-align: center;
  margin-bottom: var(--size-5);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  word-wrap: break-word;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  cursor: text;
}
#drop-zone:focus,
#drop-zone:focus-within,
#drop-zone:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  outline: none;
}
#drop-zone.dragover {
  transform: scale(1.01);
  border-style: solid;
  border-color: var(--color-primary);
  background:
    radial-gradient(120% 120% at 50% 0%, var(--color-primary-soft), transparent 70%),
    var(--color-surface);
  box-shadow: var(--shadow-md);
}

/* =============================================================
   Input zone (mobile paste row)
   ============================================================= */
.input-zone a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.input-group-append { margin-left: 0; }

/* ==========================================================================
   URL input + paste button — flat flex row, error message wraps below.
   ========================================================================== */
.input-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--size-2);
  text-align: left;
  width: 100%;
}
.input-zone #url-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  font-size: 0.95rem;
  box-sizing: border-box;
  margin: 0;
}
.input-zone #paste-button {
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  box-sizing: border-box;
  font-size: 0;
  line-height: 0;
  text-indent: -9999px;
  overflow: hidden;
}
.input-zone #paste-button::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  text-indent: 0;
  background-color: var(--color-text);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/><rect x='8' y='2' width='8' height='4' rx='1' ry='1'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/><rect x='8' y='2' width='8' height='4' rx='1' ry='1'/></svg>");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  opacity: 0.7;
  transition: opacity var(--dur-fast) var(--ease);
}
.input-zone #paste-button:hover,
.input-zone #paste-button:active {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
}
.input-zone #paste-button:hover::before,
.input-zone #paste-button:active::before {
  opacity: 1;
  background-color: var(--color-primary);
}
.input-zone #error-message {
  flex: 0 0 100%;
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--color-danger);
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.3;
  display: none;
}
.input-zone #error-message.is-success {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--color-success);
}
/* Only show inline error while the sticky bar is visible (stuck) and non-empty.
   When not stuck, errors surface through the top #dynamic-alert banner instead. */
.input-zone.is-stuck #error-message:not(:empty) {
  display: block;
}

/* =============================================================
   Share buttons
   ============================================================= */
#share-with-friends, #share-on-socials {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--size-2);
}
#share-with-friends a, #share-on-socials a, .share-buttons .native-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: var(--size-2) var(--size-4);
  border-radius: var(--radius-full);
  margin: var(--size-1);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
#share-with-friends a svg, #share-on-socials a svg, .native-share svg {
  /* SVGs inherit currentColor from the anchor so the icon recolors with
     hover/focus state automatically. */
  display: block;
  flex-shrink: 0;
}
#share-with-friends a:hover, #share-on-socials a:hover, .native-share:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: translateY(-1px);
}

/* Bottom share block comes into view once listings exist */
.share-buttons-bottom { margin-top: var(--size-7); }
.share-buttons h3 { text-align: center; }

/* =============================================================
   Listings / cards
   ============================================================= */
#listings { display: flex; flex-direction: column; gap: var(--size-4); }

.card, .price-wrap {
  display: flex;
  flex-direction: row;
  width: 100%;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  animation: cardIn var(--dur-slow) var(--ease) both;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in oklab, var(--color-primary) 35%, var(--color-border));
}
.card-column, .price-column {
  display: flex;
  flex-direction: column;
  flex: 0 1 50%;
}

.index .card-image { background-size: cover; }
.img-white-bg {
  border: 10px solid transparent;
  background-size: contain;
  background-color: var(--color-surface-2);
}
.img-non-white-bg { background-size: cover; }

.card-image {
  position: relative;
  min-height: 240px;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 0;
}
.card-image img.card-img-top {
  object-fit: cover;
  height: 100%;
  max-height: 340px;
  border-radius: 0;
}
.card-body {
  padding: var(--size-5);
  gap: var(--size-3);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 var(--size-3) 0;
  color: var(--color-text);
  line-height: 1.3;
}

/* Stack the per-listing image-action icons (trash, menu link, future ones)
   vertically in the top-right of the card image. Wrapping in a flex column
   means we don't have to hand-position each new icon. */
.card-image-actions {
  position: absolute;
  top: var(--size-3);
  right: var(--size-3);
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  z-index: 2;
}
.card-image-actions .del-white-bg {
  /* When the image uses the white-bg layout the parent .card-image-actions
     handles positioning — the per-icon top/right shift is no longer needed. */
  top: auto;
  right: auto;
}
.img-white-bg .card-image-actions {
  top: var(--size-2);
  right: var(--size-2);
}

.delete-icon {
  padding: 6px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.delete-icon:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.05);
}
.del-white-bg {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--color-border);
}

/* Menu-link icon — same chip styling as the trash icon, no destructive intent. */
.menu-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.menu-link-icon:hover,
.menu-link-icon:focus {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
  transform: scale(1.05);
  text-decoration: none;
  outline: none;
}
.menu-link-icon svg { display: block; }
.menu-link-icon.del-white-bg {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--color-border);
}

.default-image-used {
  font-family: var(--font-mono);
  margin: var(--size-3);
  padding: 4px 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: inline-block;
  border-radius: var(--radius-full);
  max-width: 172px;
  font-size: 0.75rem;
}

/* =============================================================
   Forms / textareas
   ============================================================= */
.info-wrap { margin-bottom: var(--size-3); }

.form-control {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  outline: none;
  padding: 6px 10px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
select.form-control { padding: 0 10px; }
textarea.form-control {
  display: block;
  height: 98px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.5;
}
textarea.form-control::-webkit-scrollbar { display: none; }
.form-control:focus,
.mobile-textarea-overlay textarea:focus {
  background: var(--color-surface);
  border-color: var(--color-primary);
  outline: none;
  box-shadow: var(--shadow-glow);
}
/* Native <select>s: draw our own chevron so the placeholder isn't cropped
   by the browser's (browser-variable-width) built-in arrow. SVG is fully
   URL-encoded — some browsers reject raw < and > in data: URIs. */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2712%27%20height%3D%278%27%20viewBox%3D%270%200%2012%208%27%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27%23555%27%20stroke-width%3D%271.5%27%20d%3D%27M1%201.5l5%205%205-5%27%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  text-overflow: ellipsis;
}
select.form-control::-ms-expand { display: none; }

/* Mobile textarea fullscreen editor */
.mobile-textarea-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  padding: var(--size-3);
}
.textarea-container {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  box-sizing: border-box;
}
.mobile-textarea-overlay textarea {
  width: 100%;
  height: 70vh;
  margin: 0;
  padding: var(--size-3);
  font-size: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

/* =============================================================
   Buttons
   ============================================================= */
.button-wrap { gap: var(--size-3); display: flex; flex-wrap: wrap; }
.button-wrap .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: auto;
}

.btn {
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-success {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-success:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-success.disabled, .btn-success:disabled {
  background: color-mix(in oklab, var(--color-primary) 55%, white);
  border-color: color-mix(in oklab, var(--color-primary) 55%, white);
  cursor: not-allowed;
}

.btn-secondary {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-primary);
}

.remove-upvote {
  color: var(--color-primary);
  background: transparent;
  border-color: var(--color-primary);
}
.remove-upvote:hover {
  background: var(--color-primary-soft);
}

/* Vote pulse */
@keyframes votePulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 var(--color-primary-soft); }
  45%  { transform: scale(1.06); box-shadow: 0 0 0 10px transparent; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}
.upvote.pulse { animation: votePulse 380ms var(--ease); }

/* =============================================================
   Skeleton card — shown between socket "new_listing" (skeleton)
   and "update_listing" (real title + image arrived).
   ============================================================= */
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.card.is-skeleton .card-image {
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.card.is-skeleton .card-title {
  color: var(--color-text-muted);
  font-style: italic;
  font-weight: 500;
}
.card.is-skeleton .info {
  /* Discourage the user from editing info on a skeleton — the row's about
     to get overwritten by enrichment anyway. */
  opacity: 0.7;
  pointer-events: none;
}
/* Right-side shimmer — mirrors the loading-overlay on the image so the whole
   card reads as "in flight" instead of just the picture. Sweeps a soft band
   across the card-body via background-position animation (reusing the
   loadingShimmer keyframes already declared above). */
.card.is-skeleton .card-body {
  position: relative;
  overflow: hidden;
}
.card.is-skeleton .card-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 25%,
    var(--color-primary-soft) 50%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: loadingShimmer 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
.card.is-skeleton .card-body > * {
  position: relative;
  z-index: 2;
}

/* Full-image loading overlay shown during skeleton state. Trash + menu
   icons live in .card-image-actions at z-index:2 and stay clickable on
   top of this. Animation: spinner rotates, dots cycle, backdrop has a
   subtle shimmer. All three respect prefers-reduced-motion — the spinner
   is excluded from the reduce-motion override below because a non-spinning
   "spinner" is just a ring (functionally meaningless), so we keep its
   rotation as an exception. The "Loading…" text + visual circle are
   sufficient signals even when the shimmer/dots stop. */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(
    100deg,
    rgba(15, 23, 42, 0.55) 0%,
    rgba(15, 23, 42, 0.62) 50%,
    rgba(15, 23, 42, 0.55) 100%
  );
  background-size: 200% 100%;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1;
  animation: loadingShimmer 2.4s ease-in-out infinite;
}
@keyframes loadingShimmer {
  0%, 100% { background-position: 200% 0; }
  50%      { background-position: 0% 0; }
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-text {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
/* Animated trailing dots: "Loading"   →   "Loading."   →   "Loading.."   →
   "Loading..." cycle. Pure CSS, no JS timers. */
.loading-dots::after {
  content: '';
  animation: loadingDots 1.6s steps(4, end) infinite;
}
@keyframes loadingDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

@media (max-width: 580px) {
  .loading-spinner { width: 32px; height: 32px; border-width: 3px; }
  .loading-text    { font-size: 0.8rem; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

/* =============================================================
   Price row
   ============================================================= */
.price-wrap {
  margin-top: auto;
  margin-bottom: var(--size-4);
  gap: var(--size-3);
}

/* =============================================================
   Start project / CTA link
   ============================================================= */
.start-project { text-align: center; }
.start-project a {
  color: #fff;
  padding: 12px 46px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  text-decoration: none;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.start-project a:hover {
  text-decoration: none;
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* Create-list link variant */
.createList:hover {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* List action links */
#new-project {
  text-align: center;
  position: static;
  margin-bottom: var(--size-6);
}
#new-project a {
  display: inline-block;
  margin: var(--size-6) 0 var(--size-2) 0;
  padding: 8px 22px;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
#new-project a:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
/* Admin (view-only) read-only mode */
#admin-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  text-align: center;
  padding: 8px 12px;
  background: #d29922;
  color: #161b22;
  font-size: 0.85rem;
  font-weight: 600;
}
#admin-banner a { color: #161b22; text-decoration: underline; margin-left: 8px; }
body.admin-view { padding-top: 34px; }
body.admin-view .drop-zone,
body.admin-view .input-zone,
body.admin-view #showUserAndVotes,
body.admin-view .upvote,
body.admin-view .remove-upvote,
body.admin-view .delete-icon,
body.admin-view .share-buttons { display: none !important; }
body.admin-view .info { pointer-events: none; opacity: 0.85; }

/* =============================================================
   User vote counts / pills
   ============================================================= */
#maxUpvotes { margin-top: var(--size-4); display: inline-block; color: var(--color-text-muted); }
#showUserAndVotes {
  display: none;
  margin-top: var(--size-5);
  text-align: center;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
}
#showUserAndVotes span#userName { color: var(--color-text); font-weight: 600; }
ul#user-vote-counts { list-style-type: none; padding: 0; margin-top: var(--size-3); }
ul#user-vote-counts li {
  display: inline-block;
  color: #fff;
  padding: 2px 14px 4px;
  margin: 6px 4px 0 4px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  background: var(--color-primary);
}
/* Creator-only: clickable pills get a pointer cursor + subtle hover.
   The remove-user modal opens on click. */
ul#user-vote-counts li.is-clickable {
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
ul#user-vote-counts li.is-clickable:hover,
ul#user-vote-counts li.is-clickable:focus {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  outline: none;
}

/* Remove-user modal — passkey status chip + radio rows + inline error. */
.remove-user-status-line {
  margin: 0 0 var(--size-4);
}
.remove-user-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 4px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
}
.remove-user-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.remove-user-status.is-passkey {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.remove-user-status.is-anon {
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.remove-user-options {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  margin: var(--size-3) 0 0;
}
.remove-user-options label {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  padding: var(--size-2) var(--size-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.remove-user-options label:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.remove-user-options input[type="radio"] { margin: 0; }
.remove-user-error {
  margin: var(--size-3) 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--color-danger);
  font-size: 0.85rem;
}
.btn-danger {
  color: #fff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-danger:hover,
.btn-danger:focus {
  background: color-mix(in oklab, var(--color-danger) 80%, black);
  border-color: color-mix(in oklab, var(--color-danger) 80%, black);
}
.btn-danger:disabled {
  background: color-mix(in oklab, var(--color-danger) 55%, white);
  border-color: color-mix(in oklab, var(--color-danger) 55%, white);
  cursor: not-allowed;
}

/* =============================================================
   Connection banner (silent-retry fallback)
   ============================================================= */
#connection-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-3);
  padding: 8px 14px;
  background: #d29922;
  color: #161b22;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
#connection-banner[hidden] { display: none; }
#connection-refresh {
  background: #161b22;
  color: #fff;
  border: 0;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
#connection-refresh:hover { background: #000; }
body.has-connection-banner { padding-top: var(--connection-banner-height, 48px); }
body.has-connection-banner .modal { top:var(--connection-banner-height, 48px); height:calc(100% - var(--connection-banner-height, 48px)); }
/* Stack below an admin banner if both happen to be visible. */
body.admin-view.has-connection-banner #connection-banner { top: 34px; }
body.admin-view.has-connection-banner { padding-top:calc(34px + var(--connection-banner-height, 48px)); }
body.admin-view.has-connection-banner .modal { top:calc(34px + var(--connection-banner-height, 48px)); height:calc(100% - 34px - var(--connection-banner-height, 48px)); }

/* Always-visible passkey nav (top-right) */
#passkey-nav {
  position: fixed;
  top: 16px;
  right: var(--size-3);
  display: flex;
  gap: var(--size-2);
  z-index: 50;
}
#passkey-nav a {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
#passkey-nav a:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-text);
  transform: translateY(-1px);
}
#passkey-nav a#mylists-link {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  gap: 6px;
}
.mylists-icon { width:14px; height:14px; flex-shrink:0; }
#passkey-nav a#mylists-link:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}
/* Narrow desktop & mobile: place the passkey nav in a blurred bottom bar so it
   doesn't collide with the top-bar h1 / sticky URL bar. Top-right placement is
   only safe once the viewport has enough slack to clear the h1 (>=1165px). */
@media screen and (max-width: 1164px) {
  #passkey-nav {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    transform: none;
    justify-content: center;
    width: 100%;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -3px 16px rgba(0, 0, 0, 0.05);
  }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* =============================================================
   Alerts
   ============================================================= */
.alert-warning {
  position: fixed;
  top: 0;
  width: 100%;
  text-align: center;
  border-radius: 0;
  z-index: 9;
  background: var(--color-accent);
  color: #fff;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  border: 0;
}
#error-message { color: var(--color-danger); }
#copy-success { margin-top: var(--size-3); color: var(--color-success); }
#copy-success2 { text-align: center; color: var(--color-success); }

/* =============================================================
   Page URL pop-up + creation time
   ============================================================= */
#page-url {
  border: 0;
  width: 80%;
  color: var(--color-text-muted);
  background: transparent;
}
#project-creation-time {
  font-family: var(--font-mono);
  text-align: center;
  color: var(--color-text-muted);
  margin-top: -8px;
  font-size: 0.85rem;
}
#time-remaining { margin-top: var(--size-5); color: var(--color-text-muted); }

/* Create-passkey link inside the URL-remember modal footer. Visually a
   text link (matches the modal copy "...or create a passkey to save
   your lists"), action-wise it opens the passkey-register modal. JS
   reveals it via .d-none toggle only when the visitor isn't already
   signed in via a passkey. */
.create-passkey-link {
  align-self: center;
  color: var(--color-primary);
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}
.create-passkey-link:hover,
.create-passkey-link:focus {
  color: var(--color-primary-hover);
  text-decoration: underline;
  outline: none;
}

/* =============================================================
   Contact
   ============================================================= */
#contact {
  padding-inline: 20px;
  overflow-wrap: anywhere;
  text-align: center;
  margin: var(--size-5) 0 60px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
#contact a { color: inherit; text-decoration: underline; }

/* =============================================================
   Spinner overlay
   ============================================================= */
.spinner-container {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 999;
}
.spinner {
  width: 44px;
  height: 44px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -22px 0 0 -22px;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}
.spinner-message {
  width: 260px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 48px 0 0 -130px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 8px 18px;
  text-align: center;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@keyframes spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }

/* =============================================================
   Modal polish (works over Bootstrap default)
   ============================================================= */
.modal-content {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom-color: var(--color-border); }
.modal-footer { border-top-color: var(--color-border); }
#rememberURLmodal .modal-footer .btn-secondary { color: var(--color-primary); }
.modal-title { font-weight: 600; }
.modal .btn-close, .modal .close { color: var(--color-text); opacity: 0.6; }
.modal .btn-close:hover, .modal .close:hover { opacity: 1; }

/* Passkey modal — special centered card */
#passkey-modal .modal-content {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
#passkey-modal .modal-body {
  padding: var(--size-6) var(--size-5) var(--size-5);
  text-align: center;
}
#passkey-modal h5 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 0 0 var(--size-3) 0;
}
#passkey-modal p {
  color: var(--color-text-muted);
  margin: 0 0 var(--size-5) 0;
  line-height: 1.5;
}
#passkey-modal .passkey-actions {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}
#passkey-modal .passkey-actions .btn {
  width: 100%;
  padding: 10px 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}
#passkey-modal #passkey-register-btn {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
#passkey-modal #passkey-register-btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
#passkey-modal #passkey-skip-btn {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  font-weight: 500;
}
#passkey-modal #passkey-skip-btn:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
#passkey-modal #passkey-error[hidden] { display: none !important; }
#passkey-modal #passkey-error {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--size-2) var(--size-3);
  margin-bottom: var(--size-3);
  font-size: 0.85rem;
  text-align: left;
}

/* My-lists modal list rows */
#mylists-modal .modal-body { padding: var(--size-4); }
#mylists-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom-color: var(--color-border);
  padding: var(--size-4) var(--size-5);
}
#mylists-modal .modal-header .modal-title {
  margin: 0;
  flex: 1 1 auto;
}
#mylists-modal .modal-header .close {
  position: static;
  float: none;
  margin: 0;
  padding: 4px 0px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-text);
  opacity: 0.55;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-shadow: none;
}
#mylists-modal .modal-header .close:hover {
  opacity: 1;
  background: var(--color-bg-soft);
  border-color: var(--color-border);
}

.mylists-row {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--size-2);
  margin-bottom: var(--size-2);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.mylists-row:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.mylists-row.is-current {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.mylists-link {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  flex: 1 1 auto;
  text-decoration: none;
  color: var(--color-text);
  min-width: 0;
}
.mylists-link:hover { color: var(--color-text); text-decoration: none; }
.mylists-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--color-bg-soft);
  display: block;
}
.mylists-meta { min-width: 0; flex: 1 1 auto; }
.mylists-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mylists-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mylists-current-tag {
  display: inline-block;
  margin-left: var(--size-2);
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  vertical-align: middle;
}
.mylists-remove {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.mylists-remove:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
}

#mylists-modal .mylists-footer {
  justify-content: flex-start;
  border-top-color: var(--color-border);
  padding: var(--size-2) var(--size-4);
}
#mylists-modal .mylists-signout {
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  padding: 4px 8px;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
#mylists-modal .mylists-signout:hover {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.08);
  text-decoration: none;
}

/* =============================================================
   Responsive
   ============================================================= */
/* Sticky URL bar.
   · Default / mobile: inline + position:sticky — always visible (only input
     on mobile). Sticks to top once its natural position scrolls past.
   · Desktop (min-width: 681px): position:fixed + translated off-screen;
     slides down only when .is-stuck is applied — the drop-zone is the
     primary CTA at the top of the page on desktop. */
.input-zone {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: var(--size-3);
  padding: 10px 14px;
  box-sizing: border-box;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: transform var(--dur) var(--ease),
              visibility var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.input-zone.is-stuck {
  border-bottom-color: var(--color-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.submission-feedback { margin:8px 0 0; color:var(--color-text); font-size:14px; line-height:1.4; }
.input-zone .submission-feedback { flex-basis:100%; width:100%; }
.submission-feedback[hidden] { display:none; }
.submission-feedback.is-busy::before { content:""; display:inline-block; width:12px; height:12px; margin-right:8px; border:2px solid var(--color-border); border-top-color:var(--color-primary); border-radius:50%; vertical-align:-2px; animation:submission-spin .8s linear infinite; }
.submission-feedback-desktop { text-align:center; margin-top:-12px; margin-bottom:16px; }
@keyframes submission-spin { to { transform:rotate(360deg); } }
@media (max-width:680px) { .submission-feedback-desktop { display:none; } }
@media (prefers-reduced-motion:reduce) { .submission-feedback.is-busy::before { animation:none; } }

/* Desktop: fixed + hidden; revealed only when .is-stuck is applied. */
@media (min-width: 681px) {
  .input-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    transform: translateY(-100%);
    visibility: hidden;
  }
  .input-zone.is-stuck {
    transform: translateY(0);
    visibility: visible;
  }
}
/* Leave room for all three account links, including My lists, plus a gap.
   Below this breakpoint the account navigation moves to the bottom. */
@media (min-width: 1165px) {
  .input-zone { padding-right: var(--account-nav-space, calc(21rem + 100px)); }
}

@media screen and (max-width: 680px) {
  .drop-zone { display: none; }

  .button-wrap { flex-wrap: nowrap; gap: var(--size-2); }
  .button-wrap .btn {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .button-wrap .remove-upvote {
    flex: 0 0 auto;
    padding: 8px 12px;
  }
  .price-label-span { display: none; }
  #share-with-friends a, #share-on-socials a, .share-buttons .native-share { padding: 4px 14px; margin: 0; }
}
@media screen and (max-width: 580px) {
  .card { flex-direction: column; }
  .card-column { flex: 0 1 100%; }
  .card-image { min-height: 200px; border-radius: 0; }
  .card-title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
  }
  .share-buttons h3 { font-size: 1.05em !important; }
  textarea.form-control { height: 98px; }
  h1 { font-size: 1.3rem; }
}

/* =============================================================
   Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  /* Exempted: the busy-overlay spinner + the entire skeleton-loading state
     (image overlay, spinner, text, dots, AND the card-body shimmer).
     These are functional indicators (the user needs to see content is on
     the way), not decoration — so they keep animating regardless of the
     OS-level reduce-motion preference. Everything else (card-entry slide,
     vote pulse, etc.) is frozen per the user's accessibility setting. */
  *:not(.spinner):not(.loading-spinner):not(.loading-overlay):not(.loading-text):not(.loading-dots):not(.is-skeleton .card-body),
  *:not(.spinner):not(.loading-spinner):not(.loading-overlay):not(.loading-text):not(.loading-dots)::before,
  *:not(.spinner):not(.loading-spinner):not(.loading-overlay):not(.loading-text):not(.loading-dots)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Explicit re-enable for the shimmer pseudo-element. */
  .card.is-skeleton .card-body::after {
    animation-duration: 2.4s !important;
    animation-iteration-count: infinite !important;
  }
}

/* Readable explanatory copy beneath the homepage footer. */
.homepage-about { max-width: 850px; margin: 3rem auto 5rem; padding: 0 1.25rem; text-align: left; line-height: 1.7; }
.homepage-about h2 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 1rem; }
.homepage-about h3 { font-size: 1.15rem; margin-top: 1.5rem; }
.homepage-about p { margin-bottom: 1rem; }
@media (max-width: 680px) {
  .homepage-about h2,
  .homepage-about h3 {
    text-align: left;
    font-weight: 700;
    margin-inline: 0;
  }
}

/* Join dialog: one clear primary action, then sign-in and list navigation. */
#login-modal .join-actions { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 20px 24px; }
#login-modal .join-actions > * { margin: 0; }
#login-modal .join-primary .btn, #login-modal .join-passkey { width: 100%; }
#login-modal .join-navigation { display: grid; grid-template-columns: minmax(0, 2.3fr) repeat(2, minmax(0, 1fr)); gap: 8px; }
#login-modal .join-navigation a, #login-modal .join-navigation button { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 40px; margin: 0; font-size: .8rem; font-weight: 500; padding: 8px 6px; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); white-space: nowrap; text-decoration: none; }
@media (max-width: 480px) {
  #login-modal .join-actions { padding: 16px; }
  #login-modal .join-navigation a, #login-modal .join-navigation button { font-size: .75rem; }
}
.card-body .job-status { font-size: .9rem; line-height: 1.5; border-top: 1px solid var(--color-border); padding-top: 12px; margin-top: auto; }
.card-body .job-status .btn { padding: 4px 10px; }

/* Optional creator-managed list introduction and desktop breathing room. */
@media (min-width: 681px) { .list-page { margin-top: 24px; } }
.list-profile { position:relative; display: flex; gap: 24px; align-items: flex-start; margin: 0 0 24px; padding: 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.list-profile-photo { width: 160px; height: 160px; object-fit: cover; background: var(--color-bg-soft); border-radius: var(--radius-md); flex-shrink: 0; }
.list-profile-details { min-width: 0; flex:1; padding-right:32px; }
.list-profile-edit { position:absolute; top:12px; right:12px; display:flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid var(--color-border); border-radius:50%; background:var(--color-surface); color:var(--color-text-muted); opacity:0; transition:opacity var(--dur-fast) var(--ease); }
.list-profile:hover .list-profile-edit, .list-profile:focus-within .list-profile-edit { opacity:1; }
.list-profile-edit:hover { color:var(--color-primary); background:var(--color-primary-soft); }
@media (hover:none), (pointer:coarse) { .list-profile-edit { opacity:1; } }
.list-profile h1 { text-align: left; font-weight: 700; font-size: 1.6rem; margin-bottom: 12px; overflow-wrap: anywhere; }
.list-profile-description { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }
.list-profile dl { margin:0; display:grid; grid-template-columns:max-content minmax(0,1fr); column-gap:20px; row-gap:6px; align-items:baseline; }
.list-profile dl div { display:contents; }
.list-profile dt { min-width:0; font-size:.85rem; line-height:1.5; color:var(--color-text-muted); }
.list-profile dd { margin:0; line-height:1.5; overflow-wrap:anywhere; }
#personalise-modal label { display: block; margin: 16px 0 5px; font-size: .9rem; font-weight: 600; }
#personalise-modal .personalise-hint { font-size: .85rem; color: var(--color-text-muted); }
.personalise-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
#personalise-modal textarea { height: auto; min-height: 90px; }
#personalise-modal .form-control-file { max-width: 100%; }
#personalise-modal small { display: block; margin-top: 6px; color: var(--color-text-muted); }
#personalise-error { color: var(--color-danger); margin-top: 12px; }
@media (max-width: 680px) {
  .list-profile { margin-top: 12px; padding: 16px; gap: 14px; }
  .list-profile-photo { width: 88px; height: 88px; }
  .list-profile h1 { font-size: 1.2rem; }
  .list-profile dt { min-width:0; }
}
@media (max-width: 400px) { .personalise-fields { grid-template-columns: 1fr; } }

/* List details, native sharing and archive controls. */
.photo-picker { display:flex; align-items:center; gap:16px; padding:14px; border:1px solid var(--color-border); background:var(--color-bg); border-radius:12px; }
.photo-picker-controls { display:flex; flex-direction:column; align-items:flex-start; gap:8px; min-width:0; flex:1; }
.photo-file-input { position:absolute; width:1px; height:1px; opacity:0; }
.photo-picker .photo-pick-button { margin:0; cursor:pointer; padding:10px 16px; border:1px solid currentColor; border-radius:8px; font-weight:600; }
.photo-file-input:focus-visible + label { outline:3px solid currentColor; outline-offset:3px; }
#photo-filename { flex:1; min-width:90px; overflow-wrap:anywhere; font-size:.85rem; }
#photo-preview { width:88px; height:88px; flex-shrink:0; object-fit:cover; border-radius:10px; }
.native-share { font-family:inherit; cursor:pointer; }
.native-share[hidden], #photo-preview[hidden] { display:none; }
.archive-notice { padding:14px; border:1px solid currentColor; border-radius:10px; text-align:center; }
.archived-list #drop-zone, .archived-list .input-zone, .archived-list .upvote, .archived-list .remove-upvote, .archived-list .delete, .archived-list .delete-button, .archived-list .retry-listing { display:none !important; }
.archived-list textarea.info { pointer-events:none; }
.mylists-section-title { font-size:1.1rem; font-weight:700; margin:20px 0 8px; }
.mylists-archive { border:1px solid currentColor; border-radius:8px; padding:7px 10px; background:transparent; color:inherit; font-size:.8rem; }
.language-picker { display:flex; justify-content:center; gap:8px; margin:20px auto; padding:0 20px; }
.language-select-wrap { position:relative; }
.language-select-wrap::after { content:""; position:absolute; width:7px; height:7px; right:20px; top:calc(50% - 5px); border:solid var(--color-text-muted); border-width:0 1.5px 1.5px 0; transform:rotate(45deg); pointer-events:none; }
.language-picker select { appearance:none; -webkit-appearance:none; max-width:230px; padding:10px 46px 10px 22px; border:1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-border)); border-radius:var(--radius-full); background:transparent; color:var(--color-text); cursor:pointer; font-size:.9rem; }
.language-picker select option { background:var(--color-surface); color:var(--color-text); }
.language-trigger { position:relative; min-width:145px; padding:10px 44px 10px 22px; border:1px solid var(--color-border); border-radius:var(--radius-full); background:var(--color-surface); color:var(--color-text); font:inherit; font-size:.9rem; cursor:pointer; }
.language-trigger:hover, .language-trigger[aria-expanded="true"] { border-color:var(--color-primary); }
.language-options { position:absolute; z-index:1040; bottom:calc(100% + 10px); left:50%; transform:translateX(-50%); min-width:190px; padding:6px; border:1px solid var(--color-border); border-radius:16px; background:var(--color-surface); box-shadow:0 8px 30px #0002; }
.language-options[hidden] { display:none; }
.language-options { max-height:calc(100dvh - 120px); overflow-y:auto; }
.language-options [role="option"] { display:block; width:100%; padding:10px 14px; text-align:left; text-decoration:none; border:0; border-radius:10px; background:transparent; color:var(--color-text); font:inherit; cursor:pointer; }
.language-options [role="option"]:hover, .language-options [role="option"]:focus-visible, .language-options [role="option"][aria-selected="true"] { background:color-mix(in srgb,var(--color-primary) 12%,var(--color-surface)); color:var(--color-primary); }
.language-trigger:focus-visible, .language-options [role="option"]:focus-visible { outline:2px solid var(--color-primary); outline-offset:2px; }
.language-enhanced::after { z-index:1; }
html { touch-action:pan-x pan-y; }
.push-controls { max-width:440px; margin:18px auto; padding:0 16px; color:var(--color-text-muted); font-size:.9rem; }
.push-controls[hidden] { display:none; }
.push-options { margin-top:12px; padding:18px; border:1px solid var(--color-border); border-radius:16px; background:var(--color-surface); }
.push-options label { display:flex; gap:10px; align-items:center; padding:5px 0; }
.push-options input { accent-color:var(--color-primary); }
.push-privacy { font-size:.8rem; margin-top:10px; }
.push-actions { display:flex; flex-wrap:wrap; gap:8px; }
.push-actions button { padding:9px 16px; border:1px solid var(--color-border); border-radius:var(--radius-full); color:var(--color-primary); background:var(--color-surface); font:inherit; cursor:pointer; }
.push-actions button:hover { background:var(--color-primary-soft); }
.push-actions button:disabled { opacity:.6; }
#push-status { margin:10px 0 0; }
#push-nudge .btn-link { color:var(--color-text-muted); }
#push-nudge .btn-link:hover { color:var(--color-primary); }

@media (max-width: 480px) {
  #passkey-nav { gap:6px; padding-left:8px; padding-right:8px; }
  #passkey-nav a { font-size:clamp(.66rem, 2.6vw, .8rem); padding:8px; }
  .mylists-icon { width:14px; height:14px; }
  .mylists-row { flex-wrap:wrap; }
  .mylists-link { min-width:0; }
}

/* Footer list actions stay available on empty lists, including personalisation. */
#new-project { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:12px; margin:24px 16px; }
#new-project a { display:inline-flex; align-items:center; justify-content:center; gap:8px; margin:0; padding:10px 18px; font:inherit; font-size:.9rem; line-height:1.5; border:1px solid transparent; border-radius:var(--radius-full); cursor:pointer; }
#new-project a.list-action-secondary { background:var(--color-surface); border-color:var(--color-primary); color:var(--color-text-muted); }
#new-project a.list-action-secondary:hover, #new-project a.list-action-secondary:focus-visible { background:var(--color-primary-soft); border-color:var(--color-primary); color:var(--color-primary); }
#new-project #delete-list { width:44px; min-width:44px; height:44px; padding:0; }
#new-project a { min-height:44px; }
#new-project #notifications-toggle[aria-expanded="true"] { background:var(--color-primary-soft); color:var(--color-primary); }
.list-action-short { display:none; }
@media (max-width:680px) {
  #new-project { flex-wrap:wrap; gap:8px; margin:24px 12px; }
  #new-project a { gap:5px; padding:10px 14px; font-size:.8rem; white-space:nowrap; }
  #new-project .list-action-full { display:none; }
  #new-project .list-action-short { display:inline; }
  #new-project .action-icon { width:13px; height:13px; }
  #new-project #notifications-toggle { width:44px; min-width:44px; height:44px; padding:0; }
  #notifications-toggle span { display:none; }
}
@media (max-width:380px) {
  #new-project { gap:4px; }
  #new-project a { padding:10px 10px; gap:4px; font-size:.72rem; }
}
.action-icon { flex-shrink:0; }
.own-wishlist .upvote, .own-wishlist #maxUpvotes, .own-wishlist #userName { display:none !important; }
.recipient-choice { margin:16px 0; }
.recipient-choice > label { display:block; font-weight:600; margin-bottom:6px; }
.recipient-choice small { display:block; color:var(--color-text-muted); margin-top:6px; }

/* Keep iOS focus at the user's chosen zoom level; do not disable pinch zoom. */
@media (max-width:680px) {
  input:not([type=checkbox]):not([type=radio]), textarea, select, [contenteditable=true],
  .form-control, .language-picker select { font-size:16px !important; }
  #share-with-friends { gap:6px; }
  #share-with-friends a, #share-with-friends .native-share { padding:6px 8px; gap:4px; font-size:.75rem; white-space:nowrap; }
  #share-with-friends .native-share { order:0; }
  #share-with-friends #copy-url-btn2 { order:1; }
  #share-with-friends #email-share { order:2; }
  #share-with-friends #sms-share { order:3; }
  #share-with-friends #whatsapp-share { order:4; }
  #share-with-friends #telegram-share { order:5; }
  #share-with-friends #signal-share { order:6; }
  body.has-connection-banner .input-zone { top:var(--connection-banner-height, 48px); }
}

.share-row { display:contents; }
@media (max-width:680px) {
  #share-with-friends { display:flex; flex-direction:column; gap:8px; }
  #share-with-friends .share-row { display:flex; justify-content:center; gap:6px; width:100%; }
  #share-with-friends a, #share-with-friends .native-share {
    padding:6px clamp(3px, 2vw, 15px); gap:6px; font-size:.85rem;
    white-space:nowrap; margin:0; min-height:36px; justify-content:center;
  }
}

.share-label-short { display:none; }
@media (max-width:680px) {
  .share-label-full { display:none; }
  .share-label-short { display:inline; }
}
@media (max-width:380px) {
  #share-with-friends a, #share-with-friends .native-share { padding-inline:3px; gap:4px; }
  #share-with-friends .share-row { gap:4px; }
}

/* A personal wishlist is curated by its creator. Keep the input nodes available
   for shared handlers, but hide them before any script or socket connects. */
.guest-wishlist #drop-zone,
.guest-wishlist .submission-feedback-desktop,
.guest-wishlist .input-zone,
.guest-wishlist .list-invitations { display:none !important; }
