@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --canvas: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-hover: #f1f2f3;
  --ink: #1a1a1b;
  --ink-soft: #57606a;
  --ink-muted: #7c7f82;
  --line: #edeff1;
  --line-strong: #d7dadd;
  --orange: #ff4500;
  --orange-dark: #d93f00;
  --up: #ff4500;
  --down: #7193ff;
  --blue: #0079d3;
  --green: #46a758;
  --shadow: 0 10px 28px rgba(26, 26, 27, 0.12);
  --radius: 8px;
  --font-sans: "InterVariable", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); font-family: var(--font-sans); }
body { font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100dvh; isolation: isolate; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; background: var(--surface);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.brand-link { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { width: 31px; height: 31px; border-radius: 9px; background: var(--orange); display: grid; place-items: center; color: #fff; position: relative; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.brand-mark::before { content: ""; width: 15px; height: 12px; border: 2px solid #fff; border-radius: 7px; position: absolute; top: 7px; left: 8px; }
.brand-mark::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 999px; background: #fff; box-shadow: 7px 0 #fff; top: 12px; left: 12px; }
.brand-name { font-size: 18px; }
.brand-wordmark { font-weight: 700; color: var(--ink); }
.brand-wordmark em { color: var(--orange); font-style: normal; }
.topbar-search { position: relative; min-width: 160px; flex: 1 1 520px; max-width: 610px; }
.topbar-search input { width: 100%; height: 38px; padding: 0 42px 0 40px; border-radius: 22px; border: 1px solid transparent; background: #f6f7f8; color: var(--ink); font-size: 14px; transition: border .15s ease, background .15s ease; }
.topbar-search input:hover { background: #eef0f1; }
.topbar-search input:focus { background: #fff; border-color: var(--blue); outline: none; }
.search-icon { position: absolute; left: 15px; top: 10px; color: var(--ink-muted); font-size: 15px; pointer-events: none; }
.clear-search { position: absolute; right: 8px; top: 6px; height: 26px; width: 26px; border: 0; background: transparent; border-radius: 50%; color: var(--ink-muted); cursor: pointer; display: none; }
.clear-search.show { display: inline-grid; place-items: center; }
.clear-search:hover { background: var(--surface-hover); color: var(--ink); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.icon-btn, .ghost-btn, .primary-btn, .outline-btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.icon-btn { height: 36px; width: 36px; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 17px; }
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.ghost-btn { height: 36px; padding: 0 12px; border-radius: 18px; background: transparent; color: var(--ink-soft); font-weight: 600; }
.ghost-btn:hover { background: var(--surface-hover); color: var(--ink); }
.outline-btn { height: 36px; padding: 0 14px; border-radius: 18px; background: #fff; color: var(--orange); border: 1px solid var(--orange); font-weight: 600; }
.outline-btn:hover { background: #fff4ef; }
.primary-btn { height: 38px; padding: 0 16px; border-radius: 19px; background: var(--orange); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.primary-btn:hover { background: var(--orange-dark); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; outline: 1px solid rgba(0,0,0,.06); outline-offset: -1px; flex: 0 0 auto; }
.avatar-sm { width: 24px; height: 24px; font-size: 9px; }
.avatar-lg { width: 44px; height: 44px; font-size: 14px; }
.avatar-ash { background: linear-gradient(140deg,#2e7d74,#8bc8bc); }
.avatar-liv { background: linear-gradient(140deg,#6f5aa4,#cb9bd4); }
.avatar-olive { background: linear-gradient(140deg,#6a7437,#c3c982); }
.avatar-sky { background: linear-gradient(140deg,#347ca8,#9ed3e7); }
.avatar-coral { background: linear-gradient(140deg,#ba5c4d,#efb8a7); }
.avatar-amber { background: linear-gradient(140deg,#b67b21,#ebcb7a); }
.account-trigger { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border: 1px solid transparent; background: transparent; border-radius: 22px; cursor: pointer; }
.account-trigger:hover { background: var(--surface-hover); border-color: var(--line); }
.account-meta { min-width: 0; text-align: left; }
.account-name { display: block; font-weight: 600; font-size: 12px; line-height: 1.2; }
.karma { color: var(--ink-muted); font-size: 11px; display: block; line-height: 1.2; }
.chevron { font-size: 13px; color: var(--ink-muted); }

.page { max-width: 1380px; margin: 0 auto; padding: 20px 24px 48px; }
.mobile-only { display: none; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 292px; gap: 20px; align-items: start; }
.left-rail, .right-rail { position: sticky; top: 76px; }
.left-rail { display: flex; flex-direction: column; gap: 18px; }
.nav-section { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.nav-label { color: var(--ink-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 0 12px 8px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; height: 37px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; text-align: left; font-size: 13px; }
.nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.nav-item.active { background: #f0f1f2; color: var(--ink); font-weight: 600; }
.nav-icon { width: 19px; text-align: center; color: var(--ink-muted); font-size: 16px; }
.nav-item.active .nav-icon { color: var(--orange); }
.community-list { display: grid; gap: 2px; max-height: 315px; overflow: auto; }
.community-row { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 5px 8px; border: 0; background: transparent; text-align: left; border-radius: 6px; cursor: pointer; }
.community-row:hover { background: var(--surface-hover); }
.community-row .community-copy { min-width: 0; }
.community-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.community-count { color: var(--ink-muted); font-size: 11px; }
.rail-note { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink-soft); font-size: 12px; }
.rail-note strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 5px; }
.rail-note p { margin: 0; line-height: 1.5; }
.main-column { min-width: 0; }

.welcome-banner { background: linear-gradient(105deg,#fff 0%,#fff8f5 72%,#ffe9df 100%); border: 1px solid #f3ddd3; border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.welcome-copy { min-width: 0; }
.welcome-copy h1 { font-size: 17px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
.welcome-copy p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.welcome-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.feed-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab { flex: 0 0 auto; border: 0; background: transparent; padding: 9px 12px 10px; color: var(--ink-muted); font-weight: 600; font-size: 13px; cursor: pointer; position: relative; }
.feed-tab::after { content: ""; position: absolute; height: 2px; left: 11px; right: 11px; bottom: -1px; background: transparent; border-radius: 3px 3px 0 0; }
.feed-tab:hover { color: var(--ink); }
.feed-tab.active { color: var(--orange); }
.feed-tab.active::after { background: var(--orange); }
.feed-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.feed-context { color: var(--ink-muted); font-size: 12px; }
.sort-control { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; color: var(--ink-soft); cursor: pointer; }
.sort-control:hover { border-color: var(--line-strong); color: var(--ink); }
.sort-control select { border: 0; background: transparent; color: inherit; font-weight: 600; font-size: 12px; cursor: pointer; outline: none; }
.sort-control option { color: var(--ink); }
.feed-list { display: grid; gap: 10px; transition: opacity .16s ease, transform .16s ease; }
.feed-list.is-loading { opacity: .45; transform: translateY(3px); pointer-events: none; }
.skeleton { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-height: 168px; padding: 14px; }
.skeleton-line { height: 10px; border-radius: 5px; background: linear-gradient(90deg,#f0f1f2 20%,#f8f9fa 50%,#f0f1f2 80%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 11px; }
.skeleton-line.short { width: 32%; }
.skeleton-line.med { width: 63%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; transition: border-color .15s ease, box-shadow .15s ease; }
.post-card:hover { border-color: #d4d7d9; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.post-card.pinned { border-color: #b7d7c0; }
.post-body { display: grid; grid-template-columns: 46px minmax(0,1fr); }
.vote-rail { background: #fafafa; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; }
.vote-btn { width: 32px; height: 29px; border: 0; background: transparent; color: #878a8c; border-radius: 4px; cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.vote-btn:hover { background: #f0f1f2; }
.vote-btn.upvoted { color: var(--up); background: #fff0ea; }
.vote-btn.downvoted { color: var(--down); background: #eef1ff; }
.score { font-size: 12px; font-weight: 700; line-height: 1; padding: 3px 0; tabular-nums: tabular-nums; }
.score.up { color: var(--up); }
.score.down { color: var(--down); }
.post-content { min-width: 0; padding: 11px 13px 10px; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--ink-muted); font-size: 11px; line-height: 1.25; }
.post-meta button { color: var(--ink-soft); font-weight: 600; border: 0; padding: 0; background: transparent; cursor: pointer; }
.post-meta button:hover { text-decoration: underline; }
.dot { color: #b7babd; }
.moderator { color: var(--green); font-weight: 600; }
.post-title { margin: 6px 0 7px; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; text-wrap: balance; cursor: pointer; }
.post-title:hover { color: var(--orange-dark); }
.post-flair { display: inline-flex; align-items: center; min-height: 19px; border-radius: 4px; background: #eff1f2; color: var(--ink-soft); padding: 0 7px; font-size: 10px; font-weight: 600; margin: 0 4px 5px 0; }
.post-flair.orange { background: #fff0eb; color: var(--orange-dark); }
.post-flair.blue { background: #edf5ff; color: #2f6ea7; }
.post-flair.green { background: #eef8f0; color: #397c47; }
.post-copy { color: var(--ink-soft); margin: 0 0 10px; font-size: 13px; line-height: 1.55; max-width: 72ch; }
.post-link-card { display: flex; align-items: stretch; min-height: 76px; margin: 9px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfbfb; overflow: hidden; cursor: pointer; }
.post-link-card:hover { background: #f7f7f7; }
.link-thumb { width: 90px; flex: 0 0 auto; background: linear-gradient(145deg,#24303d,#4e7798 55%,#d6e4ea); position: relative; }
.link-thumb::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.8); left: 50%; top: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 7px rgba(255,255,255,.14); }
.link-thumb.purple { background: linear-gradient(145deg,#3f315e,#8d7aba 55%,#e5d9ef); }
.link-thumb.green { background: linear-gradient(145deg,#23413d,#69ad8f 55%,#d9efe0); }
.link-thumb.sun { background: linear-gradient(145deg,#674b2a,#d2a052 55%,#f3e8cd); }
.link-info { min-width: 0; padding: 9px 11px; display: grid; align-content: center; gap: 3px; }
.link-domain { text-transform: uppercase; letter-spacing: .06em; font-size: 9px; color: var(--ink-muted); font-weight: 700; }
.link-title { font-size: 12px; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-url { font-size: 11px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; color: var(--ink-muted); }
.post-action { border: 0; background: transparent; min-height: 29px; padding: 0 8px; display: inline-flex; gap: 5px; align-items: center; border-radius: 4px; color: inherit; cursor: pointer; font-size: 11px; font-weight: 600; }
.post-action:hover { background: #f1f2f3; color: var(--ink-soft); }
.post-action.selected { color: var(--orange); background: #fff0eb; }
.post-action.saved { color: #2d6d98; background: #eef7ff; }
.post-action .action-icon { font-size: 14px; line-height: 1; }
.post-menu { position: relative; z-index: 30; }
.menu-popover { position: absolute; right: 0; top: calc(100% + 5px); width: 178px; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); padding: 5px; display: none; }
.menu-popover.open { display: grid; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 0; background: transparent; border-radius: 5px; text-align: left; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.menu-item:hover { background: var(--surface-hover); color: var(--ink); }
.menu-item.danger { color: #c83a24; }
.pinned-note { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; font-weight: 700; margin-bottom: 3px; }

.right-rail { display: grid; gap: 12px; }
.community-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.community-cover { height: 58px; background: linear-gradient(115deg,#1f2833,#486276 53%,#e0986a); }
.community-summary { position: relative; padding: 0 14px 14px; }
.community-summary .community-avatar { width: 54px; height: 54px; margin-top: -26px; border-radius: 14px; border: 4px solid #fff; background: linear-gradient(145deg,#ff8a4f,#d83432); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 24px; }
.community-summary h2 { font-size: 16px; margin: 8px 0 2px; letter-spacing: -.01em; }
.community-summary p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.community-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin: 13px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.community-stat strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.community-stat span { display: block; font-size: 10px; color: var(--ink-muted); }
.join-btn { width: 100%; height: 34px; border: 1px solid var(--orange); background: #fff; color: var(--orange); border-radius: 17px; cursor: pointer; font-size: 12px; font-weight: 700; }
.join-btn.joined { background: var(--orange); color: #fff; }
.join-btn:hover { background: #fff0eb; }
.join-btn.joined:hover { background: var(--orange-dark); }
.side-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.side-block h3 { font-size: 12px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); }
.rule-list, .trend-list { list-style: none; margin: 0; padding: 0; display: grid; }
.rule-list li { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.rule-list li:first-child { border-top: 0; padding-top: 0; }
.rule-num { color: var(--ink-muted); font-weight: 700; width: 17px; flex: 0 0 auto; }
.trend-row { padding: 8px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 7px; align-items: center; }
.trend-row:first-child { border-top: 0; padding-top: 0; }
.trend-rank { color: var(--ink-muted); font-size: 11px; }
.trend-name { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-meta { color: var(--ink-muted); font-size: 10px; }
.trend-up { color: var(--green); font-size: 12px; }
.side-footer { color: var(--ink-muted); font-size: 10px; line-height: 1.5; padding: 0 4px; }

.subreddit-header { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.subreddit-banner { height: 84px; background: linear-gradient(112deg,#223448,#5e86a4 54%,#d9a279); position: relative; }
.subreddit-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 24% 30%, rgba(255,255,255,.22), transparent 33%), radial-gradient(circle at 88% 70%, rgba(255,255,255,.18), transparent 28%); }
.subreddit-head { display: flex; align-items: flex-end; gap: 13px; padding: 0 16px 13px; margin-top: -26px; position: relative; z-index: 1; }
.subreddit-icon { width: 64px; height: 64px; border-radius: 16px; border: 4px solid #fff; background: linear-gradient(145deg,#f26d4e,#8b2f49); display: grid; place-items: center; color: #fff; font-size: 27px; font-weight: 700; }
.subreddit-title-group { min-width: 0; flex: 1; }
.subreddit-title-group h1 { margin: 0 0 2px; font-size: 21px; letter-spacing: -.02em; }
.subreddit-title-group p { margin: 0; color: var(--ink-muted); font-size: 12px; }
.subreddit-head .join-btn { width: auto; padding: 0 18px; }
.subreddit-links { display: flex; gap: 17px; padding: 0 16px; border-top: 1px solid var(--line); height: 40px; align-items: center; }
.subreddit-links button { border: 0; background: transparent; color: var(--ink-muted); font-size: 12px; cursor: pointer; padding: 0; }
.subreddit-links button:hover, .subreddit-links button.active { color: var(--orange); }

.detail-shell { animation: routeIn .2s ease both; }
@keyframes routeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.back-link { border: 0; background: transparent; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; padding: 0 0 13px; font-size: 12px; cursor: pointer; }
.back-link:hover { color: var(--orange); }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-card .post-title { cursor: default; font-size: 22px; margin-top: 7px; }
.detail-card .post-title:hover { color: var(--ink); }
.detail-card .post-copy { font-size: 14px; }
.detail-main { display: grid; grid-template-columns: 46px minmax(0,1fr); }
.detail-main .post-content { padding: 16px 18px 16px; }
.detail-media { height: 240px; border-radius: 6px; margin: 13px 0 12px; background: linear-gradient(140deg,#20323d,#5b879c 44%,#e3b58f 95%); position: relative; overflow: hidden; }
.detail-media::before { content: ""; position: absolute; width: 200px; height: 200px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; left: 13%; top: -68px; box-shadow: 0 0 0 24px rgba(255,255,255,.07), 0 0 0 48px rgba(255,255,255,.07); }
.detail-media::after { content: "community notes • 12 min read"; position: absolute; bottom: 13px; left: 14px; color: rgba(255,255,255,.83); font-size: 11px; letter-spacing: .02em; }
.comments-section { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px 6px; }
.comments-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.comments-header h2 { margin: 0; font-size: 15px; }
.comments-header span { color: var(--ink-muted); font-size: 11px; }
.comment { position: relative; padding: 0 0 12px 28px; margin-left: 2px; border-left: 2px solid #edeff1; }
.comment.level-0 { border-left-color: transparent; margin-left: 0; padding-left: 0; }
.comment.level-1 { margin-left: 12px; }
.comment.level-2 { margin-left: 22px; }
.comment.is-collapsed .comment-body, .comment.is-collapsed .comment-actions { display: none; }
.comment.is-collapsed { padding-bottom: 5px; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 24px; font-size: 11px; color: var(--ink-muted); }
.comment-head button { border: 0; background: transparent; padding: 0; font-size: 11px; cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.comment-head button:hover { color: var(--orange); text-decoration: underline; }
.comment-body { margin: 6px 0 7px; font-size: 13px; line-height: 1.55; color: var(--ink); max-width: 76ch; }
.comment-actions { display: flex; align-items: center; gap: 4px; }
.comment-action { border: 0; background: transparent; color: var(--ink-muted); padding: 3px 6px; cursor: pointer; border-radius: 4px; font-size: 10px; font-weight: 600; }
.comment-action:hover { background: var(--surface-hover); color: var(--ink-soft); }
.comment-score { color: var(--ink-muted); font-size: 10px; font-weight: 700; }
.comment-toggle { border: 0; background: transparent; color: var(--ink-muted); padding: 0; cursor: pointer; font-size: 11px; }
.comment-toggle:hover { color: var(--orange); }
.reply-box { border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; margin: 4px 0 10px; background: #fff; }
.reply-box textarea { display: block; width: 100%; min-height: 60px; resize: vertical; border: 0; outline: 0; font-size: 12px; color: var(--ink); }
.reply-actions { display: flex; justify-content: flex-end; gap: 6px; }
.mini-btn { border: 0; border-radius: 14px; height: 28px; padding: 0 11px; cursor: pointer; font-size: 11px; font-weight: 600; }
.mini-btn.ghost { background: var(--surface-hover); color: var(--ink-soft); }
.mini-btn.primary { background: var(--orange); color: #fff; }

.empty-state { background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 35px 20px; text-align: center; color: var(--ink-soft); }
.empty-state .empty-icon { width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: #fff4ef; color: var(--orange); font-size: 22px; }
.empty-state h2 { margin: 0 0 5px; font-size: 15px; color: var(--ink); }
.empty-state p { margin: 0 auto 14px; max-width: 42ch; font-size: 12px; }

.toast-region { position: fixed; z-index: 90; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 30px)); pointer-events: none; }
.toast { pointer-events: auto; min-height: 46px; display: flex; align-items: center; gap: 10px; background: #222; color: #fff; border-radius: 7px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.24); font-size: 12px; animation: toastIn .2s ease both; }
.toast.success::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; background: #4caf62; display: grid; place-items: center; font-weight: 700; }
.toast-message { flex: 1; min-width: 0; }
.toast button { border: 0; background: transparent; color: #ff8e63; font-weight: 700; cursor: pointer; font-size: 11px; padding: 3px 4px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.overlay { position: fixed; inset: 0; z-index: 70; display: none; }
.overlay.open { display: block; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(14,16,18,.48); backdrop-filter: blur(1px); }
.dialog { position: relative; z-index: 1; width: min(560px, calc(100vw - 28px)); max-height: min(720px, calc(100dvh - 36px)); overflow: auto; margin: 18vh auto 0; background: #fff; border-radius: 10px; box-shadow: 0 20px 55px rgba(0,0,0,.26); animation: modalIn .18s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 17px; }
.dialog-close { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: var(--ink-muted); font-size: 18px; }
.dialog-close:hover { background: var(--surface-hover); color: var(--ink); }
.dialog-body { padding: 17px 18px 19px; }
.dialog-copy { margin: 0 0 14px; color: var(--ink-soft); font-size: 12px; }
.form-grid { display: grid; gap: 13px; }
.field-label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.field-label input, .field-label textarea, .field-label select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); padding: 9px 10px; font-size: 13px; }
.field-label textarea { min-height: 120px; resize: vertical; }
.field-label input:focus, .field-label textarea:focus, .field-label select:focus { border-color: var(--blue); outline: 2px solid rgba(0,121,211,.18); outline-offset: 0; }
.field-helper { color: var(--ink-muted); font-size: 11px; font-weight: 400; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.signin-dialog { width: min(430px, calc(100vw - 28px)); }
.signin-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.signin-brand .brand-mark { width: 38px; height: 38px; }
.signin-brand strong { font-size: 18px; }
.provider-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; cursor: pointer; font-weight: 600; font-size: 12px; }
.provider-btn:hover { background: var(--surface-hover); }
.or-line { display: flex; align-items: center; gap: 9px; margin: 14px 0; color: var(--ink-muted); font-size: 10px; }
.or-line::before, .or-line::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.terms { margin: 13px 0 0; color: var(--ink-muted); font-size: 10px; line-height: 1.45; }
.terms a { color: var(--blue); }

.mobile-drawer { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: #fff; z-index: 2; box-shadow: 8px 0 28px rgba(0,0,0,.14); padding: 66px 15px 18px; animation: drawerIn .18s ease both; overflow-y: auto; }
@keyframes drawerIn { from { transform: translateX(-16px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.drawer-close { position: absolute; top: 16px; right: 12px; }
.drawer-label { color: var(--ink-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 0 11px 7px; }
.drawer-section { margin-bottom: 17px; }

.author-popover { position: fixed; z-index: 40; width: min(285px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: none; padding: 14px; }
.author-popover.open { display: block; animation: modalIn .15s ease both; }
.author-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.author-card-top strong { display: block; font-size: 13px; }
.author-card-top span { display: block; font-size: 11px; color: var(--ink-muted); }
.author-bio { color: var(--ink-soft); font-size: 11px; line-height: 1.45; margin: 0 0 11px; }
.author-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.author-stats strong { display: block; font-size: 13px; }
.author-stats span { display: block; color: var(--ink-muted); font-size: 10px; }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 196px minmax(0,1fr); }
  .right-rail { display: none; }
}
@media (max-width: 800px) {
  body { font-size: 16px; }
  .topbar { height: 56px; padding: 0 12px; gap: 8px; min-width: 0; overflow: hidden; }
  .brand-name { display: none; }
  .topbar-search { order: 3; min-width: 0; flex: 1 1 80px; max-width: none; }
  .top-actions { margin-left: 0; gap: 2px; min-width: 0; flex: 0 1 auto; }
  .top-actions .ghost-btn, .top-actions .outline-btn { display: none; }
  .account-meta, .account-trigger .chevron { display: none; }
  .account-trigger { padding: 3px; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .page { padding: 12px 10px 34px; }
  .layout { display: block; }
  .left-rail { display: none; }
  .welcome-banner { padding: 14px; align-items: flex-start; }
  .welcome-actions { display: none; }
  .feed-toolbar { align-items: flex-start; }
  .feed-context { font-size: 12px; padding-top: 7px; }
  .post-card { border-radius: 6px; }
  .post-body { grid-template-columns: 40px minmax(0,1fr); }
  .vote-rail { padding-top: 9px; }
  .post-content { padding: 11px 11px 9px; }
  .post-title { font-size: 17px; }
  .post-copy { font-size: 16px; line-height: 1.5; }
  .post-action { min-height: 34px; padding: 0 7px; font-size: 11px; }
  .subreddit-head { align-items: flex-start; flex-wrap: wrap; padding-bottom: 12px; }
  .subreddit-icon { width: 58px; height: 58px; }
  .subreddit-title-group h1 { font-size: 19px; }
  .subreddit-head .join-btn { margin-left: 71px; margin-top: -4px; }
  .subreddit-links { overflow-x: auto; }
  .detail-main { grid-template-columns: 40px minmax(0,1fr); }
  .detail-main .post-content { padding: 13px 12px; }
  .detail-card .post-title { font-size: 20px; }
  .detail-media { height: 180px; }
  .comments-section { padding: 13px 11px 4px; }
  .comment-body { font-size: 16px; }
  .comment-action { font-size: 11px; padding: 5px 7px; }
  .dialog { margin-top: 9vh; }
}
@media (max-width: 440px) {
  .topbar-search input { height: 35px; font-size: 16px; }
  .brand-link { gap: 0; }
  .brand-mark { width: 30px; height: 30px; }
  .feed-tab { padding-left: 9px; padding-right: 9px; }
  .post-meta { font-size: 10px; }
  .post-title { font-size: 16px; }
  .post-actions { gap: 0; }
  .post-action span:not(.action-icon) { display: none; }
  .post-action { min-width: 33px; justify-content: center; }
  .link-thumb { width: 72px; }
  .welcome-copy h1 { font-size: 16px; }
}
