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

:root {
  --bg-top: #1f1147;
  --bg-mid: #2a2fb7;
  --bg-bottom: #0f2a7a;
  --card: #31333b;
  --card-elev: #3a3c46;
  --text: #e7e9ef;
  --muted: #b6bac7;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --danger: #f04747;
  --border: #40424a;
  --input: #2b2d33;
  --sidebar: #1f2126;
  --sidebar-2: #2a2c33;
  --sidebar-3: #111318;
  --online: #43b581;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(88, 101, 242, 0.25), transparent 40%),
              radial-gradient(circle at 80% 0%, rgba(114, 137, 218, 0.22), transparent 45%),
              linear-gradient(160deg, var(--bg-top), var(--bg-mid), var(--bg-bottom));
}

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

a:hover {
  color: var(--accent-hover);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px 16px;
}

.auth-card {
  width: min(920px, 100%);
  background: var(--card);
  border-radius: 12px;
  padding: 36px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.auth-card.single {
  grid-template-columns: 1fr;
}

.auth-title {
  font-size: 18px;
  margin: 0 0 8px;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

.suspended-auth-card {
  width: min(760px, 100%);
}

.suspended-reason-box {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(240, 71, 71, 0.16);
  color: #ffd7d7;
}

.suspended-meta-line {
  margin-bottom: 12px;
}

.suspended-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 16px;
}

.suspended-logout-btn {
  width: auto;
  text-align: center;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

.birth-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.checkbox input {
  margin-top: 4px;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}

.auth-side {
  background: var(--card-elev);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}

.auth-side .qr {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #000;
  font-weight: 700;
}

.alert {
  background: rgba(240, 71, 71, 0.15);
  border: 1px solid rgba(240, 71, 71, 0.4);
  color: #f7c4c4;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert.success {
  background: rgba(67, 181, 129, 0.15);
  border-color: rgba(67, 181, 129, 0.4);
  color: #b7f0d6;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: 84px 280px 1fr;
  min-height: 100vh;
  background: var(--sidebar-3);
}

body.is-authed {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100dvh;
}

body.is-authed .app-shell {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  height: 100dvh;
}

body.is-authed .server-bar,
body.is-authed .side-panel,
body.is-authed .main-content {
  min-height: 0;
}

body.is-authed .server-bar,
body.is-authed .side-panel,
body.is-authed .main-content {
  overflow: hidden;
}

.server-bar {
  background: #191b20;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.dm-unread-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.dm-unread-stack[hidden] {
  display: none !important;
}

.server-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #2b2d33;
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.server-icon.dm-unread-icon,
.server-icon.dm-unread-icon img {
  border-radius: 999px;
}

.server-icon.dm-unread-icon.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.server-icon.add {
  background: #212328;
  color: var(--accent);
  border: 1px dashed rgba(88, 101, 242, 0.5);
}

.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.server-icon-unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f04747;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  right: 2px;
  bottom: 2px;
  border: 2px solid #191b20;
  pointer-events: none;
}

.server-icon-unread-badge[hidden] {
  display: none !important;
}

.server-context-menu {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6000;
  display: none;
}

.server-context-menu.open {
  display: block;
}

.server-context-menu-card {
  width: 320px;
  border-radius: 12px;
  background: #252832;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  padding: 8px;
}

.channel-context-menu .server-context-menu-card {
  width: 300px;
}

.member-context-menu .server-context-menu-card {
  width: 300px;
  padding: 8px;
  overflow: visible;
}

.member-context-menu .member-context-scroll {
  max-height: none;
  overflow: visible;
  padding: 0;
}

.member-role-submenu {
  position: fixed;
  width: 240px;
  border-radius: 12px;
  background: #252832;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  padding: 8px;
  z-index: 6100;
  display: none;
}

.member-role-submenu.open {
  display: block;
}

.member-role-submenu-title {
  color: #9ba3be;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 8px 8px;
}

.member-role-submenu-list {
  display: grid;
  gap: 4px;
}

.member-role-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 14px;
}

.member-role-option:hover {
  background: #323645;
}

.member-role-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.member-role-option-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--role-color, #9aa9b7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}

.member-role-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role-option-check {
  color: #9bc7ff;
  font-weight: 700;
  font-size: 15px;
  opacity: 0;
}

.member-role-option.assigned .member-role-option-check {
  opacity: 1;
}

.server-context-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-context-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}

.server-context-item:hover {
  background: #323645;
}

.server-context-item.danger {
  color: #f47b7b;
}

.server-context-item.danger:hover {
  color: #ff9a9a;
  background: rgba(240, 71, 71, 0.16);
}

.server-context-item.disabled,
.server-context-item:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.server-context-item.disabled:hover,
.server-context-item:disabled:hover {
  background: transparent;
}

.server-context-copy {
  display: grid;
  gap: 2px;
}

.server-context-sub {
  color: var(--muted);
  font-size: 13px;
}

.server-context-arrow {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.server-context-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
}

.server-context-sep {
  height: 1px;
  margin: 8px 4px;
  background: rgba(255, 255, 255, 0.08);
}

.server-invite-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 7000;
  padding: 20px;
}

.server-invite-modal.open {
  display: flex;
}

.server-invite-card {
  width: min(620px, 96vw);
  max-height: min(700px, 92vh);
  background: #252832;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  padding: 20px;
  position: relative;
  display: grid;
  gap: 12px;
}

.server-invite-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.server-invite-title {
  margin: 0;
  padding-right: 36px;
  font-size: 34px;
  line-height: 1.15;
}

.server-invite-sub {
  margin: 0;
  color: var(--muted);
}

.server-invite-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #1f212a;
  padding: 10px 12px;
}

.server-invite-search-icon {
  color: var(--muted);
  font-size: 14px;
}

.server-invite-search input {
  background: transparent;
  border: none;
  color: var(--text);
  width: 100%;
  outline: none;
  padding: 0;
}

.server-invite-list {
  overflow-y: auto;
  padding-right: 2px;
  max-height: min(380px, 50vh);
  display: grid;
  gap: 8px;
}

.server-invite-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 6px 2px;
}

.server-invite-user {
  min-width: 0;
}

.server-invite-name {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-invite-tag {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-invite-btn {
  width: auto;
  min-width: 100px;
  padding: 10px 12px;
  background: #343744;
}

.server-invite-btn:hover {
  background: #3e4353;
}

.server-invite-empty {
  color: var(--muted);
  padding: 8px 4px;
}

.server-invite-link {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  display: grid;
  gap: 8px;
}

.server-invite-link-title {
  font-weight: 700;
}

.server-invite-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.server-invite-link-row input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1f212a;
  color: var(--text);
  padding: 10px 12px;
}

.server-invite-copy {
  min-width: 110px;
}

.server-invite-link-sub {
  color: var(--muted);
  font-size: 12px;
}

.server-ban-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.68);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 7080;
  padding: 20px;
}

.server-ban-modal.open {
  display: flex;
}

.server-ban-card {
  width: min(560px, 96vw);
  background: #252833;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  padding: 24px;
  position: relative;
  display: grid;
  gap: 14px;
}

.server-ban-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #c9cedf;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.server-ban-title {
  margin: 0;
  padding-right: 38px;
  font-size: 36px;
  line-height: 1.15;
}

.server-ban-section-title {
  font-weight: 700;
  margin-top: 2px;
}

.server-ban-section-title .req {
  color: #ff6666;
}

.server-ban-reason-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: #d6dae8;
}

.server-ban-reason-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #6576f6;
}

.server-ban-other-wrap {
  display: grid;
  gap: 8px;
}

.server-ban-other-wrap label {
  color: #c3c8d8;
}

.server-ban-other-wrap textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1f212a;
  color: var(--text);
  padding: 10px 12px;
  resize: vertical;
  min-height: 86px;
}

.server-ban-select-wrap {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.server-ban-select-wrap select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1f212a;
  color: var(--text);
  padding: 10px 12px;
}

.server-ban-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.server-settings-modal {
  position: fixed;
  inset: 0;
  background: #1f212a;
  z-index: 7100;
  display: none;
}

.server-settings-modal.open {
  display: flex;
}

.channel-settings-modal {
  position: fixed;
  inset: 0;
  background: #1f212a;
  z-index: 7200;
  display: none;
}

.channel-settings-modal.open {
  display: flex;
}

.channel-settings-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 86px;
  background: #1f212a;
}

.channel-settings-side {
  background: #11131a;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 48px 16px 24px;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

.channel-settings-side-category {
  color: #8f95aa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 10px 10px;
}

.channel-settings-side-item {
  border: none;
  background: transparent;
  color: #c4cada;
  text-align: left;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 15px;
  cursor: pointer;
}

.channel-settings-side-item:hover {
  background: #262a37;
  color: #f2f4ff;
}

.channel-settings-side-item.active {
  background: #2e3341;
  color: #ffffff;
}

.channel-settings-side-item.danger {
  color: #ff7d7d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.channel-settings-side-item.danger:hover {
  background: rgba(240, 71, 71, 0.14);
  color: #ffaaaa;
}

.channel-settings-delete-icon {
  font-size: 16px;
}

.channel-settings-side-divider {
  height: 1px;
  margin: 12px 10px 2px;
  background: rgba(255, 255, 255, 0.08);
}

.channel-settings-main {
  padding: 34px 42px 38px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 20px;
  position: relative;
}

.channel-settings-view {
  display: grid;
  align-content: start;
  gap: 20px;
}

.channel-settings-view[hidden] {
  display: none !important;
}

.channel-settings-head h2 {
  margin: 0;
  font-size: 26px;
}

.channel-settings-head p {
  margin: 8px 0 0;
  color: #a7aec3;
  font-size: 14px;
  line-height: 1.4;
}

.channel-settings-field {
  display: grid;
  gap: 10px;
}

.channel-settings-field > span {
  font-size: 16px;
  font-weight: 700;
}

.channel-settings-field small {
  color: #a7aec3;
  font-size: 14px;
  line-height: 1.45;
}

.channel-settings-name-wrap {
  position: relative;
}

.channel-settings-name-wrap input,
.channel-settings-field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #181b24;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
  padding: 14px 18px;
}

.channel-settings-name-wrap input {
  padding-right: 54px;
}

.channel-settings-name-wrap input:focus,
.channel-settings-field select:focus,
.channel-settings-topic-editor textarea:focus {
  outline: none;
  border-color: rgba(88, 101, 242, 0.75);
}

.channel-settings-inline-emoji {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #acb2c8;
  font-size: 18px;
  cursor: pointer;
}

.channel-settings-inline-emoji:hover {
  color: #e5e8f4;
}

.channel-settings-emoji-picker {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  z-index: 7305;
}

.channel-settings-topic-editor {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #181b24;
  overflow: hidden;
}

.channel-settings-topic-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #2a2d38;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.channel-settings-topic-toolbar button {
  border: none;
  background: transparent;
  color: #d5daeb;
  min-width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
}

.channel-settings-topic-toolbar button:hover {
  background: #3a3e4c;
}

.channel-settings-color-chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  background: conic-gradient(#ff6b6b, #f7d154, #55d88b, #4ea4ff, #a26bff, #ff6b6b);
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.channel-settings-code-icon {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.8px;
}

.channel-settings-topic-toolbar-spacer {
  flex: 1 1 auto;
}

.channel-settings-strike {
  text-decoration: line-through;
}

.channel-settings-topic-editor textarea {
  width: 100%;
  min-height: 240px;
  border: none;
  resize: vertical;
  background: transparent;
  color: var(--text);
  padding: 16px 18px 10px;
  font-size: 18px;
  line-height: 1.35;
}

.channel-settings-topic-editor textarea::placeholder {
  color: #8f95aa;
}

.channel-settings-topic-count {
  text-align: right;
  color: #b6bdd4;
  font-size: 20px;
  padding: 0 16px 10px;
  font-weight: 700;
}

.channel-settings-toggle-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.channel-settings-toggle-row strong {
  display: block;
  font-size: 16px;
}

.channel-settings-toggle-row p {
  margin: 8px 0 0;
  color: #a7aec3;
  font-size: 14px;
  line-height: 1.42;
}

.channel-settings-toggle {
  width: 58px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #202432;
  cursor: pointer;
  position: relative;
  margin-top: 4px;
}

.channel-settings-toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f2f8;
  transition: transform 120ms ease;
}

.channel-settings-toggle[aria-pressed="true"] {
  background: #4e66ff;
  border-color: #4e66ff;
}

.channel-settings-toggle[aria-pressed="true"] span {
  transform: translateX(24px);
}

.channel-settings-close-pane {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  align-content: start;
  justify-items: center;
  padding-top: 30px;
}

.channel-settings-close {
  border: none;
  background: transparent;
  color: #d7dbee;
  display: grid;
  gap: 4px;
  justify-items: center;
  cursor: pointer;
}

.channel-settings-close span {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
}

.channel-settings-close small {
  color: #8f95aa;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.server-settings-wrap {
  width: 100%;
  height: 100%;
  background: #1f212a;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 260px;
  overflow: hidden;
}

.server-settings-side {
  background: #11131a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 48px 16px 24px;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  align-self: stretch;
}

.server-settings-side-title {
  color: #8f95aa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 4px 8px 8px;
}

.server-settings-side-section {
  color: #8f95aa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 14px 8px 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.server-settings-side-item {
  border: none;
  background: transparent;
  color: #c0c4d2;
  text-align: left;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 15px;
  cursor: pointer;
}

.server-settings-side-item.with-icon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.server-settings-side-item .item-icon {
  color: #8f95aa;
  font-size: 14px;
  line-height: 1;
}

.server-settings-side-item.danger {
  color: #f47b7b;
}

.server-settings-side-item:hover {
  background: #242734;
  color: #f2f4ff;
}

.server-settings-side-item.danger:hover {
  color: #ff9a9a;
  background: rgba(240, 71, 71, 0.16);
}

.server-settings-side-item.danger .item-icon {
  color: inherit;
}

.server-settings-side-item.active {
  background: #2c2f3a;
  color: #ffffff;
  font-weight: 600;
}

.server-settings-side-divider {
  height: 1px;
  margin: 8px 8px;
  background: rgba(255, 255, 255, 0.08);
}

.server-settings-main {
  padding: 34px 42px 38px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  gap: 16px;
  align-self: stretch;
}

.server-settings-head h2 {
  margin: 0;
  font-size: 30px;
}

.server-settings-head p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #a4a9bb;
  max-width: 620px;
}

.server-settings-field {
  display: grid;
  gap: 8px;
}

.server-settings-field span {
  font-size: 14px;
  font-weight: 700;
}

.server-settings-field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #181b24;
  color: var(--text);
  padding: 10px 12px;
  font-size: 20px;
  line-height: 1.1;
}

.server-settings-field input:focus {
  outline: none;
  border-color: rgba(88, 101, 242, 0.8);
}

.server-settings-block {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 14px;
  display: grid;
  gap: 8px;
}

.server-settings-block h3 {
  margin: 0;
  font-size: 22px;
}

.server-settings-block p {
  margin: 0;
  color: #a4a9bb;
}

.server-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-settings-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.server-settings-swatch {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  height: 58px;
  background: linear-gradient(180deg, #ff1717 0%, #ff6f4f 100%);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.server-settings-swatch.active {
  outline: 2px solid #d2d5ff;
  outline-offset: 2px;
}

.server-settings-swatch.s2 {
  background: linear-gradient(180deg, #ff11b8 0%, #ff6fbe 100%);
}

.server-settings-swatch.s3 {
  background: linear-gradient(180deg, #ff2d2d 0%, #ff9f58 100%);
}

.server-settings-swatch.s4 {
  background: linear-gradient(180deg, #ffd72b 0%, #fff189 100%);
}

.server-settings-swatch.s5 {
  background: linear-gradient(180deg, #6f3fc3 0%, #b786de 100%);
}

.server-settings-swatch.s6 {
  background: linear-gradient(180deg, #109dff 0%, #7de1ff 100%);
}

.server-settings-preview {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: 30px 14px 24px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  align-content: start;
  align-self: stretch;
  position: relative;
}

.server-settings-close {
  justify-self: end;
  border: none;
  background: transparent;
  color: #d7dbee;
  display: grid;
  gap: 4px;
  justify-items: center;
  cursor: pointer;
}

.server-settings-close span {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
}

.server-settings-close small {
  color: #8f95aa;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.server-settings-card-preview {
  border-radius: 14px;
  overflow: hidden;
  background: #2a2d37;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.server-settings-card-banner {
  height: 92px;
  background: linear-gradient(180deg, #ff0909 0%, #ff7b5f 100%);
}

.server-settings-card-body {
  padding: 12px;
  position: relative;
}

.server-settings-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 3px solid #2a2d37;
  background: #f7f7f7;
  color: #1c2027;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  position: absolute;
  top: -26px;
  left: 12px;
}

.server-settings-card-name {
  margin-top: 26px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}

.server-settings-card-meta {
  margin-top: 6px;
  color: #a4a9bb;
  font-size: 13px;
}

.server-settings-view {
  display: grid;
  align-content: start;
  gap: 16px;
}

.server-settings-view[hidden] {
  display: none !important;
}

.server-settings-wrap.is-tag-view .server-settings-card-preview {
  display: none;
}

.server-settings-wrap.is-tag-view {
  grid-template-columns: 300px minmax(0, 1fr) 92px;
}

.server-settings-wrap.is-tag-view .server-settings-main {
  padding-right: 18px;
}

.server-settings-wrap.is-tag-view .server-settings-preview {
  padding-left: 8px;
  padding-right: 8px;
  border-left-color: rgba(255, 255, 255, 0.04);
}

.server-tag-view {
  gap: 18px;
}

.server-tag-head h2 {
  margin: 0;
  font-size: 34px;
}

.server-tag-head p {
  margin: 8px 0 0;
  color: #c2c8dd;
  line-height: 1.5;
  max-width: 760px;
}

.server-tag-layout {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.server-tag-config {
  display: grid;
  gap: 16px;
}

.server-tag-note {
  border-radius: 10px;
  border: 1px solid rgba(88, 101, 242, 0.5);
  background: rgba(88, 101, 242, 0.16);
  color: #e8edff;
  font-size: 14px;
  line-height: 1.45;
  padding: 12px 13px;
}

.server-tag-field {
  display: grid;
  gap: 8px;
}

.server-tag-field > span,
.server-tag-badges-wrap > span {
  font-size: 16px;
  font-weight: 700;
}

.server-tag-input-wrap {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #181b24;
  border-radius: 12px;
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 0 88px 0 62px;
}

.server-tag-input-wrap:focus-within {
  border-color: rgba(88, 101, 242, 0.75);
}

.server-tag-input-badge {
  position: absolute;
  left: 18px;
  font-size: 27px;
  line-height: 1;
}

.server-tag-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  color: #f4f6ff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 0;
}

.server-tag-input-wrap input:focus {
  outline: none;
}

.server-tag-count {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #95a0be;
  font-size: 13px;
  font-weight: 700;
}

.server-tag-field small {
  color: #98a1bc;
  font-size: 13px;
  line-height: 1.45;
}

.server-tag-badges-wrap {
  display: grid;
  gap: 10px;
}

.server-tag-badges {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 52px));
  gap: 10px;
}

.server-tag-badges button {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #202432;
  color: #e8ecff;
  font-size: 24px;
  cursor: pointer;
}

.server-tag-badges button:hover {
  background: #2a2f42;
  border-color: rgba(255, 255, 255, 0.23);
}

.server-tag-badges button.active {
  border-color: #8ea2ff;
  box-shadow: 0 0 0 2px rgba(111, 134, 255, 0.34);
}

.server-tag-status {
  border-radius: 10px;
  border: 1px solid rgba(88, 101, 242, 0.52);
  background: rgba(88, 101, 242, 0.2);
  color: #f0f2ff;
  padding: 9px 12px;
  font-size: 14px;
}

.server-tag-status.is-error {
  border-color: rgba(240, 71, 71, 0.55);
  background: rgba(240, 71, 71, 0.18);
  color: #ffd7d7;
}

.server-tag-preview {
  min-width: 0;
}

.server-tag-preview-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #12151d;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.server-tag-preview-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #d9def0;
}

.server-tag-preview-row img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.server-tag-preview-row strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
}

.server-tag-preview-row p {
  margin: 4px 0 0;
  color: #aeb6d0;
  font-size: 15px;
  line-height: 1.3;
}

.server-tag-preview-row.muted {
  opacity: 0.46;
}

.server-tag-preview-row.active {
  opacity: 1;
}

.server-tag-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(88, 101, 242, 0.2);
  color: #e9edff;
  border: 1px solid rgba(88, 101, 242, 0.58);
}

.server-tag-pill-badge {
  font-size: 14px;
  line-height: 1;
}

.server-tag-pill-text {
  letter-spacing: 0.4px;
}

.server-settings-wrap.is-emojis-view .server-settings-card-preview {
  display: none;
}

.server-settings-wrap.is-emojis-view {
  grid-template-columns: 300px minmax(0, 1fr) 92px;
}

.server-settings-wrap.is-emojis-view .server-settings-main {
  padding-right: 18px;
}

.server-settings-wrap.is-emojis-view .server-settings-preview {
  padding-left: 8px;
  padding-right: 8px;
  border-left-color: rgba(255, 255, 255, 0.04);
}

.server-emojis-view {
  gap: 18px;
}

.server-emojis-head h2 {
  margin: 0;
  font-size: 34px;
}

.server-emojis-head p {
  margin: 8px 0 0;
  color: #c2c8dd;
  line-height: 1.5;
  max-width: 760px;
}

.server-emojis-upload {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #242733;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.server-emojis-upload p {
  margin: 0;
  color: #b8bfd8;
  line-height: 1.45;
}

.server-emojis-status {
  border-radius: 10px;
  border: 1px solid rgba(88, 101, 242, 0.52);
  background: rgba(88, 101, 242, 0.2);
  color: #f0f2ff;
  padding: 9px 12px;
  font-size: 14px;
}

.server-emojis-status.error {
  border-color: rgba(240, 71, 71, 0.55);
  background: rgba(240, 71, 71, 0.18);
  color: #ffd7d7;
}

.server-emojis-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.server-emojis-section-head {
  display: grid;
  gap: 3px;
}

.server-emojis-section-head h3 {
  margin: 0;
  font-size: 33px;
}

.server-emojis-section-head small {
  color: #c2c8dd;
  font-size: 17px;
  line-height: 1;
}

.server-emojis-table {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #222530;
  overflow: hidden;
}

.server-emojis-table-head,
.server-emojis-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(180px, 250px) 78px;
  align-items: center;
  gap: 14px;
}

.server-emojis-table-head {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8cde0;
  font-size: 14px;
  font-weight: 700;
}

.server-emojis-table-body {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, 0.03);
}

.server-emojis-row {
  padding: 10px 16px;
  background: #272a35;
}

.server-emojis-row:hover {
  background: #2b2f3c;
}

.server-emojis-thumb {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.server-emojis-name {
  font-size: 16px;
  color: #eff2ff;
}

.server-emojis-uploader {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  color: #e5e9fb;
}

.server-emojis-uploader img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.server-emojis-uploader span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-emojis-actions {
  display: flex;
  justify-content: flex-end;
}

.server-emojis-delete {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(240, 71, 71, 0.46);
  background: rgba(240, 71, 71, 0.16);
  color: #ff9f9f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.server-emojis-delete:hover {
  background: rgba(240, 71, 71, 0.26);
}

.server-emojis-empty {
  padding: 14px 16px;
  background: #272a35;
  color: #97a0be;
  font-size: 15px;
}

.server-settings-wrap.is-roles-view .server-settings-card-preview {
  display: none;
}

.server-settings-wrap.is-roles-view {
  grid-template-columns: 300px minmax(0, 1fr) 92px;
}

.server-settings-wrap.is-roles-view .server-settings-main {
  padding-right: 18px;
}

.server-settings-wrap.is-roles-view .server-settings-preview {
  padding-left: 8px;
  padding-right: 8px;
  border-left-color: rgba(255, 255, 255, 0.04);
}

.server-roles-view {
  gap: 14px;
}

.server-roles-head h2 {
  margin: 0;
  font-size: 34px;
}

.server-roles-head p {
  margin: 6px 0 0;
  color: #c2c8dd;
  font-size: 14px;
  line-height: 1.5;
  max-width: 860px;
}

.server-roles-warning {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #b47a14;
  background: rgba(180, 122, 20, 0.13);
  color: #f6ede0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.server-roles-warning-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0a10b;
  color: #171717;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.server-roles-warning-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  flex: 1;
}

.server-roles-warning-arrow {
  color: #b7bfd9;
  font-size: 28px;
  line-height: 1;
}

.server-roles-default-card {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #242733;
  color: #e6eaf9;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.server-roles-default-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d202b;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #c8cde0;
  flex: 0 0 auto;
}

.server-roles-default-text {
  display: grid;
  gap: 4px;
  flex: 1;
}

.server-roles-default-text strong {
  font-size: 17px;
  font-weight: 700;
}

.server-roles-default-text small {
  color: #a6aec7;
  font-size: 13px;
}

.server-roles-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.server-roles-search {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #1b1e27;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #a6aec7;
}

.server-roles-search input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 17px;
}

.server-roles-help {
  margin: 0;
  color: #c2c8dd;
  line-height: 1.45;
}

.server-roles-table-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 4px 10px;
  color: #cdd3ea;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 120px;
  gap: 14px;
  align-items: center;
}

.server-roles-list {
  display: grid;
}

.server-role-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 4px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 120px;
  gap: 14px;
  align-items: center;
}

.server-role-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.server-role-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 600;
}

.server-role-icon {
  color: #aeb6cf;
  font-size: 22px;
  line-height: 1;
}

.server-role-members {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c3c9dd;
  font-size: 16px;
}

.server-role-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.server-role-action {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #2a2d38;
  color: #d2d7ea;
  cursor: pointer;
  font-size: 18px;
}

.server-role-action:hover {
  background: #343848;
}

.server-roles-empty {
  color: #a2aac3;
  padding: 14px 4px;
}

.server-settings-wrap.is-role-editor-view {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.server-settings-wrap.is-role-editor-view .server-settings-side {
  display: none;
}

.server-settings-wrap.is-role-editor-view .server-settings-main {
  padding: 0;
}

.server-settings-wrap.is-role-editor-view .server-settings-card-preview {
  display: none;
}

.server-settings-wrap.is-role-editor-view .server-settings-preview {
  padding-left: 8px;
  padding-right: 8px;
  border-left-color: rgba(255, 255, 255, 0.04);
}

.server-role-editor-view {
  height: 100%;
  gap: 0;
}

.server-role-editor-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background: #1f212a;
}

.server-role-editor-side {
  background: #1a1d27;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.server-role-editor-side-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.server-role-editor-back,
.server-role-editor-add {
  border: none;
  background: transparent;
  color: #d8dcee;
  font-weight: 700;
  cursor: pointer;
}

.server-role-editor-back {
  text-align: left;
  padding: 8px 6px;
}

.server-role-editor-add {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.server-role-editor-add:hover,
.server-role-editor-back:hover {
  background: #2a2e3d;
}

.server-role-editor-list {
  overflow-y: auto;
  display: grid;
  gap: 6px;
  align-content: start;
}

.server-role-editor-item {
  border: none;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  background: transparent;
  color: #d6dbec;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.server-role-editor-item[draggable='true'] {
  cursor: grab;
}

.server-role-editor-item[draggable='true']:active {
  cursor: grabbing;
}

.server-role-editor-item.is-dragging {
  opacity: 0.45;
}

.server-role-editor-item.drag-over-before {
  box-shadow: inset 0 2px 0 #6f86ff;
}

.server-role-editor-item.drag-over-after {
  box-shadow: inset 0 -2px 0 #6f86ff;
}

.server-role-editor-item-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--role-color, #9aa9b7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}

.server-role-editor-item.active,
.server-role-editor-item:hover {
  background: #303543;
  color: #ffffff;
}

.server-role-editor-item:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.server-role-editor-main {
  padding: 18px 22px 24px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.server-role-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.server-role-editor-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.4px;
}

.server-role-editor-menu {
  border: none;
  background: transparent;
  color: #d5daeb;
  font-size: 28px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}

.server-role-editor-menu:hover {
  background: #2a2d38;
}

.server-role-editor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.server-role-editor-tabs button {
  border: none;
  background: transparent;
  color: #aeb5ce;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.server-role-editor-tabs button.active {
  color: #8ea2ff;
  border-bottom: 2px solid #6f86ff;
}

.server-role-editor-section {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
}

.server-role-editor-tab-panel {
  display: grid;
  gap: 12px;
}

.server-role-editor-tab-panel[hidden] {
  display: none !important;
}

.server-role-permission-search {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #1b1e27;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #a6aec7;
}

.server-role-permission-search input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 17px;
}

.server-role-permission-groups {
  display: grid;
  gap: 16px;
}

.server-role-permission-group {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  display: grid;
  gap: 2px;
}

.server-role-permission-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.server-role-permission-group-head h3 {
  margin: 0;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
  color: #f3f5ff;
}

.server-role-permission-reset {
  border: none;
  background: transparent;
  color: #6f86ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.server-role-permission-reset:hover {
  color: #8ea2ff;
}

.server-role-permission-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-role-permission-item strong {
  display: block;
  font-size: 17px;
}

.server-role-permission-item small {
  display: block;
  margin-top: 7px;
  color: #aeb5ce;
  max-width: 860px;
  line-height: 1.35;
  font-size: 14px;
}

.server-role-permission-warning {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #b47a14;
  background: rgba(180, 122, 20, 0.13);
  color: #f6ede0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 10px 12px;
}

.server-role-permission-empty {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 18px 16px;
  color: #aeb5ce;
  font-size: 14px;
}

.server-role-placeholder-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.server-role-placeholder-panel h3 {
  margin: 0;
  font-size: 21px;
}

.server-role-placeholder-panel p {
  margin: 8px 0 0;
  color: #aeb5ce;
  line-height: 1.4;
  font-size: 14px;
}

.server-role-editor-section h3 {
  margin: 0;
  font-size: 16px;
}

.server-role-editor-note {
  margin: 0;
  color: #aeb5ce;
}

.server-role-editor-field {
  display: grid;
  gap: 8px;
}

.server-role-editor-field span {
  font-size: 16px;
  font-weight: 700;
}

.server-role-editor-field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #181b24;
  color: var(--text);
  font-size: 18px;
  padding: 12px 14px;
}

.server-role-editor-field input:focus {
  outline: none;
  border-color: rgba(88, 101, 242, 0.85);
}

.server-role-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.server-role-style-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #212531;
  color: #dce1f1;
  padding: 14px 10px;
  min-height: 96px;
  text-align: center;
  cursor: pointer;
}

.server-role-style-card.active {
  border-color: #6f86ff;
  box-shadow: inset 0 0 0 1px rgba(111, 134, 255, 0.35);
}

.server-role-style-upgrade {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: radial-gradient(circle at 74% 56%, rgba(124, 96, 255, 0.34), rgba(34, 37, 49, 0.95) 48%);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.server-role-style-upgrade strong {
  font-size: 18px;
  line-height: 1.15;
}

.server-role-style-upgrade small {
  display: block;
  margin-top: 6px;
  color: #c5cbe0;
}

.server-role-color-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.server-role-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  height: 34px;
  background: var(--sw, #9aa9b7);
  cursor: pointer;
}

.server-role-color-swatch.active {
  outline: 2px solid #e3e7ff;
  outline-offset: 1px;
}

.server-role-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #2b2f3a;
  color: #eff2ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.server-role-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.server-role-icon-box {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background: #161922;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.server-role-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.server-role-icon-box span {
  color: #8a92ab;
  font-size: 26px;
}

.server-role-preview-list {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.server-role-preview-row {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.server-role-preview-row.variant-1 {
  background: #3a3f4a;
}

.server-role-preview-row.variant-2 {
  background: #222632;
}

.server-role-preview-row.variant-3 {
  background: #04050a;
}

.server-role-preview-row.variant-4 {
  background: #e6e6e8;
  color: #222;
}

.server-role-preview-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.server-role-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-role-preview-head {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
}

.server-role-preview-name {
  font-size: 16px;
  font-weight: 700;
}

.server-role-preview-rankicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #262a36;
  color: #e5e8f5;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  flex: 0 0 auto;
}

.server-role-preview-rankicon.has-image {
  background-size: cover;
  background-position: center;
  border-color: rgba(255, 255, 255, 0.4);
  color: transparent;
}

.server-role-preview-time {
  color: #99a1bb;
  font-size: 13px;
}

.server-role-preview-text {
  margin-top: 4px;
  color: inherit;
  font-size: 14px;
}

.server-role-toggle-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-role-toggle-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.server-role-toggle-item strong {
  display: block;
  font-size: 17px;
}

.server-role-toggle-item small {
  display: block;
  margin-top: 6px;
  color: #aeb5ce;
  max-width: 780px;
  line-height: 1.35;
}

.server-role-toggle {
  width: 50px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1d212c;
  padding: 2px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease;
}

.server-role-toggle span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d8ddec;
  transform: translateX(0);
  transition: transform 0.15s ease;
}

.server-role-toggle.on {
  background: #5b6ef8;
  border-color: #5b6ef8;
}

.server-role-toggle.on span {
  transform: translateX(20px);
}

@media (max-width: 760px) {
  .server-invite-title {
    font-size: 24px;
  }
  .server-invite-name {
    font-size: 22px;
  }
}

.side-panel {
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.side-search {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.side-search input {
  background: #2a2c33;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
}

.side-menu {
  padding: 14px 10px;
  display: grid;
  gap: 6px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.side-item.active,
.side-item:hover {
  background: var(--sidebar-2);
  color: var(--text);
}

.dm-list {
  padding: 8px 10px 16px;
  color: var(--muted);
  font-size: 13px;
}

.dm-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
}

.dm-entry:hover {
  background: var(--sidebar-2);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3a3c46;
  display: grid;
  place-items: center;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.status-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid #1f2126;
  bottom: 2px;
  right: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.avatar.large .status-dot {
  width: 12px;
  height: 12px;
  border-width: 3px;
  bottom: 4px;
  right: 4px;
}

.user-panel {
  background: #23252b;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-meta {
  display: grid;
  gap: 2px;
  font-size: 13px;
}

.user-meta > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.online-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 2px #1f2126;
}

.main-content {
  background: #1c1e23;
  padding: 0;
  color: var(--text);
  min-height: 0;
  height: 100%;
}

.main-content .card {
  background: #20222a;
}

.server-shell {
  background: #1c1e23;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
}

.server-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #1f2126;
}

.server-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  min-width: 0;
}

.server-title-name {
  display: inline-block;
  white-space: nowrap;
}

.server-title-topic-sep {
  color: #8f95aa;
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}

.server-title-topic {
  color: #9aa3bc;
  font-weight: 500;
  font-size: 14px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.server-title-topic strong {
  font-weight: 700;
}

.server-title-topic em {
  font-style: italic;
}

.server-title-topic s {
  text-decoration: line-through;
}

.server-title-topic .chat-md-code {
  font-size: 12px;
  padding: 0 5px;
}

.server-title-topic .chat-md-spoiler {
  background: #323747;
  border-radius: 4px;
  color: transparent;
  padding: 0 5px;
  cursor: pointer;
  user-select: none;
}

.server-title-topic .chat-md-spoiler.revealed {
  color: #dfe5f6;
}

.server-title-topic .chat-inline-emoji {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
}

.server-verified-badge {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: inline-block;
  background: url('/assets/images/server-verified-badge.png') center / contain no-repeat;
}

.user-verified-badge {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-block;
  background: url('/assets/images/server-verified-badge.png') center / contain no-repeat;
}

.server-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #2b2d33;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.server-title-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  min-height: 0;
  height: 100%;
}

.server-shell.is-locked {
  position: relative;
}

.server-shell.is-locked .server-header,
.server-shell.is-locked .server-body {
  filter: blur(3.6px) grayscale(0.2);
  opacity: 0.58;
  pointer-events: none;
  user-select: none;
}

.server-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 3;
  pointer-events: none;
}

.server-shell.is-locked .server-lock-overlay {
  right: 220px;
}

.server-lock-card {
  width: min(620px, 92vw);
  background: rgba(24, 27, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.45);
  padding: 22px;
  display: grid;
  gap: 12px;
  pointer-events: auto;
}

.server-lock-card h2 {
  margin: 0;
  font-size: 31px;
  line-height: 1.2;
}

.server-lock-card p {
  margin: 0;
  color: #d4daec;
  line-height: 1.44;
}

.server-lock-card .server-lock-reason {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(240, 71, 71, 0.16);
  color: #ffd7d7;
}

.friends-page {
  padding: 28px 32px;
}

.friends-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.friends-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.friends-tabs .tab {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.tab {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  background: #2b2d33;
  color: var(--text);
}

.btn.small {
  width: auto;
  padding: 8px 12px;
}

.friends-card {
  background: #23252b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.friends-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.friends-add input {
  border-radius: 10px;
}

.friends-list-title {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.friends-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-radius: 10px;
}

.friends-item:hover {
  background: #23252b;
}

.friends-meta .muted {
  color: var(--muted);
  font-size: 12px;
}

.friends-actions {
  display: flex;
  gap: 12px;
  color: var(--muted);
  align-items: center;
  flex-wrap: wrap;
}

.friends-actions form {
  margin: 0;
}

.friends-actions .btn.small {
  white-space: nowrap;
}

.friends-state {
  font-size: 12px;
  color: var(--muted);
  background: #2b2d33;
  border-radius: 8px;
  padding: 6px 8px;
}

.friends-empty {
  color: var(--muted);
  padding: 12px 0;
}

.admin-page {
  display: grid;
  gap: 16px;
}

body.is-authed .main-content.is-admin-page {
  padding: 14px 16px 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 860px) {
  body.is-authed .main-content.is-admin-page {
    padding: 10px 10px 14px;
  }
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-title {
  font-size: 18px;
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.admin-card {
  background: #23252b;
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.admin-item {
  background: #1f2126;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  background: #1f2126;
  padding: 10px;
  border-radius: 10px;
}

.admin-duty-badge-list.drag-over {
  outline: 2px dashed rgba(88, 101, 242, 0.8);
  outline-offset: 3px;
  border-radius: 10px;
}

.admin-duty-badge-row {
  cursor: grab;
  user-select: none;
}

.admin-duty-badge-row.is-dragging {
  opacity: 0.45;
  border: 1px solid rgba(88, 101, 242, 0.8);
}

.admin-duty-badge-handle {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  margin-right: 8px;
  letter-spacing: -1px;
  cursor: grab;
}

.admin-col {
  display: grid;
  gap: 2px;
}

.admin-name {
  font-weight: 600;
}

.admin-sub {
  color: var(--muted);
  font-size: 12px;
}

.admin-inline {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-smtp-form {
  display: grid;
  gap: 12px;
}

.admin-smtp-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-smtp-field {
  display: grid;
  gap: 6px;
}

.admin-smtp-field > span {
  font-size: 12px;
  color: var(--muted);
}

.admin-smtp-field input,
.admin-smtp-field select {
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}

.admin-smtp-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.admin-smtp-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.admin-mailer-form {
  display: grid;
  gap: 12px;
}

.admin-mail-head-inline {
  flex-wrap: wrap;
}

.admin-mail-scope-wrap {
  display: grid;
  gap: 8px;
}

.admin-mail-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-mail-scope-tab {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.admin-mail-scope-tab input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-mail-scope-tab span {
  background: #1f2126;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  color: #cfd6eb;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.admin-mail-scope-tab input[type='radio']:checked + span {
  border-color: rgba(88, 101, 242, 0.85);
  background: rgba(88, 101, 242, 0.22);
  color: #e9edff;
}

.admin-mail-manual-field[hidden],
.admin-mail-user-select[hidden],
.admin-mail-global-note[hidden] {
  display: none !important;
}

.admin-mail-user-select {
  background: #1f2126;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.admin-mail-select-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-mail-user-search-field {
  margin: 0;
}

.admin-mail-select-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-mail-user-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.admin-mail-user-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #2a2d37;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.admin-mail-user-row:hover {
  border-color: rgba(88, 101, 242, 0.45);
}

.admin-mail-user-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #5865f2;
}

.admin-mail-user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-mail-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.admin-mail-user-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-mail-editor {
  min-height: 188px;
  align-items: stretch;
  background: #2b2d33;
}

.admin-mail-editor textarea {
  min-height: 148px;
  max-height: 420px;
  resize: vertical;
  padding-top: 4px;
}

.admin-mail-body-field .admin-sub {
  margin-top: 4px;
}

.admin-translation-search {
  width: 100%;
}

.admin-translation-search input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.admin-translation-empty {
  padding: 8px 2px;
}

.admin-inline select,
.admin-inline input[type="text"] {
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
}

.admin-inline input[type="file"] {
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
}

.admin-add {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
}

.admin-add.admin-duty-badge-add {
  grid-template-columns: minmax(180px, 220px) 1fr 110px auto;
  gap: 8px;
}

.admin-duty-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-duty-icon-emoji {
  margin-right: 6px;
}

.admin-badge {
  color: var(--muted);
  font-size: 12px;
  padding: 4px 8px;
  background: #2b2d33;
  border-radius: 8px;
}

.admin-badge-inline {
  margin-left: 8px;
}

.admin-badge.ok {
  background: rgba(87, 242, 135, 0.18);
  color: #8ff7b3;
}

.admin-badge.danger {
  background: rgba(240, 71, 71, 0.18);
  color: #ffb3b3;
}

.admin-server-row {
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 1fr) auto;
  align-items: center;
}

.admin-server-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-server-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  background: #2b2d33;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.admin-server-icon-fallback {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-server-transfer {
  justify-content: flex-start;
}

.admin-server-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-report-row {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: flex-start;
}

.admin-report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-report-body {
  margin-top: 6px;
  background: #262a35;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #d7ddf3;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  max-width: 360px;
}

.admin-owner-modal-card {
  width: min(560px, 94vw);
}

.admin-owner-target {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.admin-owner-modal-form {
  display: grid;
  gap: 12px;
}

.admin-owner-modal-field {
  display: grid;
  gap: 6px;
}

.admin-owner-modal-field span {
  font-size: 13px;
  color: var(--muted);
}

.admin-owner-modal-field input[type="text"] {
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-owner-modal-field input[type="text"]:focus {
  outline: none;
  border-color: rgba(88, 101, 242, 0.8);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.admin-suspend-modal-card {
  width: min(620px, 95vw);
}

.admin-suspend-modal-form {
  display: grid;
  gap: 12px;
}

.admin-suspend-modal-target {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.admin-suspend-modal-field {
  display: grid;
  gap: 6px;
}

.admin-suspend-modal-field > span {
  font-size: 13px;
  color: var(--muted);
}

.admin-suspend-modal-field textarea,
.admin-suspend-modal-field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1f212a;
  color: var(--text);
  padding: 10px 12px;
}

.admin-suspend-modal-field textarea {
  min-height: 92px;
  resize: vertical;
}

.admin-add.admin-reaction-category-add {
  grid-template-columns: 1fr auto;
}

.admin-inline.admin-reaction-upload {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.2fr) minmax(220px, 1fr) auto;
  gap: 8px;
}

.admin-reaction-upload textarea {
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
  min-height: 88px;
  font-family: inherit;
}

.admin-reaction-upload input[type="file"] {
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
}

.admin-reaction-category {
  background: #1f2126;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.admin-reaction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  min-height: 64px;
}

.admin-reaction-item {
  background: #2a2d37;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: grab;
  user-select: none;
}

.admin-reaction-item.is-dragging {
  opacity: 0.45;
  border-color: rgba(88, 101, 242, 0.8);
}

.admin-reaction-grid.drag-over {
  outline: 2px dashed rgba(88, 101, 242, 0.8);
  outline-offset: 2px;
  border-radius: 8px;
}

.admin-reaction-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.admin-reaction-item span {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-reaction-delete-form {
  margin-left: auto;
}

.admin-reaction-delete-btn {
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(240, 71, 71, 0.2);
  color: #ffb3b3;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.admin-reaction-delete-btn:hover {
  background: rgba(240, 71, 71, 0.36);
  color: #ffd3d3;
}

.admin-reaction-drop-hint {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px;
  text-align: center;
  font-size: 12px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

@media (max-width: 980px) {
  .admin-inline.admin-reaction-upload {
    grid-template-columns: 1fr;
  }

  .admin-mail-select-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-mail-select-actions {
    justify-content: flex-start;
  }

  .admin-mail-user-row {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .admin-mail-user-row .admin-badge {
    justify-self: start;
    margin-left: 0;
  }

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

  .admin-server-actions {
    justify-content: flex-start;
  }

  .admin-report-row {
    grid-template-columns: 1fr;
  }

  .admin-report-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

.btn.danger {
  background: #f04747;
}

.btn.danger:hover {
  background: #d83c3c;
}

.dm-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: 56px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.dm-header {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #1f2126;
}

.dm-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.dm-body {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  padding: 16px 20px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.dm-messages {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}

.dm-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.dm-message.chat-message {
  padding-right: 52px;
}

.dm-message.chat-message .chat-message-actions {
  top: -6px;
  right: 4px;
}

.dm-bubble {
  background: transparent;
  border-radius: 0;
  padding: 0;
  max-width: 720px;
}

.dm-name {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 2px;
  font-weight: 600;
}

.dm-text {
  color: var(--text);
  line-height: 1.4;
}

.dm-invite-card {
  margin-top: 8px;
  background: #1f2128;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  max-width: 460px;
}

.dm-invite-head {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.dm-invite-server {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dm-invite-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #2b2d33;
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
}

.dm-invite-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-invite-meta {
  min-width: 0;
}

.dm-invite-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-invite-channel {
  color: var(--muted);
  font-size: 12px;
}

.dm-invite-actions {
  display: flex;
}

.dm-invite-state {
  color: var(--muted);
  font-size: 13px;
}

.dm-invite-state.success {
  color: #9ee6bf;
}

.dm-message + .dm-message {
  margin-top: 0;
}

.dm-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2b2d33;
  border-radius: 10px;
  padding: 10px 14px;
}

.dm-input input[type="text"] {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
}

.dm-profile {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 16px;
  min-height: 0;
  overflow-y: auto;
}

.dm-profile-card {
  background: #23252b;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.avatar.large {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  font-size: 22px;
}

.dm-profile-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.dm-profile-tag {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .dm-shell {
    grid-template-columns: 1fr;
  }
  .dm-profile {
    display: none;
  }
}

.server-icon.logo {
  background: #2b2d33;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.server-icon.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.server-icon.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.server-icon.suspended-owner {
  opacity: 0.52;
  filter: grayscale(0.6) saturate(0.75);
}

/* channel list moved to left side-panel in server view */

.channel-category-title {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.8px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
}

.channel-item-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.channel-item-prefix {
  color: inherit;
  flex: 0 0 auto;
}

.channel-item-name {
  color: inherit;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-item-unread-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f04747;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.channel-item-unread-badge[hidden] {
  display: none !important;
}

.channel-item.active,
.channel-item:hover {
  background: #2b2d33;
  color: var(--text);
}

.channel-item.has-unread .channel-item-name,
.channel-item.has-unread .channel-item-prefix {
  color: #ffffff;
}

.channel-item.is-hold-pending {
  outline: 1px solid rgba(88, 101, 242, 0.55);
}

.channel-item.is-drag-source {
  opacity: 0.32;
}

.channel-category.is-drop-target {
  background: rgba(88, 101, 242, 0.13);
  border-radius: 10px;
}

.channel-category.is-drop-target .channel-category-title {
  color: #aeb8ff;
}

.channel-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12000;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #2b2f3a;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

.chat-panel {
  padding: 24px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 20px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chat-messages {
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
}

.chat-unread-separator {
  position: relative;
  width: 100%;
  border-top: 1px solid #ed4245;
  margin: 4px 0 8px;
}

.chat-unread-separator-label {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-50%);
  background: #ed4245;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 0 8px 8px 0;
}

.chat-unread-separator-label::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 8px solid #ed4245;
  border-left: 6px solid transparent;
}

.chat-messages,
.dm-messages,
.dm-profile,
.chat-reaction-picker-categories,
.chat-reaction-picker-emojis,
.chat-input-emoji-categories,
.chat-input-emoji-emojis,
.channel-settings-side,
.channel-settings-main,
.channel-settings-topic-editor textarea,
.server-settings-side,
.server-settings-main,
.server-role-editor-list,
.server-role-editor-main,
.chat-input textarea,
.chat-message-editor-input {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar,
.dm-messages::-webkit-scrollbar,
.dm-profile::-webkit-scrollbar,
.chat-reaction-picker-categories::-webkit-scrollbar,
.chat-reaction-picker-emojis::-webkit-scrollbar,
.chat-input-emoji-categories::-webkit-scrollbar,
.chat-input-emoji-emojis::-webkit-scrollbar,
.channel-settings-side::-webkit-scrollbar,
.channel-settings-main::-webkit-scrollbar,
.channel-settings-topic-editor textarea::-webkit-scrollbar,
.server-settings-side::-webkit-scrollbar,
.server-settings-main::-webkit-scrollbar,
.server-role-editor-list::-webkit-scrollbar,
.server-role-editor-main::-webkit-scrollbar,
.chat-input textarea::-webkit-scrollbar,
.chat-message-editor-input::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.chat-placeholder {
  text-align: center;
  color: var(--muted);
}

.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  padding-right: 156px;
  transition: background-color 120ms ease;
}

.chat-message.is-editing {
  padding-right: 0;
}

.chat-message:hover,
.chat-message:focus-within {
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px;
}

.chat-message-body {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.chat-message-actions {
  position: absolute;
  top: -12px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #1f232b;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  z-index: 3;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-message-action-btn {
  border: none;
  background: transparent;
  color: #a9b1c5;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.chat-message-action-btn:hover {
  background: #2b2f3a;
  color: #e9eefc;
}

.chat-more-menu {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6200;
  display: none;
}

.chat-more-menu.open {
  display: block;
}

.chat-more-menu-card {
  width: 306px;
  border-radius: 12px;
  background: #252832;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  padding: 8px;
}

.chat-more-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}

.chat-more-menu-item:hover {
  background: #323645;
}

.chat-more-menu-item.danger {
  color: #f47b7b;
}

.chat-more-menu-item.danger:hover {
  color: #ff9a9a;
  background: rgba(240, 71, 71, 0.16);
}

.chat-more-menu-icon {
  color: #b0b6c8;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.chat-more-menu-item.danger .chat-more-menu-icon {
  color: inherit;
}

.chat-more-menu-sep {
  height: 1px;
  margin: 8px 4px;
  background: rgba(255, 255, 255, 0.08);
}

.chat-report-modal {
  position: fixed;
  inset: 0;
  z-index: 6800;
  background: rgba(0, 0, 0, 0.64);
  display: none;
  place-items: center;
  padding: 18px;
}

.chat-report-modal.open {
  display: grid;
}

.chat-report-modal-card {
  width: min(560px, 96vw);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  background: #242730;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.55);
  padding: 20px;
  position: relative;
}

.chat-report-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: #a9b0c2;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.chat-report-close:hover {
  color: #f5f7ff;
  background: rgba(255, 255, 255, 0.08);
}

.chat-report-screen {
  display: grid;
  gap: 14px;
}

.chat-report-screen[hidden] {
  display: none !important;
}

.chat-report-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.06;
}

.chat-report-subtitle {
  margin: 0;
  color: #c9cfdd;
  line-height: 1.36;
  font-size: 18px;
}

.chat-report-selected-wrap {
  display: grid;
  gap: 8px;
}

.chat-report-selected-label {
  color: #b7bdd0;
  font-size: 15px;
  font-weight: 700;
}

.chat-report-selected-message {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #22252f;
  padding: 10px;
}

.chat-report-selected-message .avatar {
  width: 42px;
  height: 42px;
}

.chat-report-selected-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-report-selected-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.chat-report-selected-author {
  color: #f5f7ff;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chat-report-selected-time {
  color: #9da6bd;
  font-size: 12px;
}

.chat-report-selected-body {
  color: #d4d9e8;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-report-reason-list {
  display: grid;
  gap: 6px;
}

.chat-report-reason-item {
  width: 100%;
  border: none;
  background: #2a2d37;
  color: #edf1ff;
  border-radius: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.chat-report-reason-item:hover {
  background: #333747;
}

.chat-report-reason-arrow {
  color: #b7bfd8;
  font-size: 24px;
  line-height: 1;
}

.chat-report-success-box {
  display: grid;
  gap: 10px;
  background: #2a2d37;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
}

.chat-report-success-heading {
  font-size: 18px;
  font-weight: 700;
}

.chat-report-success-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chat-report-success-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-report-success-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: #f2f5ff;
  overflow-wrap: anywhere;
}

.chat-report-success-subtitle {
  color: #b8c0d8;
  font-size: 14px;
  line-height: 1.28;
}

@media (max-width: 680px) {
  .chat-report-modal {
    padding: 10px;
  }

  .chat-report-modal-card {
    width: min(560px, 100%);
    max-height: 92vh;
    padding: 16px;
  }

  .chat-report-title {
    font-size: 34px;
  }

  .chat-report-subtitle {
    font-size: 16px;
  }

  .chat-report-reason-item {
    font-size: 16px;
    padding: 12px;
  }
}

.chat-message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-author-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-message-author {
  font-weight: 700;
  color: var(--text);
}

.chat-author-server-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: rgba(88, 101, 242, 0.22);
  color: #e9edff;
  border: 1px solid rgba(88, 101, 242, 0.58);
}

.chat-author-server-tag-badge {
  font-size: 12px;
  line-height: 1;
}

.chat-author-server-tag-text {
  letter-spacing: 0.2px;
}

.chat-message-role-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  flex: 0 0 auto;
  transform: translateY(1px);
}

.chat-message-role-icon[hidden] {
  display: none !important;
}

.chat-message-time {
  color: var(--muted);
  font-size: 11px;
}

.chat-message-text {
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.chat-message-text:empty {
  display: none;
}

.chat-message-attachment {
  margin-top: 8px;
}

.chat-message-image {
  display: block;
  width: auto;
  max-width: min(700px, 100%);
  max-height: 520px;
  object-fit: cover;
  border-radius: 12px;
  background: #1f222b;
}

.chat-message-editor {
  margin-top: 8px;
  width: 100%;
}

.chat-message-editor-input-wrap {
  position: relative;
  width: 100%;
}

.chat-message-editor-input {
  width: 100%;
  min-height: 42px;
  max-height: 180px;
  resize: none;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #252832;
  color: #eef1fa;
  padding: 11px 44px 11px 14px;
  outline: none;
  font: inherit;
  line-height: 1.42;
  overflow-y: auto;
}

.chat-message-editor-input:focus {
  border-color: rgba(88, 101, 242, 0.85);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.chat-message-editor-emoji-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #aab2c9;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: default;
  pointer-events: none;
}

.chat-message-editor-hint {
  margin-top: 8px;
  font-size: 13px;
  color: #b8bfd3;
}

.chat-message-editor-hint strong {
  color: #6fa2ff;
  font-weight: 700;
}

.chat-message-text strong {
  font-weight: 700;
}

.chat-message-text em {
  font-style: italic;
}

.chat-message-text s {
  text-decoration: line-through;
}

.chat-md-quote {
  margin: 2px 0;
  padding-left: 10px;
  border-left: 3px solid #8089a5;
  color: #d6dcef;
}

.chat-md-code {
  display: inline-block;
  font-family: Consolas, 'Courier New', monospace;
  background: #2c3140;
  color: #edf3ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 1px 6px;
}

.chat-md-codeblock {
  margin: 3px 0;
  padding: 7px 10px;
  background: #222734;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #eef2ff;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-md-spoiler {
  display: inline-block;
  border-radius: 5px;
  background: #2f3442;
  color: transparent;
  padding: 0 6px;
  cursor: pointer;
  user-select: none;
}

.chat-md-spoiler.revealed {
  color: #e6ebf8;
}

.chat-md-color {
  display: inline;
}

.chat-message-reactions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-message-reactions[hidden] {
  display: none !important;
}

.chat-reaction-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: #2a2d37;
  color: #d8deef;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.chat-reaction-chip:hover {
  background: #343846;
  border-color: rgba(255, 255, 255, 0.24);
}

.chat-reaction-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.chat-reaction-chip.mine {
  background: rgba(88, 101, 242, 0.26);
  border-color: rgba(111, 133, 255, 0.9);
  color: #eef2ff;
}

.chat-reaction-chip.mine:hover {
  background: rgba(88, 101, 242, 0.34);
}

.chat-reaction-picker {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6400;
  display: none;
}

.chat-reaction-picker.open {
  display: block;
}

.chat-reaction-picker-card {
  width: min(460px, calc(100vw - 18px));
  height: min(320px, calc(100vh - 18px));
  max-height: min(320px, calc(100vh - 18px));
  min-height: 220px;
  border-radius: 12px;
  background: #252832;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  overflow: hidden;
}

.chat-reaction-picker-categories {
  padding: 8px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overscroll-behavior: contain;
}

.chat-reaction-category-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #d7ddf0;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 20px;
  cursor: pointer;
}

.chat-reaction-category-btn:hover {
  background: #303543;
}

.chat-reaction-category-btn.active {
  background: #3c4152;
  color: #ffffff;
}

.chat-reaction-category-icon {
  line-height: 1;
  display: inline-block;
}

.chat-reaction-category-image {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.chat-reaction-picker-emojis {
  padding: 8px;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 8px;
}

.chat-reaction-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.chat-reaction-emoji-btn {
  border: none;
  border-radius: 8px;
  background: #2d313d;
  min-height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 4px;
}

.chat-reaction-emoji-btn:hover {
  background: #3a3f4f;
}

.chat-reaction-emoji-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.chat-reaction-empty {
  color: #99a2be;
  padding: 8px;
  font-size: 13px;
}

@media (max-width: 760px) {
  .chat-reaction-picker-card {
    width: min(420px, calc(100vw - 14px));
    height: min(300px, calc(100vh - 14px));
    max-height: min(300px, calc(100vh - 14px));
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .chat-reaction-emoji-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .chat-reaction-picker-card {
    width: calc(100vw - 10px);
    height: min(280px, calc(100vh - 10px));
    max-height: min(280px, calc(100vh - 10px));
    border-radius: 10px;
  }

  .chat-reaction-emoji-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .chat-reaction-emoji-btn {
    min-height: 34px;
    border-radius: 7px;
  }

  .chat-reaction-emoji-btn img {
    width: 21px;
    height: 21px;
  }
}

.chat-input {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #2b2d33;
  border-radius: 10px;
  padding: 10px 14px;
}

.chat-slowmode-notice {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin: 0 2px 3px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #aeb5c9;
  font-size: 13px;
  line-height: 1;
  text-align: right;
}

.chat-slowmode-notice[hidden] {
  display: none !important;
}

.chat-slowmode-notice-icon {
  color: #9da6bc;
  font-size: 11px;
  line-height: 1;
}

.chat-slowmode-notice-text {
  color: inherit;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.2px;
}

.chat-input-add {
  border: none;
  background: transparent;
  color: #b3b9c8;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px 8px;
  user-select: none;
  cursor: default;
}

button.chat-input-add {
  cursor: pointer;
}

.chat-input-add:hover {
  color: #e2e6f2;
}

.chat-input-upload-input {
  display: none !important;
}

.chat-composer-toolbar {
  position: absolute;
  left: 16px;
  top: -46px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: #171a22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  z-index: 60;
}

.chat-composer-toolbar[hidden] {
  display: none !important;
}

.chat-composer-tool-btn {
  width: 34px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e5e9f4;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-composer-tool-btn:hover {
  background: #2b2f3a;
}

.chat-composer-tool-btn strong,
.chat-composer-tool-btn em {
  font-size: 26px;
  line-height: 1;
  pointer-events: none;
}

.chat-composer-tool-btn em {
  font-style: italic;
  font-weight: 600;
}

.chat-composer-tool-btn .tool-strike {
  text-decoration: line-through;
  font-size: 26px;
  line-height: 1;
  pointer-events: none;
}

.chat-composer-tool-btn .tool-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5f6d 0%, #ffc371 32%, #7bff5e 64%, #4ea5ff 100%);
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.chat-composer-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chat-input input,
.chat-input textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font: inherit;
}

.chat-input textarea {
  min-height: 22px;
  max-height: 160px;
  resize: none;
  line-height: 1.4;
  overflow-y: auto;
  padding: 6px 0;
}

.chat-input input::placeholder,
.chat-input textarea::placeholder {
  color: #7f8699;
}

.chat-input-emoji-btn {
  border: none;
  background: #3a3f4c;
  color: #c2c8d8;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  flex: 0 0 auto;
  margin-bottom: 2px;
}

.chat-input-emoji-btn:hover {
  background: #474d5d;
  color: #e1e5ef;
}

.chat-input-emoji-picker {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 8px);
  width: min(420px, calc(100vw - 80px));
  height: min(280px, calc(100vh - 140px));
  max-height: min(280px, calc(100vh - 140px));
  overflow: hidden;
  background: #1f222b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  padding: 0;
  z-index: 45;
}

.chat-input-emoji-picker.channel-settings-emoji-picker {
  position: fixed;
  right: auto;
  bottom: auto;
  z-index: 7305;
}

.chat-input-emoji-picker[hidden] {
  display: none !important;
}

.chat-input-emoji-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.chat-input-emoji-categories {
  padding: 8px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overscroll-behavior: contain;
}

.chat-input-emoji-categories .chat-reaction-category-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
}

.chat-input-emoji-emojis {
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.chat-input-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.chat-input-emoji-item {
  border: none;
  background: #2d313d;
  border-radius: 8px;
  min-height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 4px;
}

.chat-input-emoji-item:hover {
  background: #3a3f4f;
}

.chat-input-emoji-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.chat-inline-emoji {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: -4px;
  margin: 0 1px;
}

.member-panel {
  background: #1f2126;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 12px;
  min-height: 0;
  overflow: hidden;
}

.member-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.member-list {
  display: grid;
  gap: 2px;
}

.member-group {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.member-group-title {
  color: #9da6c2;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.8px;
  margin: 2px 0 6px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.member-item-name {
  color: var(--text);
}

.member-item-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.member-server-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: rgba(88, 101, 242, 0.22);
  color: #e9edff;
  border: 1px solid rgba(88, 101, 242, 0.58);
}

.member-server-tag-pill-badge {
  font-size: 12px;
  line-height: 1;
}

.member-server-tag-pill-text {
  letter-spacing: 0.2px;
}

.member-owner-crown {
  color: #f7b500;
  margin-left: 6px;
  font-size: 14px;
}

.member-item.context-enabled {
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -8px 8px;
  cursor: context-menu;
}

.member-item.context-enabled:hover {
  background: #2a2d38;
}

.server-side-header {
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  height: 56px;
}

.server-side-list {
  padding: 14px 10px;
  overflow: hidden;
}

.server-side-header.is-locked,
.server-side-list.is-locked {
  filter: blur(3.2px) grayscale(0.35);
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 1100px) {
  .server-body {
    grid-template-columns: 1fr;
  }
  .member-panel {
    display: none;
  }
  .server-shell.is-locked .server-lock-overlay {
    right: 0;
  }
}

@media (max-width: 860px) {
  .server-body {
    grid-template-columns: 1fr;
  }

  .chat-message {
    padding-right: 0;
  }

  .dm-message.chat-message {
    padding-right: 0;
  }

  .chat-message-actions {
    top: auto;
    right: auto;
    position: static;
    margin-left: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 4px;
  }

  .dm-message.chat-message .chat-message-actions {
    top: auto;
    right: auto;
    position: static;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 9999;
}

.modal.open {
  display: grid;
}

.member-profile-modal {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  padding: 0;
  z-index: 10030;
}

.member-profile-modal.open {
  display: block;
}

.member-profile-card {
  position: absolute;
  width: min(320px, calc(100vw - 16px));
  border-radius: 14px;
  overflow: hidden;
  background: #22252f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.44);
}

.member-profile-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: rgba(20, 22, 29, 0.58);
  color: #f4f6ff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.member-profile-close:hover {
  background: rgba(20, 22, 29, 0.82);
}

.member-profile-banner {
  height: 84px;
  background: linear-gradient(135deg, #f04747, #df3e7d);
}

.member-profile-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid #22252f;
  background: #171921;
  overflow: hidden;
  position: absolute;
  top: 44px;
  left: 14px;
}

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

.member-profile-body {
  padding: 38px 14px 14px;
  display: grid;
  gap: 6px;
}

.member-profile-username-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.member-profile-name {
  font-size: 22px;
  line-height: 1.08;
  font-weight: 700;
  color: #f8f9ff;
  overflow-wrap: anywhere;
}

.member-profile-user-verified-badge {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.member-profile-user-verified-badge[hidden] {
  display: none !important;
}

.member-profile-server-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid rgba(115, 145, 255, 0.45);
  background: rgba(88, 101, 242, 0.2);
  color: #eff3ff;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.member-profile-server-tag[hidden] {
  display: none !important;
}

.member-profile-server-tag-badge {
  font-size: 12px;
  line-height: 1;
}

.member-profile-server-tag-text {
  line-height: 1;
}

.member-profile-duty-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 183, 77, 0.5);
  background: rgba(255, 167, 38, 0.18);
  color: #ffe8c7;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.member-profile-duty-pill[hidden] {
  display: none !important;
}

.member-profile-duty-pill-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.member-profile-duty-pill-icon.is-image {
  font-size: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 3px;
}

.member-profile-duty-pill-text {
  line-height: 1;
}

.member-profile-username {
  font-size: 14px;
  color: #c4c9de;
  overflow-wrap: anywhere;
}

.member-profile-roles-title {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #969eb8;
  text-transform: uppercase;
}

.member-profile-roles {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-profile-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1c1f28;
  color: #f2f4ff;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 600;
}

.member-profile-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--role-color, #9aa9b7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.member-profile-role-empty {
  color: #97a0bd;
  font-size: 13px;
}

.modal-card {
  width: min(520px, 100%);
  background: #2b2d33;
  border-radius: 14px;
  padding: 28px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.modal-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.4;
}

.modal-action {
  width: 100%;
  background: #23252b;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: left;
  cursor: pointer;
}

.modal-action:hover {
  background: #2f3138;
}

.upload-circle {
  width: 110px;
  height: 110px;
  margin: 8px auto 16px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  position: relative;
}

.upload-circle input {
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.upload-circle label {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 6px;
}

.upload-circle span {
  font-size: 12px;
  letter-spacing: 1px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.create-modal-card {
  width: min(620px, 96vw);
  background: #252832;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px 26px;
}

.create-modal-title {
  margin: 0 0 18px;
  font-size: 36px;
  line-height: 1.15;
}

.create-field {
  margin-bottom: 14px;
}

.create-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.create-type-list {
  display: grid;
  gap: 10px;
}

.create-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1f212a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.create-type-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.create-modal-card input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(88, 101, 242, 0.8);
  background: #1f212a;
  color: var(--text);
  padding: 12px 14px;
  font-size: 18px;
}

.create-channel-name-input-wrap {
  position: relative;
}

.create-channel-name-input-wrap input[type="text"] {
  padding-right: 52px;
}

.create-channel-emoji-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  margin-bottom: 0;
  z-index: 2;
}

.create-channel-emoji-picker {
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 80;
}

.create-note {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 14px;
}

.create-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn.secondary {
  background: #2f323c;
}

.btn.secondary:hover {
  background: #3a3e4a;
}

@media (max-width: 760px) {
  .create-modal-card {
    padding: 18px 16px;
  }
  .create-modal-title {
    font-size: 26px;
  }
  .create-actions {
    grid-template-columns: 1fr;
  }
  .create-channel-emoji-picker {
    width: min(420px, calc(100vw - 44px));
  }
  .member-profile-name {
    font-size: 20px;
  }
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 16px;
}

.settings-card {
  width: min(980px, 96vw);
  height: min(720px, 92vh);
  padding: 0;
  overflow: hidden;
}

.settings-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
}

.settings-side {
  background: #1f2126;
  padding: 18px 14px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.settings-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-name {
  font-weight: 700;
}

.settings-tag {
  color: var(--muted);
  font-size: 12px;
}

.settings-search input {
  width: 100%;
  background: #2a2c33;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
}

.settings-menu {
  display: grid;
  gap: 6px;
  overflow-y: auto;
}

.settings-section {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 6px 0 4px;
}

.settings-item {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.settings-item.active,
.settings-item:hover {
  background: #2b2d33;
  color: var(--text);
}

.settings-main {
  background: #20222a;
  padding: 20px 24px;
  overflow-y: auto;
}

.settings-header h2 {
  margin: 0 0 16px;
}

.settings-profile-card {
  background: #23252b;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.settings-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.avatar-edit {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-edit input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-edit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.settings-fields {
  display: grid;
  gap: 10px;
}

.settings-badge-block {
  background: #1f2126;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.settings-badge-title {
  font-size: 14px;
  font-weight: 700;
}

.settings-badge-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-field {
  display: grid;
  gap: 6px;
  background: #1f2126;
  padding: 10px 12px;
  border-radius: 8px;
}

.settings-field input,
.settings-field select {
  width: 100%;
  background: #2a2c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
}

.settings-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.settings-field input:focus,
.settings-field select:focus {
  outline: none;
  border-color: rgba(88, 101, 242, 0.75);
}

@media (max-width: 860px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }
  .settings-side {
    display: none;
  }
}

@media (max-width: 1180px) {
  .channel-settings-wrap {
    grid-template-columns: 250px minmax(0, 1fr) 74px;
  }
  .channel-settings-side-item {
    font-size: 14px;
  }
  .channel-settings-side-category {
    font-size: 12px;
  }
  .channel-settings-head h2,
  .channel-settings-field > span,
  .channel-settings-name-wrap input,
  .channel-settings-field select,
  .channel-settings-toggle-row strong {
    font-size: 18px;
  }
  .channel-settings-topic-editor textarea,
  .channel-settings-toggle-row p {
    font-size: 16px;
  }
  .channel-settings-head p,
  .channel-settings-field small {
    font-size: 13px;
  }
  .channel-settings-topic-count {
    font-size: 16px;
  }

  .server-settings-wrap {
    grid-template-columns: 250px minmax(0, 1fr) 74px;
  }
  .server-settings-wrap.is-emojis-view {
    grid-template-columns: 250px minmax(0, 1fr) 74px;
  }
  .server-settings-wrap.is-roles-view {
    grid-template-columns: 250px minmax(0, 1fr) 74px;
  }
  .server-settings-wrap.is-tag-view {
    grid-template-columns: 250px minmax(0, 1fr) 74px;
  }
  .server-settings-wrap.is-role-editor-view {
    grid-template-columns: minmax(0, 1fr) 74px;
  }
  .server-settings-preview {
    display: grid;
    padding-left: 8px;
    padding-right: 8px;
    border-left-color: rgba(255, 255, 255, 0.04);
  }
  .server-settings-card-preview {
    display: none;
  }
  .server-tag-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .server-tag-preview {
    max-width: 560px;
  }
}

@media (max-width: 860px) {
  .channel-settings-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-settings-side {
    display: none;
  }
  .channel-settings-main {
    padding: 18px 14px 24px;
  }
  .channel-settings-close-pane {
    position: fixed;
    top: 10px;
    right: 10px;
    border-left: none;
    padding-top: 0;
  }
  .channel-settings-head h2 {
    font-size: 24px;
  }
  .channel-settings-head p {
    font-size: 14px;
  }
  .channel-settings-field > span {
    font-size: 16px;
  }
  .channel-settings-name-wrap input,
  .channel-settings-field select {
    font-size: 18px;
  }
  .channel-settings-topic-editor textarea {
    min-height: 180px;
    font-size: 16px;
  }
  .channel-settings-topic-count {
    font-size: 14px;
  }
  .channel-settings-toggle-row strong {
    font-size: 18px;
  }
  .channel-settings-toggle-row p,
  .channel-settings-field small {
    font-size: 14px;
  }

  .server-settings-modal {
    padding: 0;
  }
  .server-settings-wrap {
    width: 100%;
    height: 100%;
    border-radius: 0;
    grid-template-columns: 1fr;
  }
  .server-settings-wrap.is-roles-view {
    grid-template-columns: 1fr;
  }
  .server-settings-wrap.is-emojis-view {
    grid-template-columns: 1fr;
  }
  .server-settings-wrap.is-tag-view {
    grid-template-columns: 1fr;
  }
  .server-settings-wrap.is-role-editor-view {
    grid-template-columns: 1fr;
  }
  .server-settings-side {
    display: none;
  }
  .server-settings-main {
    padding: 18px 14px 24px;
  }
  .server-settings-preview {
    display: grid;
    position: fixed;
    top: 10px;
    right: 10px;
    border-left: none;
    padding: 0;
    gap: 0;
  }
  .server-settings-card-preview {
    display: none;
  }
  .server-settings-head h2 {
    font-size: 24px;
  }
  .server-settings-block h3 {
    font-size: 19px;
  }
  .server-settings-field input {
    font-size: 18px;
  }
  .server-tag-head h2 {
    font-size: 24px;
  }
  .server-tag-field > span,
  .server-tag-badges-wrap > span {
    font-size: 15px;
  }
  .server-tag-input-wrap {
    min-height: 62px;
    padding-left: 54px;
    padding-right: 74px;
  }
  .server-tag-input-badge {
    left: 16px;
    font-size: 22px;
  }
  .server-tag-input-wrap input {
    font-size: 28px;
  }
  .server-tag-badges {
    grid-template-columns: repeat(5, minmax(0, 50px));
  }
  .server-tag-badges button {
    width: 50px;
    height: 50px;
  }
  .server-tag-preview-card {
    padding: 12px;
  }
  .server-tag-preview-row strong {
    font-size: 16px;
  }
  .server-roles-toolbar {
    grid-template-columns: 1fr;
  }
  .server-roles-table-head {
    grid-template-columns: minmax(0, 1fr) 80px 96px;
    gap: 8px;
    font-size: 12px;
  }
  .server-role-row {
    grid-template-columns: minmax(0, 1fr) 80px 96px;
    gap: 8px;
  }
  .server-role-name span:last-child {
    font-size: 16px;
  }
  .server-role-action {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .server-role-editor-layout {
    grid-template-columns: 1fr;
  }
  .server-role-editor-side {
    display: none;
  }
  .server-role-editor-main {
    padding: 14px 12px 18px;
  }
  .server-role-editor-head h2 {
    font-size: 20px;
  }
  .server-role-editor-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .server-role-editor-field input {
    font-size: 20px;
  }
  .server-role-style-grid {
    grid-template-columns: 1fr;
  }
  .server-role-style-upgrade {
    grid-template-columns: 1fr;
  }
  .server-role-style-upgrade strong {
    font-size: 18px;
  }
  .server-role-color-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .server-role-icon-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .server-emojis-head h2 {
    font-size: 24px;
  }
  .server-emojis-section-head h3 {
    font-size: 24px;
  }
  .server-emojis-section-head small {
    font-size: 15px;
  }
  .server-emojis-table-head,
  .server-emojis-row {
    grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr) 52px;
    gap: 10px;
  }
  .server-emojis-table-head {
    font-size: 12px;
  }
  .server-emojis-name {
    font-size: 15px;
  }
  .server-emojis-uploader {
    font-size: 13px;
  }
  .server-emojis-uploader img {
    width: 22px;
    height: 22px;
  }
  .server-emojis-delete {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .server-role-preview-row {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 10px 10px;
  }
  .server-role-toggle-item {
    align-items: flex-start;
  }
  .server-role-toggle-item strong {
    font-size: 15px;
  }
  .server-role-permission-search input {
    font-size: 16px;
  }
  .server-role-permission-item {
    align-items: flex-start;
  }
  .server-role-permission-item strong {
    font-size: 15px;
  }
  .server-role-permission-item small {
    font-size: 13px;
  }
  .server-role-permission-group-head {
    align-items: flex-start;
  }
  .server-role-placeholder-panel h3 {
    font-size: 19px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 70px 1fr;
  }
  .side-panel {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .server-bar {
    display: none;
  }
}

@media (max-width: 860px) {
  .auth-card {
    grid-template-columns: 1fr;
  }
}
