/* ==========================================================================
   PostVibe Studio - 10 Social Media & Creator Templates
   Pixel-perfect, authentic platform aesthetics
   ========================================================================== */

/* Universal Card Wrapper */
.post-card {
  width: 100%;
  max-width: 540px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  transition: transform 0.15s ease;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Global text wrapping & containment against 50,000+ character continuous strings */
.post-card,
.post-card * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Native BiDi plaintext isolation for automatic Right-To-Left (RTL) Arabic/Hebrew/Urdu rendering */
.post-card,
.notes-title, .notes-body, .notes-date,
.tweet-body, .tweet-display-name, .tweet-handle,
.ig-content-box, .ig-caption,
.threads-body, .threads-username,
.li-name, .li-headline, .li-body,
.spotify-title, .spotify-artist, .spotify-quote-box,
.wa-name, .wa-status, .wa-bubble,
.fb-name, .fb-sub, .fb-bubble,
.imessage-contact-name, .imessage-bubble,
.igdm-username, .igdm-active-status, .igdm-bubble,
.reddit-title, .reddit-body,
.terminal-filename, .terminal-code,
.quote-body, .quote-author, .quote-author-title,
.glass-tag, .glass-title, .glass-body, .glass-author {
  unicode-bidi: plaintext;
  text-align: start;
}

/* --------------------------------------------------------------------------
   1. Apple Notes Template
   -------------------------------------------------------------------------- */
.template-notes {
  background: #ffffff;
  color: #1c1c1e;
  padding: 24px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.template-notes.dark-theme {
  background: #1c1c1e;
  color: #f2f2f7;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 8px;
}
.template-notes.dark-theme .notes-header {
  border-bottom-color: rgba(255,255,255,0.08);
}

.notes-folder-tag {
  color: #d97706;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.template-notes.dark-theme .notes-folder-tag {
  color: #fbbf24;
}

.notes-date {
  color: #8e8e93;
  font-size: 0.74rem;
  text-align: center;
  margin-bottom: 12px;
}

.notes-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.notes-body {
  font-size: 0.98rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   2. X / Twitter Mockup
   -------------------------------------------------------------------------- */
.template-tweet {
  background: #ffffff;
  color: #0f1419;
  padding: 22px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #eff3f4;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.template-tweet.dark-theme {
  background: #000000;
  color: #ffffff;
  border-color: #2f3336;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

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

.tweet-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tweet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.tweet-names {
  display: flex;
  flex-direction: column;
}

.tweet-display-name {
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-badge-svg {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}

.tweet-handle {
  color: #536471;
  font-size: 0.82rem;
}
.template-tweet.dark-theme .tweet-handle {
  color: #71767b;
}

.tweet-body {
  font-size: 1.05rem;
  line-height: 1.45;
  white-space: pre-wrap;
  margin-bottom: 14px;
  word-break: break-word;
}

.tweet-timestamp {
  color: #536471;
  font-size: 0.78rem;
  padding-bottom: 10px;
  border-bottom: 1px solid #eff3f4;
}
.template-tweet.dark-theme .tweet-timestamp {
  color: #71767b;
  border-bottom-color: #2f3336;
}

.tweet-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  color: #536471;
  font-size: 0.82rem;
}
.template-tweet.dark-theme .tweet-metrics {
  color: #71767b;
}

.tweet-metrics .metric-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}
.tweet-metrics .metric-item svg {
  display: block;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
.tweet-metrics .metric-count {
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.tweet-metrics .metric-reply:hover { color: #1d9bf0; }
.tweet-metrics .metric-retweet:hover { color: #00ba7c; }
.tweet-metrics .metric-like:hover { color: #f91880; }
.tweet-metrics .metric-save:hover { color: #1d9bf0; }

/* --------------------------------------------------------------------------
   3. Instagram Feed Post Mockup
   -------------------------------------------------------------------------- */
.template-instagram {
  background: #ffffff;
  color: #262626;
  padding: 16px 20px 20px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #dbdbdb;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.template-instagram.dark-theme {
  background: #000000;
  color: #f5f5f5;
  border-color: #262626;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

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

.ig-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ig-avatar-ring {
  padding: 2px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-radius: 50%;
  display: flex;
}

.ig-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  object-fit: cover;
}

.ig-names {
  display: flex;
  flex-direction: column;
}

.ig-username {
  font-weight: 700;
  font-size: 0.85rem;
}

.ig-location {
  font-size: 0.7rem;
  color: #8e8e93;
}

.ig-content-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid #f1f5f9;
}
.template-instagram.dark-theme .ig-content-box {
  background: #121212;
  border-color: #262626;
}

.ig-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.ig-left-actions {
  display: flex;
  gap: 12px;
}

.ig-likes-text {
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.ig-caption {
  font-size: 0.88rem;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   4. Threads Post Mockup
   -------------------------------------------------------------------------- */
.template-threads {
  background: #ffffff;
  color: #000000;
  padding: 20px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.template-threads.dark-theme {
  background: #101010;
  color: #f3f5f7;
  border-color: #262626;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.threads-layout {
  display: flex;
  gap: 12px;
}

.threads-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.threads-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.threads-connector-line {
  width: 2px;
  flex: 1;
  background: #e5e7eb;
  margin: 6px 0;
  border-radius: 2px;
}
.template-threads.dark-theme .threads-connector-line {
  background: #333333;
}

.threads-right-col {
  flex: 1;
}

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

.threads-username {
  font-weight: 700;
  font-size: 0.88rem;
}

.threads-time {
  color: #999999;
  font-size: 0.75rem;
}

.threads-body {
  font-size: 0.98rem;
  line-height: 1.48;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.threads-icons {
  display: flex;
  gap: 14px;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   5. LinkedIn Post Mockup
   -------------------------------------------------------------------------- */
.template-linkedin {
  background: #ffffff;
  color: rgba(0,0,0,0.9);
  padding: 20px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #e0e0e0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.template-linkedin.dark-theme {
  background: #1b1f23;
  color: #ffffff;
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.li-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.li-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.li-user-details {
  display: flex;
  flex-direction: column;
}

.li-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.li-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.li-degree {
  font-size: 0.75rem;
  color: #666666;
}

.li-headline {
  font-size: 0.74rem;
  color: #666666;
  line-height: 1.3;
}
.template-linkedin.dark-theme .li-headline {
  color: #a0a0a0;
}

.li-meta {
  font-size: 0.68rem;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.li-body {
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 14px;
}

.li-reactions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e8e8e8;
  padding-top: 10px;
  font-size: 0.75rem;
  color: #666666;
}
.template-linkedin.dark-theme .li-reactions-row {
  border-top-color: #33383f;
  color: #a0a0a0;
}

/* --------------------------------------------------------------------------
   6. Spotify Song / Lyric Card
   -------------------------------------------------------------------------- */
.template-spotify {
  background: #121212;
  color: #ffffff;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.spotify-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.spotify-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.spotify-track-meta {
  display: flex;
  flex-direction: column;
}

.spotify-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.spotify-artist {
  color: #b3b3b3;
  font-size: 0.82rem;
}

.spotify-quote-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 1.15rem;
  line-height: 1.45;
  font-weight: 600;
  color: #1ed760;
  white-space: pre-wrap;
}

.spotify-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin-bottom: 6px;
  position: relative;
}

.spotify-progress-fill {
  width: 45%;
  height: 100%;
  background: #1ed760;
  border-radius: 2px;
}

.spotify-timestamps {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #b3b3b3;
}

/* --------------------------------------------------------------------------
   7. Reddit Post Mockup
   -------------------------------------------------------------------------- */
.template-reddit {
  background: #ffffff;
  color: #1a1a1b;
  padding: 18px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #ccc;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.template-reddit.dark-theme {
  background: #1a1a1b;
  color: #d7dadc;
  border-color: #343536;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.reddit-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #787c7e;
  margin-bottom: 10px;
}

.reddit-sub {
  font-weight: 700;
  color: inherit;
}

.reddit-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.35;
}

.reddit-body {
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 14px;
}

.reddit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reddit-vote-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.05);
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.78rem;
}
.template-reddit.dark-theme .reddit-vote-pill {
  background: rgba(255,255,255,0.08);
}

/* --------------------------------------------------------------------------
   8. Developer Terminal / Code Card
   -------------------------------------------------------------------------- */
.template-terminal {
  background: #18181b;
  color: #f4f4f5;
  padding: 16px 20px 22px 20px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 8px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-filename {
  font-size: 0.72rem;
  color: #a1a1aa;
}

.terminal-code {
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #38bdf8;
}

/* --------------------------------------------------------------------------
   9. Minimalist Editorial Quote
   -------------------------------------------------------------------------- */
.template-quote {
  background: #ffffff;
  color: #09090b;
  padding: 36px 32px;
  font-family: 'Playfair Display', Georgia, serif;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.template-quote.dark-theme {
  background: #09090b;
  color: #fafaf9;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.quote-symbol {
  font-size: 3rem;
  line-height: 1;
  color: #4f46e5;
  margin-bottom: 8px;
}

.quote-body {
  font-size: 1.25rem;
  line-height: 1.48;
  font-style: italic;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.quote-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, sans-serif;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 12px;
}
.template-quote.dark-theme .quote-footer {
  border-top-color: rgba(255,255,255,0.1);
}

.quote-author {
  font-weight: 700;
  font-size: 0.88rem;
}
.quote-author-title {
  color: #64748b;
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   10. Modern Glassmorphism
   -------------------------------------------------------------------------- */
.template-glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #09090b;
  padding: 26px 28px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}
.template-glass.dark-theme {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.glass-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  margin-bottom: 12px;
}
.template-glass.dark-theme .glass-tag {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.glass-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.glass-body {
  font-size: 0.98rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
   11. WhatsApp Chat Dialogue (Authentic Native Fidelity)
   -------------------------------------------------------------------------- */
.template-whatsapp {
  background: #efeae2;
  color: #111b21;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid #d1d7db;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}
.template-whatsapp.dark-theme {
  background: #0b141a;
  color: #e9edef;
  border-color: #222e35;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.wa-header {
  background: #008069;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.template-whatsapp.dark-theme .wa-header {
  background: #202c33;
  color: #e9edef;
}

.wa-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-avatar-container {
  position: relative;
  width: 38px;
  height: 38px;
}
.wa-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.wa-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.wa-status {
  font-size: 0.72rem;
  opacity: 0.88;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  opacity: 0.9;
}
.template-whatsapp.dark-theme .wa-header-actions {
  color: #aebac1;
}

.wa-chat-area {
  padding: 16px 16px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 0);
  background-size: 16px 16px;
}
.template-whatsapp.dark-theme .wa-chat-area {
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 0);
}

.wa-date-divider {
  align-self: center;
  background: #ffffff;
  color: #54656f;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  margin-bottom: 4px;
}
.template-whatsapp.dark-theme .wa-date-divider {
  background: #182229;
  color: #8696a0;
}

.wa-bubble-row {
  display: flex;
  width: 100%;
}
.wa-bubble-row.incoming {
  justify-content: flex-start;
}
.wa-bubble-row.outgoing {
  justify-content: flex-end;
}

.wa-bubble {
  max-width: 82%;
  padding: 7px 11px 6px 11px;
  border-radius: 8px;
  font-size: 0.91rem;
  line-height: 1.42;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
}

.wa-bubble.incoming {
  background: #ffffff;
  color: #111b21;
  border-top-left-radius: 0;
}
.template-whatsapp.dark-theme .wa-bubble.incoming {
  background: #202c33;
  color: #e9edef;
}

.wa-bubble.outgoing {
  background: #d9fdd3;
  color: #111b21;
  border-top-right-radius: 0;
}
.template-whatsapp.dark-theme .wa-bubble.outgoing {
  background: #005c4b;
  color: #e9edef;
}

.wa-time-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 0.65rem;
  color: #667781;
  margin-top: 3px;
  float: right;
  margin-left: 10px;
}
.template-whatsapp.dark-theme .wa-time-status {
  color: #8696a0;
}
.wa-check-blue {
  color: #53bdeb;
  display: inline-flex;
}

/* --------------------------------------------------------------------------
   12. Messenger Chat Dialogue (Native iOS/Android Fidelity)
   -------------------------------------------------------------------------- */
.template-messenger {
  background: #ffffff;
  color: #050505;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #e4e6eb;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}
.template-messenger.dark-theme {
  background: #18191a;
  color: #e4e6eb;
  border-color: #393a3b;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.fb-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e4e6eb;
}
.template-messenger.dark-theme .fb-header {
  border-bottom-color: #393a3b;
}

.fb-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
}
.fb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.fb-active-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #31a24c;
  border: 2px solid #ffffff;
  border-radius: 50%;
}
.template-messenger.dark-theme .fb-active-dot {
  border-color: #18191a;
}

.fb-header-info {
  display: flex;
  flex-direction: column;
}
.fb-name {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.2;
}
.fb-sub {
  font-size: 0.7rem;
  color: #65676b;
}
.template-messenger.dark-theme .fb-sub {
  color: #b0b3b8;
}

.fb-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #0084ff;
}

.fb-chat-body {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.fb-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.fb-bubble-row.incoming {
  justify-content: flex-start;
}
.fb-bubble-row.outgoing {
  justify-content: flex-end;
}

.fb-mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.fb-bubble {
  max-width: 78%;
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 0.93rem;
  line-height: 1.42;
  word-break: break-word;
}
.fb-bubble.incoming {
  background: #f0f2f5;
  color: #050505;
  border-bottom-left-radius: 4px;
}
.template-messenger.dark-theme .fb-bubble.incoming {
  background: #303031;
  color: #e4e6eb;
}
.fb-bubble.outgoing {
  background: linear-gradient(135deg, #0084ff 0%, #a033ff 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* --------------------------------------------------------------------------
   13. Apple Messages (iMessage Blue & SMS Green)
   -------------------------------------------------------------------------- */
.template-imessage {
  background: #ffffff;
  color: #000000;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  border: 1px solid #e5e5ea;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}
.template-imessage.dark-theme {
  background: #000000;
  color: #ffffff;
  border-color: #2c2c2e;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.imessage-topbar {
  padding: 12px 14px 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid #efeff4;
  position: relative;
}
.template-imessage.dark-theme .imessage-topbar {
  border-bottom-color: #1c1c1e;
}

.imessage-back-link {
  position: absolute;
  left: 12px;
  top: 14px;
  color: #007aff;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.imessage-facetime-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  color: #007aff;
}

.imessage-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 4px;
}
.imessage-contact-name {
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 3px;
}
.imessage-arrow-small {
  font-size: 0.65rem;
  color: #8e8e93;
}

.imessage-chat-body {
  padding: 16px 14px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.imessage-timestamp-stamp {
  align-self: center;
  font-size: 0.7rem;
  font-weight: 500;
  color: #8e8e93;
  margin-bottom: 4px;
}

.imessage-bubble-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.imessage-bubble-row.incoming {
  align-items: flex-start;
}
.imessage-bubble-row.outgoing {
  align-items: flex-end;
}

.imessage-bubble {
  max-width: 76%;
  padding: 9px 15px;
  border-radius: 18px;
  font-size: 0.94rem;
  line-height: 1.4;
  word-break: break-word;
}
.imessage-bubble.incoming {
  background: #e9e9eb;
  color: #000000;
  border-bottom-left-radius: 4px;
}
.template-imessage.dark-theme .imessage-bubble.incoming {
  background: #26252a;
  color: #ffffff;
}

.imessage-bubble.outgoing {
  background: #007aff;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.template-imessage.green-sms .imessage-bubble.outgoing {
  background: #34c759;
}

.imessage-delivered-label {
  font-size: 0.68rem;
  color: #8e8e93;
  font-weight: 500;
  margin-top: 4px;
  padding-right: 4px;
}

/* --------------------------------------------------------------------------
   14. Instagram Direct Message (IG DM)
   -------------------------------------------------------------------------- */
.template-igdm {
  background: #ffffff;
  color: #000000;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #dbdbdb;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}
.template-igdm.dark-theme {
  background: #000000;
  color: #f5f5f5;
  border-color: #262626;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.igdm-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #efefef;
}
.template-igdm.dark-theme .igdm-header {
  border-bottom-color: #262626;
}

.igdm-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.igdm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.igdm-header-names {
  display: flex;
  flex-direction: column;
}
.igdm-username {
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.igdm-active-status {
  font-size: 0.68rem;
  color: #8e8e93;
}

.igdm-chat-body {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
}

.igdm-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  position: relative;
}
.igdm-bubble-row.incoming {
  justify-content: flex-start;
}
.igdm-bubble-row.outgoing {
  justify-content: flex-end;
}

.igdm-bubble {
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
}
.igdm-bubble.incoming {
  background: #efefef;
  color: #000000;
}
.template-igdm.dark-theme .igdm-bubble.incoming {
  background: #262626;
  color: #ffffff;
}
.igdm-bubble.outgoing {
  background: linear-gradient(135deg, #3797f0 0%, #833ab4 50%, #e1306c 100%);
  color: #ffffff;
}

.igdm-heart-reaction {
  position: absolute;
  bottom: -9px;
  left: 36px;
  background: #ffffff;
  border-radius: 9999px;
  padding: 1px 5px;
  font-size: 0.68rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #efefef;
}
.template-igdm.dark-theme .igdm-heart-reaction {
  background: #262626;
  border-color: #333333;
}

/* Updated Chat Simulation Watermark */
.simulation-disclaimer-tag {
  background: rgba(0,0,0,0.05);
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  letter-spacing: 0.04em;
  border-top: 1px dashed rgba(0,0,0,0.08);
}
.dark-theme .simulation-disclaimer-tag {
  background: rgba(255,255,255,0.04);
  color: #94a3b8;
  border-top-color: rgba(255,255,255,0.08);
}


