/* ═══════════════════════════════════════
   WOBAZI — Result share sheet (app/result-share.js) + the public /card/:token page
   A bottom sheet on phones, a centred dialog with the card beside the buttons on wider screens.
═══════════════════════════════════════ */
html.rs-open, html.rs-open body { overflow: hidden; }
.rs-backdrop {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4, 4, 10, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: 'Outfit', 'Noto Sans SC', 'Noto Sans Thai', system-ui, sans-serif;
  color: var(--text, #f0f0ff);
}
.rs-sheet {
  width: 100%; max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-card, #13132a); border: 1px solid var(--card-line, rgba(255, 255, 255, 0.09));
  border-radius: 22px 22px 0 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: rs-up 0.22s ease-out;
}
@keyframes rs-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.rs-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rs-title { margin: 0; font-size: 18px; font-weight: 700; }
.rs-x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--m7, rgba(240,240,255,0.7)); cursor: pointer; }
.rs-x:hover { background: var(--w08, rgba(240,240,255,0.08)); color: var(--text, #f0f0ff); }
.rs-x:focus-visible, .rs-off:focus-visible { outline: 2px solid var(--gold, #f0c040); outline-offset: 2px; }
.rs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.rs-side, .rs-controls, .rs-kit { min-width: 0; }
.rs-preview { display: flex; justify-content: center; }
.rs-preview img, .rs-skel {
  display: block; width: auto; height: min(46dvh, 420px); aspect-ratio: 1080 / 1920;
  border-radius: 16px; border: 1px solid var(--border, rgba(240,240,255,0.1)); background: #0c0b18;
}
.rs-skel { animation: rs-pulse 1.2s ease-in-out infinite alternate; }
@keyframes rs-pulse { from { opacity: 0.5; } to { opacity: 1; } }
.rs-controls { display: flex; flex-direction: column; gap: 12px; }
.rs-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; cursor: pointer; }
.rs-toggle input { width: 22px; height: 22px; accent-color: var(--gold, #f0c040); flex: none; }
.rs-warn { margin: -4px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; background: rgba(240,192,64,0.12); border: 1px solid rgba(240,192,64,0.35); }
.rs-warn[hidden] { display: none; }
.rs-muted { margin: 0; font-size: 13px; line-height: 1.45; color: var(--m5, rgba(240,240,255,0.55)); }
.rs-off { align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: #ff8a8f; font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rs-off:disabled { opacity: 0.5; }
@media (min-width: 720px) {
  .rs-backdrop { align-items: center; padding: 24px; }
  .rs-sheet { max-width: 760px; border-radius: 22px; padding: 18px 22px 22px; }
  .rs-grid { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 24px; }
  .rs-preview img, .rs-skel { height: min(70dvh, 560px); }
}
@media (prefers-reduced-motion: reduce) { .rs-sheet, .rs-skel { animation: none; } }

/* /card/:token */
.result-public-main { max-width: 1000px; }
.result-public-card img { max-width: 440px; margin: 0 auto; }
.result-public-score { margin: 0; font-size: 16px; color: var(--m8, rgba(240,240,255,0.8)); }
.result-public-score b { font-size: 34px; color: var(--gold, #f0c040); }
@media (min-width: 860px) {
  .result-public-main { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 40px; align-items: center; padding-top: 48px; }
  .result-public-card img { margin: 0; }
}
