@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bg: #0B0B10;
  --surface: #16161D;
  --surface-2: #1E1E27;
  --surface-3: #262631;
  --text: #F1F0F5;
  --muted: #8B8A99;
  --border: rgba(255,255,255,0.08);
  --violet: #8B7CF6;
  --violet-2: #6C5CE0;
  --rose: #F2678C;
  --gold: #E8B75A;
  --shadow: 0 8px 30px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius-sm: 12px;
  font-size: 16px;
}

html[data-theme="light"] {
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --surface-2: #F1EEE8;
  --surface-3: #E9E5DD;
  --text: #1B1A22;
  --muted: #6E6C7C;
  --border: rgba(20,18,30,0.08);
  --shadow: 0 8px 24px rgba(30,25,15,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  transition: background .4s ease, color .4s ease;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--violet); color: #fff; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--violet), var(--rose), var(--gold), var(--violet));
  flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--muted); margin-top: -2px; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: transform .3s ease;
}
.theme-toggle:active { transform: scale(0.9) rotate(20deg); }

/* ===== Stories rail ===== */
.stories-rail {
  display: flex; gap: 18px; overflow-x: auto;
  padding: 20px 24px; scrollbar-width: none;
}
.stories-rail::-webkit-scrollbar { display: none; }

.story-item { flex-shrink: 0; text-align: center; width: 76px; cursor: pointer; }
.story-ring {
  width: 68px; height: 68px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from var(--ring-angle, 0deg), var(--violet), var(--rose), var(--violet));
  animation: spin 6s linear infinite;
  margin: 0 auto;
}
.story-item.seen .story-ring { animation: none; background: var(--border); }
.story-item.highlight .story-ring { animation: none; background: linear-gradient(135deg, var(--gold), #fff3d6, var(--gold)); }
@keyframes spin { to { --ring-angle: 360deg; } }
@property --ring-angle { syntax: '<angle>'; inherits: true; initial-value: 0deg; }

.story-thumb {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--bg); background: var(--surface-2);
}
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-label { font-size: 0.72rem; margin-top: 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-add {
  width: 68px; height: 68px; border-radius: 50%; border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--muted);
}

/* ===== Layout / columns ===== */
.feed {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  padding: 8px 24px 60px; max-width: 1280px; margin: 0 auto;
}
.column { display: flex; flex-direction: column; gap: 16px; position: relative; }
.column::before {
  content: ''; position: absolute; top: 8px; bottom: 8px; right: 27px;
  width: 2px; background: linear-gradient(var(--border), transparent);
  z-index: 0;
}
.column-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 4px; }
.column-head h2 { font-size: 1rem; margin: 0; font-weight: 800; }
.column-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.col-posts .dot { background: var(--violet); }
.col-tweets .dot { background: var(--rose); }
.col-gallery .dot { background: var(--gold); }

@media (max-width: 980px) {
  .feed { grid-template-columns: 1fr; max-width: 640px; }
}

/* ===== Cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; position: relative; z-index: 1; box-shadow: var(--shadow);
  animation: rise .5s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card-time { font-size: 0.72rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.card-time .tdot { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }

.card-img { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; background: var(--surface-2); }
.card-img img { width: 100%; height: auto; }
.card-caption { font-size: 0.9rem; line-height: 1.9; margin-bottom: 10px; }
.tweet-card .card-caption { font-size: 0.98rem; }

.card-actions { display: flex; align-items: center; gap: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
.action-btn { display: flex; align-items: center; gap: 5px; background: none; border: none; color: var(--muted); font-size: 0.82rem; }
.action-btn.liked { color: var(--rose); }
.action-btn:hover { color: var(--text); }
.action-btn .n { font-variant-numeric: tabular-nums; }

.gallery-card .card-img { aspect-ratio: 1/1; }
.gallery-card .card-img img { width: 100%; height: 100%; object-fit: cover; }

/* Comments */
.comments-box { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.comment-toggle { font-size: 0.78rem; color: var(--violet); background: none; border: none; }
.comment-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.comment-item { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 0.82rem; }
.comment-item b { color: var(--violet); }
.comment-form { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.comment-form input, .comment-form textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  padding: 8px 10px; font-family: inherit; font-size: 0.8rem;
}
.comment-form input { flex: 1; min-width: 90px; }
.comment-form textarea { width: 100%; resize: vertical; min-height: 40px; }
.comment-form button { background: var(--violet); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 0.8rem; font-weight: 700; }

.empty-state { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 0.85rem; }

/* ===== Story viewer ===== */
.story-viewer {
  position: fixed; inset: 0; background: #000; z-index: 100;
  display: none; align-items: center; justify-content: center;
}
.story-viewer.open { display: flex; }
.story-viewer-inner { width: 100%; max-width: 420px; height: 100%; max-height: 100vh; position: relative; display: flex; flex-direction: column; }
.story-progress { display: flex; gap: 4px; padding: 10px 10px 0; }
.story-progress .bar { flex: 1; height: 3px; background: rgba(255,255,255,0.3); border-radius: 3px; overflow: hidden; }
.story-progress .bar span { display: block; height: 100%; width: 0%; background: #fff; }
.story-progress .bar.done span { width: 100%; }
.story-viewer-media { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-viewer-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.story-viewer-cap { color: #fff; padding: 14px; font-size: 0.9rem; background: linear-gradient(transparent, rgba(0,0,0,0.6)); position: absolute; bottom: 0; left: 0; right: 0; }
.story-viewer-close { position: absolute; top: 14px; left: 14px; color: #fff; background: rgba(255,255,255,0.15); border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; z-index: 5; }
.story-viewer-meta { position: absolute; top: 20px; right: 16px; color: #fff; font-size: 0.75rem; opacity: 0.85; }
.story-tap-zone { position: absolute; top: 0; bottom: 0; width: 40%; z-index: 3; }
.story-tap-zone.right { right: 0; }
.story-tap-zone.left { left: 0; }

footer.site-footer { text-align: center; padding: 30px; color: var(--muted); font-size: 0.78rem; }

/* ===== نسخه ۲: مقاله، نگارخانه گرید، مودال‌ها ===== */

.column-head { justify-content: space-between; }
.column-head .grid-toggle {
  margin-right: auto; background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; width: 30px; height: 30px; font-size: 0.9rem;
}

/* مقاله */
.article-title { font-size: 1.02rem; font-weight: 800; margin: 0 0 8px; line-height: 1.6; }
.excerpt { color: var(--text); opacity: 0.9; }
.excerpt a, .tweet-text a, .comment-item a { color: var(--violet); text-decoration: underline; word-break: break-all; }
.read-more-btn {
  background: none; border: none; color: var(--violet); font-size: 0.82rem; font-weight: 700;
  padding: 0; margin: 4px 0 10px; display: block;
}

/* استوری ویدیو */
.story-thumb video, .story-viewer-media video { width: 100%; height: 100%; object-fit: cover; }
.story-viewer-media video { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ===== مودال‌های عمومی ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 120;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); max-width: 620px; width: 100%;
  max-height: 88vh; position: relative; box-shadow: var(--shadow); border: 1px solid var(--border);
  animation: rise .3s ease both;
}
.modal-close {
  position: absolute; top: 12px; left: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 0.95rem; z-index: 5;
}
.modal-scroll { padding: 26px 22px; overflow-y: auto; max-height: 88vh; }
.article-modal .modal-scroll h2 { font-size: 1.25rem; margin: 6px 0 4px; }
.article-modal img, .article-modal video { width: 100%; border-radius: var(--radius-sm); margin: 10px 0; }
.article-modal .body-content { line-height: 2; font-size: 0.95rem; }
.article-modal .body-content p { margin: 0 0 14px; }

/* لایت‌باکس نگارخانه */
.lightbox-box { max-width: 720px; background: #000; }
.lightbox-box img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-cap { color: #fff; padding: 12px 16px; font-size: 0.85rem; }

/* گرید نگارخانه ۴تایی */
.gallery-grid.grid-mode {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.gallery-grid.grid-mode::before { display: none; }
.gallery-tile { margin: 0; position: relative; cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1/1; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-tile:hover img { transform: scale(1.06); }
.gallery-tile figcaption { display: none; }
.gallery-tile .gallery-mini-stats {
  position: absolute; bottom: 4px; right: 6px; font-size: 0.65rem; color: #fff;
  background: rgba(0,0,0,0.45); padding: 1px 6px; border-radius: 8px;
}
.gallery-grid:not(.grid-mode) .gallery-tile { aspect-ratio: auto; margin-bottom: 4px; }
.gallery-grid:not(.grid-mode) .gallery-tile figcaption { display: block; padding: 8px 2px; font-size: 0.82rem; color: var(--muted); }

/* نسخه/نقشه راه */
.version-badge { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); border-radius: 20px; padding: 4px 12px; font-size: 0.75rem; }
.version-modal h2 { margin-top: 4px; }
.v-credit { font-size: 0.82rem; color: var(--muted); }
.v-credit a { color: var(--violet); }
.roadmap-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.roadmap-list li { font-size: 0.85rem; display: flex; gap: 8px; align-items: center; }
.badge-done, .badge-next { font-size: 0.65rem; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; }
.badge-done { background: rgba(139,124,246,0.18); color: var(--violet); }
.badge-next { background: var(--surface-2); color: var(--muted); }

/* ===== نسخه ۳: پلیر موزیک، فیلتر نگارخانه، اسکرول نوشته‌ها ===== */

/* نوار پلیر بالای صفحه */
.player-bar {
  position: sticky; top: 0; z-index: 50; display: none; align-items: center; gap: 12px;
  padding: 8px 20px; background: linear-gradient(90deg, var(--violet-2), var(--violet));
  color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.player-bar.open { display: flex; }
.player-cover { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: rgba(255,255,255,0.2); flex-shrink: 0; }
.player-info { min-width: 0; flex-shrink: 0; width: 140px; }
.player-title { font-size: 0.82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 0.7rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-seek { flex: 1; accent-color: #fff; height: 4px; cursor: pointer; }
.player-time { font-size: 0.7rem; opacity: 0.9; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.player-btn { background: rgba(255,255,255,0.18); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 0.9rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.player-download { text-decoration: none; }
@media (max-width: 700px) { .player-info { width: 80px; } }

/* اسکرول مستقل ستون نوشته‌ها */
.tweets-scroll { max-height: calc(100vh - 160px); overflow-y: auto; padding-left: 6px; }
.tweets-scroll::-webkit-scrollbar { width: 6px; }
.tweets-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.loading-more { text-align: center; font-size: 0.78rem; color: var(--muted); padding: 10px; }
.scroll-sentinel { height: 1px; }

/* فیلتر نگارخانه */
.gallery-filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.filter-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 16px; padding: 5px 14px; font-size: 0.78rem; }
.filter-btn.active { background: var(--violet); color: #fff; border-color: var(--violet); }

/* موزیک تایل داخل نگارخانه */
.gallery-tile.music-tile { background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); display: flex; align-items: center; justify-content: center; position: relative; }
.gallery-tile.music-tile img.cover-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.gallery-tile.music-tile .music-play-icon {
  position: absolute; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.92);
  color: #111; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.gallery-grid:not(.grid-mode) .gallery-tile.music-tile { aspect-ratio: 1/1; }
.gallery-tile.video-tile video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* ویجت آهنگ داخل مقاله/نوشته */
.embed-audio {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 12px; margin: 10px 0; cursor: pointer;
}
.embed-audio .ea-cover { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.embed-audio .ea-play { width: 32px; height: 32px; border-radius: 50%; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.embed-audio .ea-meta { min-width: 0; }
.embed-audio .ea-title { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.embed-audio .ea-artist { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== نسخه ۴: پروفایل، پیام خصوصی، وویس، استیکر ===== */

/* پروفایل در هدر */
.brand-mark { cursor: pointer; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.brand-name-wrap { cursor: pointer; }

.about-modal .about-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 4px auto 14px; border: 3px solid var(--violet); cursor: zoom-in; }
.about-modal h2 { text-align: center; margin: 0 0 4px; }
.about-modal .about-bio { line-height: 2; font-size: 0.92rem; white-space: pre-wrap; margin-top: 10px; }
.photo-zoom-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 140; display: none; align-items: center; justify-content: center; padding: 20px; }
.photo-zoom-overlay.open { display: flex; }
.photo-zoom-overlay img { max-width: 100%; max-height: 90vh; border-radius: 12px; }

/* دکمه شناور پیام خصوصی */
.dm-fab {
  position: fixed; bottom: 20px; left: 20px; z-index: 40; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--rose)); color: #fff; border: none; font-size: 1.3rem;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
}
.dm-modal .field { margin-bottom: 12px; }
.dm-modal label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.dm-modal input, .dm-modal textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: inherit; box-sizing: border-box;
}
.dm-modal textarea { min-height: 80px; resize: vertical; }
.dm-modal .btn { background: var(--violet); color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-weight: 700; width: 100%; }

/* ضبط صدا */
.voice-recorder { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-top: 6px; }
.voice-rec-btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--rose); color: #fff; font-size: 1rem; flex-shrink: 0; }
.voice-rec-btn.recording { animation: pulse-rec 1s infinite; }
@keyframes pulse-rec { 0%,100% { box-shadow: 0 0 0 0 rgba(242,103,140,0.5);} 50% { box-shadow: 0 0 0 8px rgba(242,103,140,0);} }
.voice-rec-status { font-size: 0.78rem; color: var(--muted); flex: 1; }
.voice-rec-remove { background: none; border: none; color: var(--muted); font-size: 0.85rem; }

/* ویجت وویس داخل مقاله/نوشته */
.embed-voice {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 14px; margin: 8px 0; cursor: pointer; width: fit-content; max-width: 100%;
}
.embed-voice .ev-play { width: 30px; height: 30px; border-radius: 50%; background: var(--rose); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.embed-voice .ev-label { font-size: 0.82rem; color: var(--muted); }

/* استیکر اینلاین */
.inline-sticker { width: 96px; height: 96px; object-fit: contain; display: inline-block; vertical-align: middle; margin: 4px; border-radius: 8px; }

/* ===== نسخه ۵: هوم، نوار پایین، سرچ، دانلود، ریپلای/ریتویت، اصلاح موبایل ===== */

.topbar-actions { display: flex; gap: 8px; }

/* نوار پایین صفحه — فقط موبایل (در دسکتاپ پنهان است، پایین در media query فعال می‌شود) */
.bottom-nav {
  position: sticky; bottom: 0; z-index: 45; display: none; background: var(--surface);
  border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
}
.bn-btn {
  flex: 1; background: none; border: none; color: var(--muted); font-size: 0.68rem; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px;
}
.bn-btn span { font-size: 1.15rem; }
.bn-btn.active { color: var(--violet); background: rgba(139,124,246,0.1); }

/* بنر محتوای جدید */
.new-content-pill {
  position: sticky; top: 66px; z-index: 35; display: block; margin: 0 auto; background: var(--violet);
  color: #fff; border: none; border-radius: 20px; padding: 8px 18px; font-size: 0.8rem; font-weight: 700;
  box-shadow: var(--shadow);
}

/* اسکرول ستون + دکمه برو بالا */
.col-scroll-wrap { position: relative; }
.jump-top-btn {
  position: sticky; bottom: 10px; float: left; margin-top: -50px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); z-index: 5;
}

/* هوم یکپارچه */
.col-home { max-width: 640px; margin: 0 auto; width: 100%; }
.home-scroll { max-height: calc(100vh - 200px); display: flex; flex-direction: column; }
#homeList { display: flex; flex-direction: column; gap: 14px; }
.home-item { display: flex; gap: 4px; align-items: center; font-size: 0.7rem; color: var(--muted); margin-bottom: -8px; }

/* سرچ */
.search-modal { max-width: 500px; }
.search-input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; box-sizing: border-box; margin-bottom: 12px; }
.search-result-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; align-items: center; }
.search-result-item:hover { background: var(--surface-2); }
.search-result-item img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.search-result-item .sr-title { font-size: 0.85rem; }
.search-result-item .sr-snippet { font-size: 0.72rem; color: var(--muted); }
.search-result-item .sr-badge { font-size: 0.62rem; color: var(--violet); }

/* دانلود روی محتوا */
.lightbox-actions { display: flex; justify-content: center; padding: 10px; }
.lightbox-actions .action-btn { color: #fff; }

/* ریپلای/ریتویت */
.ref-preview {
  display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; margin-bottom: 8px; cursor: pointer;
}
.ref-preview img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ref-preview .rp-label { font-size: 0.68rem; color: var(--violet); }
.ref-preview .rp-title { font-size: 0.8rem; }

/* استوری: لایک/کامنت */
.story-viewer-actions { position: absolute; bottom: 60px; left: 16px; z-index: 5; display: flex; gap: 10px; }
.story-viewer-actions .action-btn { background: rgba(0,0,0,0.4); color: #fff; border-radius: 20px; padding: 6px 12px; }
.story-comment-box { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.85); padding: 12px; z-index: 6; max-height: 40%; overflow-y: auto; }
.story-comment-box .comment-item { background: rgba(255,255,255,0.1); color: #fff; }
.story-comment-box .comment-form input, .story-comment-box .comment-form textarea { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); }

/* ===== موبایل: اصلاحات کلی ===== */
@media (max-width: 700px) {
  .topbar { padding: 12px 14px; }
  .brand-mark { width: 40px; height: 40px; }
  .stories-rail { padding: 14px 14px; gap: 14px; }
  .feed { padding: 8px 12px 20px; gap: 16px; }
  .player-bar { padding: 6px 10px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
  .player-seek { min-width: 50px; }
  .new-content-pill { top: 60px; }
  .search-modal, .about-modal, .dm-modal { max-width: 94vw; }
  .gallery-grid.grid-mode { grid-template-columns: repeat(3, 1fr); }
  .bottom-nav { display: flex; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .dm-fab { bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* دکمه‌های مخصوص ادمین روی سایت اصلی (فقط وقتی از همون مرورگر لاگین است) */
.admin-only { display: none !important; }
.is-admin .admin-only { display: inline-flex !important; }

.home-card { max-width: 100%; }

.col-tweets { position: relative; }
.col-tweets > .jump-top-btn {
  position: sticky; bottom: 10px; float: left; margin-top: -48px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); z-index: 6;
}

/* ===== نسخه ۶: جزئیات آهنگ، صف پخش، انتخاب پلی‌لیست ===== */

.playlist-select-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.8rem; color: var(--muted); }
.playlist-select-wrap select {
  flex: 1; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: inherit;
}

/* مودال جزئیات آهنگ */
.music-modal { text-align: center; max-width: 380px; }
.music-modal-cover { width: 220px; height: 220px; border-radius: 16px; object-fit: cover; margin: 10px auto 16px; box-shadow: var(--shadow); background: var(--surface-2); }
.music-modal .modal-scroll h2 { margin: 0 0 4px; font-size: 1.15rem; }
.music-modal-artist { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.music-modal-actions { display: flex; gap: 10px; justify-content: center; align-items: center; }
.music-modal-actions .btn { background: var(--violet); color: #fff; border: none; border-radius: 24px; padding: 10px 26px; font-weight: 700; }

/* پنل صف پخش */
.queue-panel {
  position: fixed; top: 0; left: 0; right: 0; z-index: 55; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow); max-height: 60vh; display: flex; flex-direction: column;
  transform: translateY(-100%); transition: transform .25s ease;
}
.queue-panel.open { transform: translateY(0); }
.queue-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.queue-panel-head h3 { margin: 0; font-size: 0.95rem; }
.icon-x { background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; color: var(--text); }
.queue-track-list { overflow-y: auto; padding: 0 10px; flex: 1; }
.queue-track-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; cursor: pointer;
}
.queue-track-row:hover { background: var(--surface-2); }
.queue-track-row.playing { background: rgba(139,124,246,0.12); }
.queue-track-row img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.queue-track-row .qt-meta { flex: 1; min-width: 0; }
.queue-track-row .qt-title { font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-track-row .qt-artist { font-size: 0.7rem; color: var(--muted); }
.queue-track-row .qt-remove { background: none; border: none; color: var(--muted); font-size: 0.9rem; padding: 4px 8px; flex-shrink: 0; }
.queue-track-row .qt-remove:hover { color: var(--rose); }
.queue-add-btn { margin: 10px 16px 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--violet); border-radius: 10px; padding: 10px; font-weight: 700; font-size: 0.85rem; }

/* ===== نسخه ۷: رفع باگ مهم CSS ===== */
/*
  باگ واقعی: کلاس‌هایی مثل .column و .playlist-select-wrap مقدار
  display را صریح ست کرده بودند (مثلاً display:flex). چون این‌ها
  همون تعداد specificity رو دارن که قانون پیش‌فرض مرورگر برای
  ویژگی [hidden] داره (که display:none می‌کنه)، و در کد ما بعد از
  اون تعریف شده بودن، همیشه برنده می‌شدن — یعنی وقتی جاوااسکریپت
  element.hidden = true می‌کرد، عنصر همچنان دیده می‌شد! این دقیقاً
  چرا تب «خانه» توی دسکتاپ قایم نمی‌شد و چرا انتخابگر پلی‌لیست حتی
  برای فیلترهای غیر از «آهنگ» هم نمایش داده می‌شد.
  این قانون با !important تضمین می‌کنه [hidden] همیشه واقعاً مخفی باشه.
*/
[hidden] { display: none !important; }

.player-btn.mode-active { color: var(--gold); background: rgba(232,183,90,0.2); }

/* کارت پخش کامل (Now Playing) */
.player-tap-open { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.music-modal { text-align: center; max-width: 380px; }
.music-modal-cover { width: 220px; height: 220px; border-radius: 16px; object-fit: cover; margin: 10px auto 16px; box-shadow: var(--shadow); background: var(--surface-2); display: block; }
.music-modal .modal-scroll h2 { margin: 0 0 4px; font-size: 1.15rem; }
.music-modal-artist { color: var(--muted); font-size: 0.9rem; margin: 0 0 14px; }
.music-modal-seek { width: 100%; accent-color: var(--violet); margin-bottom: 4px; }
.music-modal-time { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.music-modal-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 20px; }
.mm-ctrl-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.mm-ctrl-btn.mode-active { color: var(--gold); background: rgba(232,183,90,0.2); }
.mm-play { width: 56px; height: 56px; background: var(--violet); color: #fff; font-size: 1.3rem; border: none; }
.music-modal-actions { display: flex; justify-content: center; gap: 14px; border-top: 1px solid var(--border); padding-top: 14px; }

.player-bar.force-hide { display: none; }
