*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --border: #e2e4e7;
  --text: #1a1a1b;
  --text-muted: #6b7280;
  --accent: #00000000;
  --tag-bg: #f0f0f0;
  --tag-text: #444;
  --radius: 12px;
  --sidebar-w: 260px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── LAYOUT ───────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  align-items: start;
}

/* ── MAIN FEED ────────────────────────────────── */
.feed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.feed-header svg { flex-shrink: 0; }
.feed-header label { font-weight: 600; color: var(--text); }
.feed-header select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

/* ── THREAD CARD ──────────────────────────────── */
.thread-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: box-shadow .15s;
}
.thread-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }

/* meta row */
.thread-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-icon { color: var(--text-muted); }
.thread-author { font-weight: 600; font-size: .9rem; }
.thread-dot { color: var(--text-muted); }
.thread-time { font-size: .82rem; color: var(--text-muted); }
.btn-flag {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: 6px; transition: color .15s;
}
.btn-flag:hover { color: #ef4444; }

/* title */
.thread-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  color: var(--text);
}

/* tags */
.thread-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* content slot */
.thread-content {
  margin-bottom: 16px;
}
.thread-content p {
  font-size: .93rem;
  line-height: 1.6;
  color: #333;
}
.thread-content img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}
.content-placeholder {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 8px;
  height: 220px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .85rem;
}

/* actions */
.thread-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.action-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.action-btn:hover { background: var(--bg); color: var(--text); }
.action-btn.active { color: var(--accent); }
.action-btn svg { flex-shrink: 0; }
.action-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ── SIDEBAR ──────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.sidebar-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.tags-grid {
  display: flex; flex-wrap: wrap; gap: 7px;
}
.tags-grid .tag {
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tags-grid .tag:hover {
  background: var(--accent);
  color: #fff;
}

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}