:root {
  --ink: #111114;
  --muted: #727187;
  --quiet: #8a8692;
  --line: #ececf6;
  --line-strong: #d7d2df;
  --surface: #fff;
  --surface-soft: #f8f7fb;
  --surface-purple: #f5f1ff;
  --purple: #6e40ff;
  --purple-dark: #4b22d6;
  --blue: #0797ff;
  --green: #00c8a5;
  --gold: #ffe045;
  --danger: #bd2c3b;
  --header-height: 76px;
  --left-width: 284px;
  --right-width: 332px;
  --radius: 14px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--surface); }
body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; overflow: hidden; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(110,64,255,.26); outline-offset: 2px; }

.site-header {
  height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.98);
  position: relative;
  z-index: 30;
}
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; justify-self: start; }
.brand span { color: var(--purple); }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a { padding: 10px 14px; border-radius: 10px; font-size: .89rem; font-weight: 600; color: #38353e; white-space: nowrap; }
.site-nav a:hover { color: var(--purple); background: var(--surface-soft); }
.site-nav a[aria-current="page"] { color: var(--purple); background: var(--surface-purple); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.header-icon, .mobile-menu-button {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: transparent; color: #4d4954; cursor: pointer;
}
.header-icon:hover, .mobile-menu-button:hover { background: var(--surface-soft); color: var(--purple); }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); position: absolute; right: 8px; top: 7px; box-shadow: 0 0 0 2px #fff; }
.account-button { min-height: 42px; min-width: 88px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer; font-size: .83rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.account-button:hover { border-color: var(--purple); color: var(--purple); }
.account-button .avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--purple); color: #fff; font-size: .72rem; }
.mobile-menu-button { display: none; }
.mobile-nav { position: fixed; z-index: 35; top: var(--header-height); inset-inline: 0; padding: 12px 18px 18px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 30px rgba(20,18,28,.08); }
.mobile-nav a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mobile-nav a[aria-current="page"] { color: var(--purple); font-weight: 700; }

#communityApp { height: calc(100vh - var(--header-height)); }
.community-view { display: none; height: 100%; }
.community-view[data-active="true"] { display: grid; }
#feedView { grid-template-columns: var(--left-width) minmax(520px, 1fr) var(--right-width); }

.realm-rail, .context-rail, .thread-left, .thread-right, .me-sidebar, .me-context { min-width: 0; overflow-y: auto; scrollbar-width: thin; }
.realm-rail { padding: 24px 22px; border-right: 1px solid var(--line); }
.rail-heading { margin-bottom: 18px; }
.rail-heading h1 { margin: 0 0 6px; font-size: 1.65rem; letter-spacing: -.04em; }
.rail-heading p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.realm-switcher { display: grid; gap: 8px; }
.realm-button {
  width: 100%; min-height: 76px; padding: 14px 15px; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center;
  border-radius: var(--radius); background: var(--surface-soft); text-align: left; cursor: pointer; transition: transform .22s var(--ease), background .22s var(--ease), color .22s var(--ease);
}
.realm-button:hover { transform: translateX(3px); }
.realm-button[aria-pressed="true"] { color: #fff; background: var(--realm-color); }
.realm-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--realm-color); background: color-mix(in srgb, var(--realm-color) 12%, white); }
.realm-button[aria-pressed="true"] .realm-icon { color: #fff; background: rgba(255,255,255,.18); }
.realm-copy { min-width: 0; display: grid; gap: 2px; }
.realm-copy strong { font-size: .98rem; }
.realm-copy span { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.realm-button[aria-pressed="true"] .realm-copy span { color: rgba(255,255,255,.84); }
.realm-button > svg { font-size: .85rem; }
.rail-section-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 3px 8px; font-size: .8rem; }
.rail-section-heading button { display: flex; align-items: center; gap: 2px; color: var(--muted); background: none; cursor: pointer; font-size: .7rem; }
.rail-section-heading button:hover { color: var(--purple); }
.circle-list { display: grid; gap: 2px; }
.circle-list button { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: center; padding: 10px 9px; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; font-size: .78rem; }
.circle-list button:hover { background: var(--surface-soft); }
.circle-list button[aria-current="true"] { color: var(--purple); background: var(--surface-purple); font-weight: 700; }
.circle-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--circle-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--circle-color) 12%, white); }
.circle-list button > svg { color: var(--quiet); font-size: .78rem; }

.discussion-desk { min-width: 0; height: 100%; display: grid; grid-template-rows: auto auto auto auto minmax(0,1fr); }
.desk-toolbar { padding: 20px 20px 14px; display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 14px; }
.desk-toolbar h2 { margin: 0; font-size: 1.56rem; letter-spacing: -.04em; }
.search-box { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--quiet); transition: border-color .18s, box-shadow .18s; }
.search-box:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110,64,255,.1); }
.search-box input { min-width: 0; flex: 1; height: 40px; border: 0; outline: 0; background: transparent; font-size: .78rem; }
.search-box input::placeholder { color: #77737e; }
.primary-button, .secondary-button, .quiet-button, .text-action {
  min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; font-size: .78rem; font-weight: 700; cursor: pointer; transition: transform .18s var(--ease), background .18s, border-color .18s;
}
.primary-button { color: #fff; background: var(--purple); box-shadow: 0 6px 16px rgba(83,40,223,.18); }
.primary-button:hover { background: var(--purple-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .52; cursor: wait; transform: none; }
.secondary-button { background: #fff; border: 1px solid var(--line-strong); }
.secondary-button:hover { border-color: var(--purple); color: var(--purple); }
.quiet-button, .text-action { background: transparent; color: var(--muted); }
.quiet-button:hover, .text-action:hover { color: var(--purple); background: var(--surface-soft); }
.circle-strip { padding: 0 20px 13px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.circle-strip::-webkit-scrollbar { display: none; }
.circle-chip { min-width: 142px; padding: 9px 12px; display: grid; grid-template-columns: 31px 1fr; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.circle-chip:hover { border-color: var(--circle-color); }
.circle-chip[aria-pressed="true"] { border-color: var(--circle-color); background: color-mix(in srgb, var(--circle-color) 5%, white); }
.chip-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--circle-color); font-size: .67rem; font-weight: 800; }
.circle-chip strong { display: block; font-size: .73rem; white-space: nowrap; }
.circle-chip small { display: block; margin-top: 2px; color: var(--muted); font-size: .63rem; }
.feed-controls { min-height: 52px; padding: 7px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.feed-controls > div { display: flex; gap: 4px; }
.feed-controls [data-sort] { min-height: 36px; padding: 0 13px; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: .76rem; }
.feed-controls [data-sort][aria-pressed="true"] { color: var(--purple); background: var(--surface-purple); font-weight: 700; }
.status-line { min-height: 0; padding: 0 20px; color: var(--muted); font-size: .72rem; overflow: hidden; }
.status-line:not(:empty) { min-height: 38px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.feed-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.feed-loading { display: grid; gap: 0; }
.feed-skeleton { height: 132px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg,#fff 20%,#f7f5fb 46%,#fff 72%); background-size: 260% 100%; animation: shimmer 1.2s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -160% 0; } }
.thread-row { position: relative; border-bottom: 1px solid var(--line); }
.thread-row[data-pinned="true"] { background: #fbf9ff; }
.thread-row-inner { min-height: 128px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; padding: 17px 20px; }
.user-avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; background: color-mix(in srgb, var(--avatar-color) 13%, white); color: var(--avatar-color); font-size: .73rem; font-weight: 800; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.thread-open { min-width: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: .66rem; }
.type-label { color: var(--purple); font-weight: 700; }
.official-label { color: #7a4d00; background: #fff5d7; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
.thread-title { margin: 7px 0 4px; font-size: .98rem; line-height: 1.45; letter-spacing: -.02em; }
.thread-open:hover .thread-title { color: var(--purple); }
.thread-summary { margin: 0; color: #55515c; font-size: .75rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thread-bottom { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.thread-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.thread-tag { padding: 3px 7px; border-radius: 6px; background: var(--surface-soft); color: #5c5764; font-size: .62rem; }
.thread-counts { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .66rem; white-space: nowrap; }
.thread-counts span { display: inline-flex; align-items: center; gap: 4px; }
.row-actions { display: flex; align-items: flex-start; gap: 3px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--purple); background: var(--surface-purple); }
.icon-button[aria-pressed="true"] { color: var(--purple); background: var(--surface-purple); }
.empty-state { min-height: 290px; display: grid; place-items: center; padding: 38px; text-align: center; }
.empty-state > div { max-width: 380px; }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 15px; color: var(--purple); background: var(--surface-purple); font-size: 1.35rem; }
.empty-state h3 { margin: 0 0 7px; font-size: 1rem; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.mobile-realm-tabs { display: none; }

.context-rail { border-left: 1px solid var(--line); padding: 23px 20px; }
.context-section { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.context-section:last-child { border-bottom: 0; }
.context-kicker { margin: 0 0 12px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.context-circle-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.context-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--circle-color); font-size: .72rem; font-weight: 800; }
.context-circle-title h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.02em; }
.context-description { margin: 0 0 14px; color: #5d5964; font-size: .72rem; line-height: 1.7; }
.follow-button { width: 100%; min-height: 42px; border: 1px solid var(--purple); border-radius: 11px; color: var(--purple); background: #fff; font-size: .75rem; font-weight: 700; cursor: pointer; }
.follow-button:hover, .follow-button[aria-pressed="true"] { color: #fff; background: var(--purple); }
.context-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.context-list li { display: flex; align-items: flex-start; gap: 8px; color: #504c56; font-size: .72rem; line-height: 1.55; }
.context-list svg { margin-top: 2px; color: var(--purple); flex: 0 0 auto; }
.related-list { display: grid; }
.related-button { width: 100%; padding: 9px 0; display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; background: transparent; text-align: left; cursor: pointer; }
.related-button:hover strong { color: var(--purple); }
.related-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--circle-color); font-size: .6rem; font-weight: 800; }
.related-button strong { display: block; font-size: .7rem; }
.related-button small { display: block; margin-top: 2px; color: var(--muted); font-size: .61rem; }
.my-summary { padding: 15px; border-radius: var(--radius); background: var(--surface-purple); }
.my-summary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.my-summary-head strong { font-size: .82rem; }
.my-summary-head button { color: var(--purple); background: transparent; cursor: pointer; font-size: .68rem; }
.realm-progress { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; margin-top: 10px; font-size: .66rem; }
.progress-track { height: 3px; background: #ddd7ec; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--progress-color); }

.discovery-panel { padding: 4px 20px 20px; }
.discovery-intro { padding: 18px 0 12px; display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid var(--line); }
.discovery-intro h3 { margin: 0; font-size: 1.1rem; }
.discovery-intro p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.discovery-list { display: grid; }
.discovery-row { padding: 18px 0; display: grid; grid-template-columns: 46px 1fr auto; gap: 13px; align-items: center; border-bottom: 1px solid var(--line); }
.discovery-row h4 { margin: 0 0 4px; font-size: .86rem; }
.discovery-row p { margin: 0; max-width: 64ch; color: var(--muted); font-size: .7rem; line-height: 1.6; }
.discovery-row .follow-button { width: auto; padding-inline: 15px; }

.thread-layout { grid-template-columns: var(--left-width) minmax(560px,1fr) var(--right-width); }
.thread-left { border-right: 1px solid var(--line); padding: 21px 20px; }
.back-button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 4px; background: transparent; color: var(--muted); font-size: .73rem; cursor: pointer; }
.back-button:hover { color: var(--purple); }
.thread-left-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.thread-left-section h3 { margin: 0 0 12px; font-size: .76rem; }
.thread-left-section p { margin: 7px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.65; }
.topic-link { width: 100%; padding: 8px 2px; display: flex; justify-content: space-between; color: var(--purple); background: transparent; font-size: .7rem; cursor: pointer; }
.thread-reader { min-width: 0; overflow-y: auto; padding: 26px 34px 70px; scroll-behavior: smooth; }
.thread-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .68rem; }
.thread-breadcrumb button { padding: 0; background: transparent; color: inherit; cursor: pointer; }
.thread-breadcrumb button:hover { color: var(--purple); }
.reader-type { display: inline-flex; margin: 18px 0 8px; color: var(--purple); font-size: .7rem; font-weight: 700; }
.reader-title { max-width: 28ch; margin: 0; font-size: clamp(1.6rem,2.5vw,2.2rem); line-height: 1.23; letter-spacing: -.035em; }
.reader-author { margin-top: 17px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .68rem; }
.reader-author strong { color: var(--ink); }
.reader-author .user-avatar { width: 36px; height: 36px; border-radius: 11px; }
.reader-body { max-width: 72ch; padding: 25px 0; color: #302d34; font-size: .87rem; line-height: 1.92; }
.reader-body p { margin: 0 0 1em; }
.reader-body h2, .reader-body h3 { margin: 1.65em 0 .55em; line-height: 1.4; }
.reader-body h2 { font-size: 1.1rem; }.reader-body h3 { font-size: .98rem; }
.reader-body pre { padding: 14px 16px; overflow-x: auto; border: 1px solid #d9d2ea; border-radius: 10px; background: #faf8ff; color: #39314d; font-family: "SFMono-Regular", Consolas, monospace; font-size: .74rem; line-height: 1.65; }
.reader-body ul, .reader-body ol { padding-left: 1.3em; }
.reader-actions { padding: 12px 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.reader-actions .secondary-button[aria-pressed="true"] { color: var(--purple); border-color: var(--purple); background: var(--surface-purple); }
.reader-actions .danger-action { margin-left: auto; }
.danger-action { color: var(--danger); }
.reply-composer { margin: 24px 0 28px; }
.reply-composer h2, .comments-heading h2 { margin: 0; font-size: 1.05rem; }
.reply-composer p { margin: 5px 0 12px; color: var(--muted); font-size: .7rem; }
.reply-box { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.reply-box:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110,64,255,.08); }
.reply-box textarea { width: 100%; min-height: 112px; padding: 14px; resize: vertical; border: 0; outline: 0; font-size: .78rem; line-height: 1.65; }
.reply-box-footer { padding: 9px 10px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); background: #fcfbfd; }
.reply-box-footer span { color: var(--muted); font-size: .65rem; }
.comments-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.comment-list { display: grid; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-main { display: grid; grid-template-columns: 36px 1fr; gap: 10px; }
.comment .user-avatar { width: 36px; height: 36px; border-radius: 11px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: .64rem; }
.comment-head strong { color: var(--ink); font-size: .72rem; }
.comment-body { margin: 7px 0 8px; color: #39363e; font-size: .76rem; line-height: 1.72; white-space: pre-wrap; }
.comment-actions { display: flex; gap: 4px; }
.comment-actions button { min-height: 32px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: .64rem; }
.comment-actions button:hover, .comment-actions button[aria-pressed="true"] { color: var(--purple); background: var(--surface-purple); }
.comment-children { margin: 12px 0 0 46px; padding-left: 14px; border-left: 1px solid #d8d1e9; }
.comment-children .comment { padding: 13px 0; }
.inline-reply { margin: 10px 0 0 46px; display: grid; gap: 8px; }
.inline-reply textarea { min-height: 78px; padding: 10px 11px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; font-size: .73rem; }
.inline-reply textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110,64,255,.08); }
.inline-reply div { display: flex; justify-content: flex-end; gap: 7px; }
.inline-edit { margin-top: 8px; }
.thread-right { border-left: 1px solid var(--line); padding: 22px 20px; }
.side-card { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.side-card h3 { margin: 0 0 12px; font-size: .76rem; }
.author-card { display: grid; grid-template-columns: 42px 1fr; gap: 10px; }
.author-card p { grid-column: 1/-1; margin: 2px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.6; }

.me-layout { grid-template-columns: var(--left-width) minmax(560px,1fr) var(--right-width); }
.me-sidebar { padding: 22px 20px; border-right: 1px solid var(--line); }
.me-profile { padding: 19px 0; display: flex; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.me-profile h1 { margin: 0 0 3px; font-size: 1.1rem; }
.me-profile p { margin: 0; color: var(--muted); font-size: .66rem; }
.me-nav { display: grid; gap: 3px; padding: 16px 0; }
.me-nav button { min-height: 42px; padding: 0 10px; display: flex; align-items: center; gap: 9px; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: .75rem; }
.me-nav button[aria-pressed="true"], .me-nav button:hover { color: var(--purple); background: var(--surface-purple); }
.me-mobile-tabs { display: none; }
.me-content { min-width: 0; overflow-y: auto; padding: 28px 34px 70px; }
.me-content-header { display: flex; align-items: end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.me-content-header h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.035em; }
.me-content-header p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.me-section { padding: 22px 0; }
.realm-stat-list { display: grid; gap: 0; }
.realm-stat-row { padding: 18px 0; display: grid; grid-template-columns: 120px minmax(120px,1fr) 180px; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); }
.realm-stat-row h3 { margin: 0; font-size: .86rem; }
.realm-stat-row small { display: block; margin-top: 4px; color: var(--muted); font-size: .63rem; }
.realm-stat-row .progress-track { height: 5px; }
.stat-numbers { display: flex; justify-content: flex-end; gap: 14px; color: var(--muted); font-size: .65rem; }
.stat-numbers strong { color: var(--ink); }
.personal-list { display: grid; }
.personal-row { padding: 16px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; border-bottom: 1px solid var(--line); }
.personal-row button { padding: 0; background: transparent; text-align: left; cursor: pointer; }
.personal-row h3 { margin: 0 0 5px; font-size: .84rem; }
.personal-row p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.personal-row small { color: var(--muted); font-size: .63rem; }
.notification-row[data-unread="true"] { background: linear-gradient(90deg,var(--surface-purple),transparent); }
.me-context { padding: 22px 20px; border-left: 1px solid var(--line); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(23,22,27,.3); animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.composer-sheet { position: fixed; z-index: 60; top: 0; right: 0; width: min(520px,100vw); height: 100vh; padding: 24px 26px; overflow-y: auto; background: #fff; transform: translateX(104%); transition: transform .32s var(--ease); box-shadow: -18px 0 44px rgba(20,18,28,.14); }
.composer-sheet[aria-hidden="false"] { transform: translateX(0); }
.composer-sheet form { display: grid; gap: 16px; }
.sheet-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.sheet-header h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.035em; }
.sheet-header p { margin: 6px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.composer-sheet label, .report-dialog label { display: grid; gap: 7px; color: #4e4a54; font-size: .72rem; font-weight: 600; }
.composer-sheet input, .composer-sheet select, .composer-sheet textarea, .report-dialog select, .report-dialog textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; outline: 0; font-size: .78rem; font-weight: 400; }
.composer-sheet input, .composer-sheet select, .report-dialog select { min-height: 44px; padding: 0 12px; }
.composer-sheet textarea, .report-dialog textarea { min-height: 220px; padding: 12px; resize: vertical; line-height: 1.65; }
.composer-sheet input:focus, .composer-sheet select:focus, .composer-sheet textarea:focus, .report-dialog select:focus, .report-dialog textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110,64,255,.08); }
.form-note { margin: -4px 0 0; padding: 11px 12px; border-radius: 10px; color: #4f4862; background: var(--surface-purple); font-size: .68rem; line-height: 1.6; }
.form-error { min-height: 0; color: var(--danger); font-size: .7rem; }
.form-error:not(:empty) { padding: 10px 12px; border-radius: 9px; background: #fff1f2; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.report-dialog { width: min(460px,calc(100vw - 28px)); padding: 22px; border: 0; border-radius: 16px; box-shadow: 0 24px 70px rgba(20,18,28,.22); }
.report-dialog::backdrop { background: rgba(23,22,27,.36); }
.report-dialog form { display: grid; gap: 15px; }
.report-dialog textarea { min-height: 130px; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 24px; max-width: min(460px,calc(100vw - 32px)); padding: 11px 16px; border-radius: 11px; color: #fff; background: #242129; box-shadow: 0 10px 30px rgba(20,18,28,.18); font-size: .73rem; line-height: 1.5; opacity: 0; transform: translate(-50%,14px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.toast[data-show="true"] { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1260px) {
  :root { --left-width: 246px; --right-width: 286px; }
  .site-header { grid-template-columns: auto 1fr auto; }
  .site-nav { justify-self: center; gap: 2px; }
  .site-nav a { padding-inline: 9px; font-size: .8rem; }
  .realm-rail { padding-inline: 16px; }
  .context-rail, .thread-right, .me-context { padding-inline: 15px; }
  .thread-reader, .me-content { padding-inline: 26px; }
}

@media (max-width: 1040px) {
  #feedView, .thread-layout, .me-layout { grid-template-columns: 224px minmax(0,1fr); }
  .context-rail, .thread-right, .me-context { display: none; }
  .site-nav a:nth-child(4), .site-nav a:nth-child(5) { display: none; }
}

@media (max-width: 760px) {
  body { height: auto; min-height: 100vh; overflow: auto; }
  :root { --header-height: 64px; }
  .site-header { height: var(--header-height); padding: 0 14px; grid-template-columns: 1fr auto; }
  .brand { font-size: 1.25rem; }
  .site-nav, .header-icon { display: none; }
  .header-actions { grid-column: 2; }
  .account-button { min-width: 70px; min-height: 40px; padding-inline: 12px; }
  .mobile-menu-button { display: grid; }
  #communityApp { height: auto; min-height: calc(100vh - var(--header-height)); }
  .community-view, .community-view[data-active="true"] { height: auto; min-height: calc(100vh - var(--header-height)); }
  #feedView, .thread-layout, .me-layout { display: none; grid-template-columns: 1fr; }
  #feedView[data-active="true"], .thread-layout[data-active="true"], .me-layout[data-active="true"] { display: grid; }
  .realm-rail, .thread-left, .me-sidebar { display: none; }
  .discussion-desk { height: auto; display: block; }
  .desk-toolbar { padding: 14px; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .mobile-realm-tabs { grid-column: 1/-1; display: flex; gap: 6px; overflow-x: auto; }
  .mobile-realm-tabs button { min-height: 38px; padding: 0 12px; border-radius: 9px; color: var(--muted); background: var(--surface-soft); white-space: nowrap; font-size: .72rem; }
  .mobile-realm-tabs button[aria-pressed="true"] { color: #fff; background: var(--realm-color); }
  .desk-toolbar h2 { display: none; }
  .search-box { min-width: 0; }
  .primary-button { min-width: 44px; padding-inline: 12px; }
  #openComposer span { display: none; }
  .circle-strip { padding-inline: 14px; }
  .circle-chip { min-width: 136px; }
  .feed-controls { padding-inline: 14px; }
  .feed-controls .quiet-button { font-size: 0; width: 42px; padding: 0; }
  .feed-controls .quiet-button svg { font-size: .9rem; }
  .feed-scroll { overflow: visible; }
  .thread-row-inner { grid-template-columns: 38px minmax(0,1fr); padding: 15px 14px; min-height: 0; }
  .thread-row .user-avatar { width: 38px; height: 38px; }
  .row-actions { grid-column: 2; justify-self: end; margin-top: -40px; }
  .thread-bottom { align-items: flex-end; }
  .thread-counts { gap: 8px; }
  .thread-summary { font-size: .72rem; }
  .thread-reader, .me-content { overflow: visible; padding: 18px 16px 60px; }
  .reader-title { font-size: 1.55rem; }
  .reader-actions .danger-action { margin-left: 0; }
  .comment-children { margin-left: 22px; padding-left: 10px; }
  .inline-reply { margin-left: 0; }
  .me-content-header { align-items: flex-start; gap: 12px; }
  .me-mobile-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 12px 0 0; border-bottom: 1px solid var(--line); }
  .me-mobile-tabs button { flex: 0 0 auto; padding-inline: 11px; }
  .realm-stat-row { grid-template-columns: 90px 1fr; }
  .stat-numbers { grid-column: 1/-1; justify-content: flex-start; }
  .composer-sheet { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
