/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:  #f97316;
  --bg:      #0f172a;
  --bg2:     #1e293b;
  --bg3:     #334155;
  --text:    #e2e8f0;
  --text2:   #94a3b8;
  --border:  #334155;
  --success: #22c55e;
  --danger:  #ef4444;
  --radius:  12px;
  --shadow:  0 4px 24px rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; }
body { font-family: var(--font, system-ui, -apple-system, sans-serif); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
textarea, input, select { font-family: inherit; }
code { background: var(--bg3); border-radius: 4px; padding: 1px 6px; font-size: .85em; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.layout-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; padding-top: 24px; padding-bottom: 40px; }
@media (max-width: 860px) { .layout-grid { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ===== NAVBAR ===== */
.navbar { background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { display: flex; align-items: center; gap: 12px; height: 58px; }
.nav-logo { font-size: 1.3rem; font-weight: 800; color: var(--accent); flex-shrink: 0; white-space: nowrap; }
.nav-logo:hover { text-decoration: none; }
.nav-logo-img { flex-shrink: 0; display: flex; align-items: center; }
.site-logo { max-height: 36px; width: auto; object-fit: contain; }
.nav-tabs { display: flex; gap: 2px; flex: 1; overflow: hidden; }
.nav-tab { padding: 6px 12px; border-radius: 8px; color: var(--text2); font-size: .88rem; white-space: nowrap; transition: background .15s, color .15s; }
.nav-tab:hover, .nav-tab.active { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.nav-search { display: flex; background: var(--bg3); border-radius: 8px; overflow: hidden; }
.nav-search input { background: none; border: none; padding: 7px 12px; color: var(--text); width: 150px; outline: none; font-size: .88rem; }
.nav-search input::placeholder { color: var(--text2); }
.nav-search button { background: none; border: none; color: var(--text2); padding: 0 10px; display: flex; align-items: center; }
.nav-search button:hover { color: var(--text); }
.nav-user-menu { position: relative; }
.nav-avatar-btn { background: none; border: none; padding: 0; display: flex; align-items: center; justify-content: center; }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); display: block; }
.user-dropdown { display: none; position: absolute; right: 0; top: 44px; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; min-width: 185px; box-shadow: var(--shadow); z-index: 200; overflow: hidden; }
.user-dropdown.open { display: block; }
.user-dropdown a { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--text); font-size: .88rem; }
.user-dropdown a:hover { background: var(--bg3); text-decoration: none; }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.user-dropdown a.danger { color: var(--danger); }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; color: var(--text2); display: flex; align-items: center; }
.theme-toggle:hover { color: var(--text); }
.btn-add { white-space: nowrap; }

/* Hamburger button */
.nav-hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu { display: none; padding: 12px 16px 20px; border-top: 1px solid var(--border); background: var(--bg2); }
.mobile-menu.open { display: block; }
.mobile-menu-nav { display: flex; flex-direction: column; gap: 2px; }
.mobile-menu-link { display: block; padding: 11px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .95rem; transition: background .15s; }
.mobile-menu-link:hover { background: var(--bg3); }
.mobile-menu-accent { color: var(--accent); font-weight: 600; }
.mobile-menu-danger { color: var(--danger, #ef4444); }
.mobile-menu-hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.mobile-menu-search { display: flex; gap: 8px; margin-top: 4px; }
.mobile-menu-search input { flex: 1; background: var(--bg3); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.mobile-menu-search button { background: var(--accent); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: .9rem; cursor: pointer; }

@media (max-width: 640px) {
  .nav-tabs { display: none; }
  .nav-search { display: none; }
  .btn-add { display: none; }
  .nav-btn-login { display: none; }
  .nav-btn-register { display: none; }
  .nav-hamburger { display: flex; }
  /* Centrowanie contentu */
  .container { padding: 0 12px; }
  .layout-grid { padding-top: 16px; }
  .post-card { margin: 0; }
}

/* ===== BUTTONS ===== */
.btn-primary { display: inline-block; padding: 8px 18px; background: var(--accent); color: #fff; border-radius: 8px; border: none; font-weight: 600; font-size: .9rem; transition: opacity .15s; cursor: pointer; }
.btn-primary:hover { opacity: .88; text-decoration: none; color: #fff; }
.btn-ghost { display: inline-block; padding: 8px 18px; border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-weight: 600; font-size: .9rem; transition: background .15s; background: none; cursor: pointer; }
.btn-ghost:hover { background: var(--bg3); text-decoration: none; }
.btn-danger { padding: 8px 16px; background: var(--danger); color: #fff; border: none; border-radius: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.btn-success { padding: 8px 16px; background: var(--success); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-tiny { padding: 3px 9px; font-size: .8rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); cursor: pointer; }
.btn-tiny.danger { background: rgba(239,68,68,.1); border-color: var(--danger); color: var(--danger); }
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.badge.red { background: var(--danger); }
.badge.green { background: var(--success); }
.badge.yellow { background: #ca8a04; color:#fff; }
.inline-form { display: inline; }

/* ===== FLASH ===== */
.flash-container { max-width: 1200px; margin: 12px auto 0; padding: 0 16px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-size: .92rem; }
.flash-success { background: #14532d; border: 1px solid var(--success); color: #86efac; }
.flash-error   { background: #450a0a; border: 1px solid var(--danger);  color: #fca5a5; }

/* ===== POSTS LIST ===== */
.posts-list { display: flex; flex-direction: column; gap: 14px; }
.post-card { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); display: flex; overflow: hidden; }
.post-vote { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 14px 10px; gap: 4px; min-width: 52px; background: var(--bg3); }
.vote-btn { background: none; border: none; color: var(--text2); font-size: 1.1rem; width: 32px; height: 32px; border-radius: 6px; transition: background .15s, color .15s; display: flex; align-items: center; justify-content: center; }
.vote-btn:hover { background: var(--bg); }
.vote-btn.vote-up.active, .vote-btn.vote-up:hover  { color: var(--accent); }
.vote-btn.vote-down.active, .vote-btn.vote-down:hover { color: #60a5fa; }
.vote-score { font-weight: 700; font-size: .95rem; }
.post-body { flex: 1; padding: 14px 16px; min-width: 0; }
.post-meta { font-size: .78rem; color: var(--text2); margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.post-category { background: var(--bg3); padding: 2px 8px; border-radius: 99px; color: var(--text2); font-size: .78rem; }
.post-category:hover { color: var(--text); text-decoration: none; }
.post-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; line-height: 1.35; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-media { margin-bottom: 10px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.post-img { max-height: 550px; width: 100%; object-fit: contain; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-overlay-link { position: absolute; inset: 0; z-index: 2; }
.tweet-card-wrap { position: relative; }
.tweet-card-overlay { position: absolute; inset: 0; z-index: 10; cursor: pointer; }
.fb-embed-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #fff; min-height: 200px; max-width: 100%; }
.fb-embed-wrap iframe { display: block; width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
.post-media { overflow: hidden; max-width: 100%; }
@media (max-width: 640px) {
  .fb-embed-wrap { width: calc(100vw - 100px) !important; overflow: hidden; }
}
.post-media:has(.fb-embed-wrap) { background: #fff; }
@media (min-width: 861px) { .fb-embed-iframe--list { height: 660px !important; } .fb-embed-iframe--single { height: 700px !important; } }
@media (max-width: 860px) { .nav-avatar-btn { display: flex; align-items: center; justify-content: center; } .posts-list { margin-left: -8px; } }
.post-video { width: 100%; border-radius: 8px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { background: var(--bg3); color: var(--text2); padding: 2px 9px; border-radius: 99px; font-size: .78rem; }
.tag:hover { color: var(--accent); text-decoration: none; }
.post-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.post-action { background: none; border: none; color: var(--text2); font-size: .82rem; padding: 3px 0; cursor: pointer; }
.post-action:hover { color: var(--text); }
.danger-action:hover { color: var(--danger) !important; }

/* ===== POST FULL ===== */
.post-full { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; margin-bottom: 20px; }
.post-full-meta { font-size: .83rem; color: var(--text2); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.post-full-title { font-size: 1.55rem; font-weight: 800; margin-bottom: 12px; line-height: 1.25; }
.post-full-desc { color: var(--text2); margin-bottom: 14px; }
.post-full-media { margin-bottom: 18px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.post-full-img { max-height: 80vh; width: 100%; object-fit: contain; }
.post-full-video { width: 100%; border-radius: 10px; }
.vote-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 14px; }
.vote-btn-lg { padding: 9px 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font-weight: 600; font-size: .9rem; transition: .15s; }
.vote-btn-lg.vote-up.active, .vote-btn-lg.vote-up:hover   { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote-btn-lg.vote-down.active, .vote-btn-lg.vote-down:hover { background: #1e40af; border-color: #1e40af; color: #fff; }
.vote-score-lg { font-size: 1.4rem; font-weight: 800; min-width: 36px; text-align: center; }
.fav-btn-lg { padding: 9px 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font-weight: 600; cursor: pointer; }
.fav-btn-lg.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.report-btn { background: none; border: none; color: var(--text2); cursor: pointer; font-size: .85rem; }
.report-btn:hover { color: var(--danger); }

/* Social embeds */
.social-embed-wrap { max-width: 550px; margin: 0 auto; }
.social-embed-wrap iframe { border-radius: 8px; }
.bluesky-embed { border-radius: 10px; overflow: hidden; }

/* Tweet placeholder */
.tweet-card-wrap { position: relative; min-height: 120px; }
.tweet-placeholder { display: flex; align-items: center; justify-content: center; min-height: 120px; }
.tweet-placeholder-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: #1d9bf0; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tweet-card-wrap .twitter-tweet a { display: none; }
.tweet-card-wrap.tweet-loaded { min-height: unset; }
.tweet-card-wrap.tweet-loaded .tweet-placeholder { display: none; }

/* X/Twitter card */
.x-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); background: var(--bg2); transition: border-color .15s; }
.x-card:hover { border-color: #fff; text-decoration: none; }
.x-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.x-card-author { display: flex; flex-direction: column; gap: 2px; }
.x-display-name { font-weight: 700; font-size: .95rem; color: var(--text); }
.x-handle { font-size: .8rem; color: var(--text2); }
.x-logo { width: 20px; height: 20px; color: var(--text); flex-shrink: 0; }
.x-text { font-size: .95rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; color: var(--text); }
.x-text-placeholder { color: var(--text2); font-style: italic; }
.x-time { font-size: .78rem; color: var(--text2); text-decoration: none; display: inline-block; }
.x-time:hover { color: var(--text); text-decoration: none; }

/* Bluesky card */
.bsky-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); background: var(--bg2); transition: border-color .15s; }
.bsky-card:hover { border-color: #0085ff; text-decoration: none; }
.bsky-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bsky-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg3); }
.bsky-avatar-placeholder { display: inline-block; width: 42px; height: 42px; border-radius: 50%; background: var(--bg3); }
.bsky-card-author { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.bsky-display-name { font-weight: 600; font-size: .95rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsky-handle { font-size: .8rem; color: var(--text2); }
.bsky-logo { width: 22px; height: 22px; flex-shrink: 0; }
.bsky-text { font-size: .95rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; color: var(--text); }
.bsky-time { font-size: .78rem; color: var(--text2); text-decoration: none; display: inline-block; }
.bsky-time:hover { color: #0085ff; text-decoration: none; }
.bsky-images { display: grid; gap: 4px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.bsky-images-1 { grid-template-columns: 1fr; }
.bsky-images-2 { grid-template-columns: 1fr 1fr; }
.bsky-images-3 { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
.bsky-images-3 img:first-child { grid-column: 1 / -1; }
.bsky-images-4 { grid-template-columns: 1fr 1fr; }
.bsky-images img { width: 100%; height: 200px; object-fit: cover; display: block; }
.bsky-video { width: 100%; border-radius: 10px; display: block; margin-bottom: 10px; max-height: 400px; }
.bsky-video-thumb { width: 100%; border-radius: 10px; display: block; margin-bottom: 10px; object-fit: cover; }
.bsky-external { display: flex; gap: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: var(--bg3); }
.bsky-external-thumb { width: 100px; height: 80px; object-fit: cover; flex-shrink: 0; }
.bsky-external-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; justify-content: center; min-width: 0; }
.bsky-external-title { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsky-external-desc { font-size: .78rem; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== COMMENTS ===== */
.comments-section { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; }
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 18px; }
.comment-form textarea { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 10px; font-size: .9rem; resize: vertical; margin-bottom: 8px; }
.comment-form { margin-bottom: 20px; }
.comment-login-prompt { padding: 14px; background: var(--bg3); border-radius: 8px; margin-bottom: 18px; font-size: .9rem; }
.comments-list { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar.small { width: 26px; height: 26px; }
.comment-inner { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-author { font-weight: 600; font-size: .88rem; color: var(--text); }
.comment-time { font-size: .78rem; color: var(--text2); }
.comment-body { font-size: .88rem; line-height: 1.5; word-break: break-word; }
.reply-toggle { background: none; border: none; color: var(--text2); font-size: .78rem; cursor: pointer; }
.reply-toggle:hover { color: var(--accent); }
.reply-form { margin-top: 8px; }
.reply-form textarea { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px; font-size: .85rem; }
.replies { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }
.empty-text { color: var(--text2); font-size: .88rem; padding: 14px 0; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.sidebar-widget { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; }
.widget-title { font-weight: 700; font-size: .75rem; margin-bottom: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; }
.category-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.category-list > li > a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text2); font-size: .88rem; transition: background .15s; }
.category-list > li > a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.subcategory-list { list-style: none; margin-left: 12px; }
.subcategory-list li a { display: block; padding: 4px 8px; color: var(--text2); font-size: .82rem; border-radius: 5px; }
.subcategory-list li a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.top-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.top-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.top-list li a { font-size: .83rem; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .score { font-size: .78rem; color: var(--success); font-weight: 600; flex-shrink: 0; }
.sidebar-cta { text-align: center; }
.sidebar-cta h3 { margin-bottom: 6px; font-size: .95rem; }
.sidebar-cta p { color: var(--text2); font-size: .83rem; margin-bottom: 12px; }

/* ===== FORMS ===== */
.form-page { max-width: 720px; }
.form-page h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group label { display: block; font-size: .83rem; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.form-group label small { font-weight: 400; opacity: .8; }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=url],
.form-group input[type=password], .form-group input[type=number], .form-group textarea, .form-group select {
  width: 100%; padding: 9px 13px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem; outline: none; transition: border .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); }
.form-group select option { background: var(--bg2); }
.hint { font-size: .76rem; color: var(--text2); margin-top: 4px; }

/* Checkbox grid */
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: .85rem; cursor: pointer; padding: 6px 10px; background: var(--bg3); border-radius: 6px; }
.checkbox-label:hover { background: var(--border); }

/* Content type tabs */
.content-type-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.type-tab { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-size: .88rem; transition: .15s; }
.type-tab input { display: none; }
.type-tab:has(input:checked), .type-tab.active { border-color: var(--accent); background: rgba(249,115,22,.1); }
.upload-panel { margin-top: 4px; }

/* Dropzone */
.drop-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 36px 20px; text-align: center; position: relative; transition: border-color .2s, background .2s; cursor: pointer; }
.drop-zone.drag-over, .drop-zone:hover { border-color: var(--accent); }
.drop-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--text2); }
.drop-text { font-size: .95rem; margin-bottom: 4px; }
.drop-link { color: var(--accent); font-weight: 600; }
.drop-hint { font-size: .78rem; color: var(--text2); }
.drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-preview { margin-top: 10px; }
.upload-preview img { max-height: 280px; border-radius: 8px; margin: 0 auto; }

/* Sort tabs */
.sort-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.sort-tab { padding: 7px 16px; border-radius: 8px; color: var(--text2); font-weight: 600; font-size: .9rem; transition: .15s; }
.sort-tab.active { background: var(--accent); color: #fff; }
.sort-tab:hover:not(.active) { background: var(--bg3); color: var(--text); text-decoration: none; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px 0; }
.page-btn { padding: 7px 18px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-weight: 600; }
.page-btn:hover { background: var(--bg3); text-decoration: none; }
.page-info { color: var(--text2); font-size: .88rem; }

/* Auth */
.auth-page { display: flex; justify-content: center; padding: 40px 0; }
.auth-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 22px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: .83rem; }
.auth-info-box { margin-top: 16px; padding: 12px 14px; background: var(--bg3); border-radius: 8px; font-size: .83rem; color: var(--text2); }
.captcha-group input { max-width: 160px; }

/* Empty state */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon { font-size: 3.5rem; margin-bottom: 14px; }
.empty-state h2 { font-size: 1.4rem; margin-bottom: 8px; }
.empty-state p { color: var(--text2); }

/* Error page */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; text-align: center; gap: 12px; }
.error-code { font-size: 8rem; font-weight: 900; color: var(--accent); line-height: 1; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-inner { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 420px; }
.modal-inner h3 { margin-bottom: 14px; }
.modal-inner textarea { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 10px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 20px 0; margin-top: 40px; }
.footer-links { display: flex; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.footer-links a { color: var(--text2); font-size: .85rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text2); font-size: .78rem; }

/* Static pages */
.static-page { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 32px; max-width: 800px; }
.static-page-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.static-page-meta { font-size: .8rem; color: var(--text2); margin-bottom: 24px; }
.static-page-content { line-height: 1.8; overflow-wrap: break-word; word-break: break-word; overflow: hidden; }
.static-page-content img { max-width: 100%; height: auto; }
.static-page-content table { max-width: 100%; overflow-x: auto; display: block; }
.static-page-content h2 { font-size: 1.2rem; margin: 24px 0 10px; }
.static-page-content h3 { font-size: 1rem; margin: 18px 0 8px; }
.static-page-content p { margin-bottom: 12px; }
.static-page-content ul, .static-page-content ol { margin: 8px 0 12px 22px; }

/* User profile */
.profile-header { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); flex-shrink: 0; }
.profile-name { font-size: 1.3rem; font-weight: 800; }
.profile-bio { color: var(--text2); font-size: .88rem; margin-top: 4px; }
.profile-stats { display: flex; gap: 16px; margin-top: 6px; font-size: .82rem; color: var(--text2); flex-wrap: wrap; }
.profile-stats strong { color: var(--text); }

/* Page header */
.page-header { margin-bottom: 14px; }
.page-header h1 { font-size: 1.3rem; font-weight: 800; }

/* ===== COOKIE BANNER ===== */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg2); border-top: 1px solid var(--border); padding: 14px 20px; z-index: 500; box-shadow: 0 -4px 20px rgba(0,0,0,.3); }
.cookie-content { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cookie-content p { font-size: .85rem; color: var(--text2); flex: 1; min-width: 200px; }
.cookie-content p a { color: var(--accent); }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== PENDING OWN ===== */
.pending-own { border-left: 3px solid #ca8a04; }

/* ===== SECTION TITLE ===== */
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }


/* ===== COMMENT VOTES ===== */
.comment-votes { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.comment-vote-btn { background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text2); font-size: .72rem; line-height: 1; padding: 2px 7px; transition: color .15s, border-color .15s, background .15s; }
.comment-vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.comment-vote-btn.up.active { background: rgba(34,197,94,.15); border-color: #22c55e; color: #22c55e; }
.comment-vote-btn.down.active { background: rgba(239,68,68,.15); border-color: var(--danger); color: var(--danger); }
.comment-score { font-size: .8rem; font-weight: 700; min-width: 24px; text-align: center; color: var(--text2); }

/* ===== SCORE COLORS ===== */
.score-pos { color: #22c55e !important; }
.score-neg { color: var(--danger) !important; }

/* ===== FOOTER SOCIALS ===== */
.footer-socials { display: flex; gap: 14px; justify-content: center; margin-bottom: 12px; }
.social-link { color: var(--text2); display: flex; align-items: center; transition: color .15s; }
.social-link:hover { color: var(--accent); text-decoration: none; }

/* ===== PROFILE WEBSITE ===== */
.profile-website { color: var(--accent); font-size: .82rem; }

/* ===== TOP USERS SIDEBAR ===== */
.top-users-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.top-users-list li { display: flex; align-items: center; gap: 8px; }
.top-user-rank { font-size: .7rem; font-weight: 700; color: var(--text2); width: 14px; text-align: right; flex-shrink: 0; }
.top-user-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.top-user-name { font-size: .88rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user-stats { font-size: .72rem; color: var(--text2); flex-shrink: 0; }


/* ===== OWN CONTENT VOTE ===== */
.vote-own-msg { font-size: .78rem; color: var(--text2); font-style: italic; }

/* Facebook card */
.fb-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); background: var(--bg2); transition: border-color .15s; }
.fb-card:hover { border-color: #1877f2; text-decoration: none; }
.fb-card-text { font-size: .95rem; line-height: 1.55; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }
.fb-card-link { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: #1877f2; }

/* ===== SOCIAL MEDIA POST CARDS ===== */
.post-social-card { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: 10px; color: var(--text2); font-size: .9rem; font-weight: 500; text-decoration: none; transition: opacity .15s; }
.post-social-card:hover { opacity: .8; text-decoration: none; }
.post-social-twitter  { background: #000; color: #fff; }
.post-social-facebook { background: #1877f2; color: #fff; }
.post-social-bluesky  { background: #0085ff; color: #fff; }
.post-social-vimeo    { background: #1ab7ea; color: #fff; }

/* ===== CHAR COUNTER ===== */
.char-counter { font-size: .75rem; font-weight: 400; color: var(--text2); margin-left: 6px; }
.char-counter--warn { color: #f59e0b; }
.char-counter--over { color: var(--danger); font-weight: 600; }

/* ===== ADS ===== */
.partner-label { display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text2); background: var(--bg3); border-radius: 4px; padding: 2px 7px; margin-bottom: 8px; }
.partner-infeed { background: var(--bg2); border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: flex; flex-direction: column; align-items: center; }
.partner-infeed .partner-content { width: 100%; display: flex; justify-content: center; }
.sidebar-partner { display: flex; flex-direction: column; }
