/* ============================================================
   buds.social — CSS v2
   ============================================================ */

/* Variables */
:root {
  --c-bg:       #ffffff;
  --c-bg-sub:   #f6f6f6;
  --c-bg-hover: #f2f2f2;
  --c-border:   #e8e8e8;
  --c-text:     #111111;
  --c-text-sub: #6b6b6b;
  --c-text-dim: #aaaaaa;
  --c-accent:   #10c956;
  --c-accent-h: #0da048;
  --c-link:     #10c956;
  --sidebar:    250px;
  --aside:      290px;
  --main-max:   620px;
  --radius:     8px;
  --f-body:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --c-bg:       #0d0d0d;
  --c-bg-sub:   #161616;
  --c-bg-hover: #1c1c1c;
  --c-border:   #2a2a2a;
  --c-text:     #f0f0f0;
  --c-text-sub: #8a8a8a;
  --c-text-dim: #555555;
  --c-accent:   #10c956;
  --c-accent-h: #13e063;
  --c-link:     #10c956;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ─────────────────────────────────────── */
.page {
  display: flex;
  max-width: 1160px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  border-right: 1px solid var(--c-border);
  padding: 20px 12px 20px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--c-text);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.logo-dot { color: var(--c-accent); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text-sub);
  transition: background .12s, color .12s;
}
.nav-link:hover,
.nav-link.active {
  background: var(--c-bg-hover);
  color: var(--c-text);
}
.nav-link svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.nav-sep { height: 1px; background: var(--c-border); margin: 10px 0; }

.btn-post {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--c-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: background .15s;
  text-align: center;
}
.btn-post:hover { background: var(--c-accent-h); }

.sidebar-footer { margin-top: auto; padding-top: 16px; }
.theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: none;
  color: var(--c-text-sub);
  font-size: 13px;
  transition: .12s;
  width: 100%;
}
.theme-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }
.theme-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

/* ── Main Column ─────────────────────────────────── */
.main {
  flex: 1;
  border-right: 1px solid var(--c-border);
  min-width: 0;
  max-width: var(--main-max);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
}
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-back {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text-sub);
  font-size: 14px;
  font-weight: 500;
  transition: color .12s;
}
.topbar-back:hover { color: var(--c-text); }
.topbar-back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--c-text-sub);
  display: flex; align-items: center; justify-content: center;
  transition: .12s;
}
.icon-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--c-border); }
.tab {
  flex: 1;
  padding: 14px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-dim);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.tab:hover { color: var(--c-text); background: var(--c-bg-hover); }
.tab.active { color: var(--c-text); border-color: var(--c-accent); font-weight: 600; }

/* ── Post Card ───────────────────────────────────── */
.post {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border);
  transition: background .1s;
  cursor: pointer;
}
.post:hover { background: var(--c-bg-hover); }
.post:last-child { border-bottom: none; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--c-bg-sub);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }

.post-right { flex: 1; min-width: 0; }

.post-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 6px;
  margin-bottom: 3px;
}
.post-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-name:hover { text-decoration: underline; }
.post-handle { font-size: 13px; color: var(--c-text-dim); }
.post-dot { color: var(--c-text-dim); font-size: 12px; }
.post-time { font-size: 13px; color: var(--c-text-dim); }

.post-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.post-text a { color: var(--c-link); }
.post-text a:hover { text-decoration: underline; }

.post-actions {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}
.action {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--c-text-dim);
  font-size: 13px;
  transition: color .12s;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.action:hover { color: var(--c-text-sub); }
.action svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }

/* ── Post Detail ─────────────────────────────────── */
.post-detail {
  padding: 18px 20px;
  border-bottom: 1px solid var(--c-border);
}
.post-detail .post-text { font-size: 17px; margin-top: 12px; }

.post-stats {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  margin-top: 14px;
  font-size: 14px;
  color: var(--c-text-sub);
}
.post-stat strong { color: var(--c-text); }
.post-date { font-size: 13px; color: var(--c-text-dim); margin-top: 10px; }

/* ── Replies ─────────────────────────────────────── */
.reply {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  transition: background .1s;
}
.reply:hover { background: var(--c-bg-hover); }
.reply-right { flex: 1; min-width: 0; }
.reply-likes { font-size: 12px; color: var(--c-text-dim); margin-top: 6px; }

/* ── User Profile ────────────────────────────────── */
.profile-hero {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--c-border);
}
.profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.profile-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.profile-handle { font-size: 14px; color: var(--c-text-dim); margin-top: 2px; }
.profile-bio { font-size: 14px; color: var(--c-text-sub); margin-top: 8px; line-height: 1.5; }
.profile-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--c-text-sub);
}
.profile-stat strong { color: var(--c-text); font-weight: 600; }

.btn-follow {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid var(--c-border);
  background: var(--c-text);
  color: var(--c-bg);
  font-size: 13px;
  font-weight: 600;
  transition: opacity .15s;
}
.btn-follow:hover { opacity: .85; }

/* ── Aside ───────────────────────────────────────── */
.aside {
  width: var(--aside);
  flex-shrink: 0;
  padding: 16px;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.card {
  background: var(--c-bg-sub);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.trend {
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
}
.trend:last-child { border: none; padding-bottom: 0; }
.trend-name { font-size: 14px; font-weight: 600; color: var(--c-text); }
.trend-name:hover { color: var(--c-accent); }
.trend-count { font-size: 12px; color: var(--c-text-dim); margin-top: 1px; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
}
.who:last-child { border: none; }
.who-info { flex: 1; min-width: 0; }
.who-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name:hover { text-decoration: underline; }
.who-handle { font-size: 12px; color: var(--c-text-dim); }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--c-border); }
.stat-row:last-of-type { border: none; margin-bottom: 10px; }
.stat-num { font-size: 17px; font-weight: 700; color: var(--c-text); }
.stat-label { font-size: 12px; color: var(--c-text-dim); }
.btn-join { display: block; background: var(--c-accent); color: #fff; text-align: center; border-radius: 20px; padding: 8px 0; font-size: 13px; font-weight: 600; margin-top: 8px; text-decoration: none; }
.btn-join:hover { opacity: .88; }
.aside-post-link { display: block; font-size: 13px; color: var(--c-text-sub); padding: 7px 0; border-bottom: 1px solid var(--c-border); line-height: 1.45; text-decoration: none; }
.aside-post-link:last-child { border: none; }
.aside-post-link:hover { color: var(--c-accent); }

/* ── Tag Page ────────────────────────────────────── */
.tag-hero { padding: 18px 20px; border-bottom: 1px solid var(--c-border); }
.tag-hero h1 { font-size: 20px; font-weight: 700; }
.tag-sub { font-size: 13px; color: var(--c-text-dim); margin-top: 4px; }

/* ── Explore ─────────────────────────────────────── */
.explore-list { padding: 0 20px; }
.explore-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
}
.explore-user:last-child { border: none; }
.explore-info { flex: 1; min-width: 0; }
.explore-name { font-size: 15px; font-weight: 600; }
.explore-name:hover { text-decoration: underline; }
.explore-handle { font-size: 13px; color: var(--c-text-dim); }
.explore-bio { font-size: 13px; color: var(--c-text-sub); margin-top: 3px; }


/* ── Reddit-Style Post Detail ───────────────────── */
.rd-post {
  border-bottom: 1px solid var(--c-border);
  padding: 20px 20px 14px;
}
.rd-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.rd-author { font-weight: 700; font-size: 14px; color: var(--c-text); }
.rd-author:hover { text-decoration: underline; }
.rd-handle { font-size: 13px; color: var(--c-text-dim); }
.rd-dot { color: var(--c-text-dim); margin: 0 4px; }
.rd-time { font-size: 13px; color: var(--c-text-dim); }
.rd-post-text { font-size: 15px; line-height: 1.65; margin-bottom: 14px; }
.rd-post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rd-votes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-bg-sub);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 700;
}
.rd-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-dim);
  padding: 5px 10px;
  border-radius: 20px;
  transition: background .15s;
}
.rd-act:hover { background: var(--c-bg-sub); color: var(--c-text); }

/* Composer */
.rd-composer {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
}
.rd-composer-ta {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--c-bg-sub);
  color: var(--c-text);
  resize: vertical;
  margin-bottom: 8px;
}
.rd-composer-ta:focus { outline: none; border-color: var(--c-accent); }

/* Comments header */
.rd-comments-header {
  padding: 12px 20px 8px;
  font-size: 14px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-dim);
}

/* Comment item */
.rd-comments-list { padding: 0; }
.rd-post-compact {
  padding: 14px 16px 10px;
}
.rd-post-compact .rd-post-meta { margin-bottom: 8px; }
.rd-post-compact .rd-post-text { font-size: 14px; margin-bottom: 10px; }

/* Reddit-Style Comments */
.rd-comment {
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--c-border);
}
.rd-comment-children {
  margin-top: 4px;
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--c-border);
}
.rd-comment-children .rd-comment {
  padding: 8px 0 6px;
  border-bottom: none;
}
.rd-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.rd-comment-body {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 5px;
  padding-left: 36px;
}
.rd-comment-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 36px;
  flex-wrap: wrap;
}
.rd-vote-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--c-bg-sub);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 2px;
}
.rd-cv {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--c-text-dim);
  padding: 2px 3px;
  line-height: 1;
}
.rd-cv:hover { color: var(--c-accent); }
.rd-cv.voted { color: var(--c-accent); }

/* ── Empty State ─────────────────────────────────── */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--c-text-dim);
  font-size: 15px;
}


/* ── Neue Sidebar (Reddit-Style) ─────────────────── */
.snav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.snav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-sub);
  transition: background .12s, color .12s;
}
.snav-item:hover { background: var(--c-bg-hover); color: var(--c-text); }
.snav-item.active { background: var(--c-bg-hover); color: var(--c-text); }
.snav-item svg { flex-shrink: 0; stroke-width: 2; }

.snav-sep { height: 1px; background: var(--c-border); margin: 10px 0; }

/* Sections */
.snav-section { margin-bottom: 4px; }
.snav-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--c-text-dim);
  cursor: pointer;
  border-radius: var(--radius);
  user-select: none;
}
.snav-section-hd:hover { background: var(--c-bg-hover); color: var(--c-text-sub); }
.snav-chevron { transition: transform .2s; }
.snav-section.collapsed .snav-chevron { transform: rotate(180deg); }
.snav-section-bd { overflow: hidden; }
.snav-section.collapsed .snav-section-bd { display: none; }

/* Trending tags in sidebar */
.snav-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-sub);
  border-radius: var(--radius);
  transition: background .12s, color .12s;
}
.snav-tag:hover { background: var(--c-bg-hover); color: var(--c-text); }
.snav-tag svg { flex-shrink: 0; stroke: var(--c-text-dim); }
.snav-tag-cnt { margin-left: auto; font-size: 11px; color: var(--c-text-dim); }

/* Mehr-Links */
.snav-more-link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--c-text-sub);
  border-radius: var(--radius);
  transition: background .12s;
}
.snav-more-link:hover { background: var(--c-bg-hover); color: var(--c-text); }

/* Zuletzt besucht */
.snav-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  transition: background .12s;
}
.snav-recent-item:hover { background: var(--c-bg-hover); }
.snav-recent-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.snav-recent-av img { width: 100%; height: 100%; object-fit: cover; }
.snav-recent-info { flex: 1; min-width: 0; }
.snav-recent-name { font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snav-recent-sub { color: var(--c-text-dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Topbar Search ────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}
.topbar-left { flex-shrink: 0; min-width: 80px; }
.topbar-right { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--c-bg-sub);
  border: 1.5px solid var(--c-border);
  border-radius: 22px;
  padding: 0 14px;
  height: 36px;
  transition: border-color .15s;
}
.topbar-search:focus-within {
  border-color: var(--c-accent);
  background: var(--c-bg);
}
.ts-icon { flex-shrink: 0; color: var(--c-text-dim); }
.ts-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--c-text);
  padding: 0 8px;
  outline: none;
  font-family: inherit;
}
.ts-input::placeholder { color: var(--c-text-dim); }


/* ── Explore Hero ────────────────────────────────── */
.explore-hero {
  padding: 32px 24px 24px;
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-h) 100%);
  border-bottom: 1px solid var(--c-border);
}
.explore-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.explore-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  margin-bottom: 18px;
}
.explore-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border-radius: 24px;
  padding: 0 6px 0 16px;
  height: 44px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.explore-search-form svg { flex-shrink: 0; color: #888; }
.explore-search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: #111;
  padding: 0 10px;
  outline: none;
  font-family: inherit;
}
.explore-search-input::placeholder { color: #aaa; }
.explore-search-btn {
  flex-shrink: 0;
  background: var(--c-accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.explore-search-btn:hover { background: var(--c-accent-h); }
.explore-section-hd {
  padding: 12px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--c-text-dim);
  text-transform: uppercase;
}

/* ── Responsive ──────────────────────────────────── */

/* Tablet: hide aside */
@media (max-width: 1060px) {
  .aside { display: none; }
  .main { border-right: none; max-width: none; }
}

/* Mobile: hide sidebar */
@media (max-width: 700px) {
  .sidebar { display: none; }
  .page { display: block; }
  .main { max-width: 100%; }
  .post { padding: 12px 16px; }
  .topbar { padding: 0 16px; }
  .post-detail { padding: 14px 16px; }
  .reply { padding: 10px 16px; }
  .profile-hero { padding: 16px; }
  .explore-list { padding: 0 16px; }
  .tag-hero { padding: 14px 16px; }

  /* Bottom nav on mobile */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 52px;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
    z-index: 100;
  }
  .mobile-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-sub);
  }
  .mobile-nav a.active, .mobile-nav a:hover { color: var(--c-accent); }
  .mobile-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
  body { padding-bottom: 52px; }
}
@media (min-width: 701px) {
  .mobile-nav { display: none; }
}

/* ── Util ────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Thread / Nested Replies ──────────────────────────── */
.thread-connector {
  width: 2px;
  background: var(--c-border);
  flex-shrink: 0;
  border-radius: 1px;
  margin-top: 4px;
}
.reply-group {
  display: flex;
  flex-direction: column;
}
.reply-group .reply {
  border-bottom: none;
  padding-bottom: 0;
}
.reply-group .reply:last-child {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}
.reply-thread {
  display: flex;
  gap: 0;
  padding-left: 20px;
}
.reply-line {
  width: 2px;
  background: var(--c-border);
  margin: 0 19px 0 0;
  flex-shrink: 0;
  border-radius: 2px;
}
.reply-indent {
  flex: 1;
  min-width: 0;
}
.reply-bubble {
  background: var(--c-bg-sub);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.reply-bubble:hover {
  background: var(--c-bg-hover);
}
.reply-bubble .post-meta {
  margin-bottom: 4px;
}
.reply-bubble .post-text {
  font-size: 14px;
}
.show-more-replies {
  font-size: 13px;
  color: var(--c-accent);
  cursor: pointer;
  padding: 4px 0 4px 52px;
  display: block;
}
.show-more-replies:hover { text-decoration: underline; }

/* ── Media Embeds ──────────────────────────────────────── */
.embed-wrap {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-bg-sub);
}
.embed-wrap iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}
.embed-yt-thumb {
  position: relative;
  cursor: pointer;
  background: #000;
}
.embed-yt-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity .2s;
}
.embed-yt-thumb:hover img { opacity: 1; }
.embed-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 56px; height: 56px;
  background: rgba(255,0,0,0.9);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.embed-yt-thumb:hover .embed-play { transform: translate(-50%,-50%) scale(1.1); }
.embed-play svg { fill: #fff; width: 22px; height: 22px; margin-left: 3px; }
.embed-caption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--c-text-sub);
  border-top: 1px solid var(--c-border);
}
.embed-caption strong { color: var(--c-text); font-size: 14px; display: block; margin-bottom: 2px; }
.embed-source { font-size: 11px; color: var(--c-text-dim); text-transform: uppercase; letter-spacing: .5px; }

/* ── Reddit-Style Nested Replies (v2) ─────────────────── */
.replies-section { border-top: 1px solid var(--c-border); }

.reddit-reply {
  display: flex;
  gap: 0;
  padding: 10px 20px 0 20px;
}
.reddit-reply:last-child { padding-bottom: 12px; }

.reddit-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
  margin-right: 10px;
  padding-top: 2px;
}
.reddit-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-bg-sub);
  flex-shrink: 0;
}
.reddit-avatar img { width: 100%; height: 100%; object-fit: cover; }

.reddit-thread-line {
  width: 2px;
  flex: 1;
  background: var(--c-border);
  border-radius: 1px;
  margin-top: 6px;
  min-height: 20px;
  cursor: pointer;
  transition: background .15s;
}
.reddit-thread-line:hover { background: var(--c-accent); }

.reddit-body { flex: 1; min-width: 0; padding-bottom: 6px; }

.reddit-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.reddit-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}
.reddit-name:hover { text-decoration: underline; }
.reddit-handle { font-size: 12px; color: var(--c-text-dim); }
.reddit-sep { color: var(--c-text-dim); font-size: 11px; }
.reddit-time { font-size: 12px; color: var(--c-text-dim); }

.reddit-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  word-break: break-word;
}
.reddit-text a { color: var(--c-link); }

.reddit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.reddit-act {
  font-size: 12px;
  color: var(--c-text-dim);
  cursor: pointer;
  transition: color .12s;
}
.reddit-act:hover { color: var(--c-text-sub); }

/* Sub-thread indent */
.reddit-sub {
  padding-left: 38px;
}
.reddit-sub .reddit-reply {
  padding-left: 0;
}

/* ── Feed kompakter (Reddit-Style) ───────────────────── */
.post {
  padding: 12px 20px;
}
.post-actions {
  gap: 16px;
  margin-top: 8px;
}
.post-text {
  font-size: 15px;
  margin-top: 2px;
}
.post-meta {
  margin-bottom: 2px;
}

/* Post-Detail auch kompakter */
.post-detail {
  padding: 16px 20px;
}
.post-stats {
  margin-top: 10px;
  padding: 10px 0;
  font-size: 13px;
  gap: 16px;
}
.post-date {
  font-size: 12px;
  margin-top: 8px;
}

/* Reddit reply: weniger Padding gesamt */
.reddit-reply {
  padding: 8px 20px 0 20px;
}
.reddit-reply:last-child {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.reddit-body {
  padding-bottom: 4px;
}
.reddit-text {
  line-height: 1.45;
}

/* Mobile kompakter */
@media (max-width: 700px) {
  .post { padding: 10px 14px; }
  .reddit-reply { padding: 8px 14px 0; }
}

/* ── Vote Buttons Reddit-Style ────────────────────── */
.vote-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.vote-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px;
  border: none; background: none;
  color: var(--c-text-dim); cursor: pointer;
  font-size: 14px; transition: .12s;
}
.vote-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }
.vote-btn.up:hover, .vote-btn.up.active { color: #ff6314; }
.vote-btn.down:hover, .vote-btn.down.active { color: #7193ff; }
.vote-count {
  font-size: 13px; font-weight: 600; color: var(--c-text-sub);
  min-width: 24px; text-align: center;
}
.vote-sep { color: var(--c-border); margin: 0 2px; font-size: 18px; }

/* Reply Form */
.reply-form { padding: 12px 20px; border-bottom: 1px solid var(--c-border); }
.reply-form textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-bg-sub); color: var(--c-text);
  font: 14px/1.5 var(--f-body); resize: vertical; min-height: 80px;
  outline: none; transition: border .15s;
}
.reply-form textarea:focus { border-color: var(--c-accent); }
.reply-form-name {
  width: 100%; padding: 8px 14px; margin-bottom: 8px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-bg-sub); color: var(--c-text);
  font: 14px/1 var(--f-body); outline: none;
}
.reply-form-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px;
}
.btn-cancel {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--c-border);
  background: none; color: var(--c-text-sub); font-size: 13px; cursor: pointer;
}
.btn-submit {
  padding: 7px 16px; border-radius: 6px; border: none;
  background: var(--c-accent); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-submit:hover { background: var(--c-accent-h); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }
.inline-reply-form { margin: 6px 0 2px; }

/* User Reply Badge */
.user-badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  background: var(--c-accent); color: #fff;
  font-size: 10px; font-weight: 700; margin-left: 4px;
  vertical-align: middle; letter-spacing: .3px;
}

/* ── Reddit Hierarchy (rr) — neu ─────────────────────── */
.rr-wrap { margin: 0; }

.rr-row {
  display: flex;
  gap: 0;
  padding: 10px 20px 4px;
}
.rr-row:hover { background: var(--c-bg-hover); }

.rr-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
  margin-right: 10px;
}
.rr-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-bg-sub);
  flex-shrink: 0;
}
.rr-av img { width: 100%; height: 100%; object-fit: cover; }

.rr-line {
  width: 2px;
  flex: 1;
  background: var(--c-border);
  border-radius: 1px;
  margin-top: 6px;
  cursor: pointer;
  min-height: 16px;
  transition: background .15s;
}
.rr-line:hover { background: var(--c-accent); }

.rr-body { flex: 1; min-width: 0; padding-bottom: 6px; }

.rr-meta {
  display: flex; align-items: baseline;
  gap: 4px; flex-wrap: wrap; margin-bottom: 3px;
}
.rr-name { font-size: 13px; font-weight: 600; color: var(--c-text); }
.rr-name:hover { text-decoration: underline; }
.rr-handle { font-size: 12px; color: var(--c-text-dim); }
.rr-dot { color: var(--c-text-dim); font-size: 11px; }
.rr-time { font-size: 12px; color: var(--c-text-dim); }

.rr-text {
  font-size: 14px; line-height: 1.5;
  color: var(--c-text); word-break: break-word;
}
.rr-text a { color: var(--c-link); }

.rr-actions {
  display: flex; align-items: center;
  gap: 6px; margin-top: 5px;
}
.rr-vote {
  width: 22px; height: 22px; border-radius: 4px;
  border: none; background: none;
  color: var(--c-text-dim); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: .12s;
}
.rr-vote:hover { background: var(--c-bg-hover); }
.rr-vote.up:hover, .rr-vote.up.active { color: #ff6314; }
.rr-vote.down:hover, .rr-vote.down.active { color: #7193ff; }
.rr-vcount { font-size: 12px; font-weight: 600; color: var(--c-text-sub); min-width: 16px; }
.rr-reply-btn {
  font-size: 12px; font-weight: 600; color: var(--c-text-dim);
  background: none; border: none; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; transition: .12s;
}
.rr-reply-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }

/* Kids: left border creates the visual connection */
.rr-kids {
  margin-left: 14px;
  border-left: 2px solid var(--c-border);
  transition: border-color .15s;
}
.rr-kids:hover { border-color: var(--c-accent); }
.rr-kids .rr-row { padding-left: 14px; }
.rr-kids .rr-av { width: 22px; height: 22px; }
.rr-kids .rr-name { font-size: 12px; }

/* Deeper nesting */
.rr-kids .rr-kids { margin-left: 12px; }
.rr-kids .rr-kids .rr-av { width: 18px; height: 18px; }

/* Collapsed */
.rr-collapsed { display: none; }

/* Border between top-level threads */
.replies-section > .rr-wrap {
  border-bottom: 1px solid var(--c-border);
}
.replies-section > .rr-wrap:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════
   REDDIT-STYLE COMMENTS — clean copy
   ═══════════════════════════════════════════════ */
.comments { border-top: 1px solid var(--c-border); }

.comment {
  padding: 8px 16px 4px;
  font-size: 14px;
}
.comment-header {
  display: flex; align-items: center;
  gap: 6px; margin-bottom: 4px;
  font-size: 12px; color: var(--c-text-dim);
}
.comment-author {
  font-weight: 700; font-size: 12px;
  color: var(--c-text); text-decoration: none;
}
.comment-author:hover { text-decoration: underline; }
.comment-body {
  color: var(--c-text); line-height: 1.5;
  margin-bottom: 4px; word-break: break-word;
}
.comment-body a { color: var(--c-link); }
.comment-actions {
  display: flex; align-items: center;
  gap: 2px; margin-bottom: 4px;
}
.cv {
  background: none; border: none; cursor: pointer;
  padding: 2px 4px; border-radius: 2px;
  font-size: 13px; color: var(--c-text-dim);
  font-weight: 700; line-height: 1;
  transition: color .1s, background .1s;
}
.cv:hover { background: var(--c-bg-hover); color: var(--c-text); }
.cv.up:hover, .cv.up.voted { color: #ff4500; }
.cv.down:hover, .cv.down.voted { color: #9494ff; }
.cv-score {
  font-size: 12px; font-weight: 700;
  color: var(--c-text-sub); padding: 0 2px;
}
.ca {
  background: none; border: none; cursor: pointer;
  padding: 2px 6px; border-radius: 2px;
  font-size: 12px; font-weight: 700;
  color: var(--c-text-dim); margin-left: 4px;
  transition: background .1s, color .1s;
}
.ca:hover { background: var(--c-bg-hover); color: var(--c-text); }

/* Children: the border-left IS the connecting line */
.comment-children {
  margin-left: 16px;
  padding-left: 8px;
  border-left: 2px solid var(--c-border);
  cursor: pointer;
}
.comment-children:hover { border-color: var(--c-accent); }
.comment-children .comment-children { border-left-color: var(--c-border); }

/* Collapse */
.comment.collapsed .comment-body,
.comment.collapsed .comment-actions,
.comment.collapsed .comment-children { display: none; }
.comment.collapsed .comment-header { color: var(--c-text-dim); }
.comment-children:hover { border-color: var(--c-border); }
.cv:hover, .ca:hover { background: none; color: var(--c-text-dim); }

/* ── Auth Modal ───────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-bg.hidden { display: none; }
.modal {
  background: var(--c-bg); border-radius: 16px;
  padding: 28px; width: 100%; max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  position: relative;
}
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal p { font-size: 14px; color: var(--c-text-sub); margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--c-text-dim); font-size: 20px; line-height: 1;
}
.modal-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--c-border); }
.modal-tab {
  padding: 8px 16px; font-size: 14px; font-weight: 600;
  color: var(--c-text-dim); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; border-left: none; border-right: none; border-top: none;
}
.modal-tab.active { color: var(--c-text); border-bottom-color: var(--c-accent); }
.modal-input {
  width: 100%; padding: 10px 14px; margin-bottom: 10px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-bg-sub); color: var(--c-text);
  font: 14px/1 var(--f-body); outline: none; transition: border .15s;
}
.modal-input:focus { border-color: var(--c-accent); }
.modal-btn {
  width: 100%; padding: 11px; border-radius: 8px; border: none;
  background: var(--c-accent); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s;
  margin-top: 4px;
}
.modal-btn:hover { background: var(--c-accent-h); }
.modal-btn:disabled { opacity: .5; cursor: not-allowed; }
.modal-err { font-size: 13px; color: #e53; margin-top: 8px; min-height: 18px; }

/* User in Sidebar */
.user-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  margin-top: 8px; cursor: pointer; transition: .12s;
}
.user-bar:hover { background: var(--c-bg-hover); }
.user-bar-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-bg-sub); overflow: hidden; flex-shrink: 0;
}
.user-bar-av img { width: 100%; height: 100%; }
.user-bar-name { font-size: 14px; font-weight: 600; flex: 1; }
.user-bar-logout { font-size: 12px; color: var(--c-text-dim); }
.btn-login-sidebar {
  display: block; width: 100%; padding: 9px; margin-top: 8px;
  border-radius: 8px; border: 1px solid var(--c-border);
  background: none; color: var(--c-text-sub); font-size: 14px;
  font-weight: 600; cursor: pointer; text-align: center; transition: .12s;
}
.btn-login-sidebar:hover { background: var(--c-bg-hover); color: var(--c-text); }

/* Vote visual feedback */
.cv.voted, .cv.active { font-weight: 900; }
.cv.up.voted { color: #ff4500 !important; }
.cv.down.voted { color: #9494ff !important; }
/* Hover nur auf Button, nicht auf children border */
.comment-children:hover { border-color: var(--c-border) !important; }

/* Feed Autor prominenter */
.post-name { font-size: 15px; font-weight: 700; }
.post-handle { font-size: 13px; }

/* Composer */
.composer {
  padding: 14px 20px;
  border-bottom: 2px solid var(--c-border);
  display: none;
}
.composer.active { display: block; }
.composer-top { display: flex; gap: 10px; align-items: flex-start; }
.composer-av { width: 36px; height: 36px; border-radius: 50%; background: var(--c-accent); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px; }
.composer-textarea {
  flex: 1; border: none; outline: none; resize: none;
  font: 16px/1.5 var(--f-body); color: var(--c-text); background: none;
  min-height: 60px; padding: 4px 0;
}
.composer-textarea::placeholder { color: var(--c-text-dim); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-border); }
.composer-char { font-size: 12px; color: var(--c-text-dim); }
.composer-char.warn { color: #e53; }
.composer-submit { padding: 8px 20px; border-radius: 20px; border: none; background: var(--c-accent); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s; }
.composer-submit:hover { background: var(--c-accent-h); }
.composer-submit:disabled { opacity: .5; cursor: not-allowed; }
.composer-login-hint { padding: 14px 20px; border-bottom: 1px solid var(--c-border); color: var(--c-text-dim); font-size: 14px; cursor: pointer; }
.composer-login-hint:hover { background: var(--c-bg-hover); }

/* ── Sidebar Live Search ──────────────────────────── */
.sb-search-wrap {
  position: relative;
  margin-bottom: 8px;
}
.sb-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-bg-sub);
  color: var(--c-text);
  font: 14px/1 var(--f-body);
  outline: none;
  transition: border .15s;
}
.sb-search-input:focus { border-color: var(--c-accent); }
.sb-search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-dim); pointer-events: none;
}
.sb-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100; max-height: 360px; overflow-y: auto;
  display: none;
}
.sb-search-results.open { display: block; }
.sb-result {
  display: block; padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer; text-decoration: none; color: var(--c-text);
  transition: background .1s;
}
.sb-result:last-child { border: none; }
.sb-result:hover { background: var(--c-bg-hover); }
.sb-result-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.sb-result-meta { font-size: 11px; color: var(--c-text-dim); }
.sb-result-text { font-size: 12px; color: var(--c-text-sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-no-results { padding: 14px; text-align: center; font-size: 13px; color: var(--c-text-dim); }

/* ── Topbar User Dropdown ─────────────────────────── */
.topbar-user-wrap { position: relative; }
.topbar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 12px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200; display: none;
}
.topbar-dropdown.open { display: block; }
.dd-item {
  display: block; padding: 10px 16px;
  font-size: 14px; color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  text-decoration: none; transition: background .1s;
}
.dd-item:last-child { border: none; }
.dd-item:hover { background: var(--c-bg-hover); }
.dd-name { padding: 10px 16px; font-size: 12px; font-weight: 700; color: var(--c-text-dim); border-bottom: 1px solid var(--c-border); }

/* ── Reply Form Classes (Bug-Hunt R4) ─────────────── */
.rd-composer-inner { }
.reply-form-wrap { padding: 8px 12px 0; }
.reply-form-inner { display: flex; flex-direction: column; gap: 6px; }
.reply-trigger { cursor: pointer; }
.reply-cancel-btn { }
.reply-submit-btn { }
.comment-reply-wrap { }

/* ── Dark-Mode Vote-Farben (Bug-Hunt R6) ─────────────── */
[data-theme="dark"] .vote-btn.up:hover,
[data-theme="dark"] .vote-btn.up.active { color: #ff8c5a; }
[data-theme="dark"] .vote-btn.down:hover,
[data-theme="dark"] .vote-btn.down.active { color: #9aacff; }
[data-theme="dark"] .rr-vote.up:hover,
[data-theme="dark"] .rr-vote.up.active { color: #ff8c5a; }
[data-theme="dark"] .rr-vote.down:hover,
[data-theme="dark"] .rr-vote.down.active { color: #9aacff; }
[data-theme="dark"] .cv.up:hover,
[data-theme="dark"] .cv.up.voted { color: #ff6a36; }
[data-theme="dark"] .cv.down:hover,
[data-theme="dark"] .cv.down.voted { color: #a0a0ff; }
[data-theme="dark"] .cv.up.voted { color: #ff6a36 !important; }
[data-theme="dark"] .cv.down.voted { color: #a0a0ff !important; }
