:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 26%),
    linear-gradient(180deg, #1b1d21 0%, #20232a 100%);
  color: var(--text);
}

body {
  overflow: hidden;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.08);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 80%, white);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  border-radius: 8px;
  background: #101114;
  color: #fff;
  padding: 0.55rem 0.8rem;
}

.skip-link:focus {
  top: 1rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.guild-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.5rem;
  background: #111214;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.guild-pill {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #2b2d31;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  transition: transform 140ms ease, border-radius 140ms ease, background-color 140ms ease;
}

.guild-pill:hover {
  background: var(--accent);
  color: #111;
  text-decoration: none;
  border-radius: 13px;
  transform: translateY(-1px);
}

.guild-pill-home {
  background: linear-gradient(160deg, #6974f6, #4651d7);
}

.guild-pill-action {
  background: #2d7d46;
}

.guild-pill-admin {
  background: #964747;
}

.workspace-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #2b2d31;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #f3f4f6;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.logo-link:hover {
  text-decoration: none;
}

.logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
}

.header-search-form input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #1b1c20;
  background: #1e2024;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.top-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.top-nav > a,
.top-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d7dbe2;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.66rem;
}

.top-nav > a:hover,
.top-nav button:hover {
  background: #373a41;
  border-color: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.top-nav form {
  margin: 0;
}

.unread-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: #ed4245;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.app-main {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 28%, #313338), #2f3136);
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.flash {
  border: 1px solid rgba(255, 204, 102, 0.35);
  border-radius: 10px;
  background: rgba(92, 64, 15, 0.55);
  color: #ffe1a3;
  padding: 0.65rem 0.8rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 1rem;
  min-height: 100%;
  align-content: start;
}

.workspace-grid-thread {
  grid-template-columns: 260px minmax(0, 1fr) 290px;
}

.sidebar-pane,
.main-pane,
.form-shell,
.page-shell,
.profile-card,
.reading-shell {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(39, 42, 48, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.sidebar-pane {
  overflow: hidden;
}

.sidebar-section {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-section:last-child {
  border-bottom: 0;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-section h2,
.sidebar-section h3 {
  margin: 0;
  color: #f3f4f6;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.mini-action {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7dbe2;
  font-weight: 800;
}

.mini-action:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.stream-list,
.side-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}

.stream-link,
.side-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  border-radius: 10px;
  padding: 0.52rem 0.6rem;
}

.stream-link {
  color: #c1c7d0;
}

.stream-link:hover,
.stream-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.stream-hash {
  color: #7d8591;
  font-weight: 800;
}

.stream-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.stream-count,
.side-list span {
  color: #8e96a2;
  font-size: 0.75rem;
}

.side-list li {
  grid-template-columns: 1fr auto;
  margin-bottom: 0.2rem;
}

.side-list a {
  min-width: 0;
  color: #dfe3e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-note,
.empty-copy {
  color: #a1a8b3;
  line-height: 1.55;
  margin: 0.8rem 0 0;
}

.sidebar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.85rem;
  min-height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #111;
  font-weight: 800;
  padding: 0.55rem 0.9rem;
}

.sidebar-cta:hover {
  text-decoration: none;
  filter: brightness(1.04);
}

.main-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.conversation-pane {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar h1 {
  margin: 0;
  color: #f7f8fa;
  font-size: 1.35rem;
  line-height: 1.15;
  text-wrap: balance;
}

.toolbar-search {
  width: min(360px, 100%);
}

.toolbar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 0.18rem;
  color: #9aa1ab;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-pane {
  min-height: 0;
  overflow: auto;
}

.topic-pane-head,
.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 1rem;
  align-items: center;
}

.topic-pane-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.7rem 1.1rem;
  background: rgba(39, 42, 48, 0.98);
  color: #8e96a2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topic-list {
  padding: 0.2rem 0;
}

.topic-row {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 140ms ease;
}

.topic-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.topic-row-unread {
  background: rgba(255, 255, 255, 0.03);
}

.topic-row-locked {
  opacity: 0.78;
}

.topic-main {
  min-width: 0;
}

.topic-line {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.topic-line h2,
.topic-line h3 {
  margin: 0;
  min-width: 0;
  color: #f6f7f8;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-line h2 a,
.topic-line h3 a {
  color: inherit;
}

.topic-marker {
  color: color-mix(in srgb, var(--accent) 72%, white);
  font-weight: 900;
}

.topic-meta,
.thread-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 0.4rem 0 0;
  color: #9ca4af;
  font-size: 0.79rem;
  line-height: 1.4;
}

.topic-meta a,
.thread-meta a,
.user-link {
  color: #f3f4f6;
  font-weight: 800;
}

.topic-preview {
  margin: 0.38rem 0 0;
  color: #cad0d7;
  line-height: 1.5;
}

.topic-tag,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
}

.topic-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #d8dde5;
}

.badge {
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, white);
}

.topic-stats,
.notification-actions,
.moderation-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  color: #8e96a2;
  font-size: 0.75rem;
  text-align: right;
}

.topic-stats strong {
  color: #f5f6f7;
  font-size: 1.1rem;
  line-height: 1;
}

.thread-summary {
  padding: 1rem 1.1rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.thread-summary-main {
  min-width: 0;
}

.thread-post-list {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.1rem 1.3rem;
}

.thread-empty-copy {
  padding: 1rem 1.1rem 1.3rem;
}

.forum-post {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  background: rgba(33, 35, 40, 0.9);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.12);
}

.thread-starter-post {
  margin: 0;
}

.forum-post-reply {
  position: relative;
}

.forum-post-author {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.45rem;
  padding: 1rem 0.95rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  text-align: center;
}

.forum-post-author .muted {
  margin: 0;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 24px;
  margin: 0;
  border-radius: 999px;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.role-badge-admin {
  background: linear-gradient(135deg, rgba(255, 212, 112, 0.24), rgba(255, 170, 58, 0.18));
  border: 1px solid rgba(255, 205, 96, 0.34);
  color: #ffd980;
}

.role-badge-moderator {
  background: linear-gradient(135deg, rgba(92, 198, 255, 0.2), rgba(81, 124, 255, 0.14));
  border: 1px solid rgba(123, 202, 255, 0.28);
  color: #97d5ff;
}

.role-badge-member {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cfd6de;
}

.role-glyph {
  line-height: 1;
}

.member-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.member-list-head span {
  color: #9aa2ad;
  font-size: 0.74rem;
  font-weight: 800;
}

.participant-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.participant-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
  border-radius: 10px;
  padding: 0.48rem 0.55rem;
  color: #e8ebef;
}

.participant-item:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.participant-avatar,
.participant-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
}

.participant-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #596171, #434955);
  color: #fff;
  font-weight: 900;
}

.participant-meta {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.participant-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-note {
  color: #99a1ac;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.participant-item .role-badge {
  justify-self: start;
}

.participant-status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4b5563;
  box-shadow: 0 0 0 3px rgba(39, 42, 48, 0.96);
}

.participant-status.is-online {
  background: #3ba55c;
}

.forum-post-avatar,
.forum-post-avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
}

.forum-post-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #596171, #414653);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}

.forum-post-main {
  min-width: 0;
  padding: 1rem 1.05rem 1rem 0;
}

.forum-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: #9ca4af;
  font-size: 0.76rem;
  line-height: 1.45;
}

.forum-post-meta time,
.forum-post-meta span {
  display: inline-flex;
  align-items: center;
}

.reply-context {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dfe4ea;
  font-weight: 700;
  padding: 0 0.65rem;
}

.reply-context:hover {
  background: rgba(255, 255, 255, 0.11);
  text-decoration: none;
}

.forum-post-body {
  margin-top: 0.85rem;
}

.forum-post-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.forum-post-actions a,
.forum-post-actions button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e6e9ed;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.42rem 0.7rem;
}

.forum-post-actions a:hover,
.forum-post-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.post-children {
  position: relative;
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  margin-left: 1.4rem;
  padding-left: 1rem;
}

.post-children::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, transparent), rgba(255, 255, 255, 0.08));
}

.markdown-body {
  line-height: 1.62;
  word-break: break-word;
}

.markdown-body p {
  margin: 0.45rem 0;
}

.markdown-body pre {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: #181a1f;
  padding: 0.8rem;
  overflow: auto;
}

.markdown-body blockquote {
  margin: 0.6rem 0;
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding-left: 0.8rem;
  color: #bfc5cf;
}

.message-feed {
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0;
}

.message-feed-title {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 0.4rem 1.1rem;
  background: rgba(39, 42, 48, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #98a0ab;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.85rem 1.1rem;
  transition: background-color 140ms ease;
}

.message-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.message-avatar,
.post-avatar,
.profile-avatar-fallback {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #575d69, #464b55);
  color: #fff;
  font-weight: 800;
}

.message-body {
  min-width: 0;
}

.message-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.48rem;
  margin-bottom: 0.28rem;
  font-size: 0.82rem;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.message-actions a,
.inline-form button,
.stack-form button,
.topic-stats a,
.notification-actions a,
.moderation-actions a {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e6e9ed;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.38rem 0.6rem;
}

.message-actions a:hover,
.inline-form button:hover,
.stack-form button:hover,
.topic-stats a:hover,
.notification-actions a:hover,
.moderation-actions a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.inline-form,
.stack-form {
  display: inline-flex;
  margin: 0;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.attachment-preview-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.attachment-preview {
  margin: 0;
  max-width: 100%;
  min-width: 0;
}

.attachment-preview > a {
  display: inline-block;
  max-width: 100%;
}

.attachment-preview img {
  display: block;
  width: auto;
  max-width: min(100%, 1280px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
}

.attachment-preview figcaption {
  margin-top: 0.45rem;
  max-width: 100%;
}

.attachment-preview figcaption a {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.attachment-row a {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #eef1f3;
  font-size: 0.75rem;
  padding: 0.28rem 0.62rem;
}

.attachment-row a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.composer-shell {
  padding: 1rem 1.1rem 1.1rem;
  background:
    linear-gradient(180deg, rgba(47, 49, 54, 0.4) 0%, rgba(47, 49, 54, 0.96) 18%),
    rgba(47, 49, 54, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.composer-shell-guest {
  color: #cad0d7;
}

.post-composer,
.standalone-composer {
  position: relative;
}

.composer-header h2 {
  margin: 0;
  color: #f7f8fa;
  font-size: 1.1rem;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(16, 18, 22, 0.58);
}

.composer-tool {
  min-height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf0f4;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.38rem 0.72rem;
}

.composer-tool:hover {
  background: rgba(255, 255, 255, 0.1);
}

.composer-tool-clear {
  background: rgba(255, 255, 255, 0.08);
}

.reply-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(19, 21, 26, 0.78);
  color: #f2f4f7;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.7rem 0.8rem;
}

.reply-target.is-hidden,
.mention-menu.is-hidden {
  display: none;
}

.composer-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.composer-footer > p {
  flex: 1 1 280px;
  margin: 0;
}

.composer-actions,
.standalone-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1 1 100%;
  flex-wrap: wrap;
}

.composer-actions .muted,
.standalone-actions .muted {
  margin: 0;
}

.composer-actions button,
.standalone-actions button {
  flex-shrink: 0;
}

.mention-menu {
  display: grid;
  gap: 0.2rem;
  margin-top: -0.2rem;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(18, 20, 25, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  background: transparent;
  color: #edf0f4;
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.mention-item:hover,
.mention-item.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.mention-avatar,
.mention-avatar-image {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.mention-avatar {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  overflow: hidden;
}

.mention-avatar-fallback {
  background: linear-gradient(160deg, #596171, #434955);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

.mention-name {
  font-size: 0.82rem;
  font-weight: 800;
}

.mention {
  color: color-mix(in srgb, var(--accent) 82%, white);
  font-weight: 900;
}

.mention:hover {
  text-decoration: underline;
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: #9ca4af;
  font-size: 0.75rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #1a1c21;
  background: #1d1f23;
  color: #edf0f4;
  padding: 0.72rem 0.82rem;
  font: inherit;
}

textarea {
  min-height: 148px;
  resize: vertical;
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
  padding: 0.62rem 0.92rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 120ms ease, transform 120ms ease;
}

button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.vote-box {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.85rem;
}

.vote-btn {
  min-width: 34px;
  min-height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf0f4;
}

.score {
  min-width: 24px;
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.meta-list {
  margin: 0.85rem 0 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.7rem;
  padding: 0.28rem 0;
}

.meta-list dt {
  color: #8e96a2;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-list dd {
  margin: 0;
  color: #eceff3;
}

.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.stack-form {
  display: flex;
  width: 100%;
  margin-top: 0.45rem;
}

.stack-form button {
  width: 100%;
  justify-content: center;
}

.form-shell,
.page-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 1.1rem;
}

.form-shell {
  max-width: 760px;
}

.form-shell-head,
.page-head {
  margin-bottom: 1rem;
}

.form-shell-head h1,
.page-head h1 {
  margin: 0;
  color: #f7f8fa;
  font-size: 1.45rem;
}

.form-grid p {
  margin: 0 0 0.85rem;
}

.form-grid label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: #eef1f4;
  font-size: 0.8rem;
  font-weight: 800;
}

.errorlist {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  color: #ffb4b8;
  font-size: 0.76rem;
}

.reading-shell,
.list-shell {
  padding: 1rem 1.1rem;
}

.reading-shell + .reading-shell,
.list-shell + .list-shell {
  margin-top: 1rem;
}

.reading-shell.changelog-entry h2,
.list-shell h2 {
  margin-top: 0;
  color: #f3f4f6;
}

.log-row {
  display: grid;
  grid-template-columns: 170px 120px 160px 1fr;
  gap: 0.8rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #c8ced7;
  font-size: 0.82rem;
}

.profile-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.profile-banner {
  height: 150px;
  border-radius: 18px 18px 0 0;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 28%, transparent), transparent 30%),
    linear-gradient(145deg, #42485a, color-mix(in srgb, var(--accent) 62%, #2d3240));
}

.profile-card {
  margin-top: -54px;
  padding: 1.15rem;
}

.profile-header {
  display: flex;
  align-items: end;
  gap: 1rem;
}

.profile-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 5px solid rgba(39, 42, 48, 0.96);
  object-fit: cover;
}

.profile-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-top: 1.2rem;
}

.profile-panel {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
}

.profile-panel h2 {
  margin: 0 0 0.5rem;
  color: #f3f4f6;
  font-size: 0.96rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-links a,
.profile-links span,
.profile-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #ecf0f3;
  padding: 0.42rem 0.72rem;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.profile-links a:hover,
.profile-actions a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.site-footer {
  display: grid;
  gap: 0.8rem;
  margin-top: auto;
  padding: 0.95rem 1rem 1rem;
  background: #1c1e22;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-topline {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: start;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #aab1ba;
  font-size: 0.77rem;
}

.footer-brandline,
.footer-linkline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
}

.footer-brandline strong {
  color: #f4f5f6;
}

.footer-localtime {
  color: #9ea6b1;
  font-size: 0.74rem;
}

.footer-linkline a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #c2c8d1;
  padding: 0.2rem 0.6rem;
}

.footer-linkline a:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.footer-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.8fr) minmax(0, 1.3fr);
  gap: 0.8rem;
}

.footer-block {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.72rem;
}

.footer-block h4 {
  margin: 0 0 0.3rem;
  color: #f2f4f6;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inline-list {
  margin: 0;
  max-height: 72px;
  overflow: auto;
  color: #b8bec8;
  font-size: 0.76rem;
  line-height: 1.5;
}

.inline-list a {
  color: #d7dce4;
}

.cookie-banner {
  position: fixed;
  right: 1rem;
  bottom: 7rem;
  z-index: 120;
  width: min(360px, calc(100vw - 2rem));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(21, 22, 25, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
  padding: 0.85rem;
}

.user-card-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.68);
  z-index: 120;
}

.user-card-overlay.hidden {
  display: none;
}

.user-card-popup {
  width: min(344px, 92vw);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111214;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
}

.user-card-banner {
  height: 96px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 28%),
    linear-gradient(145deg, #5360df, color-mix(in srgb, var(--accent) 78%, #3a3f48));
}

.user-card-main {
  padding: 0.95rem;
}

.user-card-avatar-wrap {
  margin-top: -54px;
}

.user-card-avatar,
.user-card-avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 6px solid #111214;
  object-fit: cover;
}

.user-card-avatar-fallback {
  display: grid;
  place-items: center;
  background: #525866;
  color: #fff;
  font-size: 1.95rem;
  font-weight: 800;
}

.user-card-identity h3 {
  margin: 0.55rem 0 0.12rem;
  color: #fff;
}

.user-card-identity p {
  margin: 0;
}

.user-card-section {
  margin-top: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.72rem;
}

.user-card-section h4 {
  margin: 0 0 0.35rem;
  color: #aab1ba;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-card-section p {
  margin: 0;
}

.user-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.user-card-links a,
.user-card-links span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #edf1f4;
  font-size: 0.75rem;
  padding: 0.34rem 0.62rem;
}

.user-card-links a:hover {
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
}

.muted {
  color: #9aa2ad;
}

@media (max-width: 1300px) {
  .workspace-grid,
  .workspace-grid-thread {
    grid-template-columns: 250px minmax(0, 1fr) 260px;
  }
}

@media (max-width: 1100px) {
  .workspace-grid,
  .workspace-grid-thread {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .info-sidebar,
  .inspector-pane {
    display: none;
  }

  .footer-info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .guild-rail {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .workspace-grid,
  .workspace-grid-thread {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .stream-sidebar {
    order: 2;
  }

  .main-pane {
    order: 1;
  }

  .footer-info-grid,
  .profile-columns,
  .log-row {
    grid-template-columns: 1fr;
  }

  .topic-pane-head,
  .topic-row {
    grid-template-columns: 1fr;
  }

  .footer-topline {
    flex-direction: column;
  }

  .topic-stats,
  .notification-actions,
  .moderation-actions {
    align-items: flex-start;
    text-align: left;
  }
}
