/* Halaman percakapan dibagikan (/s/:token) + dialog "Bagikan percakapan".
   Mengikuti tema terang/gelap aplikasi; aksen emas "Benang Emas" untuk tombol utama. */
.sh-page, .share-dlg {
  --sh-gold: #d4af6a; --sh-gold-hi: #f2d79b; --sh-gold-ink: #1a1408;
  --sh-line: color-mix(in oklab, var(--ink, #222) 12%, transparent);
  --sh-soft: color-mix(in oklab, var(--ink, #222) 5%, transparent);
}
.sh-page { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }

/* Bilah atas */
.sh-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px clamp(14px, 3vw, 28px);
  background: color-mix(in oklab, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--sh-line); }
.sh-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15.5px; flex: none; }
.sh-brand img { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; }
.sh-top-title { flex: 1; min-width: 0; text-align: center; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.sh-top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.sh-icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--sh-line); background: transparent; color: var(--ink-2); cursor: pointer; }
.sh-icon-btn:hover { background: var(--sh-soft); color: var(--ink); }
.sh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; }
.sh-btn-gold { background: linear-gradient(180deg, var(--sh-gold-hi), var(--sh-gold)); color: var(--sh-gold-ink); box-shadow: 0 8px 22px -12px rgba(212, 175, 106, .8), inset 0 1px 0 rgba(255, 255, 255, .45); }
.sh-btn-gold:hover:not(:disabled) { filter: brightness(1.05); }
.sh-btn:disabled { opacity: .7; cursor: progress; }

/* Isi */
.sh-main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 24px) 140px; }
.sh-loading { display: grid; place-items: center; padding: 18vh 0; }
.sh-error { padding: 12vh 0; }
.sh-head { margin-bottom: 34px; padding-bottom: 22px; border-bottom: 1px solid var(--sh-line); }
.sh-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--sh-soft); border: 1px solid var(--sh-line); }
.sh-head h1 { margin: 14px 0 10px; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -.025em; font-weight: 800; overflow-wrap: anywhere; text-wrap: balance; }
.sh-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 0; color: var(--ink-3); font-size: 13.5px; }
.sh-meta span + span::before { content: "·"; margin: 0 8px; opacity: .7; }

.sh-thread { display: flex; flex-direction: column; gap: 30px; }
.sh-msg { min-width: 0; }
.sh-user { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sh-bubble { max-width: min(80%, 620px); padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: var(--surface-2, var(--sh-soft)); color: var(--ink); font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 80%; }
.sh-att { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--sh-line); color: var(--ink-2); font-size: 12.5px; }
.sh-ai-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--ink-2); font-size: 13.5px; font-weight: 700; }
.sh-ai-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--sh-soft); border: 1px solid var(--sh-line); }
.sh-ai-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sh-ai-body .prose { font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.sh-ai-body .prose pre { max-width: 100%; overflow-x: auto; }
.sh-ai-body .prose table { display: block; max-width: 100%; overflow-x: auto; }
.sh-ai-body .prose img { max-width: 100%; height: auto; }
.sh-empty { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--sh-line); color: var(--ink-3); font-size: 14px; }
.sh-ai-actions { display: flex; gap: 4px; margin-top: 8px; }
.sh-act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sh-act:hover { background: var(--sh-soft); color: var(--ink); }

/* Artefak & media */
.sh-art { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--sh-line); background: var(--surface, transparent); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.sh-art:hover { border-color: color-mix(in oklab, var(--sh-gold) 60%, transparent); transform: translateY(-1px); }
.sh-art-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--sh-gold); background: color-mix(in oklab, var(--sh-gold) 14%, transparent); }
.sh-art-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-art-title { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.sh-art-sub { color: var(--ink-3); font-size: 13px; }
.sh-art-open { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.sh-media { display: flex; flex-direction: column; gap: 10px; }
.sh-images { display: grid; gap: 8px; }
.sh-images.n1 { grid-template-columns: minmax(0, 420px); }
.sh-images.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sh-images.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sh-img { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--sh-line); background: var(--sh-soft); }
.sh-img img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: cover; }
.sh-audio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--sh-line); color: var(--ink-2); font-size: 13.5px; min-width: 0; }
.sh-audio span { flex: 0 1 auto; min-width: 0; }
.sh-audio audio { flex: 1; min-width: 0; height: 36px; }
.sh-note { margin: 40px 0 0; color: var(--ink-3); font-size: 12.5px; text-align: center; }

/* Dok bawah: ajakan melanjutkan */
.sh-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 0 16px calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
.sh-dock-in { pointer-events: auto; max-width: 740px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 20px;
  background: color-mix(in oklab, var(--surface, var(--bg)) 92%, transparent); border: 1px solid var(--sh-line); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sh-dock-mark { flex: none; }
.sh-dock-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sh-dock-txt b { font-size: 14.5px; }
.sh-dock-txt span { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-dock .sh-btn { height: 40px; flex: none; }

@media (max-width: 640px) {
  .sh-top { gap: 10px; }
  .sh-top-title { display: none; }
  .sh-brand span { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sh-btn { padding: 0 13px; font-size: 13.5px; }
  .sh-bubble { max-width: 88%; font-size: 15px; }
  .sh-images.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-dock-mark { display: none; }
  .sh-dock-txt span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .sh-main { padding-bottom: 150px; }
}

/* ───── Dialog "Bagikan percakapan" ───── */
.share-dlg-body { display: flex; flex-direction: column; gap: 16px; }
.share-dlg-preview { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--sh-soft); border: 1px solid var(--sh-line); min-width: 0; }
.share-dlg-mark { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); border: 1px solid var(--sh-line); }
.share-dlg-pv-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.share-dlg-pv-txt b { font-size: 14.5px; }
.share-dlg-pv-txt span { color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.share-dlg-label { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.share-dlg-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.share-dlg-seg button { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--sh-line); background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.share-dlg-seg button.on { border-color: color-mix(in oklab, var(--sh-gold) 70%, transparent); background: color-mix(in oklab, var(--sh-gold) 16%, transparent); color: var(--ink); }
/* Baris tautan: ikon · URL (memotong dengan elipsis) · tombol Salin (tidak pernah patah baris) */
.share-dlg-link { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 5px 5px 12px; border-radius: 14px; border: 1px solid var(--sh-line); background: var(--bg); color: var(--ink-3); }
.share-dlg-url { flex: 1 1 auto; min-width: 0; width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-overflow: ellipsis; }
.share-dlg-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 10px; white-space: nowrap; word-break: keep-all; font-size: 13.5px; font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, var(--sh-gold-hi), var(--sh-gold)); color: var(--sh-gold-ink); }
.share-dlg-copy span { white-space: nowrap; }
.share-dlg-help { display: flex; align-items: center; gap: 6px; margin: -6px 0 0; color: var(--ink-3); font-size: 12.5px; }
.share-dlg-list { display: flex; flex-direction: column; gap: 6px; }
.share-dlg-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--sh-line); }
.share-dlg-item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-dlg-item-txt b { font-size: 13.5px; font-weight: 600; }
.share-dlg-item-txt span { color: var(--ink-3); font-size: 12.5px; }
.share-dlg-revoke { flex: none; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--sh-line); background: transparent; color: var(--danger, #d9534f); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.share-dlg .modal-foot .btn { white-space: nowrap; }
.share-dlg .share-dlg-done { background: linear-gradient(180deg, var(--sh-gold-hi), var(--sh-gold)); color: var(--sh-gold-ink); border: 0; box-shadow: 0 8px 22px -12px rgba(212, 175, 106, .8); }
@media (max-width: 330px) { .share-dlg-copy span { display: none; } .share-dlg-copy { padding: 0 12px; } }
