/* =====================================================================
   Clean layout. Loaded last, after every other stylesheet.
   Desktop: one canvas, the deck on top, the sidebar and the main view
   as two rounded cards with a small gutter.
   Phones (<=760px): the channel header is the only top bar; the deck
   is hidden and only the avatar and the live voice pill float over it.
   Colours only change for the default dark theme so user themes keep working.
   ===================================================================== */

:root { --gap: 8px; --panel-r: 12px; --control-r: 8px; --deck-h: 52px; --tap: 40px; }
:root:not([data-theme]), :root[data-theme="dark"] {
  --bg: #0c0d10; --bg-1: #141519; --bg-2: #111215; --bg-3: #1b1c21;
  --bg-4: #23252b; --bg-hover: #1e1f24; --bg-active: #26282e;
  --line: #222429; --text: #ececef; --text-2: #a6a9b2; --muted: #74777f;
  --gold: #f0c04a; --gold-d: #d9a832; --gold-soft: rgba(240, 192, 74, .1);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ---------- shell ---------- */
:root:not(.fx-on) .app { background: var(--bg); }
.shell { gap: var(--gap); padding: 0 var(--gap) var(--gap); border-top: 0; }
.nav { width: 264px; }
.sidebar { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--panel-r); }
.main { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--panel-r); }

/* ---------- deck ---------- */
.deck { background: transparent; height: var(--deck-h); padding-inline: 12px; gap: 10px; }
.deck-brand { font-size: 15px; font-weight: 600; padding: 6px 8px 6px 4px; }
.deck-brand img { width: 24px; height: 24px; }
.deck-servers { gap: 6px; padding: 6px 4px 8px; }
.dtile-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-3); border-color: transparent; font-size: 12.5px; font-weight: 600; }
.dtile-btn:hover { transform: none; background: var(--bg-4); border-color: transparent; }
.dtile.active .dtile-btn { box-shadow: inset 0 0 0 1.5px var(--gold); border-color: transparent; }
.dtile.active::after { bottom: -7px; width: 14px; height: 2px; }
.dtile.home .dtile-btn { background: var(--gold-soft); border-color: transparent; }
.dtile.action .dtile-btn { border: 1px dashed var(--bg-active); background: transparent; }
.dtile-sep { height: 20px; }
.deck-search { height: 34px; width: 240px; border-radius: var(--control-r); background: var(--bg-2); border-color: var(--line); font-size: 13px; }
.deck-search kbd { background: transparent; }
.me-cluster { gap: 2px; }
.me-cluster .icon-btn { width: 34px; height: 34px; border-radius: var(--control-r); color: var(--text-2); }
.me-cluster .icon-btn:hover { background: var(--bg-3); color: var(--text); }
.me-chip { border-radius: 10px; background: transparent; border-color: transparent; padding: 3px 10px 3px 3px; }
.me-chip:hover { background: var(--bg-3); border-color: transparent; }
.me-chip .av { width: 30px; height: 30px; }
.me-chip .av .dot { border-color: var(--bg); }
.live-pill { border-radius: 10px; height: 38px; }

/* ---------- sidebar ---------- */
.sidebar .server-card { border-bottom: 1px solid var(--line); }
.sidebar .server-card:not(.has-banner) .sc-row { min-height: 52px; padding: 8px 12px; }
.panel-head { height: 52px; border-bottom-color: var(--line); }
.hub-grid { padding: 8px; gap: 1px; }
.hub-tile { min-height: 36px; padding: 8px 10px; border-radius: var(--control-r); color: var(--text-2); }
.hub-tile:hover { background: var(--bg-hover); color: var(--text); }
.hub-tile.active { background: var(--bg-active); color: var(--text); }
.cat { padding: 18px 12px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.chan { min-height: 32px; margin: 1px 8px; border-radius: var(--control-r); color: var(--text-2); font-size: 13.5px; }
.chan:hover { background: var(--bg-hover); color: var(--text); }
.chan.active { background: var(--bg-active); color: var(--text); box-shadow: none; }
.chan.active::before { display: none; }
.chan.unread { color: var(--text); font-weight: 600; }
.dm-item { margin: 1px 8px; border-radius: var(--control-r); }
.dm-item:hover { background: var(--bg-hover); }
.dm-item.active { background: var(--bg-active); }

/* ---------- topbar ---------- */
.topbar { height: 52px; min-height: 52px; padding: 0 12px 0 16px; gap: 10px; border-bottom: 1px solid var(--line); background: transparent; }
.topbar .t-name { font-size: 14.5px; font-weight: 600; gap: 8px; min-width: 0; }
.topbar .t-name > svg { color: var(--muted); width: 18px; height: 18px; }
.topbar .t-topic { color: var(--muted); font-size: 12.5px; border-left: 1px solid var(--line); padding-left: 10px; }
.t-actions { gap: 2px; }
.t-actions .icon-btn { width: 34px; height: 34px; border-radius: var(--control-r); color: var(--text-2); }
.t-actions .icon-btn:hover { background: var(--bg-3); color: var(--text); }
.t-actions .icon-btn.active { color: var(--gold); background: var(--gold-soft); }
.topbar .search input { height: 32px; border-radius: var(--control-r); background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }

/* ---------- messages ---------- */
.msg { margin: 0 8px; border-radius: var(--control-r); }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.head { margin-top: 14px; }
.m-meta .m-author { font-weight: 600; font-size: 14.5px; }
.m-meta .m-time, .m-time { color: var(--muted); font-size: 11.5px; }
.m-content { line-height: 1.5; }
.m-tools { border-radius: 10px; border: 1px solid var(--line); background: var(--bg-3); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); padding: 2px; }
.day-sep { margin: 20px 16px 10px; font-size: 11px; font-weight: 600; }
.chan-intro { padding: 32px 20px 8px; }
.ci-card { padding: 0 4px 12px; }
.ci-card .ci-icon { border-radius: 14px; background: var(--bg-3); }
.ci-card h2 { font-size: 24px; }

/* ---------- composer ---------- */
.composer { padding: 0 16px 16px; }
.compose-box { border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); padding: 5px; }
.compose-box:focus-within { border-color: rgba(240, 192, 74, .35); }
.compose-box .icon-btn { border-radius: var(--control-r); color: var(--text-2); }
.compose-box .icon-btn:hover { background: var(--bg-4); color: var(--text); }
.compose-box .send-btn { border-radius: var(--control-r); padding-inline: 12px; }

/* ---------- members ---------- */
.members { background: transparent; border-left: 1px solid var(--line); padding: 8px; width: 240px; }
.member { border-radius: var(--control-r); padding: 6px 8px; }
.member:hover { background: var(--bg-hover); }

/* ---------- controls ---------- */
.btn { border-radius: var(--control-r); }
.input, .select, .textarea { border-radius: var(--control-r); background: var(--bg-2); border-color: var(--line); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(240, 192, 74, .45); box-shadow: 0 0 0 3px var(--gold-soft); }
.icon-btn { border-radius: var(--control-r); }

input[type=file]::file-selector-button { font: 500 13px var(--font); color: var(--text); background: var(--bg-4); border: 1px solid var(--line); border-radius: var(--control-r); padding: 7px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--bg-active); }

/* ---------- floating surfaces ---------- */
.modal, .modal.wide { border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(0, 0, 0, .55); }
.modal-back { background: rgba(5, 6, 8, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-foot { background: transparent; }
.popover > .menu, .menu { border-radius: 12px; }
.menu button { border-radius: 7px; }
.popover { border-radius: 12px; }
.toast { border-radius: 10px; }
.settings-nav { background: var(--bg-2); }
.settings-nav button { border-radius: var(--control-r); }
.settings-nav button.active { background: var(--bg-active); color: var(--text); box-shadow: none; }

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: #2a2c33 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2c33; border: 2px solid transparent; background-clip: content-box; }

/* ---------- medium screens ---------- */
@media (max-width: 1180px) { .deck-search { width: 36px; height: 34px; } }
@media (max-width: 900px) {
  .members { border-left: 1px solid var(--line); background: var(--bg-1); }
}

/* =====================================================================
   Phones
   ===================================================================== */
@media (max-width: 760px) {
  :root { --deck-h: 0px; --hdr: 52px; --safe-t: env(safe-area-inset-top, 0px); }
  html, body { overscroll-behavior: none; }
  /* app shell: pinned to the visible screen like a native app. --mobile-viewport-height
     (experience.js) is the area above the keyboard, so the composer stays in view. */
  html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .app { width: 100%; height: var(--mobile-viewport-height, 100dvh); padding-top: 0; overflow: hidden; }
  body.has-pcbar #userpanel { top: calc(var(--pcbar-h, 0px) + var(--safe-t) + 8px); }
  body.has-pcbar #voicepanel { top: calc(var(--pcbar-h, 0px) + var(--safe-t) + var(--hdr) + 6px); }
  .deck, .topbar, .drawer-servers, .t-actions, .compose-box .icon-btn, .menu button, .dtile-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  /* the deck is hidden; its avatar and voice pill float over the channel header */
  .deck { position: static; height: 0; padding: 0; border: 0; overflow: visible; background: none; }
  .deck > .menu-btn, .deck-brand, .deck-servers, .deck-search { display: none !important; }
  #userpanel { position: fixed; z-index: 30; top: calc(var(--safe-t) + 8px); right: 8px; }
  .me-cluster .icon-btn { display: none; }
  .me-chip { padding: 2px; margin: 0; background: transparent; }
  .me-chip .who { display: none; }
  .me-chip .av { width: 32px; height: 32px; }
  .me-chip .av .dot { border-color: var(--bg-1); }
  #voicepanel { position: fixed; z-index: 29; left: 8px; right: 8px; top: calc(var(--safe-t) + var(--hdr) + 6px); display: flex; justify-content: center; pointer-events: none; }
  #voicepanel :is(.live-pill,.voice-connection) { pointer-events: auto; background: var(--bg-3); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); max-width: 100%; }
  #voicepanel .lp-name { display: inline; max-width: 40vw; }
  .app:has(#voicepanel .live-pill):not(:has(#stage)) .main > .topbar { margin-bottom: 50px; }
  .app:has(#voicepanel .voice-connection):not(:has(#stage)) .main > .topbar { margin-bottom: 112px; }
  #voicepanel .voice-connection { width:min(360px,100%);border:1px solid var(--line);border-radius:10px;padding:10px; }
  #voicepanel .voice-connection-actions .icon-btn { min-width:44px;min-height:44px;height:44px; }
  .app:has(#stage) #voicepanel { display: none; }
  .app.nav-open #userpanel, .app.nav-open #voicepanel, .app:has(.members-back) #userpanel { visibility: hidden; }

  .shell { padding: 0; gap: 0; }
  .main { border: 0; border-radius: 0; padding-top: var(--safe-t); }
  .topbar { height: var(--hdr); min-height: var(--hdr); padding: 0 52px 0 6px; gap: 4px; background: var(--bg-1); position: relative; }
  .topbar .menu-btn { display: grid !important; margin: 0; width: var(--tap); height: var(--tap); flex: none; }
  .topbar .t-name { flex: 1 1 auto; min-width: 0; font-size: 15px; overflow: hidden; }
  .topbar .t-name > *:not(svg):not(.av) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .topbar .t-topic, .topbar .search { display: none; }
  .topbar > div[style*="flex:1"] { display: none; }
  .t-actions { flex: none; gap: 0; margin-left: auto; }
  .t-actions .icon-btn { width: 38px; height: var(--tap); }

  /* drawer */
  .nav { width: auto; }
  .sidebar { width: min(340px, calc(100vw - 44px)); border-radius: 0 16px 16px 0; border: 0; padding-top: 0; background: var(--bg-2); }
  .drawer-servers { padding: 10px 12px 12px; gap: 8px; border-bottom: 1px solid var(--line); }
  .drawer-servers .dtile-btn { width: 44px; height: 44px; border-radius: 12px; }
  .chan { min-height: 42px; font-size: 15px; }
  .hub-tile { min-height: 42px; }
  .dm-item { min-height: 48px; }
  .app.nav-open .backdrop { background: rgba(0, 0, 0, .6); }

  /* members slide-over */
  .members { width: min(300px, 86vw); padding: calc(10px + var(--safe-t)) 8px 10px; border-radius: 16px 0 0 16px; border: 0; background: var(--bg-2); }
  .member { min-height: 44px; }

  /* messages + composer */
  .msg { margin: 0 2px; padding-left: 58px; padding-right: 10px; }
  .msg .m-av { left: 10px; }
  .msg:hover { background: transparent; }
  .chan-intro { padding: 20px 12px 6px; }
  .ci-card h2 { font-size: 20px; overflow-wrap: anywhere; }
  .composer { padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .compose-box { border-radius: 22px; padding: 4px; }
  .compose-box textarea { font-size: 16px; }
  .compose-box .icon-btn { width: var(--tap); height: var(--tap); min-width: var(--tap); border-radius: 50%; }
  .compose-box .send-btn { width: var(--tap); height: var(--tap); min-height: var(--tap); border-radius: 50%; padding: 0; justify-content: center; }
  .compose-box .send-btn span { display: none; }
  .jumpbar { left: 8px; right: 8px; }

  /* every text field at 16px so iOS never zooms in */
  input, textarea, select, .input, .select, .textarea { font-size: 16px !important; }

  /* modals become full-height sheets */
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { width: 100% !important; max-width: none !important; max-height: calc(var(--mobile-viewport-height, 100dvh) - var(--safe-t) - 12px); border-radius: 18px 18px 0 0; border-bottom: 0; }
  .modal.wide, .modal.wide.settings-modal { height: var(--mobile-viewport-height, 100dvh); max-height: var(--mobile-viewport-height, 100dvh); padding-top: var(--safe-t); border-radius: 0; border: 0; }
  .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .settings-nav { position: sticky; top: 0; z-index: 2; padding: 8px 52px 8px 8px; background: var(--bg-2); scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { min-height: 38px; }
  .settings-main { padding: 18px 14px calc(24px + env(safe-area-inset-bottom, 0px)); min-width: 0; }
  .account-identity { flex-wrap: wrap; }
  .account-identity .btn { margin-left: 0; }

  /* menus and pickers stay inside the screen */
  .popover:not(.sheet):not(:has(.sheet, .emoji-picker, .sticker-picker, .sound-picker, .ctx-menu)) { max-width: calc(100vw - 16px); max-height: calc(var(--mobile-viewport-height, 100dvh) - 24px); overflow-y: auto; }
  .menu button { min-height: 44px; }
  .profile-card { max-width: calc(100vw - 16px); }
  .emoji-picker, .gif-picker, .sticker-picker { max-width: calc(100vw - 16px); }
  #toast-root { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100vw - 24px); }

  /* long words and links never widen the page */
  .m-content, .em-desc, .em-field div, .t-name, .dname { overflow-wrap: anywhere; }
  .m-content pre, .m-content code { max-width: 100%; overflow-x: auto; }
  img, video { max-width: 100%; }
  .page { padding: 14px 12px calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* very narrow phones: the channel name needs the room; reports stay in the avatar and message menus */
@media (max-width: 380px) {
  .topbar [data-act=reportChannel] { display: none; }
  .t-actions .icon-btn { width: 36px; }
}

/* Owner-approved service configuration. Deliberately subdued: it is an
   operations screen, not a member-facing settings surface. */
.integrations-admin { max-width: 1120px; }
.integration-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px 22px; border:1px solid var(--line); border-radius:12px; background:linear-gradient(120deg,rgba(89,119,255,.12),rgba(20,24,35,.7)); }
.integration-hero h2 { margin:0 0 6px; font-size:22px; }
.integration-hero p { margin:0; color:var(--text-2); max-width:700px; line-height:1.5; }
.integration-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:14px; }
.integration-card { min-width:0; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--bg-2); }
.integration-card header h3 { margin:0 0 5px; font-size:16px; }
.integration-card header p { margin:0 0 16px; color:var(--text-2); font-size:13px; line-height:1.45; }
.integration-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.integration-field { min-width:0; display:grid; gap:6px; color:var(--text-2); font-size:12px; font-weight:700; }
.integration-field > div { display:flex; gap:6px; min-width:0; }
.integration-field .input, .integration-field .select { min-width:0; width:100%; }
.integration-field small { color:var(--muted); font-weight:400; line-height:1.35; }
.integration-field em { color:var(--muted); font-size:11px; font-style:normal; font-weight:500; }
.integration-saved { display:inline-block; margin-left:6px; padding:2px 5px; color:var(--green); background:rgba(52,211,153,.12); border-radius:4px; font-size:10px; font-style:normal; text-transform:uppercase; }
.integration-switches { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:14px; }
.integration-switches .admin-flag { margin:0; font-size:12px; }
.integration-oauth { grid-template-columns:repeat(2,minmax(0,1fr)); }
.integration-provider { min-width:0; padding:12px; border:1px solid var(--line); border-radius:8px; display:grid; gap:10px; }
.integration-provider h4 { margin:0; font-size:13px; }
.integration-wide { grid-column:1/-1; }
.integration-submit { grid-column:1/-1; display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:4px 0 10px; }
.integration-submit .form-error { flex:1; margin:0; color:var(--red); }
.integration-requests { grid-column:1/-1; }
.integration-requests article { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0; border-top:1px solid var(--line); }
.integration-requests article:first-of-type { border-top:0; }
.integration-requests p, .integration-requests small { margin:3px 0 0; color:var(--text-2); }
.coin-topup { margin-top:16px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 20px; border:1px solid rgba(245,197,24,.34); border-radius:12px; background:linear-gradient(110deg,rgba(245,197,24,.10),rgba(29,33,44,.72)); }
.coin-topup > div { display:flex; align-items:center; gap:12px; }.coin-topup h3,.coin-topup p { margin:0; }.coin-topup p { color:var(--text-2); font-size:13px; margin-top:3px; }.coin-topup > div:last-child { margin-left:auto; }.coin-topup > div:last-child b { font-size:13px; white-space:nowrap; }
@media (max-width:800px) { .integration-grid { grid-template-columns:1fr; } }
@media (max-width:540px) { .integration-hero { padding:16px; flex-direction:column; gap:10px; }.integration-fields { grid-template-columns:1fr; }.integration-oauth { grid-template-columns:1fr; }.integration-submit { justify-content:stretch; }.integration-submit .btn { width:100%; justify-content:center; }.integration-requests article,.coin-topup { align-items:flex-start; flex-direction:column; }.coin-topup > div:last-child { margin-left:0; width:100%; justify-content:space-between; } }

/* Settings: the close button stays pinned while the page scrolls (it used to scroll away with the content). */
.settings-main > .x { position: sticky !important; top: 0; float: right; z-index: 6; margin: -8px -10px 0 12px; box-shadow: 0 0 0 4px var(--bg-1); }
@media (max-width: 760px) { .settings-main > .x { margin: -4px -4px 0 8px; } }

/* Update prompts: calm, not alarming. */
.update-bar { background: var(--bg-2); color: var(--text); border-bottom: 1px solid var(--line); font-weight: 500; }
.update-card { position: fixed; right: 18px; bottom: 18px; z-index: 9000; display: flex; align-items: center; gap: 12px; max-width: 420px; padding: 12px 14px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.update-card-text { display: grid; gap: 2px; min-width: 0; }
.update-card-text b { font-size: 14px; font-weight: 600; }
.update-card-text span { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.update-card-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 520px) { .update-card { left: 12px; right: 12px; bottom: 12px; flex-wrap: wrap; } }

/* Loading screen: a plain progress bar, no glow. */
.cur-bar i { background: var(--gold, #f5c518); box-shadow: none; }
.cur-glow, .cur-message { display: none; }

/* Verified server check (set by Vexel admins). */
.server-verified { display: inline-flex; align-items: center; vertical-align: -2px; margin-right: 5px; color: #3ba55c; flex: none; }
.server-verified svg { width: 16px; height: 16px; }
h3 .server-verified svg { width: 18px; height: 18px; }

/* Slash command option chips */
.slash-opts .slash-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; cursor: pointer; font: inherit; color: inherit; background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.slash-opts .slash-chip:hover, .slash-opts .slash-chip:focus-visible { border-color: var(--gold); }
.slash-opts .slash-chip.req b { color: var(--gold); }
.slash-opts .slash-chip small { color: var(--text-2); }
.slash-opts .slash-chip span { color: var(--muted); font-size: 11.5px; }
.slash-opt-item span { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* Members → Add role picker */
.role-add-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px dashed var(--line); background: transparent; color: var(--text-2); font: 500 12.5px/1 inherit; cursor: pointer; }
.role-add-btn:hover { border-style: solid; border-color: var(--gold); color: var(--text); }
.role-picker { width: 270px; max-width: 100%; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.4); overflow: hidden; }
.rp-search { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.rp-search .input { height: 32px; font-size: 13px; }
.rp-list { max-height: 280px; overflow-y: auto; padding: 4px; }
.rp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rp-item:hover, .rp-item.sel { background: var(--bg-hover, var(--bg-3)); }
.rp-item[hidden] { display: none; }
.rp-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--rc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 30%, transparent); }
.rp-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: var(--bg-3); color: var(--text-2); }
.rp-tag.admin { color: #f0b232; }
.rp-tag svg { width: 11px; height: 11px; }
.rp-item small { color: var(--muted); font-size: 11px; flex: none; }
.rp-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* Invite dialog: friends list */
.inv-friends { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.inv-search { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.inv-search .input { height: 32px; font-size: 13px; }
.inv-flist { max-height: 230px; overflow-y: auto; padding: 4px; }
.inv-friend { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.inv-friend:hover { background: var(--bg-hover, var(--bg-3)); }
.inv-friend[hidden] { display: none; }
.inv-friend > span { flex: 1; min-width: 0; display: grid; }
.inv-friend b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-friend small { color: var(--muted); font-size: 11.5px; }
.inv-friend .btn { flex: none; min-width: 64px; }
.inv-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; }

/* Threads */
.threads-pop { width: 320px; max-width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.4); overflow: hidden; }
.tp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tp-head b { display: inline-flex; align-items: center; gap: 6px; }
.tp-tabs { display: flex; gap: 4px; padding: 6px 8px 0; }
.tp-tabs button { border: 0; background: transparent; color: var(--text-2); padding: 6px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.tp-tabs button.on { background: var(--bg-3); color: var(--text); }
.tp-list { max-height: 320px; overflow-y: auto; padding: 6px; color: var(--muted); font-size: 13px; }
.tp-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.tp-item:hover { background: var(--bg-hover, var(--bg-3)); }
.tp-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13.5px; }
.tp-item small { color: var(--muted); font-size: 11.5px; }
.tp-empty { padding: 16px; text-align: center; }
.thread-state { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: var(--bg-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; }

/* Scheduled events */
.ev-list { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.ev-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg-2); }
.ev-card.ev-s3, .ev-card.ev-s4 { opacity: .6; }
.ev-when { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-2); }
.ev-when span { color: var(--gold); font-weight: 600; }
.ev-s2 .ev-when span { color: #3ba55c; }
.ev-card h4 { margin: 4px 0 2px; font-size: 15px; }
.ev-card p { margin: 0 0 6px; color: var(--text-2); font-size: 13px; white-space: pre-wrap; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.ev-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Roles on profile cards: remove (×) and add (+) */
.pc-roles .role-chip { position: relative; }
.pc-roles .rc-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; font-size: 13px; line-height: 1; opacity: 0; transition: opacity .12s; }
.pc-roles .role-chip:hover .rc-x, .pc-roles .rc-x:focus-visible { opacity: 1; color: var(--text); }
@media (hover: none) { .pc-roles .rc-x { opacity: 1; } }
.pc-roles .role-chip-add { border: 1px dashed var(--line); background: transparent; color: var(--text-2); cursor: pointer; padding: 2px 8px; }
.pc-roles .role-chip-add:hover { border-style: solid; border-color: var(--gold); color: var(--text); }

/* Profile song: volume on the card */
.pc-song { position: relative; }
.pc-song-vol { display: flex; align-items: center; gap: 2px; flex: none; }
.pc-song-vol .icon-btn { width: 26px; height: 26px; }
.pc-song-vol input[type=range] { width: 64px; accent-color: var(--gold); }
@media (max-width: 520px) { .pc-song-vol input[type=range] { width: 48px; } }

/* Badges: first 4, then "+N" */
.badge-row .pbadge-more { display: none; }
.badge-row.all .pbadge-more { display: inline-flex; }
.badge-row .pbadge-all { border: 1px solid var(--line); background: var(--bg-3); color: var(--text-2); border-radius: 10px; padding: 0 8px; height: 22px; font: 600 11.5px/1 inherit; cursor: pointer; align-self: center; }
.badge-row .pbadge-all:hover { color: var(--text); border-color: var(--gold); }

/* settings: sub-headings and merged pages */
.settings-subhead { margin: 26px 0 4px; font-size: 15px; font-weight: 600; }
.settings-merged + .settings-merged { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.settings-merged + .settings-merged > h2 { font-size: 18px; margin-bottom: 14px; }

/* Compact profile card (click someone's name or avatar) */
.profile-card.pc-compact .pc-hero { position: relative; padding: 52px 16px 0; }
.profile-card.pc-compact .pc-hero::before { height: 80px; }
.profile-card.pc-compact .pc-badges { position: absolute; right: 14px; top: 88px; max-width: 55%; }
.profile-card.pc-compact .pc-badges .badge-row { margin: 0; justify-content: flex-end; flex-wrap: wrap; }
.profile-card.pc-compact .pc-names { margin-top: 6px; }
.profile-card.pc-compact .pc-names h3 { margin: 0; font-size: 18px; }
.profile-card.pc-compact .pc-body { display: grid; gap: 10px; padding: 8px 16px 14px; }
.pc-compact .pc-line { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; min-width: 0; }
.pc-compact .pc-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-compact .pc-bio p { margin: 0; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pc-compact .pc-bio.open p { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.pc-compact .pc-link { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--gold); }
.pc-compact .pc-link:hover { text-decoration: underline; }
.pc-compact [data-song-slot]:empty { display: none; }
.pc-compact .pc-roles { margin: 0; }
.pc-compact .pc-roles h5 { display: none; }
.pc-compact .pc-facts-line { font-size: 12px; color: var(--muted); line-height: 1.5; }
.pc-compact .pc-facts-line .pc-link { color: var(--text-2); font-size: 12px; }
.pc-compact .pc-callvol { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.pc-compact .pc-callvol input { flex: 1; accent-color: var(--gold); }
.pc-compact .pc-listen-compact { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-compact .pc-message .input { width: 100%; height: 36px; font-size: 13.5px; }
.pc-compact .pc-actions { display: flex; gap: 8px; margin: 0; }
.pc-compact .pc-actions .btn:first-child { flex: 1; }
.pc-compact .pc-more-menu { position: static; width: 100%; margin: 0; box-shadow: none; border: 1px solid var(--line); }

/* ===== Profile card (click a name or avatar) ===== */
.profile-card.pc2 { width: 340px; max-width: calc(100vw - 16px); overflow: visible; background: var(--bg-1); border-radius: 12px; }
.pc2-banner { position: relative; height: 120px; background: var(--pc-bg); border-radius: 12px 12px 0 0; overflow: visible; }
.pc2-banner > .profile-banner-image { position: absolute; inset: 0; height: 120px; border-radius: 12px 12px 0 0; }
.pc2-corner { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 3; }
.pc2-round { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.pc2-round:hover { background: rgba(0,0,0,.75); }
.pc2-round.accept { background: var(--green); }
.pc2-round[disabled] { opacity: .7; cursor: default; }
.pc2-menu { position: absolute; top: 48px; right: 10px; z-index: 6; min-width: 180px; }
.profile-card.pc2 .pc2-head { display: block; position: relative; height: 0; padding: 0 16px; background: none; }
.profile-card.pc2 .pc2-head::before, .profile-card.pc2 .pc2-head::after { display: none; }
.profile-card.pc2 .pc2-av { position: absolute; left: 16px; top: -46px; margin: 0; z-index: 2; }
.profile-card.pc2 .pc2-av .av-img { border: 6px solid var(--bg-1); box-sizing: content-box; }
.profile-card.pc2 .pc2-body { display: flex; flex-direction: column; gap: 12px; padding: 50px 16px 14px; min-width: 0; }
.profile-card.pc2 .pc2-body > * { min-width: 0; }
.pc2-names h3 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.pc2-names .crown { color: var(--gold); vertical-align: -2px; }
.pc2-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; font-size: 13.5px; color: var(--text-2); }
.pc2-dot { color: var(--muted); }
.pc2-badges { margin-top: 8px; }
.pc2-badges .badge-row { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 3px 6px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.pc2-mutuals { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; color: var(--text-2); }
.pc2-stack { display: inline-flex; margin-right: 2px; }
.pc2-stack .av { width: 20px; height: 20px; margin-left: -6px; border: 2px solid var(--bg-1); border-radius: 50%; }
.pc2-stack .av:first-child { margin-left: 0; }
.pc2-stack .av .av-img { font-size: 8px; }
.pc2-link { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.pc2-link:hover { text-decoration: underline; color: var(--text); }
.pc2-status { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); }
.pc2-bio { font-size: 14px; line-height: 1.45; }
.pc2-bio-text { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.pc2-more-bio { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pc2-activity .pc-sec { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.pc2 [data-song-slot]:empty, .fp2 [data-song-slot]:empty { display: none; }
.pc2 .pc-song, .fp2 .pc-song { margin: 0; max-width: 100%; box-sizing: border-box; }
.pc2 .pc-song-info { min-width: 0; }
.pc2 .pc-song-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc2 .pc-roles { margin: 0; }
.pc2-callvol { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.pc2-callvol input { flex: 1; accent-color: var(--gold); }
.pc2-listen { display: flex; flex-wrap: wrap; gap: 6px; }
.pc2-message .input { width: 100%; height: 40px; border-radius: 10px; font-size: 14px; }
.pc2-actions .btn { width: 100%; justify-content: center; }
.pc2-full { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; align-self: center; }
.pc2-full:hover { color: var(--text); text-decoration: underline; }

/* ===== Full profile: two columns ===== */
.fp-modal.fp2-modal { width: min(920px, calc(100vw - 24px)) !important; max-width: min(920px, calc(100vw - 24px)) !important; height: min(720px, calc(100vh - 32px)); padding: 0; overflow: hidden; }
.full-profile.fp2 { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100%; max-height: none; position: relative; }
.fp2-close { position: absolute; top: 12px; right: 12px; z-index: 5; }
.fp2-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow-y: auto; padding: 0 22px 22px; border-right: 1px solid var(--line); background: var(--bg-1); }
.full-profile.fp2 .fp2-banner { position: relative; height: 120px; margin: 0 -22px; background: var(--fp-bg); flex: none; }
.full-profile.fp2 .fp2-top { padding: 0; margin-top: -58px; position: relative; z-index: 2; }
.full-profile.fp2 .fp2-top .av-img { border: 6px solid var(--bg-1); box-sizing: content-box; }
.fp2-id h2 { margin: 4px 0 0; font-size: 24px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.fp2-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; font-size: 14px; color: var(--text-2); }
.fp2-actions { position: relative; display: flex; gap: 8px; }
.fp2-actions .btn.primary { flex: 0 1 auto; }
.fp2-actions .icon-only { width: 36px; padding: 0; justify-content: center; }
.fp2-menu { position: absolute; top: 42px; left: 0; z-index: 6; min-width: 190px; }
.fp2-bio { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.fp2-bio small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.fp2-status { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.fp2-fact h5, .fp2 .pc-sec h5 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: none; letter-spacing: 0; }
.fp2-fact p { margin: 0; font-size: 14px; }
.fp2 .pc-sec { margin: 0; }
.fp2-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 18px 22px 0; }
.full-profile.fp2 .fp2-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); padding-right: 40px; overflow-x: auto; scrollbar-width: none; flex: none; }
.full-profile.fp2 .fp2-tabs button { border: 0; background: none; padding: 10px 0; color: var(--text-2); font: inherit; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; border-radius: 0; }
.full-profile.fp2 .fp2-tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.full-profile.fp2 .fp2-body { flex: 1; overflow-y: auto; padding: 16px 0 22px; display: flex; flex-direction: column; gap: 12px; }
.fp2-card { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.fp2-card h4 { margin: 0 0 10px; font-size: 14px; }
.fp2-card .pc-sec { margin: 0; }
.fp2-empty { display: grid; place-items: center; gap: 6px; padding: 40px 10px; color: var(--muted); text-align: center; }
.fp2-empty p { margin: 0; }
.fp2 .profile-community { margin: 0; }
@media (max-width: 760px) {
  .fp-modal.fp2-modal { height: calc(100dvh - 16px); }
  .full-profile.fp2 { display: block; overflow-y: auto; }
  .fp2-side { overflow: visible; border-right: 0; }
  .fp2-main { padding: 0 16px; }
  .full-profile.fp2 .fp2-body { overflow: visible; }
}

/* Full profile fixes: backdrops (card backgrounds) and extra layers must never take a grid column */
.full-profile.fp2 { grid-template-areas: "side main"; grid-template-rows: minmax(0, 1fr); }
.full-profile.fp2 > .fp2-side { grid-area: side; }
.full-profile.fp2 > .fp2-main { grid-area: main; }
.full-profile.fp2 > .fp2-close, .full-profile.fp2.has-profile-backdrop > .fp2-close { position: absolute; top: 12px; right: 12px; z-index: 5; }
.full-profile.fp2 > .profile-backdrop { grid-area: 1 / 1 / -1 / -1; }
.full-profile.fp2.has-profile-backdrop > .fp2-side { background: rgba(10, 12, 18, .45); }
.full-profile.fp2.has-profile-backdrop > .fp2-main { background: transparent; }
.full-profile.fp2.has-profile-backdrop .fp2-banner { background: var(--fp-bg); }
.full-profile.fp2.has-profile-backdrop .fp2-top .av-img { border-color: rgba(10, 12, 18, .9); }
/* the song player and sections sit flush with the rest of the left column */
.full-profile.fp2 .fp2-side > .pc-song { margin: 0 !important; }
.full-profile.fp2 .fp2-side > .pc-sec { margin: 0 !important; padding: 0 !important; background: transparent !important; }
.profile-card.pc2 .pc2-body > .pc-song { margin: 0 !important; }
@media (max-width: 760px) { .full-profile.fp2 { display: block; } }
.full-profile.fp2 .fp2-id.fp-names { flex-basis: auto; padding-top: 0; min-width: 0; }
.full-profile.fp2 .fp2-id.fp-names h2 { font-size: 24px; }

/* Mute server menu */
.mute-menu .menu-head { padding: 8px 10px 4px; font-weight: 600; font-size: 13px; }
.mute-menu .mute-all { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: start; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.mute-menu .mute-all input { margin-top: 2px; accent-color: var(--gold); }
.mute-menu .mute-all small { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.menu .menu-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

/* Profile cards: the ring around the avatar is a shadow outside the picture, not a border that makes it 12px
   bigger. The picture keeps the exact box that frames and decorations are centred on, so they line up. */
.profile-card.pc2 .pc2-av { left: 22px; top: -40px; }
.profile-card.pc2 .pc2-av .av-img, .full-profile.fp2 .fp2-top .av-img { border: 0; box-sizing: border-box; box-shadow: 0 0 0 6px var(--bg-1); }
.profile-card.pc2.themed .pc2-av .av-img { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pc-a) 30%, var(--bg-1)); }
.full-profile.fp2.has-profile-backdrop .fp2-top .av-img { box-shadow: 0 0 0 6px rgba(10, 12, 18, .9); }
.full-profile.fp2 .fp2-top > .av { margin: 6px; }
.av.art-framed, .av.art-framed > .av-img, .av.art-framed::before { border-radius: 50%; }

/* Settings › Profile: @username field and name change limits */
.pf-handle { display: flex; align-items: center; gap: 0; }
.pf-handle span { padding: 0 8px 0 12px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--bg-3, var(--bg)); color: var(--muted); font-weight: 600; }
.pf-handle .input { border-radius: 0 8px 8px 0; flex: 1; min-width: 0; }
.pf-limit { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.pf-limit.used { color: var(--gold-d, var(--gold)); }
#pf-form .input[readonly] { opacity: .65; cursor: not-allowed; }

/* Twemoji: emoji drawn as images, sized to the text around them */
img.emoji { width: 1.25em; height: 1.25em; margin: 0 .05em; vertical-align: -0.25em; display: inline-block; }
.big-emoji img.emoji { width: 48px; height: 48px; vertical-align: middle; }
.react img.emoji { width: 18px; height: 18px; vertical-align: -4px; margin: 0; }
/* the full emoji picker */
.emoji-picker.ep2 { width: 372px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; }
.ep2 .ep-search { display: flex; gap: 8px; align-items: center; }
.ep2 .ep-search input { flex: 1; min-width: 0; }
.ep2 .ep-tones { display: flex; gap: 1px; flex: none; }
.ep2 .ep-tones button { width: 24px; height: 24px; padding: 2px; border-radius: 6px; opacity: .45; font-size: 15px; line-height: 1; }
.ep2 .ep-tones button.on, .ep2 .ep-tones button:hover { opacity: 1; background: var(--bg-hover, rgba(255,255,255,.06)); }
.ep2 .ep-tones img.emoji { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
.ep2 .ep-tabs { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.ep2 .ep-tabs button { width: 32px; height: 30px; border-radius: 6px; font-size: 18px; line-height: 1; opacity: .7; }
.ep2 .ep-tabs button:hover { opacity: 1; background: var(--bg-hover, rgba(255,255,255,.06)); }
.ep2 .ep-tabs img.emoji { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
.ep2 .ep-grid { grid-template-columns: repeat(9, 1fr); max-height: 300px; overflow-y: auto; scroll-padding-top: 4px; }
.ep2 .ep-grid img.emoji { width: 26px; height: 26px; margin: 0; vertical-align: middle; }
.ep2 .ep-empty { grid-column: 1 / -1; color: var(--muted); padding: 10px; }
.ep2 .ep-foot { min-height: 22px; padding: 4px 6px 0; font-size: 12px; color: var(--muted); text-transform: capitalize; border-top: 1px solid var(--line); }

/* Server rail (all layouts): DM and server icons show the plain avatar. Frames and decorations are drawn
   bigger than the avatar, so in a 48px icon they were squashed over the picture. Icons are clipped round. */
.dtile-btn .av-custom, .dtile-btn .av-art, .dtile-btn .av-deco, .dtile-btn .av.cf::before { display: none !important; }
.dtile-btn.has-img { overflow: hidden; }

/* ---------- Server Settings › Safety Setup ---------- */
/* "sf-page", not "sf": rail icons with a server frame cosmetic already use the class "sf" */
.sf-page { display: flex; flex-direction: column; gap: 10px; max-width: 760px; padding-bottom: 72px; }
.sf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sf-head h2 { margin: 0; }
.sf-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.sf-score { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 78px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--green) 12%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); }
.sf-score b { font-size: 22px; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.sf-score span { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.sf-alert { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--red) 50%, var(--line)); background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--text); }
.sf-alert small { display: block; color: var(--text-2); font-size: 12.5px; }
.sf-quick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); }
.sf-quick span { color: var(--muted); font-size: 13px; flex: 1; min-width: 200px; }
.sf-group { margin: 14px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sf-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.sf-card > header { display: flex; align-items: flex-start; gap: 12px; }
.sf-card > header > div { flex: 1; min-width: 0; }
.sf-card h3 { margin: 0; font-size: 15px; }
.sf-card header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.sf-card .switch { flex: none; margin-top: 2px; }
.sf-ic { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-3, var(--bg)); color: var(--text-2, var(--text)); }
.sf-card[data-card]:not(.off) .sf-ic { color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--bg-3, var(--bg))); }
.sf-card[data-card] .sf-ic { transition: color .15s, background .15s; }
.sf-card.off .sf-body { opacity: .45; }
.sf-body { display: flex; flex-direction: column; gap: 12px; padding-left: 44px; transition: opacity .15s; }
.sf-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--text-2, var(--text)); }
.sf-line small, .sf-row small { color: var(--muted); font-size: 12px; }
.sf-num { width: 74px !important; padding: 6px 8px !important; text-align: center; font-variant-numeric: tabular-nums; }
.sf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.sf-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sf-row b { font-size: 14px; font-weight: 600; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-3, var(--bg)); cursor: pointer; font-size: 13.5px; user-select: none; }
.sf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.sf-chip:has(input:checked) { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: var(--gold-soft, rgba(245,197,24,.14)); color: var(--text); }
.sf-chip:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.sf-chip .role-dot { width: 10px; height: 10px; border-radius: 50%; }
.sf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sf-cols .field { margin: 0; }
.sf-list { font: 13px/1.5 ui-monospace, Consolas, monospace !important; resize: vertical; }
.sf-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg-3, var(--bg)); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.sf-seg button { padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.sf-seg button.on { background: var(--bg-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.sf-seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.sf-body .hint { margin: 0; font-size: 12.5px; }
.sf-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: step; }
.sf-ladder li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px 8px 38px; border-radius: 10px; background: var(--bg-3, var(--bg)); position: relative; font-size: 14px; counter-increment: step; }
.sf-ladder li::before { content: counter(step); position: absolute; left: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg-2); color: var(--muted); }
.sf-ladder li span { display: inline-flex; align-items: center; gap: 8px; }
.sf-test { display: flex; gap: 8px; }
.sf-test .input { flex: 1; min-width: 0; }
.sf-verdict { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; }
.sf-verdict.bad { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.sf-verdict.ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.sf-save { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.4); transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s; }
.sf-save.show { transform: none; opacity: 1; pointer-events: auto; }
.sf-save span { flex: 1; font-size: 14px; font-weight: 600; }
@media (max-width: 560px) { .sf-body { padding-left: 0; } .sf-head { flex-direction: column; } }

/* Avatars, server icons, banners and emoji aren't things to drag around (no drag ghost, no accidental uploads) */
.av img, img.av-img, .dtile-btn img, .server-icon img, .sic img, .fp-sic img, .pp-banner img, .fp-banner img, .pc-hero img,
img.emoji, img.cemoji, .av-custom, .av-art { -webkit-user-drag: none; user-drag: none; }

/* #channel links in messages, and the channel list in the composer's autocomplete */
.m-content .mention.ch-mention { white-space: nowrap; }
.m-content .mention.ch-mention:hover { text-decoration: underline; }
.m-content .mention.ch-mention.unknown { cursor: default; opacity: .7; }
.m-content .mention.ch-mention.unknown:hover { text-decoration: none; }
.ac-hash { width: 24px; height: 24px; display: grid; place-items: center; flex: none; color: var(--muted); }
