/*
 * ═══════════════════════════════════════════════════════════════
 *  SALMART — POST DETAILS PAGE
 *  Scope: Header · Comment Input · Comments · Reactions · Toast
 *  Post card styles live in posts.css — NOT here.
 * ═══════════════════════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Syne:wght@600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --accent:          #00e676;
  --accent-dim:      #00c853;
  --accent-glow:     rgba(0, 230, 118, 0.18);
  --accent-glow-sm:  rgba(0, 230, 118, 0.10);

  /* Light surface */
  --bg:              #f4f5f7;
  --surface:         #ffffff;
  --surface-2:       #f8f9fb;
  --surface-3:       #eef0f4;
  --border:          rgba(0, 0, 0, 0.07);
  --border-strong:   rgba(0, 0, 0, 0.12);

  /* Text */
  --text-1:          #0d0f12;
  --text-2:          #44474e;
  --text-3:          #8c909a;
  --text-inv:        #ffffff;

  /* Semantics */
  --danger:          #ff4444;
  --warn:            #ffb300;
  --info:            #2979ff;
  --success:         #00e676;

  /* Geometry */
  --r-sm:   6px;
  --r-md:   14px;
  --r-lg:   22px;
  --r-full: 9999px;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:  0.15s;
  --t-base:  0.25s;
  --t-slow:  0.4s;

  /* Elevation */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-accent: 0 0 0 3px var(--accent-glow);

  /* Fonts */
  --font-ui:      'DM Sans', system-ui, sans-serif;
  --font-display: 'Syne', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #0a0b0d;
    --surface:        #111318;
    --surface-2:      #181b21;
    --surface-3:      #1e222a;
    --border:         rgba(255,255,255,0.06);
    --border-strong:  rgba(255,255,255,0.11);

    --text-1:         #eceef2;
    --text-2:         #9ea3af;
    --text-3:         #5a5f6b;
    --text-inv:       #0a0b0d;

    --shadow-sm:  0 1px 4px rgba(0,0,0,0.4),  0 0 0 1px rgba(255,255,255,0.04);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.5),  0 1px 4px rgba(0,0,0,0.3);
    --shadow-lg:  0 16px 48px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  }
}

/* ═══════════════════════════════════════════════════════════════
   BASE RESET (scoped — avoid stomping posts.css)
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: var(--font-ui);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 96px;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.post-details-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.header-left,
.header-right { flex: 0 0 44px; }

.header-center {
  flex: 1;
  text-align: center;
  overflow: hidden;
}

#post-creator {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  color: var(--text-1);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background var(--t-fast) ease, transform var(--t-fast) ease;
}

.back-button:hover  { background: var(--surface-3); }
.back-button:active { transform: scale(0.88); }

/* ═══════════════════════════════════════════════════════════════
   POST DETAILS CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.post-details-container {
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   COMMENTS SECTION WRAPPER
   ═══════════════════════════════════════════════════════════════ */
.comments-section {
  background: var(--surface);
  border-radius: var(--r-lg);
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.comments-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-header h3::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.comments-count {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0;
  text-transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   FIX 2: COMMENTS LIST — SCROLLABLE WITH MAX HEIGHT
   ═══════════════════════════════════════════════════════════════ */
.comments-list {
  /* FIX: Cap height and make it scrollable within the section itself */
  max-height: 480px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 8px 0;
}

.comments-list::-webkit-scrollbar        { width: 4px; }
.comments-list::-webkit-scrollbar-track  { background: transparent; }
.comments-list::-webkit-scrollbar-thumb  {
  background: var(--border-strong);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   COMMENT ITEM
   ═══════════════════════════════════════════════════════════════ */
.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  position: relative;
  transition: background var(--t-fast) ease;
  animation: commentReveal var(--t-slow) var(--ease-out-expo) both;
}

@keyframes commentReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.comment-item:hover { background: var(--surface-2); }

/* Optimistic state */
.comment-item.optimistic-comment {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-left: 2px solid var(--accent);
}

.comment-avatar-link { flex-shrink: 0; text-decoration: none; }

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 2px solid var(--border-strong);
  transition: transform var(--t-fast) var(--ease-spring),
              border-color var(--t-fast) ease;
  display: block;
}

.comment-avatar-link:hover .comment-avatar {
  transform: scale(1.06);
  border-color: var(--accent);
}

.comment-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Bubble */
.comment-bubble {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface-3);
  padding: 10px 14px;
  border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg);
  max-width: 100%;
  position: relative;
  transition: background var(--t-fast) ease;
}

.comment-item:hover .comment-bubble {
  background: color-mix(in srgb, var(--surface-3) 80%, var(--bg));
}

.comment-author {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-1);
  text-decoration: none;
  line-height: 1.2;
  transition: color var(--t-fast) ease;
}

.comment-author:hover { color: var(--accent-dim); }

.comment-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  word-break: break-word;
  white-space: pre-wrap;
}

/* Comment meta row */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 2px;
  flex-wrap: wrap;
}

.comment-time {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 500;
}

/* FIX 1: Reply count with icon */
.replies-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--accent-dim);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
  text-decoration: none;
  line-height: 1.4;
}

.replies-count i {
  font-size: 10px;
  opacity: 0.85;
}

.replies-count:hover {
  background: var(--accent-glow-sm);
  color: var(--accent-dim);
}

/* Optimistic loading indicator */
.optimistic-loading {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--accent-dim);
  font-weight: 600;
}

.optimistic-loading i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   NO COMMENTS
   ═══════════════════════════════════════════════════════════════ */
.no-comments {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--text-3);
}

.no-comments i {
  font-size: 36px;
  opacity: 0.4;
}

.no-comments p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   REACTION ACTION BAR
   ═══════════════════════════════════════════════════════════════ */
.comment-action-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  flex-wrap: wrap;
}

.comment-age-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  margin-left: auto;
}

/* React button */
.reaction-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-full);
  transition: color var(--t-fast) ease,
              background var(--t-fast) ease,
              transform var(--t-fast) var(--ease-spring);
  font-family: var(--font-ui);
  user-select: none;
  line-height: 1;
}

.react-btn:hover {
  color: var(--text-1);
  background: var(--surface-3);
}

.react-btn:active  { transform: scale(0.90); }

.react-btn.reacted {
  color: #e0245e;
  background: rgba(224, 36, 94, 0.08);
}

.react-btn.reacted svg { stroke: #e0245e; fill: #e0245e; }
.react-btn svg { flex-shrink: 0; transition: fill var(--t-fast), stroke var(--t-fast); }

.react-label    { font-size: 12px; }
.current-emoji  { font-size: 15px; line-height: 1; }

/* Reply action button */
.reply-action-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-full);
  transition: color var(--t-fast) ease, background var(--t-fast) ease;
  font-family: var(--font-ui);
}

.reply-action-btn:hover {
  color: var(--text-1);
  background: var(--surface-3);
}

/* Reaction summary pill */
.reaction-summary-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  padding: 3px 9px 3px 6px;
  cursor: pointer;
  transition: box-shadow var(--t-fast) ease,
              transform var(--t-fast) var(--ease-spring),
              border-color var(--t-fast) ease;
  font-family: var(--font-ui);
  box-shadow: var(--shadow-sm);
}

.reaction-summary-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow-sm), var(--shadow-sm);
  transform: translateY(-1px);
}

.top-emoji      { font-size: 14px; line-height: 1; }
.reaction-total {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   FIX 3: EMOJI PICKER — PROPERLY CENTERED
   Uses fixed positioning anchored to viewport center on mobile,
   and absolute relative to reaction-wrapper on wider screens.
   ═══════════════════════════════════════════════════════════════ */
.emoji-picker {
  /* Default: absolute, centered above the react button */
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.7) translateY(10px);
  transform-origin: bottom center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  padding: 8px 10px;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity  0.2s var(--ease-out-expo),
    transform 0.25s var(--ease-spring);
  white-space: nowrap;
  /* Prevent it from overflowing off-screen edges */
  max-width: calc(100vw - 32px);
}

/* Caret */
.emoji-picker::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 11px;
  height: 11px;
  background: var(--surface);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.emoji-picker.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(0);
}

/* ── Mobile: switch to fixed viewport-centered positioning ── */
@media (max-width: 680px) {
  .emoji-picker {
    /* Detach from parent, center in viewport */
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    transform-origin: center center;
    border-radius: var(--r-full);
    padding: 10px 12px;
    /* Hide caret on fixed mode — it would be mispositioned */
  }

  .emoji-picker::after {
    display: none;
  }

  .emoji-picker.open {
    transform: translate(-50%, -50%) scale(1);
  }

  /* Backdrop overlay so user can tap outside to close */
  .emoji-picker.open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: -1;
    border-radius: 0;
  }
}

/* Emoji option */
.emoji-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: var(--r-lg);
  transition:
    background var(--t-fast) ease,
    transform  0.2s var(--ease-spring);
  font-family: var(--font-ui);
}

.emoji-picker.open .emoji-option {
  animation: emojiIn 0.28s var(--ease-spring) both;
}

.emoji-picker.open .emoji-option:nth-child(1) { animation-delay:  0ms; }
.emoji-picker.open .emoji-option:nth-child(2) { animation-delay: 30ms; }
.emoji-picker.open .emoji-option:nth-child(3) { animation-delay: 60ms; }
.emoji-picker.open .emoji-option:nth-child(4) { animation-delay: 90ms; }
.emoji-picker.open .emoji-option:nth-child(5) { animation-delay:120ms; }
.emoji-picker.open .emoji-option:nth-child(6) { animation-delay:150ms; }

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

.emoji-option:hover {
  background: var(--surface-3);
  transform: scale(1.3) translateY(-4px);
}

.emoji-option:active  { transform: scale(1.1); }

.emoji-option.selected { background: rgba(224, 36, 94, 0.1); }
.emoji-option.selected .eo-label { color: #e0245e; font-weight: 700; }

.eo-emoji {
  font-size: 22px;
  line-height: 1;
  display: block;
  transition: transform var(--t-fast) ease;
}

.emoji-option:hover .eo-emoji { transform: scale(1.1); }

.eo-label {
  font-size: 9px;
  color: var(--text-3);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   COMMENT INPUT — STICKY BAR
   ═══════════════════════════════════════════════════════════════ */
.comment-input-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 10px 16px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.07);
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .comment-input-sticky {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

.comment-input-sticky-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
}

.comment-input-sticky:not(:has(.comment-input-sticky-inner)) {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
}

#user-avatar.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  transition: border-color var(--t-fast) ease;
}

.comment-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.comment-input,
#comment-input-field {
  width: 100%;
  padding: 11px 50px 11px 16px;
  background: var(--surface-3);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-full);
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--text-1);
  outline: none;
  transition:
    border-color var(--t-base) ease,
    background   var(--t-base) ease,
    box-shadow   var(--t-base) ease;
  caret-color: var(--accent);
  line-height: 1.4;
}

.comment-input::placeholder,
#comment-input-field::placeholder {
  color: var(--text-3);
}

.comment-input:focus,
#comment-input-field:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.comment-submit,
#comment-submit {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--text-inv);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition:
    background  var(--t-fast) ease,
    transform   var(--t-fast) var(--ease-spring),
    box-shadow  var(--t-fast) ease,
    opacity     var(--t-fast) ease;
  box-shadow: 0 2px 10px rgba(0, 230, 118, 0.4);
}

.comment-submit:hover:not(:disabled),
#comment-submit:hover:not(:disabled) {
  background: var(--accent-dim);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 18px rgba(0, 230, 118, 0.5);
}

.comment-submit:active:not(:disabled),
#comment-submit:active:not(:disabled) {
  transform: translateY(-50%) scale(0.92);
}

.comment-submit:disabled,
#comment-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.comment-input-sticky > .comment-submit,
.comment-input-sticky > #comment-submit {
  position: static;
  transform: none;
  width: 44px;
  height: 44px;
  font-size: 18px;
  flex-shrink: 0;
  border-radius: var(--r-full);
}

.comment-input-sticky > .comment-submit:hover:not(:disabled),
.comment-input-sticky > #comment-submit:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(0, 230, 118, 0.5);
}

.comment-input-sticky > .comment-submit:active:not(:disabled),
.comment-input-sticky > #comment-submit:active:not(:disabled) {
  transform: scale(0.93);
}

.comment-input-sticky > .comment-input,
.comment-input-sticky > #comment-input-field {
  padding-right: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════════ */
.post-skeleton {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton-avatar,
.skeleton-line,
.skeleton-content,
.skeleton-media,
.skeleton-button {
  background: linear-gradient(
    90deg,
    var(--surface-3) 25%,
    var(--surface-2) 50%,
    var(--surface-3) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--r-sm);
}

.skeleton-avatar  { width: 42px; height: 42px; border-radius: var(--r-full); flex-shrink: 0; }
.skeleton-info    { flex: 1; }
.skeleton-line    { height: 11px; margin-bottom: 8px; border-radius: var(--r-full); }
.skeleton-line.short { width: 55%; }
.skeleton-content { height: 72px; margin-bottom: 14px; }
.skeleton-media   { height: 280px; margin-bottom: 14px; border-radius: var(--r-md); }
.skeleton-actions { display: flex; gap: 10px; }
.skeleton-button  { flex: 1; height: 38px; border-radius: var(--r-full); }

/* ═══════════════════════════════════════════════════════════════
   ERROR STATE
   ═══════════════════════════════════════════════════════════════ */
.error-state {
  text-align: center;
  padding: 72px 32px;
  background: var(--surface);
  border-radius: var(--r-lg);
  margin-top: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.error-state i {
  font-size: 52px;
  color: var(--danger);
  margin-bottom: 18px;
  opacity: 0.85;
  display: block;
}

.error-state h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}

.error-state p {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.retry-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--text-inv);
  border: none;
  padding: 12px 28px;
  border-radius: var(--r-full);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t-fast) ease,
              transform  var(--t-fast) var(--ease-spring),
              box-shadow var(--t-fast) ease;
  box-shadow: 0 4px 16px rgba(0, 230, 118, 0.35);
}

.retry-button:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transition:
    opacity   0.3s var(--ease-out-expo),
    transform 0.3s var(--ease-spring);
  white-space: nowrap;
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-message i { font-size: 15px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   IMAGE MODAL
   ═══════════════════════════════════════════════════════════════ */
.image-modal {
  animation: modalIn 0.22s var(--ease-out-expo) both;
}

@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.post-time {
  margin-top: -5px !important;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 680px) {
  .container { padding-bottom: 100px; }

  .comments-section { border-radius: 0; border-left: none; border-right: none; }

  /* FIX 2 (mobile): slightly shorter to leave room for input bar */
  .comments-list { max-height: 360px; }

  .comment-item { padding: 11px 14px; }

  .comment-input-sticky { padding: 10px 12px 14px; }

  .eo-label { display: none; }
  .eo-emoji { font-size: 24px; }
  .emoji-option { padding: 5px 5px; }
}

@media (min-width: 681px) {
  .post-details-header {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
  }

  .comment-input-sticky {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
