/* ---------- layout ---------- */

.shell {
  position: absolute;
  inset: 0;
  display: flex;
  background: var(--bg-rail);
  animation: fade-in 250ms var(--ease);
}
.main-columns {
  flex: 1;
  min-width: 0;
  display: flex;
  background: var(--bg-main);
  border-top-left-radius: 8px;
  overflow: hidden;
}

/* ---------- server rail ---------- */

.rail {
  flex: none;
  width: 72px;
  padding: 12px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: visible;
  background: var(--bg-rail);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar {
  display: none;
}
.rail-item {
  position: relative;
  flex: none;
  width: 72px;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.rail-icon {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-normal);
  transition: border-radius 150ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease), transform 100ms var(--ease);
}
.rail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rail-icon:hover,
.rail-icon.active {
  border-radius: 16px;
}
.rail-icon:hover:not(.rail-action) {
  background: var(--brand);
  color: #fff;
}
.rail-icon.active:not(.rail-action) {
  background: var(--brand);
  color: #fff;
}
.rail-icon:active {
  transform: translateY(1px);
}
.rail-acronym {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.rail-acronym.small {
  font-size: 12px;
}
.rail-home {
  color: var(--text-normal);
}
.rail-action {
  background: var(--bg-main);
  color: var(--status-online);
}
.rail-action:hover {
  background: var(--status-online);
  color: #fff;
}
.rail-sep {
  flex: none;
  width: 32px;
  height: 2px;
  margin: 0 0 8px;
  border-radius: 1px;
  background: var(--border-subtle);
  opacity: 1;
}
[data-theme="dark"] .rail-sep,
:root:not([data-theme]) .rail-sep {
  background: #35363c;
}

/* The white pill on the left edge */
.rail-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 8px;
  border-radius: 0 4px 4px 0;
  background: var(--text-header);
  opacity: 0;
  transform: translate(-4px, -50%) scale(0.5);
  transition: height 150ms var(--ease), opacity 150ms var(--ease), transform 150ms var(--ease);
  pointer-events: none;
}
.rail-item:hover .rail-pill {
  opacity: 1;
  height: 20px;
  transform: translate(0, -50%) scale(1);
}
.rail-pill.active {
  opacity: 1;
  height: 40px;
  transform: translate(0, -50%) scale(1);
}

.rail-tip {
  position: absolute;
  left: calc(100% - 4px);
  top: 50%;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 5px;
  background: var(--bg-floating);
  color: var(--text-header);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--elevation-high);
  opacity: 0;
  transform: translate(-6px, -50%) scale(0.95);
  transform-origin: left center;
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
  pointer-events: none;
}
.rail-tip::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: inherit;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 1px;
}
.rail-item:hover .rail-tip {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
  transition-delay: 250ms;
}

/* ---------- sidebar ---------- */

.sidebar {
  flex: none;
  width: 240px;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  position: relative;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 16px;
}
.sidebar-search {
  height: 48px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  box-shadow: var(--header-shadow);
}
.search-btn {
  width: 100%;
  height: 28px;
  padding: 1px 6px;
  border: none;
  border-radius: 4px;
  text-align: left;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-input-inset);
}

.dm-row {
  width: 100%;
  height: 42px;
  margin-bottom: 2px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 16px;
  font-weight: 500;
}
.dm-row:hover {
  background: var(--bg-hover);
  color: var(--interactive-hover);
}
.dm-row.active {
  background: var(--bg-active);
  color: var(--interactive-active);
}
.dm-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 8px 4px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--channel-icon);
}
.dm-empty {
  padding: 8px 18px;
  font-size: 14px;
  color: var(--text-muted);
}

/* guild header and dropdown */
.guild-header-wrap {
  position: relative;
  flex: none;
  z-index: 30;
}
.guild-header {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  background: transparent;
  color: var(--text-header);
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--header-shadow);
  transition: background-color var(--dur) var(--ease);
}
.guild-header:hover,
.guild-header.open {
  background: var(--bg-hover);
}
.guild-header-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-menu {
  position: absolute;
  top: 56px;
  left: 10px;
  right: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-floating);
  box-shadow: var(--elevation-high), var(--elevation-stroke);
  transform-origin: top center;
  animation: pop 150ms var(--ease);
}
.menu-item {
  width: 100%;
  height: 32px;
  margin: 2px 0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 14px;
  font-weight: 500;
}
.menu-item:hover {
  background: var(--brand);
  color: #fff;
}
.menu-item.danger {
  color: var(--text-danger);
}
.menu-item.danger:hover {
  background: var(--danger);
  color: #fff;
}

/* channels */
.channel-list {
  padding-top: 12px;
}
.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 4px 0;
}
.category-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--channel-icon);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
}
.category-toggle:hover {
  color: var(--interactive-hover);
}
.category-chevron {
  display: inline-flex;
  transition: transform 150ms var(--ease);
}
.category-chevron.collapsed {
  transform: rotate(-90deg);
}
.category-add {
  opacity: 0;
}
.category:hover .category-add {
  opacity: 1;
}
.channel-row {
  width: 100%;
  height: 34px;
  margin-bottom: 2px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--channel-icon);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}
.channel-row:hover {
  background: var(--bg-hover);
  color: var(--interactive-hover);
}
.channel-row.active {
  background: var(--bg-active);
  color: var(--interactive-active);
}
.channel-icon {
  color: var(--channel-icon);
}
.channel-row.active .channel-icon,
.channel-row:hover .channel-icon {
  color: inherit;
}
.channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- user panel ---------- */

.user-panel {
  position: relative;
  flex: none;
  height: 52px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-user-panel, var(--bg-sidebar));
  box-shadow: 0 -1px 0 var(--border-subtle);
  --status-ring: var(--bg-user-panel, var(--bg-sidebar));
}
.user-panel-me {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}
.user-panel-me:hover {
  background: var(--bg-hover);
}
.user-panel-text {
  min-width: 0;
}
.user-panel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: var(--text-header);
}
.user-panel-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 13px;
  color: var(--text-muted);
}
.user-panel-actions {
  display: flex;
}
.status-menu {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 58px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-floating);
  box-shadow: var(--elevation-high), var(--elevation-stroke);
  animation: pop-up 150ms var(--ease);
  transform-origin: bottom center;
  z-index: 40;
}
.status-opt {
  width: 100%;
  min-height: 32px;
  margin: 2px 0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.status-opt:hover {
  background: var(--brand);
  color: #fff;
}
.status-opt-text {
  display: flex;
  flex-direction: column;
}
.status-opt-text small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
}
.status-swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.status-swatch.online { background: var(--status-online); }
.status-swatch.idle { background: var(--status-idle); }
.status-swatch.dnd { background: var(--status-dnd); }
.status-swatch.offline { background: var(--status-offline); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--interactive-hover);
}
.icon-btn.active {
  color: var(--interactive-active);
}
.icon-btn.off {
  color: var(--status-dnd);
}
.icon-btn.small {
  width: 24px;
  height: 24px;
}
.staff-shield {
  color: var(--brand);
}
.staff-shield:hover {
  color: #fff;
  background: var(--brand);
}

/* ---------- content and top bar ---------- */

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}
.content-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.topbar {
  flex: none;
  height: 48px;
  padding: 0 8px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-header);
  box-shadow: var(--header-shadow);
  z-index: 20;
}
.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon {
  color: var(--channel-icon);
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-header);
  white-space: nowrap;
}
.topbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 8px;
  background: var(--border-subtle);
}
.topbar-topic {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text-muted);
}
.topbar-right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.search-box {
  position: relative;
  width: 144px;
  height: 24px;
  margin: 0 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  background: var(--bg-input-inset);
  color: var(--text-muted);
  transition: width 250ms var(--ease);
}
.search-box.focused {
  width: 240px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 4px 0 6px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-normal);
}
.search-box .icon {
  margin-right: 6px;
}

.home-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}
.home-empty h2 {
  margin: 16px 0 0;
  font-size: 20px;
  color: var(--text-header);
}
.home-empty p {
  max-width: 420px;
  margin: 0;
  color: var(--text-muted);
}
.home-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.home-ember {
  opacity: 0.9;
}

/* ---------- chat ---------- */

.chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}
.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
}
.chat-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 16px;
}
.chat-welcome {
  padding: 16px 16px 8px;
  margin-bottom: 8px;
}
.chat-welcome-icon {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--channel-icon);
  color: #fff;
}
.chat-welcome h1 {
  margin: 8px 0;
  font-size: 32px;
  line-height: 40px;
  color: var(--text-header);
}
.chat-welcome p {
  margin: 0;
  color: var(--text-muted);
}

.message {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 2px 48px 2px 16px;
  margin-top: var(--group-spacing, 16px);
  font-size: var(--chat-font-size, 16px);
  line-height: 1.375;
}
.message.grouped {
  margin-top: 0;
}
.message:hover {
  background: var(--bg-hover);
}
.message-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 100ms var(--ease);
}
.message-avatar:active {
  transform: translateY(1px);
}
.message-gutter-time {
  flex: none;
  width: 40px;
  padding-top: 3px;
  font-size: 11px;
  text-align: right;
  color: var(--text-faint);
  opacity: 0;
}
.message:hover .message-gutter-time {
  opacity: 1;
}
.message-main {
  min-width: 0;
  flex: 1;
}
.message-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.message-author {
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1em;
  font-weight: 500;
  color: var(--text-header);
  cursor: pointer;
}
.message-author:hover {
  text-decoration: underline;
}
.message-time {
  font-size: 12px;
  color: var(--text-faint);
}
.message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-normal);
}
.message-edited {
  font-size: 10px;
  color: var(--text-faint);
}
.message-toolbar {
  position: absolute;
  top: -16px;
  right: 16px;
  display: flex;
  padding: 2px;
  border-radius: 4px;
  background: var(--bg-main);
  box-shadow: var(--elevation-stroke), 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
  pointer-events: none;
  z-index: 5;
}
.message:hover .message-toolbar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
:root[data-compact="1"] .message {
  margin-top: 0;
  gap: 8px;
}
:root[data-compact="1"] .message-avatar {
  display: none;
}

/* markdown */
.md strong { font-weight: 700; }
.md em { font-style: italic; }
.md a { color: var(--text-link); }
.md a:hover { text-decoration: underline; }
.md-inline {
  padding: 0.2em 0.4em;
  border-radius: 4px;
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.md-code {
  margin: 6px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 0.875em;
  white-space: pre;
  overflow: hidden;
}
.md-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px 4px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.md-copy {
  padding: 2px 8px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
}
.md-copy:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.md-code code {
  display: block;
  padding: 8px 12px;
  overflow-x: auto;
}
.md-quote {
  display: inline-block;
  padding-left: 12px;
  border-left: 4px solid #4e5058;
}
.md-h1 { font-size: 1.5em; font-weight: 700; }
.md-h2 { font-size: 1.25em; font-weight: 700; }
.md-h3 { font-size: 1.1em; font-weight: 700; }
.md-sub { font-size: 0.75em; color: var(--text-muted); }
.spoiler {
  border-radius: 3px;
  background: #1e1f22;
  color: transparent;
  cursor: pointer;
}
.spoiler.revealed {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: auto;
}

/* skeletons and typing */
.skeleton-list {
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  gap: 18px;
}
.skeleton-msg {
  display: flex;
  gap: 16px;
  animation: skeleton-pulse 1.6s infinite ease-in-out;
}
.skeleton-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-skeleton);
}
.skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}
.skeleton-bar {
  height: 14px;
  border-radius: 7px;
  background: var(--bg-skeleton);
}
.skeleton-bar.line {
  height: 12px;
  opacity: 0.8;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
}
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-normal);
  animation: dots-bounce 1.1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

/* composer */
.composer-wrap {
  flex: none;
  padding: 0 16px;
}
.composer {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4px;
  border-radius: 8px;
  background: var(--bg-input);
}
.composer-attach {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--interactive-normal);
}
.composer-attach:hover {
  color: var(--interactive-hover);
}
.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 320px;
  padding: 11px 0;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: var(--chat-font-size, 16px);
  line-height: 22px;
  color: var(--text-normal);
}
.composer textarea::placeholder {
  color: var(--text-muted);
}
.composer-tools {
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  padding-right: 6px;
}
.gif-btn span {
  padding: 1px 4px;
  border-radius: 3px;
  background: currentColor;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
}
.gif-btn span {
  background: transparent;
  box-shadow: inset 0 0 0 2px currentColor;
}
.typing-bar {
  height: 24px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- member list ---------- */

.members {
  flex: none;
  width: 240px;
  padding: 8px 0 20px 8px;
  overflow-y: auto;
  background: var(--bg-member-list);
  --status-ring: var(--bg-member-list);
}
.member-group-title {
  padding: 24px 8px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--channel-icon);
  text-transform: uppercase;
}
.member-group:first-child .member-group-title {
  padding-top: 16px;
}
.member-row {
  width: calc(100% - 8px);
  height: 42px;
  margin: 1px 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  color: var(--channel-icon);
}
.member-row:hover {
  background: var(--bg-hover);
}
.member-row.offline .member-avatar {
  opacity: 0.4;
}
.member-row.offline .member-name {
  opacity: 0.4;
}
.member-text {
  min-width: 0;
}
.member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 500;
  color: var(--interactive-normal);
}
.member-row:hover .member-name {
  color: var(--interactive-hover);
}
.member-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- popouts and menus ---------- */

@keyframes pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pop-up {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.popout {
  position: fixed;
  z-index: 500;
  width: 340px;
  animation: pop 150ms var(--ease);
  transform-origin: right center;
}
.ctx-menu {
  position: fixed;
  z-index: 600;
  width: 220px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-floating);
  box-shadow: var(--elevation-high), var(--elevation-stroke);
  animation: pop 150ms var(--ease);
  transform-origin: top left;
}
.ctx-item {
  width: 100%;
  min-height: 32px;
  margin: 2px 0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.ctx-item:hover {
  background: var(--brand);
  color: #fff;
}
.ctx-item.danger {
  color: var(--text-danger);
}
.ctx-item.danger:hover {
  background: var(--danger);
  color: #fff;
}
.ctx-sep {
  height: 1px;
  margin: 4px 4px;
  background: var(--border-subtle);
}

/* ---------- profile card ---------- */

.profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--elevation-high), var(--elevation-stroke);
  color: var(--text-normal);
}
.profile-banner {
  position: relative;
  height: 60px;
  overflow: hidden;
}
.profile-card.full .profile-banner {
  height: 120px;
}
.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-wrap {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px;
  border-radius: 50%;
  background: var(--bg-card);
  --status-ring: var(--bg-card);
}
.profile-card.full .profile-avatar-wrap {
  top: 72px;
}
.profile-badges {
  min-height: 28px;
  padding: 8px 12px 0;
  display: flex;
  justify-content: flex-end;
}
.profile-card.full .profile-badges {
  padding-top: 8px;
}
.badges {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}
.badge {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: #fff;
}
.profile-body {
  margin: 56px 12px 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}
.profile-card.full .profile-body {
  margin-top: 40px;
}
.profile-display {
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  color: #fff;
}
.profile-username {
  font-size: 14px;
  color: #dbdee1;
}
.profile-pronouns {
  color: #b5bac1;
}
.profile-custom {
  margin-top: 6px;
  font-size: 14px;
  color: #dbdee1;
}
.profile-sections {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-h {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #f2f3f5;
}
.profile-h.pad {
  margin-top: 16px;
}
.profile-text {
  font-size: 14px;
  color: #dbdee1;
}
.profile-text.muted {
  color: #b5bac1;
  font-size: 12px;
}
.profile-card .md {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 500;
  color: #f2f3f5;
}
.role-chip i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.profile-view-full {
  width: 100%;
  margin-top: 12px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #f2f3f5;
  font-size: 14px;
  font-weight: 500;
}
.profile-view-full:hover {
  background: rgba(255, 255, 255, 0.18);
}
.mono {
  font-family: var(--font-mono);
}

/* avatar decorations and profile effects */
.avatar[data-deco="ring_blurple"] { box-shadow: 0 0 0 3px #5865f2; }
.avatar[data-deco="ring_gold"] { box-shadow: 0 0 0 3px #f0b232, 0 0 10px rgba(240, 178, 50, 0.5); }
.avatar[data-deco="ring_rose"] { box-shadow: 0 0 0 3px #eb459e; }
.avatar[data-deco="halo"] { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 -8px 0 -2px rgba(255, 244, 180, 0.9); }
.avatar[data-deco="embers"] { box-shadow: 0 0 0 2px #f97316, 0 0 14px 2px rgba(249, 115, 22, 0.55); animation: ember-glow 2.4s infinite ease-in-out; }
@keyframes ember-glow {
  0%, 100% { box-shadow: 0 0 0 2px #f97316, 0 0 8px 1px rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 0 2px #fb923c, 0 0 16px 3px rgba(249, 115, 22, 0.7); }
}

/* ---------- modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  animation: fade-in 150ms var(--ease);
}
.modal {
  position: relative;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: var(--bg-modal);
  box-shadow: var(--elevation-high);
  animation: modal-in 150ms var(--ease);
  color: var(--text-normal);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
  z-index: 3;
}
.modal-close:hover {
  color: var(--interactive-hover);
}
.modal-close.on-banner {
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.modal-head {
  padding: 24px 24px 8px;
  text-align: center;
}
.modal-head.left {
  text-align: left;
}
.modal-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  color: var(--text-header);
}
.modal-head p {
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--text-muted);
}
.modal-body {
  padding: 16px 24px 24px;
}
.modal-text {
  margin: 0 0 24px;
  font-size: 16px;
  color: var(--text-normal);
}
.modal-fine {
  margin: -8px 0 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.modal-or {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text-header);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px -24px -24px;
  padding: 16px 24px;
  background: var(--bg-modal-footer);
  border-radius: 0 0 8px 8px;
}
.modal-actions.between {
  justify-content: space-between;
}
.modal .field-input {
  background: var(--bg-input-inset);
}
.wide {
  width: 100%;
}
.choice {
  width: 100%;
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input-inset);
  color: var(--text-header);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  transition: background-color var(--dur) var(--ease);
}
.choice span:nth-child(2) {
  flex: 1;
}
.choice:hover {
  background: var(--bg-hover);
}
.choice-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
}
.copy-field {
  display: flex;
  gap: 8px;
}
.type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: var(--bg-input-inset);
  color: var(--interactive-normal);
  text-align: left;
}
.type-row:hover {
  background: var(--bg-hover);
}
.type-row.selected {
  background: var(--bg-active);
  color: var(--text-header);
}
.type-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.type-text b {
  font-size: 16px;
  font-weight: 500;
}
.type-text small {
  font-size: 12px;
  color: var(--text-muted);
}
.radio {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--interactive-normal);
  border-radius: 50%;
  position: relative;
}
.radio.on {
  border-color: var(--brand);
}
.radio.on::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand);
}
.profile-modal {
  width: 600px;
  background: transparent;
  overflow: visible;
}
.profile-modal .profile-card {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* ---------- settings ---------- */

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--bg-main);
  animation: settings-in 200ms var(--ease);
}
@keyframes settings-in {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
.settings-shell {
  height: 100%;
  display: flex;
}
.settings-nav {
  flex: 1 0 218px;
  display: flex;
  justify-content: flex-end;
  background: var(--bg-sidebar);
  overflow-y: auto;
}
.settings-nav-inner {
  width: 218px;
  padding: 60px 6px 60px 20px;
}
.settings-main {
  flex: 1 1 800px;
  display: flex;
  overflow-y: auto;
  background: var(--bg-main);
}
.settings-main-inner {
  position: relative;
  width: 740px;
  max-width: 100%;
  padding: 60px 40px 80px;
}
.snav-heading {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.snav-item {
  width: 100%;
  margin-bottom: 2px;
  padding: 6px 10px;
  display: block;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}
.snav-item:hover {
  background: var(--bg-hover);
  color: var(--interactive-hover);
}
.snav-item.active {
  background: var(--bg-active);
  color: var(--interactive-active);
}
.snav-item.danger {
  color: var(--text-danger);
}
.snav-sep {
  height: 1px;
  margin: 8px 10px;
  background: var(--border-subtle);
}
.snav-version {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-faint);
}
.settings-close {
  position: absolute;
  top: 60px;
  right: -48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--interactive-normal);
}
.settings-close-ring {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  transition: background-color var(--dur) var(--ease);
}
.settings-close:hover .settings-close-ring {
  background: rgba(255, 255, 255, 0.08);
}
.settings-close-label {
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 960px) {
  .settings-close { right: 8px; top: 16px; }
}
.page-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-header);
}
.section-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-header);
}
.section-text {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.divider {
  height: 1px;
  margin: 24px 0;
  background: var(--border-subtle);
}
.divider.tight {
  margin: 8px 0 20px;
}
.empty-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
}
.static-ember .ember-body,
.static-ember {
  animation: none;
}

.account-card {
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-card);
}
.account-banner {
  position: relative;
  height: 100px;
  overflow: hidden;
}
.account-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 16px 12px 120px;
  position: relative;
  min-height: 56px;
}
.account-avatar {
  position: absolute;
  left: 16px;
  top: -40px;
  border: 6px solid var(--bg-card);
  border-radius: 50%;
  box-sizing: content-box;
  --status-ring: var(--bg-card);
}
.account-name {
  flex: 1;
  padding-top: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-header);
}
.account-fields {
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.account-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pref-title.small {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--interactive-normal);
}
.account-value {
  font-size: 16px;
  color: var(--text-header);
}
.inline-form {
  max-width: 400px;
  margin-top: 16px;
}
.token-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.token-box .field-input {
  flex: 1;
  font-size: 14px;
}
.token-box .btn {
  height: 40px;
}
.inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-label {
  font-size: 14px;
  color: var(--text-muted);
}
.field-input.compact {
  width: auto;
  height: 32px;
  padding: 4px 8px;
  font-size: 14px;
}
.field-input.compact.grow {
  flex: 1;
  min-width: 160px;
}
.field-input.compact.narrow {
  width: 72px;
}
.field-input.area {
  height: auto;
  resize: vertical;
  line-height: 1.4;
}
.emoji-box {
  width: 64px;
  text-align: center;
}
.hidden-input {
  display: none;
}
.select {
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: var(--bg-input-inset);
  color: var(--text-normal);
  font-size: 14px;
}
.select.wide {
  width: 100%;
  height: 40px;
  font-size: 16px;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
}
.pref-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-header);
}
.pref-desc {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-muted);
}
.toggle {
  flex: none;
  position: relative;
  width: 40px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #80848e;
  transition: background-color 150ms var(--ease);
}
.toggle.on {
  background: var(--status-online);
}
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms var(--ease);
}
.toggle.on .toggle-knob {
  transform: translateX(16px);
}

.profile-editor {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.profile-form {
  flex: 1;
  min-width: 0;
}
.profile-preview {
  flex: none;
  width: 340px;
  position: sticky;
  top: 20px;
}
.color-pair {
  display: flex;
  align-items: center;
  gap: 16px;
}
.color-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.color-pick input {
  width: 48px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-input-inset);
  color: var(--interactive-normal);
  font-size: 14px;
}
.chip:hover {
  background: var(--bg-hover);
}
.chip.on {
  border-color: var(--brand);
  background: var(--brand-faint);
  color: var(--text-header);
}
.save-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 750;
  width: 680px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
  background: var(--bg-floating);
  color: var(--text-header);
  font-size: 16px;
  box-shadow: var(--elevation-high);
  transform: translateX(-50%);
  animation: save-in 200ms var(--ease);
}
@keyframes save-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.save-bar-actions {
  display: flex;
  gap: 8px;
}

.device-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-card);
}
.device-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--interactive-normal);
}

.nitro-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
}
.nitro-badge {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.nitro-title {
  font-size: 20px;
  font-weight: 700;
}
.nitro-sub {
  opacity: 0.9;
}
.perk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.perk {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-card);
}
.perk b {
  display: block;
  font-size: 15px;
  color: var(--text-header);
}
.perk small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}
.perk-check {
  flex: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--status-online);
  color: #fff;
}

.msg-preview {
  margin-bottom: 24px;
  padding: 16px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-main);
}
.msg-preview .message {
  margin-top: 0;
}
.theme-cards {
  display: flex;
  gap: 16px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-normal);
  font-size: 14px;
}
.theme-card.on {
  border-color: var(--brand);
}
.theme-swatch {
  position: relative;
  width: 128px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
  display: flex;
}
.theme-swatch i {
  display: block;
  height: 100%;
}
.theme-swatch .sw-rail { width: 16%; }
.theme-swatch .sw-side { width: 26%; }
.theme-swatch .sw-main { flex: 1; }
.theme-swatch.dark .sw-rail { background: #1e1f22; }
.theme-swatch.dark .sw-side { background: #2b2d31; }
.theme-swatch.dark .sw-main { background: #313338; }
.theme-swatch.light .sw-rail { background: #e3e5e8; }
.theme-swatch.light .sw-side { background: #f2f3f5; }
.theme-swatch.light .sw-main { background: #ffffff; }
.theme-swatch.amoled .sw-rail,
.theme-swatch.amoled .sw-side,
.theme-swatch.amoled .sw-main { background: #000; }
.theme-swatch.amoled { box-shadow: inset 0 0 0 1px #2a2a2d; }

.radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-normal);
  text-align: left;
}
.radio-row.on {
  background: var(--bg-active);
}
.radio-row b {
  display: block;
  font-weight: 500;
  color: var(--text-header);
}
.radio-row small {
  color: var(--text-muted);
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
}
.slider-val {
  width: 48px;
  text-align: right;
  font-size: 14px;
  color: var(--text-muted);
}
.keybind-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--bg-card);
}
kbd {
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-active);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-header);
}

/* ---------- staff tools ---------- */

.staff-overlay {
  z-index: 710;
}
.staff-shell {
  flex-direction: column;
}
.staff-top {
  flex: none;
  height: 56px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
  box-shadow: var(--header-shadow);
}
.staff-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-header);
}
.staff-title svg {
  color: var(--brand);
}
.staff-title em {
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--brand-faint);
  color: var(--brand);
}
.staff-top .settings-close {
  position: static;
  flex-direction: row;
}
.staff-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 48px;
}
.staff-panel {
  max-width: 860px;
  margin: 0 auto;
}
.staff-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.staff-tab {
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 15px;
  font-weight: 500;
}
.staff-tab:hover {
  color: var(--interactive-hover);
}
.staff-tab.active {
  border-bottom-color: var(--brand);
  color: var(--text-header);
}
.staff-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text-header);
}
.staff-note {
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-card {
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-card);
}
.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-header);
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}
.staff-search {
  margin-bottom: 16px;
}
.staff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.staff-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}
.staff-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-card);
}
.staff-row.user {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}
.staff-row-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
.staff-row-top:hover {
  background: var(--bg-hover);
  border-radius: 8px;
}
.staff-row-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--bg-active);
  font-weight: 600;
  color: var(--text-header);
}
.staff-row-main {
  flex: 1;
  min-width: 0;
}
.staff-row-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-header);
}
.staff-handle {
  font-weight: 400;
  color: var(--text-muted);
}
.staff-row-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.staff-row-id {
  font-size: 12px;
  color: var(--text-faint);
}
.staff-row-actions {
  display: flex;
  gap: 8px;
}
.pill-tag {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--brand-faint);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.pill-tag.bad {
  background: rgba(242, 63, 67, 0.15);
  color: var(--status-dnd);
}
.staff-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
}
.staff-action-label {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.temp-pw {
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-input-inset);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-header);
}
.inspect-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-header);
}
.inspect-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inspect-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  background: var(--bg-card);
}

@media (max-width: 900px) {
  .members { display: none; }
  .search-box { display: none; }
  .profile-editor { flex-direction: column; }
  .profile-preview { width: 100%; position: static; }
  .perk-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* profile effects: a few drifting particles over the banner area */
.profile-fx {
  position: absolute;
  inset: 0 0 auto 0;
  height: 160px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  display: none;
}
.profile-card[data-effect="sparkle"] .profile-fx,
.profile-card[data-effect="embers"] .profile-fx,
.profile-card[data-effect="snow"] .profile-fx {
  display: block;
}
.profile-fx i {
  position: absolute;
  bottom: -8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  animation: fx-rise 3.6s infinite ease-in;
}
.profile-fx i:nth-child(1) { left: 12%; animation-delay: 0s; }
.profile-fx i:nth-child(2) { left: 28%; animation-delay: 0.9s; width: 4px; height: 4px; }
.profile-fx i:nth-child(3) { left: 46%; animation-delay: 1.8s; }
.profile-fx i:nth-child(4) { left: 62%; animation-delay: 0.4s; width: 4px; height: 4px; }
.profile-fx i:nth-child(5) { left: 78%; animation-delay: 2.4s; }
.profile-fx i:nth-child(6) { left: 90%; animation-delay: 1.3s; width: 4px; height: 4px; }
.profile-card[data-effect="sparkle"] .profile-fx i { background: #fff6c2; box-shadow: 0 0 8px #fff6c2; }
.profile-card[data-effect="embers"] .profile-fx i { background: #fb923c; box-shadow: 0 0 8px #f97316; }
.profile-card[data-effect="snow"] .profile-fx i { background: #fff; top: -8px; bottom: auto; animation-name: fx-fall; }
@keyframes fx-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-140px) translateX(10px) scale(1); }
}
@keyframes fx-fall {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(150px) translateX(-8px); }
}
