:root {
  --bg: #313338;       /* chat area */
  --panel: #2b2d31;    /* channel/DM list + member list */
  --rail: #1e1f22;     /* far-left server rail, inputs */
  --userbar: #232428;
  --input: #383a40;
  --hover: #35373c;
  --active: #404249;
  --text: #dbdee1;
  --head: #f2f3f5;
  --muted: #949ba4;
  --accent: #5865f2;   /* change this one line to recolor buttons */
  --accent-hover: #4752c4;
  --ok: #23a55a;
  --bad: #f23f43;
  --divider: #3f4147;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.375 "gg sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
.hidden { display: none !important; }
button { font: inherit; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: 100%; max-width: 440px;
  background: var(--panel);
  border-radius: 8px; padding: 32px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.brand { margin: 0 0 20px; font-size: 30px; font-weight: 800; color: var(--head); text-align: center; }
h2 { margin: 0 0 16px; font-size: 22px; color: var(--head); text-align: center; }
.form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"] {
  background: var(--rail); color: var(--text);
  border: 0; border-radius: 4px;
  padding: 11px 12px; font: inherit; text-transform: none; font-weight: 400; letter-spacing: 0;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; }

.btn {
  background: var(--accent); color: #fff;
  border: 0; border-radius: 4px; padding: 11px 16px;
  font-weight: 500; cursor: pointer;
  transition: background .12s;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #4e5058; }
.btn.secondary:hover:not(:disabled) { background: #6d6f78; }
.btn.ghost { background: none; color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: none; text-decoration: underline; }
.btn.danger { background: var(--bad); }
.btn.danger:hover:not(:disabled) { background: #d83c3e; }
.btn.small { padding: 9px 16px; }

.switch { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }
.hint { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.error { color: var(--bad); font-size: 14px; margin: 0; }
.error:empty { display: none; }
.hint.bad { color: var(--bad); }
.hint.good { color: var(--ok); }

.banner { border-radius: 4px; padding: 10px 12px; margin-bottom: 16px; font-size: 14px; }
.banner.success { background: rgba(35, 165, 90, .15); color: #57d98a; border: 1px solid var(--ok); }
.banner.failure { background: rgba(242, 63, 67, .15); color: #ff8a8d; border: 1px solid var(--bad); }

.rules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.rules li { color: var(--muted); padding-left: 22px; position: relative; }
.rules li::before { content: "○"; position: absolute; left: 0; }
.rules li.ok { color: var(--ok); }
.rules li.ok::before { content: "✓"; }

/* ---------- shared bits ---------- */
.icon { display: inline-grid; place-items: center; line-height: 0; }
.icon svg { width: 1em; height: 1em; }
.icon-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 4px; font-size: 20px;
  display: inline-grid; place-items: center; flex: none; padding: 0;
}
.icon-btn:hover { color: var(--head); background: var(--hover); }

.avatar {
  position: relative; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 18px; user-select: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.lg { width: 80px; height: 80px; font-size: 36px; }
.avatar .initial { line-height: 1; }
.avatar.has-img { background-size: cover; background-position: center; }
.avatar.has-img .initial { display: none; }
.avatar.xl { width: 96px; height: 96px; font-size: 40px; }
.avatar.clickable { cursor: pointer; }
.avatar .dot {
  position: absolute; right: -3px; bottom: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); border: 3px solid var(--panel); box-sizing: content-box;
}
.avatar .dot.idle { background: #f0b232; }
.avatar .dot.dnd { background: var(--bad); }
.avatar .dot.offline { background: #80848e; }
.avatar.xl .dot { width: 16px; height: 16px; right: 0; bottom: 0; border-width: 5px; }

.pill {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* ---------- app layout ---------- */
.app { height: 100%; display: grid; grid-template-columns: 72px 240px minmax(0, 1fr) 240px; }
.app.no-members { grid-template-columns: 72px 240px minmax(0, 1fr); }
.app.no-members .members { display: none; }

/* far-left rail */
.rail {
  background: var(--rail); display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 8px; overflow-y: auto; overflow-x: hidden; min-height: 0;
}
.rail::-webkit-scrollbar { width: 0; }
.rail-servers { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--divider); flex: none; }
.rail-btn {
  position: relative; flex: none;
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--head); cursor: pointer;
  display: grid; place-items: center; padding: 0;
  font-size: 17px; font-weight: 600; line-height: 1;
  transition: border-radius .15s, background .15s, color .15s;
}
.rail-btn::before {
  content: ""; position: absolute; left: -12px; top: 50%;
  width: 4px; height: 0; border-radius: 0 4px 4px 0; background: #fff;
  transform: translateY(-50%); transition: height .15s;
}
.rail-btn:hover { border-radius: 16px; }
.rail-btn:hover::before { height: 20px; }
.rail-btn.unread::before { height: 8px; }
.rail-btn.active { border-radius: 16px; }
.rail-btn.active::before { height: 40px; }
.rail-btn.home { font-size: 26px; color: var(--text); }
.rail-btn.home:hover, .rail-btn.home.active { background: var(--accent); color: #fff; }
.rail-btn.add { font-size: 24px; color: var(--ok); }
.rail-btn.add:hover { background: var(--ok); color: #fff; }
.rail-btn .badge {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-sizing: content-box; border: 3px solid var(--rail);
}

/* middle sidebar */
.sidebar { background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.sidebar-head, .chat-head {
  height: 48px; flex: none; padding: 0 12px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-weight: 700; color: var(--head);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 1.5px 0 rgba(0, 0, 0, .06);
}
.sidebar-head { padding-right: 8px; }
.head-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-menu {
  flex: 1; min-width: 0; height: 100%; margin: 0 -8px 0 -16px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: 0; color: var(--head); font-weight: 700; cursor: pointer; text-align: left;
}
.head-menu:hover { background: var(--hover); }
.head-menu .icon { font-size: 16px; }

.sidebar-body { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 4px 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; color: var(--muted);
}
.side-label .icon-btn { width: 20px; height: 20px; font-size: 16px; }
.side-empty { color: var(--muted); font-size: 14px; padding: 8px; margin: 0; }

.item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; margin-bottom: 2px; border-radius: 4px; border: 0;
  background: none; color: var(--muted); font-weight: 500; text-align: left; cursor: pointer;
}
.item:hover { background: var(--hover); color: #c4c9ce; }
.item.active { background: var(--active); color: var(--head); }
.item.unread { color: var(--head); font-weight: 700; }
.item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .hash { font-size: 20px; line-height: 1; opacity: .7; width: 16px; text-align: center; flex: none; }
.item .x { display: none; width: 20px; height: 20px; font-size: 14px; }
.item:hover .x, .item:focus-within .x { display: inline-grid; }

.me { height: 52px; flex: none; padding: 0 8px 0 4px; background: var(--userbar); display: flex; align-items: center; gap: 4px; }
.me .avatar .dot { border-color: var(--userbar); }
.me-btn {
  flex: 1; min-width: 0; height: 40px; padding: 0 6px; border: 0; border-radius: 4px; background: none;
  display: flex; align-items: center; gap: 8px; text-align: left; color: inherit; cursor: pointer;
}
.me-btn:hover { background: var(--hover); }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.me-name { font-weight: 600; font-size: 14px; color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-status { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* conversation */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }
.chat-head { justify-content: flex-start; }
.chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.chat-title .hash { font-size: 24px; font-weight: 400; color: var(--muted); line-height: 1; }
.conn { font-size: 12px; font-weight: 400; color: var(--muted); flex: none; }
.conn.live { color: var(--ok); }

.messages { flex: 1; overflow-y: auto; padding: 8px 0 16px; display: flex; flex-direction: column; min-height: 0; }
.intro { padding: 16px 16px 8px; }
.intro h2 { text-align: left; font-size: 28px; margin: 8px 0 4px; }
.intro p { margin: 0; color: var(--muted); }
.intro strong { color: var(--text); }
.day {
  display: flex; align-items: center; gap: 12px; margin: 18px 16px 6px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--divider); }

.msg { position: relative; padding: 2px 48px 2px 72px; }
.msg:hover { background: rgba(2, 2, 2, .07); }
.msg.first { margin-top: 17px; min-height: 44px; }
.msg.first .avatar { position: absolute; left: 16px; top: 4px; }
.msg .avatar .dot { display: none; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; }
.msg-author { font-weight: 500; color: var(--head); background: none; border: 0; padding: 0; cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 12px; color: var(--muted); }
.msg-body { overflow-wrap: anywhere; }

.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center; color: var(--muted);
}
.empty-state .big-icon { font-size: 64px; color: var(--muted); opacity: .6; }
.empty-state h2 { margin: 0; }
.empty-state p { margin: 0; max-width: 360px; }
.empty-state .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.composer {
  flex: none; margin: 0 16px 8px; display: flex; align-items: flex-end;
  background: var(--input); border-radius: 8px;
}
.composer:focus-within { box-shadow: 0 0 0 1px var(--accent); }
.composer textarea {
  flex: 1; resize: none; background: none; border: 0; outline: none; color: var(--text);
  padding: 12px 8px 12px 16px; font: inherit; line-height: 1.375; max-height: 160px; overflow-y: auto;
}
.composer textarea::placeholder { color: var(--muted); }
.send { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 14px; height: 46px; font-size: 20px; display: grid; place-items: center; }
.send:hover { color: var(--head); }
.chat-error { padding: 0 16px 12px; margin: 0; min-height: 20px; }
.chat-error:empty { display: block; min-height: 20px; }

/* members */
.members { background: var(--panel); padding: 8px 8px 0; overflow-y: auto; min-height: 0; }
.member {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; margin-bottom: 1px;
  border: 0; border-radius: 4px; background: none; color: #c4c9ce; font-weight: 500; text-align: left; cursor: pointer;
}
.member:hover { background: var(--hover); color: var(--head); }
.member.offline { opacity: .5; }
.member .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  background: var(--accent); color: #fff; border-radius: 3px; padding: 1px 5px;
}

/* ---------- modals ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7);
  display: grid; place-items: center; padding: 16px;
}
.modal {
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  background: var(--bg); border-radius: 8px; padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.modal h2 { margin-bottom: 8px; }
.modal .sub { margin: 0 0 16px; text-align: center; color: var(--muted); font-size: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal input[type="text"] { background: var(--rail); }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 10px; padding: 14px;
  border: 1px solid #4a4c52; border-radius: 8px; background: none; color: var(--head); text-align: left; cursor: pointer;
}
.choice:hover { background: var(--hover); border-color: #5c5f66; }
.choice > .icon:first-child { font-size: 28px; color: var(--accent); }
.choice > .icon:last-child { font-size: 18px; color: var(--muted); transform: rotate(-90deg); margin-left: auto; }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-text span { color: var(--muted); font-size: 13px; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code {
  flex: 1; min-width: 0; background: var(--rail); border-radius: 4px; padding: 10px 12px;
  font: 600 18px/1.4 ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .12em;
  color: var(--head); user-select: all; text-transform: none;
}
.menu-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

@media (max-width: 1000px) {
  .app, .app.no-members { grid-template-columns: 72px 220px minmax(0, 1fr); }
  .members { display: none; }
}
@media (max-width: 640px) {
  .app, .app.no-members { grid-template-columns: 56px 150px minmax(0, 1fr); }
  .msg { padding: 2px 12px 2px 64px; }
  .msg.first .avatar { left: 12px; }
}

/* ---------- member rows with custom status, header user button ---------- */
.member .grow { display: flex; flex-direction: column; line-height: 1.2; }
.member .sub { font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.chat-user { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 4px 8px; margin: 0 -8px; border-radius: 4px; color: var(--head); font-weight: 700; cursor: pointer; }
.chat-user:hover { background: var(--hover); }

/* ---------- profile card / pop-out ---------- */
.pop-backdrop { position: fixed; inset: 0; z-index: 50; }
.popout { position: fixed; width: 340px; max-width: calc(100vw - 24px); border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, .55); overflow: hidden; background: var(--panel); border: 1px solid var(--divider); }
.pcard { background: var(--panel); border-radius: 8px; overflow: hidden; text-align: left; }
.pc-banner { height: 90px; background-size: cover; background-position: center; }
.pc-avatar { margin: -44px 0 0 16px; width: 88px; height: 88px; position: relative; }
.pc-avatar .avatar { width: 88px; height: 88px; font-size: 38px; box-shadow: 0 0 0 6px var(--panel); }
.pc-avatar .dot { width: 18px; height: 18px; right: -2px; bottom: -2px; border: 5px solid var(--panel); }
.pc-body { padding: 10px 16px 16px; }
.pc-name { font-size: 20px; font-weight: 700; color: var(--head); overflow-wrap: anywhere; line-height: 1.2; }
.pc-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pc-pronouns { font-size: 14px; color: var(--text); margin-right: 4px; }
.pbadge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.pbadge .icon { width: 16px; height: 16px; }
.pbadge.owner { color: #f0b232; }
.pbadge.early { color: #5ee0b4; }
.pc-custom { margin-top: 8px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.pc-mutual { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.pc-mutual .icon { width: 16px; height: 16px; }
.pc-bio { margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--head); }
.pc-bio.empty { color: var(--muted); font-style: italic; }
.pc-since { margin-top: 12px; font-size: 12px; color: var(--muted); }
.pc-msg { width: 100%; margin-top: 14px; background: var(--rail); color: var(--text); border: 1px solid var(--divider); border-radius: 8px; padding: 11px 12px; font: inherit; }
.pc-msg:focus { outline: 2px solid var(--accent); }
.pc-edit { margin-top: 14px; width: 100%; }
.pc-body .error { margin-top: 6px; }
.pc-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 10px 0 4px; }

/* ---------- My Profile editor ---------- */
.modal.editor { max-width: 800px; }
.editor h2 { text-align: left; margin-bottom: 16px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.editor-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-preview { position: sticky; top: 0; }
.editor-preview .preview-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin-bottom: 8px; }
.editor-preview .pcard { border: 1px solid var(--divider); }
.editor textarea, .editor input[type="text"] {
  width: 100%; background: var(--rail); color: var(--text); border: 0; border-radius: 4px;
  padding: 10px 12px; font: inherit; font-weight: 400; text-transform: none; letter-spacing: 0;
}
.editor textarea { resize: vertical; min-height: 84px; line-height: 1.375; }
.editor textarea:focus, .editor input:focus { outline: 2px solid var(--accent); }
.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.count { font-size: 12px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; position: relative; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }
.swatch-custom { width: 32px; height: 32px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 4px; border: 1px solid #4a4c52;
  background: none; color: var(--text); font-weight: 500; cursor: pointer; text-align: left; text-transform: none; letter-spacing: 0;
}
.seg-btn:hover { background: var(--hover); }
.seg-btn[aria-pressed="true"] { border-color: var(--accent); background: rgba(88, 101, 242, .18); color: var(--head); }
.seg-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); flex: none; }
.seg-dot.idle { background: #f0b232; }
.seg-dot.dnd { background: var(--bad); }
.seg-dot.invisible { background: #80848e; }
.editor .actions { margin-top: 20px; }
@media (max-width: 760px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-preview { position: static; order: -1; }
}
.modal.editor { max-height: calc(100vh - 32px); overflow-y: auto; }
.swatch-custom::-webkit-color-swatch-wrapper { padding: 0; }
.swatch-custom::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch-custom::-moz-color-swatch { border: 0; border-radius: 50%; }

/* ---------- picture cropper (like Discord) ---------- */
.modal.cropper { max-width: 360px; }
.cropper h2 { text-align: center; }
.crop-stage { display: grid; place-items: center; margin: 4px 0 12px; }
.crop-canvas { width: 280px; height: 280px; border-radius: 8px; background: #1e1f22; cursor: grab; touch-action: none; max-width: 100%; }
.crop-canvas.grabbing { cursor: grabbing; }
.crop-zoom-row { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--muted); }
.crop-zoom { flex: 1; accent-color: var(--accent); }
.crop-small { font-size: 14px; } .crop-big { font-size: 22px; }

/* ---------- friends page ---------- */
.friends { flex: 1; overflow-y: auto; padding: 16px 24px 24px; min-height: 0; }
.chat-title .tabs { display: flex; align-items: center; gap: 6px; margin-left: 12px; padding-left: 14px; border-left: 1px solid var(--divider); }
.tab { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 500; padding: 3px 10px; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--hover); color: var(--head); }
.tab.active { background: rgba(255, 255, 255, .12); color: var(--head); }
.tab.add { background: var(--accent); color: #fff; }
.tab.add.active { background: transparent; color: #7cd99a; box-shadow: inset 0 0 0 1px #3ba55d; }
.tab .pill { position: static; margin: 0; }
.f-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 8px 0 8px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--divider); border-radius: 8px; cursor: pointer; }
.frow:hover { background: var(--hover); }
.f-text { flex: 1; min-width: 0; }
.f-name { background: none; border: 0; padding: 0; color: var(--head); font: inherit; font-weight: 600; cursor: pointer; }
.f-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn.round { width: 36px; height: 36px; border-radius: 50%; background: var(--rail); }
.icon-btn.round:hover { color: var(--head); }
.icon-btn.round.ok:hover { color: var(--ok); }
.icon-btn.more { width: 36px; height: 36px; border-radius: 50%; background: var(--rail); }
.f-empty { display: grid; justify-items: center; gap: 8px; padding: 64px 16px; color: var(--muted); text-align: center; }
.f-empty .icon { width: 64px; height: 64px; opacity: .5; }
.add-friend { max-width: 640px; }
.add-friend h2 { text-align: left; }
.add-friend .sub { text-align: left; margin: 0 0 14px; }
.add-row { display: flex; gap: 10px; }
.add-row input { flex: 1; background: var(--rail); color: var(--text); border: 1px solid var(--divider); border-radius: 8px; padding: 12px; font: inherit; }
.add-row input:focus { outline: 2px solid var(--accent); }
.friends .error { margin-top: 10px; }

/* ---------- menus ---------- */
.menu { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.popout .pc-body > .menu { margin: 8px -6px 0; padding: 0; }
.popout.menu-pop { width: 220px; }
.menu-item { background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 9px 10px; border-radius: 4px; cursor: pointer; }
.menu-item:hover:not(:disabled) { background: var(--accent); color: #fff; }
.menu-item.danger { color: var(--bad); }
.menu-item.danger:hover:not(:disabled) { background: var(--bad); color: #fff; }
.pc-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.pc-actions .btn { flex: 1; }
.pc-actions .icon-btn.more { flex: none; }
.pc-actions + .menu + .pc-msg, .pc-actions + .pc-msg { margin-top: 10px; }

/* ---------- hidden (blocked / ignored) messages ---------- */
.msg.hidden-msg { padding: 4px 16px 4px 72px; color: var(--muted); font-size: 14px; font-style: italic; display: flex; gap: 10px; align-items: baseline; }
.msg.hidden-msg .shown { font-style: normal; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.linkish { background: none; border: 0; padding: 0; color: #8ea1ff; font: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.composer textarea:disabled { cursor: not-allowed; opacity: .7; }

/* ---------- server dropdown menu ---------- */
.popout.server-menu { background: var(--bg); border-radius: 8px; }
.server-menu .menu { padding: 8px; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; }
.menu-item .icon { width: 18px; height: 18px; flex: none; }
.menu-item .mi-label { flex: 1; }
.menu-item.open { background: rgba(255, 255, 255, .06); }
.menu-sep { height: 1px; background: var(--divider); margin: 6px 4px; }
.menu.submenu { padding: 0 0 0 28px; }
.menu.submenu .menu-item { padding: 8px 10px; font-size: 14px; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--divider); }
.danger-zone .hint { margin: 0 0 10px; }
.info { display: flex; flex-direction: column; margin: 12px 0 4px; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--divider); }
.info-k { color: var(--muted); }
.info-v { color: var(--head); font-weight: 500; overflow-wrap: anywhere; text-align: right; }
.check-row { display: flex; gap: 12px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--text); cursor: pointer; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.check-row span { display: flex; flex-direction: column; gap: 2px; }

.pbadge.founder { color: #4aa3ff; background: rgba(74, 163, 255, .16); }
.rail-btn.has-icon { background-size: cover; background-position: center; }
.rail-btn.has-icon > span { display: none; }
.pbadge.developer { color: #8ea1ff; }
.pbadge.admin { color: #ff6b6b; }
.pbadge.moderator { color: #57d98a; }
.pbadge.bughunter { color: #f0b232; }
.pbadge.supporter { color: #ff7ac6; }
.pc-admin { width: 100%; margin-top: 10px; }
.crop-backdrop { z-index: 80; }
