/* BEANCORD stylesheet: Discord look. One theme, no variants. */
:root{--dc-font:var(--font)}
html body,html body input,html body button,html body select,html body textarea{font-family:var(--dc-font)}
html,html body{height:100%;overflow:clip;overscroll-behavior:none}
html,html body,html #app{background-color:var(--bg);color:var(--text)}
html body{height:100dvh;-webkit-font-smoothing:antialiased;line-height:1.375}
#app{height:100%;overflow:hidden}

/* ===== phones: slide-out server/channel drawer ===== */
@media (max-width:767px){
  #leftcol{position:fixed;top:0;left:0;bottom:0;z-index:30;transform:translateX(-100%);transition:transform .2s ease;}
  #leftcol.open{transform:translateX(0)}
  #backdrop.open{display:block}
}

/* ===== login ===== */
#auth{background:#1a1b1e;overflow-x:hidden;overflow-y:auto;position:fixed;inset:0}
#auth .blob{position:absolute;border-radius:50%;filter:blur(90px);opacity:.55;pointer-events:none}
#auth .b1{width:520px;height:520px;left:-140px;top:-160px;background:var(--accent)}
#auth .b2{width:460px;height:460px;right:-120px;bottom:-140px;background:#eb459e;opacity:.4}
#auth .b3{width:380px;height:380px;right:18%;top:-120px;background:var(--ok-solid);opacity:.25}
#auth .card{position:relative;z-index:1;width:100%;max-width:420px;padding:36px 32px 28px;border-radius:12px;background:rgba(43,45,49,.92);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 0 0 1px rgba(255,255,255,.06),0 24px 60px rgba(0,0,0,.5)}
#auth .mark{width:56px;height:56px;margin:0 auto 14px;border-radius:16px;background:linear-gradient(135deg,var(--accent),#7983f5);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 20px rgba(88,101,242,.45)}
#auth .mark span{font-size:28px;font-weight:800;color:#fff;line-height:1}
#auth .logo{font-size:24px;font-weight:700;text-align:center;color:var(--text);margin:0 0 4px;line-height:1.25;letter-spacing:0}
#auth .sub{text-align:center;font-size:15px;line-height:20px;color:var(--muted);margin:0 0 24px}
#auth .lbl{display:block;margin-bottom:8px;font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:var(--muted)}
#auth .field{display:block;width:100%;box-sizing:border-box;height:44px;margin-bottom:20px;padding:10px 12px;border:1px solid rgba(255,255,255,.04);border-radius:6px;background:var(--field);color:var(--text);font-size:16px;outline:none;transition:border-color .15s,box-shadow .15s}
#auth .field:hover{border-color:rgba(255,255,255,.1)}
#auth .field:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(88,101,242,.25)}
#auth .pw{position:relative}
#auth .pw .field{padding-right:64px;margin-bottom:8px}
#auth .eye{position:absolute;right:6px;top:7px;height:30px;padding:0 10px;border:0;border-radius:4px;background:transparent;color:var(--muted);font-size:13px;font-weight:600;cursor:pointer}
#auth .eye:hover{background:rgba(255,255,255,.08);color:#fff}
#auth .hint{display:none;margin:0 0 16px;font-size:12px;color:var(--muted)}
#auth .pw+.hint{margin-top:0}
#auth #err{margin:4px 0 12px;font-size:14px;line-height:18px;color:var(--danger-solid)}
#auth #err:empty{display:none}
#auth .btn{display:block;width:100%;box-sizing:border-box;height:46px;margin:12px 0 0;padding:2px 16px;border:0;border-radius:6px;font-size:16px;font-weight:600;cursor:pointer;transition:background-color .15s,transform .05s}
#auth .btn-in{background:var(--accent);color:var(--accent-text)}
#auth .btn-in:hover{background:var(--accent-hover)}
#auth .btn-in:active{background:#3c45a5;transform:scale(.99)}
#auth .btn-in:disabled{opacity:.7;cursor:wait}
#auth .alt{margin-top:16px;text-align:center;font-size:14px;color:var(--muted)}
#auth .btn-up{display:inline;padding:0;border:0;background:none;color:#00a8fc;font-size:14px;font-weight:500;cursor:pointer}
#auth .btn-up:hover{text-decoration:underline}
#auth .shake{animation:bcshake .4s}
@keyframes bcshake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
@media (max-width:480px){#auth{align-items:flex-start;padding:0}#auth .card{max-width:none;min-height:100%;border-radius:0;box-shadow:none;padding:64px 24px 24px;background:rgba(43,45,49,.85)}}

/* ===== server rail ===== */
#leftcol>div:first-child{border:0}
#leftcol>div:nth-child(2){border:0}
#leftcol>div:first-child button,#srv button{border-radius:50%;transition:border-radius .15s ease,background-color .15s ease,color .15s}
#leftcol>div:first-child button:hover,#srv button:hover{border-radius:16px}
#leftcol>div:first-child [class~="rounded-xl"],#srv button[class~="rounded-xl"]{border-radius:16px}
#srv>div.relative::before{content:"";position:absolute;left:-12px;top:50%;width:4px;height:8px;margin-top:-4px;border-radius:0 4px 4px 0;background:#fff;opacity:0;transition:height .15s,margin .15s,opacity .15s;pointer-events:none}
#srv>div.relative:hover::before{opacity:1;height:20px;margin-top:-10px}
#srv>div.relative:has(>button[class~="bg-[#5865f2]"])::before{opacity:1;height:40px;margin-top:-20px}
#srv button[class~="ring-2"]{--tw-ring-shadow:none;box-shadow:none}
#srv button:active{transform:translateY(1px)}

/* ===== headers ===== */
#sh,#ch,#shop h2,#rm h2,.bc-h,#bc_sheet h3,#bc_settings h2{font-weight:600;letter-spacing:0;color:var(--text)}
#sh,#ch{height:48px;min-height:48px;padding-top:0;padding-bottom:0;font-size:16px;display:flex;align-items:center;border:0 !important;box-shadow:0 1px 0 rgba(4,4,5,.2),0 1.5px 0 rgba(6,6,7,.05),0 2px 0 rgba(4,4,5,.05);position:relative;z-index:2;flex-shrink:0}
#mem{border:0;box-shadow:none}

/* ===== channel list ===== */
#sc{padding-left:8px;padding-right:8px}
#sc button{border-radius:4px;font-weight:500;padding-top:6px;padding-bottom:6px;color:var(--muted);transition:background-color .1s,color .1s}
#sc button:hover{color:var(--text)}
#sc button[class~="bg-[#404249]"]{color:#fff}

/* ===== messages ===== */
#msgs{scroll-behavior:smooth;overscroll-behavior:contain;overflow-x:hidden;overflow-wrap:anywhere;padding:16px 0 8px}
#msgs.space-y-3>*+*{margin-top:0 !important}
#msgs>div{margin:0;padding:2px 48px 2px 16px;border-radius:0;gap:16px;transition:none;position:relative}
#msgs>div[id^="m_"]:hover{background:rgba(2,2,2,.06)}
#msgs>div[id^="m_"].group.flex.gap-3{margin-top:17px}
#msgs>div[id^="m_"]:has(>span.w-9){margin-top:0}
/* hover-only buttons float over the row so hovering never changes its height */
#msgs button[class*="group-hover:inline"]{display:inline !important;position:absolute;top:2px;right:16px;float:none;visibility:hidden;background:var(--bg);padding:0 6px;border-radius:3px;font-size:12px}
#msgs .group:hover button[class*="group-hover:inline"]{visibility:visible}
#msgs>div.forum-wrap,#msgs>div.forum-wrap:hover{margin:0;padding:0;background:none}
#msgs .w-9{width:40px;flex-shrink:0}
#msgs img.w-9,#msgs div.w-9,#msgs img.h-9{height:40px}
#msgs span.font-bold.text-sm{font-size:16px;font-weight:500;line-height:1.375}
#msgs span[class*="text-[10px]"]{font-size:12px;font-weight:400;color:var(--muted);margin-left:4px}
#msgs p.text-sm{line-height:1.375;font-weight:400;color:var(--text)}
#msgs pre,#msgs code{max-width:100%;overflow-x:auto}
#msgs img,#msgs video{max-width:100%;height:auto}
.dsep{margin:24px 16px 8px;font-size:12px;font-weight:600;color:var(--muted)}
#jumpbtn{border-radius:8px}

/* ===== message box ===== */
#f{padding:0 16px 24px;flex-shrink:0}
#f #i{background:var(--hover);border:0 !important;border-radius:8px;padding:11px 16px;min-height:44px;box-shadow:none !important;color:var(--text)}
#f #i:focus{border:0 !important;box-shadow:none !important}
#f button[type=button]{background:var(--hover);border:0;border-radius:8px;color:var(--muted)}
#f button[type=button]:hover{background:var(--sel);color:var(--text)}
#f button[type=submit]{border-radius:8px;padding-left:20px;padding-right:20px}
#typing{font-size:12px;font-weight:600;color:var(--text);padding:0 20px;min-height:24px}
#sq,#shop input,#rm input[type=text],#rm select{border:0 !important;border-radius:4px;background:var(--field)}
#sq:focus{box-shadow:none !important}

/* ===== member list ===== */
#mem{padding-left:8px;padding-right:8px}
#mem [data-uid]{border-radius:4px;padding-top:6px;padding-bottom:6px}

/* ===== buttons ===== */
#app [class~="bg-[#5865f2]"]:is(button),#shop [class~="bg-[#5865f2]"]:is(button),#rm [class~="bg-[#5865f2]"]:is(button),
#app [class~="bg-[#23a55a]"]:is(button),#shop [class~="bg-[#23a55a]"]:is(button),#rm [class~="bg-[#23a55a]"]:is(button){
  border:0 !important;box-shadow:none !important;border-radius:3px;color:#fff;font-weight:500;transition:background-color .17s ease}
#app [class~="bg-[#5865f2]"]:is(button),#shop [class~="bg-[#5865f2]"]:is(button),#rm [class~="bg-[#5865f2]"]:is(button){background:var(--accent) !important}
#app [class~="bg-[#5865f2]"]:is(button):hover,#shop [class~="bg-[#5865f2]"]:is(button):hover,#rm [class~="bg-[#5865f2]"]:is(button):hover{background:var(--accent-hover) !important}
#app [class~="bg-[#23a55a]"]:is(button),#shop [class~="bg-[#23a55a]"]:is(button),#rm [class~="bg-[#23a55a]"]:is(button){background:#248046 !important}
#app [class~="bg-[#23a55a]"]:is(button):hover,#shop [class~="bg-[#23a55a]"]:is(button):hover,#rm [class~="bg-[#23a55a]"]:is(button):hover{background:#1a6334 !important}
#app [class~="bg-[#5865f2]"]:is(button):active,#app [class~="bg-[#23a55a]"]:is(button):active{transform:none}
.pill{background:rgba(0,0,0,.55);color:#fff;font-size:12px;font-weight:600;padding:5px 12px;border-radius:999px;cursor:pointer;border:0}
.pill:hover{background:rgba(0,0,0,.75)}
.pbtn{font-size:12px;font-weight:600;padding:5px 12px;border-radius:3px;background:rgba(255,255,255,.08);color:var(--text);border:0;cursor:pointer}
.pbtn:hover{background:rgba(255,255,255,.14)}
.pbtn.danger{background:rgba(242,63,67,.15);color:#ff7b7e}
.pbtn.danger:hover{background:rgba(242,63,67,.28)}

/* ===== windows, menus, inputs ===== */
#vpc,#pm>div,#rm>div,.bc-modal{border:0 !important;border-radius:8px;box-shadow:0 0 0 1px rgba(30,31,34,.6),0 8px 16px rgba(0,0,0,.24)}
#vpc{padding:20px}
#vpc:has(>.pcard-top){padding:0}
#ctx{border:0 !important;border-radius:4px;padding:6px 8px;background:var(--rail);box-shadow:0 0 0 1px rgba(30,31,34,.6),0 8px 16px rgba(0,0,0,.24)}
#ctx button{border-radius:2px;padding:6px 8px;font-size:14px}
.bc-modal input,.bc-modal select,.bc-modal textarea,#bc_sheet input,#bc_sheet select,#bc_sheet textarea,#bc_settings input[type=text],#bc_settings select,#pm input:not([type=color]):not([type=file]),#pm textarea,#pm select{
  border:0 !important;border-radius:3px;background-color:var(--field);box-shadow:none !important}
.bc-modal input:focus,#bc_sheet input:focus,#bc_settings input:focus{box-shadow:0 0 0 1px var(--accent) !important}
#bc_settings input[type=range]{accent-color:var(--accent)}
#pm input[type=color],#vpc input[type=color]{width:30px;height:30px;border:0;border-radius:50%;padding:0;background:none;cursor:pointer}
#vpc input[type=color]::-webkit-color-swatch-wrapper,#pm input[type=color]::-webkit-color-swatch-wrapper{padding:0}
#vpc input[type=color]::-webkit-color-swatch,#pm input[type=color]::-webkit-color-swatch{border:2px solid rgba(255,255,255,.25);border-radius:50%}
#pm input[type=color]::-moz-color-swatch{border:2px solid rgba(255,255,255,.25);border-radius:50%}
#vpc .vrow{background:transparent;border:0;cursor:default}
#vpc button.vrow{cursor:pointer}
#vpc button.vrow:hover{background:var(--hover)}
#st_body code,#st_body .font-mono{word-break:break-all}

/* ===== calls ===== */
.tile-big{position:fixed !important;inset:1rem !important;width:auto !important;height:auto !important;z-index:70;background:#000 !important;border:2px solid #4a4d55;border-radius:14px;box-shadow:0 0 0 100vmax rgba(0,0,0,.85)}
.tile-big video{object-fit:contain !important}
.tile-big .tbtns button{width:2rem;height:2rem;font-size:1rem}
#calltiles div:fullscreen{background:#000}#calltiles div:fullscreen video{object-fit:contain !important}
.tile-big{border:0;border-radius:8px}

/* ===== scrollbars ===== */
::-webkit-scrollbar{width:16px;height:16px}
::-webkit-scrollbar-thumb{background:#1a1b1e;border:4px solid var(--panel);border-radius:8px;background-clip:padding-box}
::-webkit-scrollbar-track{background:var(--panel);border:4px solid var(--panel);background-clip:padding-box}
#msgs::-webkit-scrollbar-thumb{border-color:var(--bg)}
#msgs::-webkit-scrollbar-track{background:var(--panel);border-color:var(--panel)}
#app:has(#mem.hidden) #membtn{display:none}

/* ===== phones and tablets ===== */
@media (hover:none){#msgs [class~="group-hover:inline"]{display:inline !important}}
@media (max-width:767px){
  #app{height:100dvh}
  #leftcol{max-width:92vw}
  #mem{display:none !important}
  #mem.mopen{display:block !important;position:fixed;top:0;right:0;bottom:0;width:82%;max-width:20rem;z-index:30;box-shadow:-12px 0 40px rgba(0,0,0,.55)}
  #msgs>div{padding:2px 12px}
  #f{padding:0 10px calc(26px + env(safe-area-inset-bottom))}
  #f button{padding-left:.65rem;padding-right:.65rem}
  input,select,textarea{font-size:16px !important}
  #ch{padding-left:8px;padding-right:8px;position:relative;z-index:2}
  #vpc,#pm>div{max-height:88vh}
}

/* ===================== Discord components: dialogs, forms, menus ===================== */
html body .bc-modal,html body #vpc,html body #pm>div,html body #rm>div,html body #bc_settings{background-color:var(--bg)}
html body .bc-modal,html body #vpc,html body #pm>div,html body #rm>div{border-radius:8px}
html body .bc-modal{max-width:440px}
html body #bc_sheet>.bc-modal.max-w-2xl{max-width:672px}
html body .bc-modal>div:first-child h3,html body .bc-h,html body #rm h2,html body #bc_settings h2{font-size:20px;line-height:24px;font-weight:600;color:var(--text)}
html body #bc_sheet h3{font-size:20px;font-weight:600}
html body #bc_sheet [data-x]{width:32px;height:32px;border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:16px}
html body #bc_sheet [data-x]:hover{background:var(--line)}
html body #bc_sheet>.bc-modal>div:first-child{padding:16px 16px 8px}
html body #bc_sheet [data-body]{padding:0 16px 16px}

/* footer bar with Cancel as a text link and a flat primary button, like Discord */
.bc-foot{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin:16px -16px -16px;padding:16px;background:var(--panel);border-radius:0 0 8px 8px}
.bc-foot button{height:38px;min-width:96px;padding:2px 16px;border:0;border-radius:3px;font-size:14px;font-weight:500;cursor:pointer;color:#fff}
.bc-foot .bc-link{background:transparent;min-width:0;color:#fff}
.bc-foot .bc-link:hover{text-decoration:underline}

/* labels */
html body :is(.bc-modal,#bc_sheet,#pm,#bc_settings) label,html body :is(.bc-modal,#bc_sheet,#pm) .uppercase{letter-spacing:.02em}
html body :is(.bc-modal,#pm) label[class*="uppercase"],html body :is(#bc_sheet,#pm,#rm) [class*="uppercase"][class*="font-bold"]{font-size:12px;font-weight:700;color:var(--muted)}

/* text fields: flat, 40px, no outline ring */
html body :is(.bc-modal,#bc_sheet,#pm,#rm,#bc_settings,#shop) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),textarea){
  background-color:var(--field);border:0 !important;border-radius:3px;color:var(--text);padding:10px;font-size:16px;line-height:1.25;outline:none;box-shadow:none !important}
html body :is(.bc-modal,#bc_sheet,#pm,#rm,#bc_settings) input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]){min-height:40px}
html body :is(.bc-modal,#bc_sheet,#pm,#rm,#bc_settings) :is(input,textarea):focus{box-shadow:0 0 0 1px var(--accent) !important}
html body textarea{resize:vertical}
::placeholder{color:var(--muted)}
html body :is(.bc-modal,#bc_sheet,#pm,#rm,#bc_settings) textarea{padding:10px}

/* dropdowns: dark field with Discord's chevron */
html body :is(select){appearance:none;-webkit-appearance:none;background-color:var(--field);color:var(--text);border:0 !important;border-radius:3px;min-height:40px;padding:8px 32px 8px 10px;font-size:14px;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23b5bac1' d='M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 6px center;background-size:20px;outline:none}
html body select:focus{box-shadow:0 0 0 1px var(--accent)}
html body select:hover{background-color:#1a1b1e}
html body #mem select{min-height:28px;padding:2px 22px 2px 8px;font-size:12px;border-radius:3px;background-position:right 2px center;background-size:16px}
option,optgroup{background:var(--panel);color:var(--text)}

/* checkboxes + radios */
html body input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:none;width:24px;height:24px;margin:0;border:2px solid var(--muted);border-radius:4px;background:transparent;cursor:pointer;position:relative;transition:background-color .1s,border-color .1s}
html body input[type=checkbox]:hover{border-color:var(--muted)}
html body input[type=checkbox]:checked{background:var(--accent);border-color:var(--accent)}
html body input[type=checkbox]:checked::after{content:"";position:absolute;left:6px;top:2px;width:6px;height:11px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
html body input[type=checkbox]:focus-visible{outline:2px solid #00a8fc;outline-offset:2px}
html body input[type=radio]{accent-color:var(--accent);width:20px;height:20px}

/* sliders */
html body input[type=range]{appearance:none;-webkit-appearance:none;height:8px;border-radius:4px;background:var(--btn);outline:none;cursor:pointer}
html body input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:10px;height:24px;border-radius:3px;background:#fff;border:1px solid #c7ccd1;box-shadow:0 1px 2px rgba(0,0,0,.3)}
html body input[type=range]::-moz-range-thumb{width:10px;height:24px;border-radius:3px;background:#fff;border:1px solid #c7ccd1}

/* list cards inside dialogs */
html body :is(.bc-modal,#bc_sheet,#rm) :is(div,label,li)[class*="rounded-lg"][class*="bg-[#1e1f22]"],
html body #rm [class*="rounded-lg"][class*="bg-[#"]{border-radius:4px}
html body #bc_sheet [class*="rounded-xl"],html body #rm [class*="rounded-xl"],html body #bc_settings [class*="rounded-xl"]{border-radius:8px}
html body :is(.bc-modal,#bc_sheet,#rm,#pm) button[class*="rounded-lg"]:not([class*="rounded-full"]){border-radius:3px}
html body :is(.bc-modal,#bc_sheet,#rm,#pm,#bc_settings) button[class*="bg-[#4e5058]"]{background:var(--btn);color:#fff;border-radius:3px;font-weight:500}
html body :is(.bc-modal,#bc_sheet,#rm,#pm,#bc_settings) button[class*="bg-[#4e5058]"]:hover{background:#6d6f78}
html body :is(.bc-modal,#bc_sheet,#rm,#pm,#bc_settings) button[class*="bg-[#f23f43]"],html body :is(.bc-modal,#bc_sheet,#rm,#pm) button[class*="bg-red-"]{border-radius:3px}
html body :is(.bc-modal,#bc_sheet,#rm,#pm) [class*="rounded-full"][class*="bg-[#1e1f22]"],html body #bc_sheet [class*="rounded-full"]:not(img):not([class*="w-"]):not([class*="h-"]){border-radius:4px}
html body :is(.bc-modal,#bc_sheet,#rm,#pm,#bc_settings) hr,html body #bc_sheet [class*="border-t"]{border-color:var(--line)}

/* thin dark scrollbars inside windows */
html body :is(.bc-modal,#bc_sheet,#vpc,#pm,#rm,#bc_settings,#ctx) ::-webkit-scrollbar,html body :is(#vpc,#pm>div,#rm>div,#bc_sheet [data-body]){scrollbar-width:thin;scrollbar-color:#1a1b1e transparent}
:is(#vpc,#pm,#rm,#bc_sheet,#bc_settings) ::-webkit-scrollbar{width:8px;height:8px}
:is(#vpc,#pm,#rm,#bc_sheet,#bc_settings) ::-webkit-scrollbar-thumb{background:#1a1b1e;border:0;border-radius:4px}
:is(#vpc,#pm,#rm,#bc_sheet,#bc_settings) ::-webkit-scrollbar-track{background:transparent;border:0}

/* backdrop */
html body :is(#vp,#pm,#rm){background:rgba(0,0,0,.85)}
html body #bc_sheet,html body .fixed.inset-0.z-\[60\]{background:rgba(0,0,0,.85)}

/* context menu: Discord item look */
html body #ctx{min-width:188px;padding:6px 8px}
html body #ctx>div[onclick],html body #ctx button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;margin:0;border-radius:2px;font-size:14px;font-weight:500;color:var(--muted);line-height:18px}
html body #ctx button:hover{background:var(--accent);color:var(--accent-text)}
html body #ctx>div[onclick].text-\[\#f23f43\],html body #ctx button.text-\[\#f23f43\]{color:var(--danger-solid)}
html body #ctx>div[onclick]:hover,html body #ctx>div[onclick].hover\:bg-\[\#35373c\]:hover{background:var(--accent);color:var(--accent-text)}
html body #ctx>div[onclick].text-\[\#f23f43\]:hover{background:var(--danger-solid);color:#fff}
html body #ctx .h-px{height:1px;margin:4px 0;background:var(--line)}
html body #ctx .grid{display:grid;gap:2px;padding:4px}

/* settings page */
html body #bc_settings nav{border:0;background:var(--panel)}
html body #bc_settings nav button{border-radius:4px;padding:6px 10px;font-size:16px;font-weight:500;color:var(--muted)}
html body #bc_settings nav button:hover{background:var(--hover);color:var(--text)}
html body #bc_settings nav button[class~="bg-[#404249]"]{background:var(--sel);color:#fff}

/* toasts */
html body #toast,html body .toast{border-radius:8px}
html body select{padding-right:32px !important}
html body #mem select{padding-right:22px !important}
html body #vpc button[class*="rounded-full"],html body #vpc .pbtn{border-radius:3px}
html body #vpc{background-color:var(--rail)}
html body #vpc [class*="bg-[#2b2d31]"]{background-color:var(--field)}


/* ===================== global sweep: shapes, chips, bars, panels ===================== */
html body .rounded-md,html body .rounded{border-radius:4px}
html body .rounded-lg{border-radius:4px}
html body .rounded-xl,html body .rounded-2xl{border-radius:8px}
html body button.rounded-full:not([class*="w-"]):not([class*="h-"]){border-radius:3px}
html body :is(button,[role=button]){font-weight:500;cursor:pointer}
html body button:disabled{cursor:not-allowed}
html body a{color:#00a8fc}
html body a:hover{text-decoration:underline}
html body :focus-visible{outline:2px solid #00a8fc;outline-offset:1px}
html body input:focus-visible,html body textarea:focus-visible,html body select:focus-visible{outline:0}

/* signed-in user panel (bottom of the channel list) */
html body #leftcol>div:nth-child(2)>div:last-child{height:auto;min-height:52px;padding:8px;gap:2px;background:var(--rail)}
html body #me{font-size:14px;font-weight:600;line-height:18px;color:var(--text)}
html body #leftcol>div:nth-child(2)>div:last-child>span:last-child{gap:0 2px;justify-content:flex-start}
html body #leftcol>div:nth-child(2)>div:last-child button{font-size:12px;font-weight:500;padding:2px 6px;border-radius:4px;color:var(--muted)}
html body #leftcol>div:nth-child(2)>div:last-child button:hover{background:var(--hover);color:#fff}

/* header toolbar icons */
html body #ch button:not([class*="hover:bg"]),html body #sh button{min-width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:4px;color:var(--muted);font-size:16px;transition:background-color .1s,color .1s}
html body #ch button:not([class*="hover:bg"]):hover,html body #sh button:hover{background:var(--hover);color:var(--text)}
html body #ch #callbtn,html body #ch #groupcallbtn{color:var(--muted)}
html body #ch #callbtn:hover,html body #ch #groupcallbtn:hover{color:var(--ok-solid)}
html body #chtitle{font-size:16px;font-weight:600;color:var(--text)}

/* call banner + call bar */
html body #ringbanner{border-radius:8px;background:#248046}
html body #ringbanner button{border-radius:3px;font-size:14px;font-weight:500;padding:6px 16px}
html body #callbar>div:first-child{background:var(--rail);border-radius:8px}
html body #callbar>div:last-child{background:var(--rail);border-radius:999px}
html body #callbar button.rounded-full{background:var(--panel);transition:background-color .1s,border-radius .1s}
html body #callbar button.rounded-full:hover{background:var(--line)}

/* search + reply + autocomplete bars */
html body #searchbar{margin:8px 16px}
html body #sq{height:36px;padding:0 10px;font-size:14px}
html body #rb{background:var(--panel);border-radius:8px 8px 0 0;padding:8px 12px;font-size:14px;color:var(--muted)}
html body #sug{background:var(--panel);border-radius:8px;padding:8px;box-shadow:0 8px 16px rgba(0,0,0,.24)}
html body #sug>*{border-radius:4px;padding:6px 8px;cursor:pointer}
html body #sug>*:hover,html body #sug>.bg-\[\#35373c\]{background:var(--hover)}
html body #sqres>*{background:var(--panel);border-radius:4px}

/* reactions: Discord pills */
html body [id^="rx_"]{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
html body [id^="rx_"] button{height:24px;padding:0 6px;border-radius:8px;font-size:14px;font-weight:500;line-height:22px;color:var(--muted);border:1px solid transparent;background:var(--panel);transition:none}
html body [id^="rx_"] button:hover{border-color:var(--muted)}
html body [id^="rx_"] button[class*="border-[#5865f2]"]{background:rgba(88,101,242,.15);border-color:var(--accent);color:#dee0fc}

/* embeds, link previews, replies, quotes, code */
html body #msgs [style*="border-left:4px solid"]{border-radius:4px;background:var(--panel);box-shadow:0 0 0 1px rgba(30,31,34,.5)}
html body #msgs .bq{border-left:4px solid var(--btn);border-radius:2px;padding-left:12px}
html body #msgs pre{background:var(--panel);border:1px solid var(--field);border-radius:4px;padding:8px;font-size:14px;line-height:1.3}
html body #msgs code{background:var(--panel);border-radius:3px;padding:.1em .3em;font-size:85%}
html body #msgs pre code{background:transparent;padding:0;font-size:inherit}
html body #msgs img[class*="max-h"],html body #msgs video{border-radius:8px}
html body .spoiler{border-radius:3px}

/* toasts */
html body #toasts>div{background:var(--rail);border-radius:4px;border-left-width:4px;box-shadow:0 8px 16px rgba(0,0,0,.24);color:var(--text);padding:12px 16px;font-size:14px}

/* tag chips and badges: small flat, like role tags */
html body #msgs span[class*="rounded"][class*="font-black"],html body #mem span[class*="rounded"][class*="font-black"]{border-radius:3px}

/* member list headers */
html body #mem [class*="uppercase"]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted)}
html body #mem [data-uid]:hover{background:var(--hover)}

/* channel category headers */
html body #sc [class*="uppercase"]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted)}
html body #sc [class*="uppercase"]:hover{color:var(--text)}

/* DM / friend rows */
html body #sc [data-friend-uid],html body #sc [data-dm]{border-radius:4px}

/* in-app browser */
html body #web #btabs{background:var(--field)}
html body #web #burl{border:0 !important;border-radius:4px;background:var(--field);height:36px;padding:0 12px;font-size:14px}
html body #web #burl:focus{box-shadow:0 0 0 1px var(--accent)}
html body #web>div:nth-child(2){border-bottom:1px solid var(--field);background:var(--panel)}
html body #web button{border-radius:4px}

/* shop */
html body #shop h2{font-size:20px;font-weight:600}
html body #shopg>*{background:var(--panel);border-radius:8px;border:0 !important}
html body #shopg>*:hover{background:var(--hover)}

/* role manager */
html body #rm #rmlist>*{background:var(--panel);border-radius:8px}
html body #rm>div>div:first-child{border-bottom:0;padding:16px}
html body #rm [class*="border-black/30"]{border-color:var(--line)}
html body #rm button[class*="border"][style*="dashed"]{border-radius:3px}

/* generic link-like buttons in dialogs */
html body :is(.bc-modal,#bc_sheet,#rm,#vpc,#pm) button[class*="text-[#5865f2]"],html body :is(.bc-modal,#bc_sheet,#rm,#vpc,#pm) button[class*="text-[#00a8fc]"]{color:#00a8fc}

/* danger buttons everywhere */
html body button[class*="bg-[#f23f43]"],html body button[class*="bg-red-"]{background:var(--danger-solid);color:#fff;border-radius:3px}
html body button[class*="bg-[#f23f43]"]:hover,html body button[class*="bg-red-"]:hover{background:#a12828}

/* Discord-style tooltips for the custom title popups are native; keep text selection colour like Discord */
::selection{background:rgba(0,104,224,.5)}
html body #sh{padding-left:16px;padding-right:8px;gap:2px}
html body #sh>*:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
html body #sh button{min-width:24px;width:24px;height:28px;font-size:14px}
html body #sh>*:not(:first-child){flex-shrink:0}
html body #vpc .bc-foot{margin:16px -20px -20px}
html body #rm [class~="space-y-3"]>#rmlist:empty{display:none}

/* Discord-style context menu details */
html body #ctx{width:auto;min-width:188px;max-width:320px;padding:6px 8px}
html body #ctx>div[onclick]{padding:6px 8px;min-height:32px}
html body #ctx .ic{width:20px;flex:none;font-size:14px;color:var(--muted);text-align:center}
html body #ctx .ic:empty{display:none}
html body #ctx>div[onclick]:hover .ic{color:#fff}
html body #ctx .ar{color:var(--muted);font-size:18px;line-height:1}
html body #ctx>div[onclick]:hover .ar{color:#fff}
html body #ctx>div.flex.gap-2{padding:0 0 8px}
html body #ctx>div.flex.gap-2>span{flex:1;width:auto;height:40px;border-radius:4px;background:var(--field);font-size:20px}
html body #ctx>div.flex.gap-2>span:hover{background:var(--hover)}
html body #ctx .h-px{margin:4px -4px}
html body #ctx .ic{filter:grayscale(1) brightness(1.4)}

/* phones: long-press menu */
html body #msgs>div[id^="m_"]{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
html body #ctx{max-height:min(80vh,calc(100dvh - 16px));overflow-y:auto}
@media (hover:none){html body #ctx>div[onclick]{min-height:44px;font-size:16px}}

/* ===== attachment tray (files wait here until you press Send) ===== */
#attray{display:flex;gap:12px;overflow-x:auto;margin:0 16px;padding:12px 12px 8px;background:var(--panel);border-radius:8px 8px 0 0}
#attray .att{position:relative;flex:none;width:120px;padding:8px;border-radius:4px;background:var(--rail)}
#attray .att img{display:block;width:100%;height:96px;object-fit:cover;border-radius:3px;background:var(--field)}
#attray .att-f{height:96px;display:flex;align-items:center;justify-content:center;font-size:40px;background:var(--field);border-radius:3px}
#attray .att-n{margin-top:6px;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#attray .att-x{position:absolute;top:-8px;right:-8px;z-index:1;width:24px;height:24px;border:0;border-radius:4px;background:var(--panel);color:var(--danger-solid);font-size:12px;cursor:pointer;box-shadow:0 0 0 1px rgba(0,0,0,.3)}
#attray .att-x:hover{background:var(--danger-solid);color:#fff}
#attray+#f{padding-top:0}
#attray+#f #i{border-radius:0 0 8px 8px}
@media (max-width:767px){#attray{margin:0 10px}}

/* ===== message hover actions ===== */
#mact{position:fixed;z-index:30;display:flex;padding:2px;border-radius:8px;background:var(--bg);box-shadow:0 0 0 1px rgba(0,0,0,.28),0 4px 12px rgba(0,0,0,.24)}
#mact.hidden{display:none}
#mact button{width:32px;height:32px;border:0;border-radius:4px;background:transparent;color:var(--muted);font-size:17px;cursor:pointer}
#mact button:hover{background:var(--line);color:var(--text)}
.reply-ref{margin-left:2px;line-height:16px}
.reply-ref:hover{text-decoration:underline}

/* ===== Server Settings (settingshub.js): Discord layout, sidebar + content ===== */
#sx{position:fixed;inset:0;z-index:45;display:flex;background:var(--bg);color:var(--text);animation:sxin .16s ease-out}
@keyframes sxin{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
#sx .sx-nav{flex:1 0 218px;background:var(--panel);display:flex;justify-content:flex-end;overflow-y:auto}
#sx .sx-nav-in{width:218px;padding:60px 6px 24px 20px;box-sizing:border-box}
#sx .sx-grp{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;color:var(--muted);padding:16px 10px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#sx .sx-grp:first-child{padding-top:0}
#sx .sx-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 10px;margin-bottom:2px;border-radius:4px;color:var(--muted);font-size:15px;font-weight:500}
#sx .sx-item:hover{background:var(--hover);color:var(--text)}
#sx .sx-item.on{background:var(--sel);color:#fff}
#sx .sx-ic{width:20px;text-align:center;font-size:14px;opacity:.85}
#sx .sx-main{flex:1 1 800px;position:relative;overflow-y:auto;padding:60px 40px 80px 40px;box-sizing:border-box}
#sx .sx-wrap{max-width:740px}
#sx .sx-head h2{font-size:20px;font-weight:700;color:var(--text);margin:0 0 20px}
#sx .sx-close{position:fixed;top:60px;right:40px;width:36px;display:flex;flex-direction:column;align-items:center;gap:4px;color:var(--muted)}
#sx .sx-close span{width:36px;height:36px;border:2px solid var(--muted);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:15px}
#sx .sx-close small{font-size:11px;font-weight:700;letter-spacing:.04em}
#sx .sx-close:hover span{background:rgba(255,255,255,.08);color:#fff;border-color:#fff}
#sx .sx-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;flex-wrap:wrap}
#sx .sx-bar-r{display:flex;gap:8px;flex-shrink:0}
#sx .sx-sub{font-size:13px;color:var(--muted);line-height:1.35}
#sx .sx-note{font-size:13px;color:var(--muted);background:var(--panel);border-radius:6px;padding:12px 14px;margin:12px 0;line-height:1.4}
#sx .sx-sec{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;color:var(--muted);margin:24px 0 8px}
#sx .sx-card,#sx .sx-row{display:flex;align-items:center;gap:12px;background:var(--panel);border-radius:8px;padding:12px 14px;margin-bottom:8px;border:1px solid transparent}
#sx .sx-card:hover{border-color:var(--line)}
#sx .sx-row{border-radius:6px;padding:8px 12px;margin-bottom:4px;background:transparent}
#sx .sx-row:hover{background:var(--hover)}
#sx .sx-grow{flex:1;min-width:0}
#sx .sx-nm{font-size:15px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sx .sx-big{font-size:20px;font-weight:700;color:#fff}
#sx .sx-rname{font-size:15px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sx .sx-dot{width:14px;height:14px;border-radius:50%;flex-shrink:0}
#sx .sx-chic{width:24px;text-align:center;color:var(--muted);font-size:18px;font-weight:700;flex-shrink:0}
#sx .sx-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
#sx .sx-chip{font-size:11px;font-weight:600;background:var(--field);color:var(--text);border-radius:4px;padding:2px 7px}
#sx .sx-chip.dim{color:var(--muted);font-weight:500}
#sx .sx-chip.adm{background:rgba(240,178,50,.15);color:#f0b232}
#sx .sx-acts{display:flex;gap:6px;flex-shrink:0}
#sx .sx-reorder{display:flex;flex-direction:column;flex-shrink:0;font-size:9px;line-height:1}
#sx .sx-reorder button{color:var(--muted);padding:3px 4px}
#sx .sx-reorder button:hover:not(:disabled){color:#fff}
#sx .sx-reorder button:disabled{opacity:.25;cursor:default}
#sx .sx-btn{font-size:14px;font-weight:500;padding:6px 14px;border-radius:3px;background:var(--btn);color:#fff;white-space:nowrap}
#sx .sx-btn:hover{background:#6d6f78}
#sx .sx-btn.blue{background:var(--accent)}#sx .sx-btn.blue:hover{background:var(--accent-hover)}
#sx .sx-btn.green{background:#248046}#sx .sx-btn.green:hover{background:#1a6334}
#sx .sx-btn.ghost{background:transparent;color:var(--text)}#sx .sx-btn.ghost:hover{text-decoration:underline;background:transparent}
#sx .sx-btn.red{background:transparent;color:var(--danger-solid);border:1px solid var(--danger-solid)}#sx .sx-btn.red:hover{background:var(--danger-solid);color:#fff;border-color:var(--danger-solid)}
#sx .sx-empty{text-align:center;color:var(--muted);font-size:14px;padding:40px 10px;line-height:1.6}
#sx .sx-back{color:#00a8fc;font-size:14px;margin-bottom:12px}#sx .sx-back:hover{text-decoration:underline}
#sx .sx-ov .sx-srvico{width:72px;height:72px;border-radius:50%;overflow:hidden;background:var(--accent);color:var(--accent-text);font-size:28px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
#sx .sx-srvico img{width:100%;height:100%;object-fit:cover}
#sx .sx-danger{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid var(--danger-solid);border-radius:8px;padding:14px 16px;margin-top:28px}
#sx .sx-dt{font-weight:700;color:var(--text);margin-bottom:2px}
/* forms */
#sx .sx-lbl{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;color:var(--muted);margin:14px 0 0}
#sx .sx-hint{text-transform:none;font-weight:400;color:var(--muted);letter-spacing:0;margin-left:4px}
#sx .sx-in{display:block;width:100%;margin-top:8px;background:var(--field);border-radius:4px;padding:10px;color:var(--text);font-size:16px;font-weight:400;text-transform:none;letter-spacing:0;outline:none;box-sizing:border-box}
#sx .sx-in:focus{box-shadow:0 0 0 2px rgba(88,101,242,.5)}
#sx .sx-sw{display:grid;grid-template-columns:repeat(10,1fr);gap:8px;margin-top:8px;max-width:420px}
#sx .sx-sw button,#sx .sx-sw .sx-cust{width:100%;aspect-ratio:1;border-radius:4px;border:2px solid transparent;position:relative}
#sx .sx-sw button.on{border-color:#fff;box-shadow:0 0 0 2px var(--bg) inset}
#sx .sx-cust{display:flex;align-items:center;justify-content:center;background:var(--field);font-size:13px;cursor:pointer;overflow:hidden}
#sx .sx-cust input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}
#sx .sx-prev{margin-top:8px;background:var(--panel);border-radius:6px;padding:14px}
#sx .sx-badge{display:inline-block;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.02em;color:#fff;padding:2px 7px;border-radius:4px}
#sx .sx-perm{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
#sx .sx-perm-adm{border-bottom:1px solid var(--line)}
#sx .sx-pn{font-size:15px;font-weight:600;color:var(--text)}
#sx .sx-pd{font-size:13px;color:var(--muted);margin-top:2px}
#sx .sx-tg{position:relative;flex-shrink:0;width:40px;height:24px;display:inline-block}
#sx .sx-tg input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:2}
#sx .sx-tg i{position:absolute;inset:0;background:var(--muted);border-radius:12px;transition:background .12s}
#sx .sx-tg i::after{content:'';position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .12s}
#sx .sx-tg input:checked+i{background:var(--ok-solid)}
#sx .sx-tg input:checked+i::after{transform:translateX(16px)}
#sx .sx-tg input:disabled{cursor:not-allowed}#sx .sx-tg input:disabled+i{opacity:.55}
#sx .sx-foot{position:sticky;bottom:14px;display:flex;justify-content:flex-end;gap:8px;background:var(--panel);border-radius:8px;padding:12px 14px;margin-top:24px;box-shadow:0 -8px 16px rgba(0,0,0,.18)}
/* the older tool pages (welcome, webhooks, auto-mod, blocked words) are drawn into this dialog too */
#sx [data-back]{display:none}
#sx #sx_b input:not([type=checkbox]):not([type=color]):not([type=range]),#sx #sx_b textarea,#sx #sx_b select{background:var(--field)}
@media (max-width:767px){
  #sx{flex-direction:column}
  #sx .sx-nav{flex:0 0 auto;justify-content:flex-start;overflow:auto hidden;border-bottom:1px solid var(--field)}
  #sx .sx-nav-in{width:auto;display:flex;align-items:center;gap:4px;padding:12px 56px 10px 12px}
  #sx .sx-grp{display:none}
  #sx .sx-item{width:auto;white-space:nowrap;margin:0;padding:6px 12px}
  #sx .sx-main{padding:16px 14px 80px}
  #sx .sx-close{top:10px;right:10px;width:auto}#sx .sx-close small{display:none}#sx .sx-close span{width:32px;height:32px;background:var(--panel)}
  #sx .sx-card{flex-wrap:wrap}#sx .sx-acts{width:100%;justify-content:flex-end}
  #sx .sx-sw{grid-template-columns:repeat(5,1fr)}
  #sx .sx-foot{bottom:10px}
}
#sx .sx-lock{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);background:var(--field);border-radius:3px;padding:1px 6px;margin-left:8px;vertical-align:middle}

/* hidden buttons stay hidden: the #ch button rule above forces display, which made DM-only buttons (call, voice, group settings) and the mobile-only members button show everywhere */
html body #ch button.hidden{display:none}
@media (min-width:768px){html body #ch #membtn{display:none}}

/* ---- avatar decorations ---- */
.dec{position:relative;display:inline-flex;flex-shrink:0;border-radius:9999px}
.dec-ring{box-shadow:0 0 0 2px var(--d1),0 0 0 4px var(--d2)}
.dec-glow{box-shadow:0 0 8px 2px var(--d1),0 0 18px 4px var(--d2)}
.dec-pulse{animation:decpulse 1.6s ease-in-out infinite}
@keyframes decpulse{0%,100%{box-shadow:0 0 4px 1px var(--d1)}50%{box-shadow:0 0 14px 5px var(--d2)}}
.dec-spin::after,.dec-rainbow::after{content:'';position:absolute;inset:-4px;border-radius:50%;pointer-events:none;background:conic-gradient(var(--d1),var(--d2),var(--d1));-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));animation:decrot 3s linear infinite}
.dec-rainbow::after{background:conic-gradient(#ff3b3b,#ffb02e,#f4ff3b,#3bff6f,#3bd5ff,#6b3bff,#ff3bd5,#ff3b3b)}
@keyframes decrot{to{transform:rotate(360deg)}}
/* picture decorations (see IMG_DECOR in app.js) */
.dec-img{border-radius:0}
.dec-img .dec-pic{object-fit:contain;position:absolute !important;left:50%;top:50%;width:calc(var(--ds) * 100%) !important;height:calc(var(--ds) * 100%) !important;max-width:none !important;transform:translate(-50%,-50%);pointer-events:none;user-select:none;z-index:3}
@media (prefers-reduced-motion:reduce){.dec,.dec::after{animation:none !important}}

/* icon + label buttons under your name in the sidebar */
.meb-row{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.meb{min-width:0;padding:6px 0 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:8px;background:rgba(255,255,255,.05);color:var(--muted);border:1px solid transparent;transition:background .15s,color .15s,transform .1s,border-color .15s}
.meb-i{font-size:15px;line-height:1}
.meb-t{font-size:9.5px;font-weight:500;line-height:1.1;white-space:nowrap}
.meb.red{grid-column:span 2}
.meb:hover{background:rgba(255,255,255,.12);color:#fff;border-color:rgba(255,255,255,.12)}
.meb:active{transform:scale(.95)}
.meb.red:hover{background:rgba(242,63,67,.2);color:var(--danger-solid);border-color:rgba(242,63,67,.35)}
