:root {
  --bg: #f6f7f8;
  --card: #fff;
  --text: #1a1a1b;
  --muted: #6a737d;
  --line: #e5e7eb;
  --brand: #ff4500;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }

.app { max-width: 1400px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }

.topbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.brand { display:flex; align-items:center; gap:10px; color:inherit; text-decoration:none; }
.brand img { width:44px; height:44px; }
.brand span { display:block; color:var(--muted); font-size:12px; }
.topbar-actions { display:flex; align-items:center; gap:8px; }

.btn, .ghost { border:1px solid var(--line); padding:8px 12px; border-radius:999px; cursor:pointer; background:#fff; }
.btn { background:var(--brand); color:#fff; border-color:var(--brand); font-weight:600; }
.ghost { background:#fff; }

.layout { display:grid; grid-template-columns: 240px minmax(0,1fr) 320px; gap:12px; align-items:start; }
.left-nav { padding:10px; position:sticky; top:8px; }
.left-nav nav { display:flex; flex-direction:column; gap:6px; }
.left-nav a { text-decoration:none; color:var(--text); padding:10px; border-radius:8px; }
.left-nav a:hover { background:#f3f4f6; }

.content { display:flex; flex-direction:column; gap:10px; }
.thread-card { padding:12px; cursor:pointer; }
.thread-card:hover { border-color:#d4d8de; }
.thread-title { font-size:20px; font-weight:700; margin-bottom:6px; }
.meta { color:var(--muted); font-size:13px; margin-bottom:8px; }
.preview { line-height:1.45; margin-bottom:10px; }
.tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.tag { font-size:12px; background:#f2f4f7; border-radius:999px; padding:4px 8px; color:#394150; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.actions button { border:1px solid var(--line); background:#fff; border-radius:999px; padding:6px 10px; cursor:pointer; }

.thread-view { padding:14px; }
.thread-view h1 { margin:0 0 6px; font-size:30px; }
.thread-body { font-size:17px; line-height:1.55; margin:12px 0; }
.summary { background:#fff7ed; border:1px solid #fed7aa; border-radius:10px; padding:10px; margin-bottom:12px; }

.comments { margin-top:10px; display:flex; flex-direction:column; gap:8px; }
.comment { border-left:2px solid #dbe0e6; margin-left:8px; padding-left:10px; }
.comment > .card { padding:10px; }
.comment .meta { margin-bottom:4px; }
.comment-actions { display:flex; gap:8px; margin-top:6px; }

.right { padding:12px; position:sticky; top:8px; }
.profile-slot { display:flex; align-items:center; gap:8px; }
.profile-slot img { width:28px; height:28px; border-radius:50%; }

.composer { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; z-index:20; }
.composer-card { width:min(760px, 95vw); padding:12px; }
.composer-head { display:flex; justify-content:space-between; align-items:center; }
.composer input, .composer textarea { width:100%; border:1px solid var(--line); border-radius:10px; padding:10px; margin-top:8px; font:inherit; }
.composer textarea { min-height:140px; resize:vertical; }
.inline { display:flex; gap:8px; align-items:center; margin-top:8px; }
.composer-actions { display:flex; justify-content:space-between; margin-top:10px; }

.empty { text-align:center; padding:40px 10px; color:var(--muted); }
.err { border-color: #fecaca; color:#b91c1c; background:#fff1f2; padding:10px; border-radius:8px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0,1fr); }
  .right { display:none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .left-nav { position:static; }
  .thread-view h1 { font-size:24px; }
}
