/* Origin workspace — compact, media-forward dark interface */
:root {
  color-scheme: dark;
  --bg: #090b12;
  --bg-deep: #06070c;
  --surface: rgba(18, 22, 34, 0.84);
  --surface-strong: #151a29;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --line: rgba(177, 192, 255, 0.13);
  --line-strong: rgba(180, 192, 255, 0.22);
  --text: #f6f7ff;
  --text-muted: #a2a9bf;
  --text-subtle: #737b95;
  --accent: #8b7cff;
  --accent-strong: #a79cff;
  --accent-ink: #191432;
  --cyan: #61d7ed;
  --rose: #ff7da4;
  --good: #66d9a4;
  --warning: #f3bd67;
  --danger: #ff6e89;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: 180ms cubic-bezier(0.2, 0.75, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(111, 91, 255, 0.2), transparent 31rem),
    radial-gradient(circle at 97% 22%, rgba(35, 170, 198, 0.11), transparent 32rem),
    linear-gradient(135deg, #0d101a 0%, var(--bg) 48%, #090b12 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

body:has(.modal-root:not(:empty)) {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  color: #fff;
  background: rgba(139, 124, 255, 0.5);
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  pointer-events: none;
  filter: blur(18px);
  opacity: 0.38;
  border-radius: 50%;
}

.ambient-one {
  top: 13rem;
  left: -24rem;
  background: radial-gradient(circle, rgba(128, 104, 255, 0.42), transparent 69%);
}

.ambient-two {
  right: -23rem;
  bottom: -13rem;
  background: radial-gradient(circle, rgba(50, 209, 231, 0.22), transparent 70%);
}

/* Global chrome */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  min-height: 68px;
  padding: 10px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid rgba(204, 210, 255, 0.09);
  background: rgba(8, 10, 17, 0.7);
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(22px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(145deg, var(--accent-strong), #5144d8 76%);
  box-shadow: 0 7px 22px rgba(125, 104, 255, 0.32), inset 0 1px rgba(255, 255, 255, 0.4);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.brand small {
  margin-top: 2px;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  line-height: 1.05;
  text-transform: uppercase;
}

.top-nav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.nav-link {
  min-width: 78px;
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  transition: color var(--ease), background var(--ease), box-shadow var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-link.is-active {
  color: #fff;
  background: rgba(139, 124, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(180, 168, 255, 0.15), 0 4px 14px rgba(48, 37, 143, 0.18);
}

.account-control {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.account-control > button,
.account-button,
.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 750;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.account-control > button:hover,
.account-button:hover,
.profile-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.shell {
  width: min(1500px, 100%);
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px);
}

/* General controls and shared cards */
.button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  transition: transform var(--ease), color var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.action-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.primary-button {
  border-color: rgba(200, 193, 255, 0.3);
  color: #fff;
  background: linear-gradient(135deg, #a091ff, #7160e9 76%);
  box-shadow: 0 7px 20px rgba(86, 68, 220, 0.28), inset 0 1px rgba(255, 255, 255, 0.25);
}

.primary-button:hover {
  background: linear-gradient(135deg, #b0a5ff, #7867f2 76%);
  box-shadow: 0 11px 28px rgba(86, 68, 220, 0.39), inset 0 1px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.danger-button {
  border-color: rgba(255, 113, 143, 0.22);
  color: #ffc2d0;
  background: rgba(255, 92, 128, 0.1);
}

.danger-button:hover {
  border-color: rgba(255, 113, 143, 0.48);
  color: #fff;
  background: rgba(255, 92, 128, 0.18);
}

.icon-button {
  width: 36px;
  padding: 0;
  border-radius: 10px;
}

.card,
.panel,
.server-hero,
.composer,
.post-card,
.member-list,
.moderation-panel,
.audit-log {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(25, 30, 46, 0.82), rgba(15, 19, 30, 0.82));
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.13), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px);
}

.muted,
.helper-text,
.empty-copy,
.post-date,
.post-meta,
.field-help {
  color: var(--text-muted);
}

.eyebrow,
.section-kicker,
.panel-kicker {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* Server view */
.server-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: clamp(18px, 2.5vw, 32px);
  align-items: start;
}

.server-main,
.feed-column,
.content-column {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.server-sidebar,
.server-aside,
.sidebar-column {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 87px;
}

.server-hero {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  padding: clamp(21px, 4vw, 36px);
  isolation: isolate;
}

.server-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 80% -20%, rgba(100, 224, 242, 0.23), transparent 38%),
    radial-gradient(circle at 15% 100%, rgba(142, 119, 255, 0.3), transparent 43%);
}

.server-hero::after {
  position: absolute;
  z-index: -1;
  top: -70px;
  right: 18%;
  width: 188px;
  height: 188px;
  content: "";
  border: 1px solid rgba(190, 179, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(180, 166, 255, 0.025), 0 0 0 66px rgba(180, 166, 255, 0.02);
}

.server-hero h1,
.server-hero h2 {
  max-width: 650px;
  margin: 5px 0 6px;
  color: #fff;
  font-size: clamp(25px, 3.1vw, 38px);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.server-hero p {
  max-width: 630px;
  margin: 0;
  color: #c2c8dc;
}

.server-hero-actions,
.hero-actions,
.panel-actions,
.post-actions,
.composer-actions,
.form-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.server-hero-actions,
.hero-actions {
  margin-top: 18px;
}

.server-summary,
.server-stats,
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat,
.server-stat,
.status-pill,
.badge,
.role-chip,
.post-count,
.image-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid rgba(185, 195, 255, 0.12);
  border-radius: 999px;
  color: #c8cde0;
  background: rgba(5, 8, 15, 0.24);
  font-size: 11px;
  font-weight: 760;
}

.status-pill.is-online,
.badge.is-success {
  border-color: rgba(94, 225, 161, 0.25);
  color: #a8f2ca;
  background: rgba(76, 199, 135, 0.11);
}

.role-chip {
  color: #d7d1ff;
  background: rgba(139, 124, 255, 0.13);
}

/* Composer */
.composer {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.composer:focus-within {
  border-color: rgba(154, 140, 255, 0.42);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(139, 124, 255, 0.08);
}

.composer-heading,
.composer-titlebar,
.composer-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.composer-heading h2,
.composer-heading h3,
.composer-header h2,
.composer-header h3,
.composer-titlebar h2,
.composer-titlebar h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.composer-preview-strip {
  display: flex;
  order: -2;
  gap: 9px;
  min-height: 0;
  padding: 0 1px 1px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 156, 255, 0.5) transparent;
}

.composer-preview-strip:empty {
  display: none;
}

.composer-preview {
  position: relative;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 1px solid rgba(181, 169, 255, 0.31);
  border-radius: 13px;
  background: #0b0e16;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.composer-preview img,
.composer-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-preview button,
.composer-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 10, 17, 0.78);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.composer-preview button:hover,
.composer-preview-remove:hover {
  background: var(--danger);
}

.composer input[type="text"],
.composer textarea,
.field input,
.field textarea,
.field select,
.settings-modal input[type="text"],
.settings-modal textarea,
.settings-modal select {
  width: 100%;
  border: 1px solid rgba(186, 195, 255, 0.14);
  border-radius: 11px;
  color: var(--text);
  background: rgba(4, 6, 12, 0.37);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.018);
  outline: 0;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.composer input[type="text"],
.field input,
.field select,
.settings-modal input[type="text"],
.settings-modal select {
  min-height: 42px;
  padding: 9px 12px;
}

.composer textarea,
.field textarea,
.settings-modal textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

.composer input[type="text"]::placeholder,
.composer textarea::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.settings-modal input::placeholder,
.settings-modal textarea::placeholder {
  color: #798198;
}

.composer input[type="text"]:focus,
.composer textarea:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.settings-modal input[type="text"]:focus,
.settings-modal textarea:focus,
.settings-modal select:focus {
  border-color: rgba(152, 137, 255, 0.7);
  background: rgba(8, 10, 18, 0.72);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.13);
}

.composer-actions {
  justify-content: space-between;
}

.composer-tools,
.composer-actions > :first-child:not(.primary-button) {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.upload-button,
.attach-button,
.photo-button {
  position: relative;
  overflow: hidden;
}

.upload-button input,
.attach-button input,
.photo-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  cursor: pointer;
  opacity: 0;
}

/* Compact feed cards */
.post-feed {
  display: grid;
  gap: 14px;
}

.feed-heading,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 5px 2px -3px;
}

.feed-heading h2,
.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.035em;
}

.post-card {
  overflow: hidden;
  min-width: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.post-card:hover {
  border-color: rgba(177, 185, 255, 0.26);
  box-shadow: 0 19px 48px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.post-card-header,
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 15px 11px;
}

.post-author-avatar,
.avatar,
.member-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(140deg, #5fd4ed, #7275ff);
  font-size: 12px;
  font-weight: 850;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28);
}

.post-author-avatar img,
.avatar img,
.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-author,
.post-author-meta,
.post-byline {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.post-author strong,
.post-byline strong,
.member-name {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author span,
.post-byline span,
.post-date {
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-header .post-actions,
.post-card-header .post-actions,
.post-menu {
  margin-left: auto;
}

.post-card-header .icon-button,
.post-header .icon-button,
.post-menu button {
  width: 30px;
  min-height: 30px;
  color: var(--text-muted);
  background: transparent;
}

.post-card-header .icon-button:hover,
.post-header .icon-button:hover,
.post-menu button:hover {
  color: #fff;
  background: var(--surface-hover);
}

.post-content,
.post-copy,
.post-body {
  padding: 0 15px 12px;
}

.post-content h3,
.post-copy h3,
.post-body h3,
.post-title {
  margin: 0 0 5px;
  color: #fff;
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -0.028em;
  line-height: 1.25;
}

.post-content p,
.post-copy p,
.post-body p,
.post-text {
  margin: 0;
  color: #b9c0d5;
  font-size: 13px;
  line-height: 1.52;
}

.post-carousel {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-top: 1px solid rgba(218, 222, 255, 0.075);
  border-bottom: 1px solid rgba(218, 222, 255, 0.075);
  background: #080a10;
}

.carousel-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: clamp(190px, 28vw, 325px);
  min-height: 190px;
  max-height: 325px;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 30%, rgba(60, 73, 110, 0.42), transparent 62%),
    #080a10;
}

.carousel-stage::before {
  position: absolute;
  z-index: -1;
  inset: -30px;
  content: "";
  background: inherit;
  filter: blur(24px) saturate(0.8);
  opacity: 0.4;
}

.carousel-stage > img,
.carousel-stage > video,
.carousel-stage .carousel-image,
.carousel-stage .post-image,
.post-carousel img:not(.carousel-arrow img),
.post-carousel video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-stage > img,
.carousel-stage > video,
.carousel-stage .carousel-image,
.carousel-stage .post-image {
  position: relative;
  z-index: 1;
}

.carousel-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: #fff;
  background: rgba(7, 9, 16, 0.66);
  box-shadow: 0 8px 21px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease), background var(--ease), border-color var(--ease);
}

.carousel-arrow:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(29, 26, 56, 0.88);
}

.carousel-arrow:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.carousel-arrow.is-prev,
.carousel-arrow.prev,
.carousel-arrow[data-direction="prev"] {
  left: 13px;
  transform: translate(-9px, -50%);
}

.carousel-arrow.is-next,
.carousel-arrow.next,
.carousel-arrow[data-direction="next"] {
  right: 13px;
  transform: translate(9px, -50%);
}

.post-carousel:hover .carousel-arrow,
.post-carousel:focus-within .carousel-arrow,
.carousel-stage:hover .carousel-arrow,
.carousel-stage:focus-within .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
}

.post-carousel:hover .carousel-arrow.is-prev,
.post-carousel:hover .carousel-arrow.prev,
.post-carousel:hover .carousel-arrow[data-direction="prev"],
.post-carousel:focus-within .carousel-arrow.is-prev,
.post-carousel:focus-within .carousel-arrow.prev,
.post-carousel:focus-within .carousel-arrow[data-direction="prev"],
.carousel-stage:hover .carousel-arrow.is-prev,
.carousel-stage:focus-within .carousel-arrow.is-prev {
  transform: translate(0, -50%);
}

.post-carousel:hover .carousel-arrow.is-next,
.post-carousel:hover .carousel-arrow.next,
.post-carousel:hover .carousel-arrow[data-direction="next"],
.post-carousel:focus-within .carousel-arrow.is-next,
.post-carousel:focus-within .carousel-arrow.next,
.post-carousel:focus-within .carousel-arrow[data-direction="next"],
.carousel-stage:hover .carousel-arrow.is-next,
.carousel-stage:focus-within .carousel-arrow.is-next {
  transform: translate(0, -50%);
}

.carousel-dots {
  position: absolute;
  z-index: 3;
  bottom: 9px;
  left: 50%;
  display: flex;
  max-width: calc(100% - 90px);
  gap: 5px;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(7px);
  transform: translateX(-50%);
}

.carousel-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.37);
  transition: width var(--ease), background var(--ease), transform var(--ease);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.is-active,
.carousel-dot[aria-current="true"] {
  width: 18px;
  background: #e2ddff;
}

.post-footer,
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 47px;
  padding: 8px 12px;
}

.post-footer .post-actions,
.post-card-footer .post-actions {
  flex-wrap: nowrap;
}

.post-footer button,
.post-card-footer button,
.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-subtle);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.post-footer button:hover,
.post-card-footer button:hover,
.reaction-button:hover {
  border-color: rgba(179, 189, 255, 0.13);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.post-footer .delete-post,
.post-card-footer .delete-post,
.post-menu .delete-post,
.post-footer button.is-danger {
  color: #ffb3c4;
}

.post-footer .delete-post:hover,
.post-card-footer .delete-post:hover,
.post-menu .delete-post:hover,
.post-footer button.is-danger:hover {
  color: #fff;
  background: rgba(255, 91, 127, 0.16);
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 25px;
  border: 1px dashed rgba(177, 190, 255, 0.18);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

/* Side panels */
.member-list,
.moderation-panel,
.audit-log {
  padding: 15px;
}

.panel-header,
.member-list > header,
.moderation-panel > header,
.audit-log > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-header h2,
.panel-header h3,
.member-list h2,
.member-list h3,
.moderation-panel h2,
.moderation-panel h3,
.audit-log h2,
.audit-log h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.member-row,
.member-item {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px 7px;
  border-radius: 10px;
  transition: background var(--ease);
}

.member-row:hover,
.member-item:hover {
  background: rgba(255, 255, 255, 0.045);
}

.member-avatar {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: 10px;
}

.member-details {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.member-role {
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moderation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.moderation-action {
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #cad0e5;
  background: rgba(5, 8, 15, 0.24);
  font-size: 11px;
  font-weight: 760;
  transition: border-color var(--ease), color var(--ease), background var(--ease), transform var(--ease);
}

.moderation-action:hover {
  border-color: rgba(176, 163, 255, 0.42);
  color: #fff;
  background: rgba(139, 124, 255, 0.13);
  transform: translateY(-1px);
}

.moderation-action.is-danger,
.moderation-action[data-action="ban"] {
  color: #ffb7c7;
}

.moderation-action.is-danger:hover,
.moderation-action[data-action="ban"]:hover {
  border-color: rgba(255, 109, 140, 0.46);
  background: rgba(255, 91, 127, 0.14);
}

.audit-item,
.audit-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(194, 203, 255, 0.07);
}

.audit-item:last-child,
.audit-row:last-child {
  border-bottom: 0;
}

.audit-item::before,
.audit-row::before {
  width: 7px;
  height: 7px;
  align-self: center;
  content: "";
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(139, 124, 255, 0.12);
}

.audit-item p,
.audit-row p {
  margin: 0;
  color: #b8bfd4;
  font-size: 11px;
}

/* Modal and role management */
.modal-root {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.modal-root:not(:empty) {
  pointer-events: auto;
  background: rgba(3, 5, 10, 0.64);
  backdrop-filter: blur(11px);
}

.dialog,
.settings-modal {
  position: relative;
  width: min(1120px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(184, 174, 255, 0.29);
  border-radius: 23px;
  background:
    radial-gradient(circle at 87% 5%, rgba(137, 118, 255, 0.18), transparent 26rem),
    radial-gradient(circle at 30% 115%, rgba(38, 195, 219, 0.11), transparent 29rem),
    linear-gradient(135deg, rgba(29, 32, 52, 0.99), rgba(12, 15, 25, 0.99));
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 64px rgba(110, 89, 244, 0.14);
  animation: dialog-in 240ms cubic-bezier(0.19, 0.88, 0.32, 1.08) both;
}

.dialog::before,
.settings-modal::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(223, 218, 255, 0.64), transparent);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-header,
.settings-header,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(205, 210, 255, 0.1);
}

.dialog-header h2,
.dialog-header h3,
.settings-header h2,
.settings-header h3,
.modal-header h2,
.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  letter-spacing: -0.035em;
}

.dialog-header p,
.settings-header p,
.modal-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.close-button,
.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  transition: color var(--ease), background var(--ease), transform var(--ease);
}

.close-button:hover,
.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  transform: rotate(4deg);
}

.settings-body,
.dialog-body {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  min-height: 0;
  max-height: calc(min(780px, 100vh - 40px) - 68px);
}

.settings-sidebar {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 13px;
  overflow-y: auto;
  border-right: 1px solid rgba(205, 210, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.settings-sidebar > h3,
.settings-sidebar > p {
  padding: 4px 8px 7px;
}

.settings-sidebar > h3 {
  margin: 0;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-nav-button,
.settings-sidebar button:not(.close-button) {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  text-align: left;
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}

.settings-nav-button:hover,
.settings-sidebar button:not(.close-button):hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.settings-nav-button.is-active,
.settings-nav-button[aria-current="page"],
.settings-sidebar button.is-active {
  border-color: rgba(181, 169, 255, 0.18);
  color: #fff;
  background: linear-gradient(100deg, rgba(139, 124, 255, 0.26), rgba(139, 124, 255, 0.1));
  box-shadow: inset 3px 0 var(--accent-strong);
}

.settings-content,
.settings-main,
.dialog-content {
  min-width: 0;
  padding: clamp(18px, 3vw, 30px);
  overflow-y: auto;
}

.settings-section,
.role-editor,
.permissions-editor {
  display: grid;
  gap: 18px;
}

.settings-section > header,
.role-editor > header,
.permissions-editor > header,
.section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.settings-section > header h2,
.settings-section > header h3,
.role-editor > header h2,
.role-editor > header h3,
.permissions-editor > header h2,
.permissions-editor > header h3,
.section-header h2,
.section-header h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.settings-section > header p,
.role-editor > header p,
.permissions-editor > header p,
.section-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.role-editor {
  grid-template-columns: minmax(210px, 0.65fr) minmax(0, 1.35fr);
  align-items: start;
}

.role-list {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 8, 15, 0.24);
}

.role-row,
.role-list button,
.role-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 43px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  text-align: left;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}

.role-row:hover,
.role-list button:hover,
.role-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.role-row.is-active,
.role-row[aria-selected="true"],
.role-list button.is-active,
.role-item.is-active {
  border-color: rgba(178, 166, 255, 0.28);
  color: #fff;
  background: rgba(139, 124, 255, 0.16);
}

.role-swatch,
.role-row::before,
.role-item::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  content: "";
  border-radius: 50%;
  background: var(--role-color, var(--accent-strong));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--role-color, var(--accent-strong)) 16%, transparent);
}

.role-details,
.role-form,
.role-settings {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid rgba(184, 191, 255, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(36, 41, 63, 0.64), rgba(13, 17, 28, 0.48));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.field,
.form-field {
  display: grid;
  gap: 6px;
}

.field > label,
.form-field > label,
.field-label {
  color: #d7dced;
  font-size: 11px;
  font-weight: 790;
}

.field-help {
  font-size: 10px;
  line-height: 1.4;
}

.color-options,
.color-picker,
.role-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option,
.color-swatch {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--color, var(--accent-strong));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.color-option:hover,
.color-swatch:hover {
  transform: scale(1.1);
}

.color-option.is-active,
.color-option[aria-pressed="true"],
.color-swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.27);
}

.permission-groups,
.permissions-list {
  display: grid;
  gap: 11px;
}

.permission-group {
  overflow: hidden;
  border: 1px solid rgba(185, 193, 255, 0.14);
  border-radius: 15px;
  background: rgba(4, 7, 14, 0.25);
}

.permission-group > h3,
.permission-group > header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  margin: 0;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(185, 193, 255, 0.09);
  color: #e6e9f5;
  font-size: 12px;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, rgba(139, 124, 255, 0.1), transparent 75%);
}

.permission-group > p {
  margin: -3px 13px 9px;
  color: var(--text-subtle);
  font-size: 10px;
}

.permission-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 53px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(185, 193, 255, 0.075);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.permission-toggle:last-child {
  border-bottom: 0;
}

.permission-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.035);
}

.permission-toggle > span:first-child,
.permission-label {
  display: grid;
  gap: 1px;
}

.permission-toggle strong,
.permission-name {
  color: #dce0ee;
  font-size: 11px;
  font-weight: 770;
}

.permission-toggle small,
.permission-description {
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.35;
}

.permission-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.permission-toggle .toggle-track,
.permission-toggle > input + span:last-child,
.switch-track {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(185, 195, 255, 0.2);
  border-radius: 999px;
  background: rgba(150, 161, 199, 0.16);
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.permission-toggle .toggle-track::after,
.permission-toggle > input + span:last-child::after,
.switch-track::after {
  width: 14px;
  height: 14px;
  content: "";
  border-radius: 50%;
  background: #c3c9d9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
  transition: transform var(--ease), background var(--ease);
}

.permission-toggle input:checked + .toggle-track,
.permission-toggle input:checked + span:last-child,
.switch input:checked + .switch-track {
  border-color: rgba(184, 173, 255, 0.62);
  background: linear-gradient(90deg, #7666ee, #9c91ff);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.13);
}

.permission-toggle input:checked + .toggle-track::after,
.permission-toggle input:checked + span:last-child::after,
.switch input:checked + .switch-track::after {
  background: #fff;
  transform: translateX(16px);
}

.permission-toggle input:focus-visible + .toggle-track,
.permission-toggle input:focus-visible + span:last-child,
.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.permission-toggle:has(input:checked) {
  background: linear-gradient(90deg, rgba(139, 124, 255, 0.1), transparent 76%);
}

.permission-toggle:has(input:checked) strong {
  color: #fff;
}

.danger-zone {
  padding: 15px;
  border: 1px solid rgba(255, 109, 140, 0.22);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255, 84, 121, 0.11), rgba(80, 16, 35, 0.09));
}

.danger-zone h3 {
  margin: 0 0 4px;
  color: #ffc1cf;
  font-size: 13px;
}

.danger-zone p {
  margin: 0 0 12px;
  color: #d59aa9;
  font-size: 11px;
}

.dialog-footer,
.settings-footer,
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid rgba(205, 210, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

/* Toasts and confirm dialogues */
.toast-root {
  position: fixed;
  z-index: 130;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(370px, calc(100vw - 36px));
  gap: 9px;
}

.toast,
.notification {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(179, 169, 255, 0.31);
  border-radius: 13px;
  color: #e7e9f4;
  background: rgba(25, 27, 44, 0.92);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.31), 0 0 26px rgba(126, 107, 245, 0.12);
  backdrop-filter: blur(14px);
  animation: toast-in 200ms ease-out both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.is-error,
.notification.is-error {
  border-color: rgba(255, 107, 139, 0.35);
}

.toast.is-success,
.notification.is-success {
  border-color: rgba(98, 221, 164, 0.34);
}

/* Responsive */
@media (max-width: 1050px) {
  .server-view {
    grid-template-columns: minmax(0, 1fr) 252px;
    gap: 19px;
  }

  .server-sidebar,
  .server-aside,
  .sidebar-column {
    top: 84px;
  }

  .role-editor {
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .top-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .nav-link {
    flex: 1;
  }

  .shell {
    min-height: calc(100vh - 113px);
  }

  .server-view {
    grid-template-columns: 1fr;
  }

  .server-sidebar,
  .server-aside,
  .sidebar-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-log {
    grid-column: 1 / -1;
  }

  .carousel-stage {
    height: clamp(205px, 48vw, 310px);
  }

  .settings-body,
  .dialog-body {
    grid-template-columns: 175px minmax(0, 1fr);
  }

  .role-editor {
    grid-template-columns: 1fr;
  }

  .role-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(148px, 1fr);
    overflow-x: auto;
  }
}

@media (max-width: 610px) {
  body {
    font-size: 14px;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 14px;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 10px;
  }

  .account-control > button,
  .account-button,
  .profile-button {
    min-height: 33px;
    padding: 6px 8px;
  }

  .account-control > button span:not(.avatar),
  .profile-button span:not(.avatar) {
    display: none;
  }

  .top-nav {
    padding: 3px;
  }

  .nav-link {
    min-width: 0;
    padding: 6px 9px;
  }

  .shell {
    min-height: calc(100vh - 104px);
    padding: 14px 12px 24px;
  }

  .server-main,
  .feed-column,
  .content-column {
    gap: 14px;
  }

  .server-hero {
    min-height: 151px;
    padding: 20px;
    border-radius: 18px;
  }

  .server-hero h1,
  .server-hero h2 {
    font-size: 26px;
  }

  .server-hero p {
    font-size: 13px;
  }

  .server-hero-actions .button,
  .server-hero-actions .primary-button,
  .hero-actions .button,
  .hero-actions .primary-button {
    flex: 1;
  }

  .composer {
    gap: 11px;
    padding: 13px;
    border-radius: 17px;
  }

  .composer-preview {
    width: 65px;
    height: 65px;
    border-radius: 11px;
  }

  .composer-actions {
    align-items: stretch;
  }

  .composer-actions .primary-button {
    margin-left: auto;
  }

  .post-card {
    border-radius: 17px;
  }

  .post-card-header,
  .post-header {
    padding: 11px 12px 9px;
  }

  .post-content,
  .post-copy,
  .post-body {
    padding: 0 12px 10px;
  }

  .post-content h3,
  .post-copy h3,
  .post-body h3,
  .post-title {
    font-size: 15px;
  }

  .carousel-stage {
    height: clamp(195px, 66vw, 285px);
    min-height: 195px;
  }

  .carousel-arrow {
    width: 34px;
    height: 34px;
  }

  .carousel-arrow.is-prev,
  .carousel-arrow.prev,
  .carousel-arrow[data-direction="prev"] {
    left: 8px;
  }

  .carousel-arrow.is-next,
  .carousel-arrow.next,
  .carousel-arrow[data-direction="next"] {
    right: 8px;
  }

  .server-sidebar,
  .server-aside,
  .sidebar-column {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .member-list,
  .moderation-panel,
  .audit-log {
    padding: 13px;
    border-radius: 17px;
  }

  .modal-root {
    align-items: end;
    padding: 0;
  }

  .dialog,
  .settings-modal {
    width: 100%;
    max-height: min(92vh, 790px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .settings-body,
  .dialog-body {
    display: flex;
    flex-direction: column;
    max-height: calc(min(92vh, 790px) - 66px);
  }

  .settings-sidebar {
    display: flex;
    gap: 5px;
    padding: 10px 13px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(205, 210, 255, 0.1);
  }

  .settings-sidebar > h3,
  .settings-sidebar > p {
    display: none;
  }

  .settings-nav-button,
  .settings-sidebar button:not(.close-button) {
    width: auto;
    min-width: max-content;
    min-height: 34px;
  }

  .settings-nav-button.is-active,
  .settings-nav-button[aria-current="page"],
  .settings-sidebar button.is-active {
    box-shadow: inset 0 -2px var(--accent-strong);
  }

  .settings-content,
  .settings-main,
  .dialog-content {
    padding: 17px 13px 22px;
  }

  .settings-section > header,
  .role-editor > header,
  .permissions-editor > header,
  .section-header {
    align-items: start;
  }

  .permission-toggle {
    min-height: 57px;
    padding: 10px 11px;
  }

  .dialog-footer,
  .settings-footer,
  .modal-footer {
    padding: 11px 13px;
  }
}

@media (hover: none) {
  .carousel-arrow {
    opacity: 0.95;
    pointer-events: auto;
    transform: translateY(-50%) !important;
  }
}

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

/* Exact component layer for the standalone Origin prototype. */
body:has(#modalRoot:not(:empty)) {
  overflow: hidden;
}

#modalRoot:not(:empty) {
  position: fixed;
  z-index: 80;
  inset: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  width: min(1440px, calc(100% - 40px));
  min-height: calc(100vh - 148px);
  margin: 28px auto 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(13, 16, 27, 0.72);
  box-shadow: var(--shadow);
}

.server-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.64);
}

.server-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(167, 156, 255, 0.48);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, rgba(150, 133, 255, 0.65), rgba(37, 26, 91, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.24), 0 9px 28px rgba(95, 77, 255, 0.24);
  font-weight: 800;
  letter-spacing: -0.08em;
}

.server-identity h1 {
  max-width: 175px;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow,
.side-label {
  margin: 0;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.server-description {
  margin: 18px 4px 15px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.server-stat-row,
.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.server-stat-row {
  margin: 0 3px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
}

.server-stat-row strong {
  color: var(--text);
}

.status-dot,
.role-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot {
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(102, 217, 164, 0.1), 0 0 16px rgba(102, 217, 164, 0.65);
}

.channel-nav {
  margin-top: 20px;
}

.channel-nav .side-label {
  margin: 0 7px 9px;
}

.channel-link {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 37px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  font-size: 13px;
  text-align: left;
  transition: color var(--ease), background var(--ease);
}

.channel-link span {
  color: var(--text-subtle);
  font-weight: 700;
}

.channel-link small {
  grid-column: 2;
  margin-top: 1px;
  color: var(--text-subtle);
  font-size: 10px;
}

.channel-link:hover,
.channel-link.is-selected {
  color: #fff;
  background: rgba(136, 119, 255, 0.12);
}

.channel-link.is-selected span {
  color: var(--accent-strong);
}

.sidebar-members {
  margin-top: 25px;
}

.side-heading {
  margin: 0 7px 8px;
  color: var(--text-subtle);
  font-size: 11px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 4px 7px;
  border-radius: 9px;
}

.member-row.is-you {
  background: rgba(255, 255, 255, 0.045);
}

.member-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row.is-you .member-name {
  color: #fff;
}

.owner-crown {
  margin-left: auto;
  color: var(--warning);
  font-size: 13px;
}

.role-dot {
  margin-left: auto;
  box-shadow: 0 0 10px currentColor;
}

.role-dot-violet { background: var(--accent); color: var(--accent); }
.role-dot-cyan { background: var(--cyan); color: var(--cyan); }
.role-dot-lime { background: var(--good); color: var(--good); }
.role-dot-amber { background: var(--warning); color: var(--warning); }
.role-dot-rose { background: var(--rose); color: var(--rose); }
.role-dot-orange { background: #ff985c; color: #ff985c; }

.settings-launch {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0 8px;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  text-align: left;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.settings-launch:hover:not(:disabled) {
  border-color: rgba(167, 156, 255, 0.5);
  color: #fff;
  background: rgba(139, 124, 255, 0.12);
}

.settings-launch small {
  grid-column: 2;
  color: var(--text-subtle);
  font-size: 10px;
}

.forum-panel {
  min-width: 0;
  background: linear-gradient(135deg, rgba(18, 21, 35, 0.35), rgba(10, 12, 20, 0.25));
}

.forum-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 28px clamp(22px, 4vw, 48px) 22px;
  border-bottom: 1px solid var(--line);
}

.forum-header h2 {
  margin: 4px 0 3px;
  color: #fff;
  font-size: clamp(25px, 3vw, 33px);
  letter-spacing: -0.045em;
}

.forum-header h2 span {
  color: var(--accent-strong);
}

.forum-header p:not(.eyebrow) {
  max-width: 500px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 4px;
  white-space: nowrap;
}

.header-chip,
.status-chip,
.composer-tip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.quiet-button,
.icon-button,
.text-danger {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.quiet-button {
  padding: 7px 10px;
  font-size: 11px;
}

.quiet-button:hover,
.icon-button:hover {
  border-color: rgba(167, 156, 255, 0.46);
  color: #fff;
  background: rgba(139, 124, 255, 0.14);
}

.post-list {
  display: grid;
  gap: 18px;
  padding: 27px clamp(22px, 4vw, 48px) 18px;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(19, 23, 37, 0.72);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.13);
}

.post-card.is-pinned {
  border-color: rgba(167, 156, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(167, 156, 255, 0.05), 0 16px 40px rgba(0, 0, 0, 0.16);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 17px;
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  background: #2a3044;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 800;
}

.avatar-small {
  width: 24px;
  height: 24px;
  font-size: 8px;
}

.avatar-violet { background: linear-gradient(145deg, #8d75ff, #3f2a8d); }
.avatar-cyan { background: linear-gradient(145deg, #53d6ea, #176d8c); }
.avatar-lime { background: linear-gradient(145deg, #88d968, #2e7c51); }
.avatar-amber { background: linear-gradient(145deg, #f4c15f, #9c5c22); }
.avatar-rose { background: linear-gradient(145deg, #ff81a5, #8d3158); }
.avatar-orange { background: linear-gradient(145deg, #ff9d63, #984323); }

.post-author {
  min-width: 0;
  flex: 1;
}

.post-author > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.post-author strong {
  color: #fff;
  font-size: 12px;
}

.post-author small {
  display: block;
  margin-top: 1px;
  color: var(--text-subtle);
  font-size: 10px;
}

.role-badge,
.owner-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
}

.owner-badge {
  border-color: rgba(243, 189, 103, 0.35);
  color: var(--warning);
  background: rgba(243, 189, 103, 0.09);
}

.role-violet { color: #b6aaff; background: rgba(139, 124, 255, 0.11); border-color: rgba(139, 124, 255, 0.36); }
.role-cyan { color: #82e6f6; background: rgba(97, 215, 237, 0.1); border-color: rgba(97, 215, 237, 0.35); }
.role-lime { color: #91eba0; background: rgba(102, 217, 164, 0.1); border-color: rgba(102, 217, 164, 0.35); }
.role-amber { color: #ffd582; background: rgba(243, 189, 103, 0.1); border-color: rgba(243, 189, 103, 0.35); }
.role-rose { color: #ff9cb8; background: rgba(255, 125, 164, 0.1); border-color: rgba(255, 125, 164, 0.35); }
.role-orange { color: #ffad74; background: rgba(255, 152, 92, 0.1); border-color: rgba(255, 152, 92, 0.35); }

.post-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pin-mark {
  color: var(--accent-strong);
  font-size: 18px;
}

.icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  font-size: 17px;
}

.danger-button:hover,
.text-danger:hover {
  border-color: rgba(255, 110, 137, 0.5);
  color: #ffd0dc;
  background: rgba(255, 110, 137, 0.12);
}

.media-stage {
  position: relative;
  display: grid;
  width: calc(100% - 32px);
  height: clamp(192px, 25vw, 300px);
  margin: 0 16px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: linear-gradient(145deg, #111729, #090b12);
  isolation: isolate;
}

.media-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #06070c;
  transition: transform 280ms ease;
}

.media-stage:hover img,
.media-stage:focus-within img {
  transform: scale(1.015);
}

.media-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.45));
}

.media-empty {
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.025);
}

.media-empty span {
  font-size: 27px;
}

.media-empty p {
  margin: 5px 0 0;
  font-size: 12px;
}

.carousel-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 10, 18, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-size: 29px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.85);
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
}

.carousel-prev { left: 13px; }
.carousel-next { right: 13px; }

.media-stage:hover .carousel-arrow,
.media-stage:focus-within .carousel-arrow,
.media-stage:focus .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.carousel-arrow:hover {
  background: rgba(139, 124, 255, 0.8);
}

.media-count {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  color: #fff;
  background: rgba(5, 6, 11, 0.65);
  font-size: 10px;
  font-weight: 750;
}

.carousel-dots {
  position: absolute;
  z-index: 3;
  bottom: 13px;
  left: 50%;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}

.carousel-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: width var(--ease), background var(--ease);
}

.carousel-dots i.is-current {
  width: 17px;
  border-radius: 99px;
  background: #fff;
}

.media-remove {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 110, 137, 0.34);
  border-radius: 8px;
  color: #ffd2dc;
  background: rgba(82, 19, 38, 0.7);
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
}

.media-stage:hover .media-remove,
.media-stage:focus-within .media-remove {
  opacity: 1;
  transform: translateY(0);
}

.media-remove:hover {
  background: rgba(142, 33, 64, 0.9);
}

.post-copy {
  padding: 17px 18px 8px;
}

.post-copy h3 {
  margin: 0 0 5px;
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.post-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.62;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 15px;
  color: var(--text-subtle);
  font-size: 10px;
}

.composer {
  margin: 0 clamp(22px, 4vw, 48px) 37px;
  padding: 20px;
  border: 1px solid rgba(167, 156, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(30, 28, 59, 0.56), rgba(18, 23, 37, 0.86));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
}

.composer-heading,
.composer-footer,
.preview-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.composer-heading {
  margin-bottom: 15px;
}

.composer-heading h3 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 17px;
}

.composer-tip {
  color: #cbc4ff;
  border-color: rgba(167, 156, 255, 0.26);
  background: rgba(139, 124, 255, 0.1);
}

.preview-panel {
  margin-bottom: 16px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 7, 12, 0.35);
}

.preview-panel-heading {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.preview-panel-heading small {
  color: var(--text-subtle);
  font-weight: 500;
}

.preview-strip {
  display: flex;
  min-height: 100px;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.preview-card,
.add-image-card {
  position: relative;
  width: 116px;
  min-width: 116px;
  height: 92px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #090b12;
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card figcaption {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 7, 12, 0.72);
  font-size: 9px;
  font-weight: 800;
}

.preview-actions {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: flex;
  gap: 3px;
}

.preview-actions button {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  color: #fff;
  background: rgba(5, 7, 12, 0.8);
  font-size: 12px;
}

.preview-actions button:hover:not(:disabled) {
  background: var(--accent);
}

.add-image-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-style: dashed;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.add-image-card:hover {
  border-color: var(--accent-strong);
  color: #fff;
  background: rgba(139, 124, 255, 0.11);
}

.add-image-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.add-image-card > span {
  font-size: 20px;
  line-height: 1;
}

.add-image-card strong {
  font-size: 11px;
}

.add-image-card small {
  color: var(--text-subtle);
  font-size: 9px;
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.text-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #fff;
  background: rgba(5, 7, 12, 0.44);
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.text-field:focus {
  border-color: rgba(167, 156, 255, 0.68);
  background: rgba(5, 7, 12, 0.64);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.12);
}

.composer-body {
  min-height: 90px;
  resize: vertical;
}

.composer-footer {
  margin-top: 15px;
  color: var(--text-subtle);
  font-size: 11px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(202, 195, 255, 0.55);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #8979f5, #6959db);
  box-shadow: 0 10px 25px rgba(93, 75, 219, 0.28);
  font-size: 12px;
  font-weight: 800;
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
}

.primary-button:hover {
  filter: brightness(1.1);
  box-shadow: 0 14px 32px rgba(93, 75, 219, 0.4);
  transform: translateY(-1px);
}

.composer-muted {
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: rgba(243, 189, 103, 0.3);
}

.composer-muted strong {
  color: #ffe0a7;
}

.composer-muted p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.composer-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--warning);
  background: rgba(243, 189, 103, 0.1);
}

.feed-page {
  width: min(1280px, calc(100% - 40px));
  margin: 43px auto 80px;
}

.feed-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
  padding: 29px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(130deg, rgba(35, 29, 72, 0.72), rgba(15, 20, 33, 0.58));
}

.feed-hero h1 {
  max-width: 620px;
  margin: 4px 0 7px;
  color: #fff;
  font-size: clamp(29px, 4vw, 52px);
  letter-spacing: -0.06em;
}

.feed-hero h1 em {
  color: #b4a9ff;
  font-style: normal;
}

.feed-hero p:not(.eyebrow) {
  max-width: 570px;
  margin: 0;
  color: var(--text-muted);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.feed-grid .post-card:first-child {
  grid-column: span 2;
}

.feed-grid .media-stage {
  height: clamp(185px, 22vw, 255px);
}

.modal-backdrop {
  position: fixed;
  z-index: 81;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 26px;
  place-items: center;
  background: rgba(2, 3, 7, 0.76);
  backdrop-filter: blur(12px);
}

.settings-dialog {
  width: min(1240px, 100%);
  max-height: min(870px, calc(100vh - 52px));
  overflow: hidden;
  border: 1px solid rgba(174, 182, 255, 0.22);
  border-radius: 24px;
  background: #111522;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 27px 21px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, rgba(51, 41, 100, 0.36), rgba(18, 22, 34, 0));
}

.settings-header h2 {
  margin: 4px 0 4px;
  color: #fff;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.settings-header p:not(.eyebrow) {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 555px;
  max-height: calc(min(870px, 100vh - 52px) - 106px);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: rgba(5, 7, 12, 0.38);
}

.settings-nav > button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.settings-nav > button:hover,
.settings-nav > button.is-selected {
  color: #fff;
  background: rgba(139, 124, 255, 0.14);
}

.settings-owner-note {
  display: flex;
  gap: 7px;
  margin-top: auto;
  padding: 11px 8px 3px;
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.45;
}

.settings-owner-note span {
  color: var(--warning);
}

.settings-owner-note p {
  margin: 0;
}

.settings-content {
  min-width: 0;
  overflow-y: auto;
  padding: 21px;
}

.roles-settings {
  display: grid;
  grid-template-columns: minmax(195px, 0.43fr) minmax(0, 1fr);
  gap: 20px;
}

.role-list-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(5, 7, 12, 0.25);
}

.panel-heading,
.role-editor-header,
.settings-section-header,
.permission-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
}

.panel-heading h3,
.role-editor-header h3,
.settings-section-header h3,
.permission-section-heading h3 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 16px;
}

.panel-heading > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.base-role {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0 7px;
  padding: 9px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--text-muted);
}

.base-role > span {
  color: var(--text-subtle);
}

.base-role strong,
.base-role small {
  display: block;
  font-size: 10px;
}

.base-role small {
  color: var(--text-subtle);
}

.base-role em {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 9px;
  font-style: normal;
}

.role-list {
  display: grid;
  gap: 6px;
}

.role-list-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  text-align: left;
}

.role-list-item:hover,
.role-list-item.is-selected {
  border-color: var(--line);
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
}

.role-swatch,
.swatch-violet,
.swatch-cyan,
.swatch-lime,
.swatch-amber,
.swatch-rose,
.swatch-orange {
  display: inline-grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.swatch-violet { background: linear-gradient(145deg, #9b8dff, #4d3eb4); }
.swatch-cyan { background: linear-gradient(145deg, #70dced, #1e7290); }
.swatch-lime { background: linear-gradient(145deg, #8ee676, #337b50); }
.swatch-amber { background: linear-gradient(145deg, #ffd172, #a76722); }
.swatch-rose { background: linear-gradient(145deg, #ff91af, #9e365f); }
.swatch-orange { background: linear-gradient(145deg, #ffad6d, #a74925); }

.role-list-item strong,
.role-list-item small {
  display: block;
}

.role-list-item strong {
  font-size: 11px;
}

.role-list-item small {
  margin-top: 1px;
  color: var(--text-subtle);
  font-size: 9px;
}

.preset-area {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.preset-area > p {
  margin: 0 0 7px;
  color: var(--text-subtle);
  font-size: 10px;
}

.preset-area > div {
  display: grid;
  gap: 5px;
}

.preset-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  text-align: left;
}

.preset-button:hover {
  border-color: rgba(167, 156, 255, 0.48);
  color: #fff;
}

.preset-button > span {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 9px;
}

.role-editor {
  min-width: 0;
  padding: 3px 0;
}

.role-editor-header {
  margin-bottom: 15px;
}

.role-editor-header .status-chip {
  white-space: nowrap;
}

.role-basics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 11px;
}

.role-basics label,
.color-picker > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
}

.role-basics input,
.role-basics textarea,
.settings-search input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: rgba(5, 7, 12, 0.42);
  outline: none;
}

.role-basics input:focus,
.role-basics textarea:focus,
.settings-search input:focus {
  border-color: var(--accent-strong);
}

.role-description {
  grid-column: span 2;
}

.role-description textarea {
  min-height: 62px;
  resize: vertical;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
}

.color-picker > div {
  display: flex;
  gap: 6px;
}

.color-option {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
}

.color-option.is-selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.permission-section {
  margin-top: 19px;
}

.permission-section-heading {
  align-items: end;
  margin-bottom: 12px;
}

.permission-section-heading > span {
  color: var(--text-subtle);
  font-size: 10px;
}

.permission-group {
  margin-top: 15px;
}

.permission-group-heading {
  margin-bottom: 7px;
}

.permission-group-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 11px;
}

.permission-group-heading p {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: 10px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.permission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.027);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.permission-card:hover:not(.is-disabled) {
  border-color: rgba(167, 156, 255, 0.42);
  background: rgba(139, 124, 255, 0.07);
}

.permission-card > span {
  min-width: 0;
}

.permission-card strong,
.permission-card small {
  display: block;
}

.permission-card strong {
  color: var(--text);
  font-size: 10px;
}

.permission-card small {
  margin-top: 2px;
  color: var(--text-subtle);
  font-size: 9px;
  line-height: 1.35;
}

.permission-card input {
  position: absolute;
  opacity: 0;
}

.permission-card i {
  position: relative;
  width: 30px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: #33394c;
  transition: background var(--ease);
}

.permission-card i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d9dceb;
  content: "";
  transition: transform var(--ease), background var(--ease);
}

.permission-card input:checked + i {
  background: var(--accent);
}

.permission-card input:checked + i::after {
  background: #fff;
  transform: translateX(13px);
}

.permission-card.is-dangerous input:checked + i {
  background: var(--danger);
}

.permission-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.role-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text-subtle);
  font-size: 10px;
}

.text-danger {
  padding: 7px 9px;
  color: var(--danger);
  font-size: 10px;
}

.settings-section-header {
  margin-bottom: 17px;
}

.settings-section-header h3 {
  font-size: 20px;
}

.settings-section-header p:not(.eyebrow) {
  max-width: 570px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-search {
  position: relative;
  display: block;
  width: 185px;
}

.settings-search > span {
  position: absolute;
  top: 11px;
  left: 10px;
  color: var(--text-subtle);
}

.settings-search input {
  margin: 0;
  padding-left: 28px;
  font-size: 11px;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-management-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 7, 12, 0.23);
}

.member-management-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.member-management-top h4 {
  margin: 0;
  color: #fff;
  font-size: 12px;
}

.member-management-top p {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: 9px;
}

.member-state {
  margin-left: auto;
  color: var(--good);
  font-size: 9px;
  text-transform: capitalize;
}

.member-role-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text-subtle);
  font-size: 9px;
}

.member-role-row > div {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
}

.member-role-toggle input {
  position: absolute;
  opacity: 0;
}

.member-role-toggle span {
  display: block;
  padding: 4px 6px;
  border: 1px solid currentColor;
  border-radius: 7px;
  cursor: pointer;
  font-size: 9px;
  opacity: 0.5;
}

.member-role-toggle input:checked + span {
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.member-role-toggle.is-locked span {
  cursor: not-allowed;
}

.moderation-actions {
  display: flex;
  gap: 5px;
  margin-top: 12px;
}

.moderation-actions button {
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
}

.moderation-actions button:hover {
  border-color: rgba(243, 189, 103, 0.45);
  color: #ffe0a7;
}

.moderation-actions button.is-danger:hover {
  border-color: rgba(255, 110, 137, 0.5);
  color: #ffd0dc;
}

.audit-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  display: flex;
  gap: 10px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
}

.audit-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.audit-list p strong {
  color: #fff;
}

.audit-list p em {
  color: #d5d1ff;
  font-style: normal;
}

.audit-list small {
  color: var(--text-subtle);
  font-size: 10px;
}

.empty-settings {
  display: grid;
  min-height: 260px;
  place-content: center;
  color: var(--text-muted);
  text-align: center;
}

.empty-settings h3 {
  margin: 5px 0;
  color: #fff;
}

.empty-settings p:not(.eyebrow) {
  max-width: 360px;
  margin: 0;
  font-size: 12px;
}

.confirmation-backdrop {
  z-index: 91;
}

.confirmation-dialog {
  width: min(415px, 100%);
  padding: 25px;
  border: 1px solid rgba(255, 110, 137, 0.3);
  border-radius: 19px;
  background: #17131d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.confirmation-dialog h2 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: 20px;
}

.confirmation-dialog > p:not(.eyebrow) {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 21px;
}

.danger-solid {
  padding: 8px 10px;
  border: 1px solid rgba(255, 110, 137, 0.45);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #c54668, #93304b);
  font-size: 11px;
  font-weight: 800;
}

.toast-root {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 350px;
  padding: 11px 13px;
  border: 1px solid rgba(102, 217, 164, 0.32);
  border-radius: 11px;
  color: #d5ffec;
  background: rgba(19, 63, 49, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  font-size: 12px;
}

.toast-warning {
  border-color: rgba(243, 189, 103, 0.35);
  color: #ffe5b0;
  background: rgba(82, 57, 23, 0.94);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .server-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .server-description,
  .server-stat-row,
  .channel-nav {
    grid-column: 1;
  }

  .sidebar-members {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }

  .settings-launch {
    grid-column: 1 / -1;
    margin-top: 16px;
  }

  .settings-layout {
    grid-template-columns: 158px minmax(0, 1fr);
  }

  .roles-settings {
    grid-template-columns: 1fr;
  }

  .role-list-panel {
    display: none;
  }
}

@media (max-width: 650px) {
  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .top-nav {
    display: none;
  }

  .identity-switch {
    display: none;
  }

  .workspace-grid,
  .feed-page {
    width: min(100% - 22px, 600px);
    margin-top: 11px;
  }

  .server-sidebar {
    display: block;
    padding: 18px 14px 13px;
  }

  .server-description,
  .server-stat-row,
  .sidebar-members {
    display: none;
  }

  .channel-nav {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    overflow-x: auto;
  }

  .channel-nav .side-label,
  .channel-link small {
    display: none;
  }

  .channel-link {
    display: block;
    width: auto;
    min-width: max-content;
    min-height: 31px;
    padding: 6px 9px;
  }

  .settings-launch {
    display: none;
  }

  .forum-header {
    display: block;
    padding: 20px 16px 17px;
  }

  .forum-header h2 {
    font-size: 26px;
  }

  .header-tools {
    margin-top: 11px;
  }

  .post-list {
    gap: 13px;
    padding: 16px 12px 12px;
  }

  .post-meta {
    padding: 11px 12px;
  }

  .media-stage {
    width: calc(100% - 20px);
    height: 208px;
    margin: 0 10px;
    border-radius: 11px;
  }

  .carousel-arrow {
    width: 33px;
    height: 33px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
  }

  .media-remove {
    opacity: 1;
    transform: none;
  }

  .post-copy {
    padding: 13px 13px 5px;
  }

  .post-footer {
    padding: 10px 13px 12px;
  }

  .composer {
    margin: 0 12px 22px;
    padding: 14px;
  }

  .composer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .composer-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .composer-footer .primary-button {
    width: 100%;
  }

  .feed-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .feed-grid,
  .feed-grid .post-card:first-child {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .feed-grid .media-stage {
    height: 208px;
  }

  .modal-backdrop {
    padding: 10px;
    place-items: end center;
  }

  .settings-dialog {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .settings-header {
    padding: 18px 15px 14px;
  }

  .settings-header h2 {
    font-size: 18px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 126px);
  }

  .settings-nav {
    flex-direction: row;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav > button {
    flex: 1;
    justify-content: center;
    padding: 8px 4px;
    font-size: 10px;
  }

  .settings-owner-note {
    display: none;
  }

  .settings-content {
    padding: 14px;
  }

  .settings-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-search {
    width: 100%;
  }

  .permission-grid,
  .members-grid {
    grid-template-columns: 1fr;
  }

  .role-basics {
    grid-template-columns: 1fr;
  }

  .role-description {
    grid-column: auto;
  }

  .color-picker {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}
