/* ============================================================================
   SPTS Legends dashboard — remake stylesheet.
   Dark "aurora glass" theme, full obsidian mode, mobile drawer at <=860px.
   ========================================================================== */

:root {
  --bg: #080a12;
  --bg-gradient:
    radial-gradient(1100px 760px at 82% -12%, #1c2145 0%, transparent 55%),
    radial-gradient(720px 500px at 48% 42%, rgba(64, 199, 245, .06) 0%, transparent 60%),
    radial-gradient(880px 620px at -12% 112%, #101d34 0%, transparent 52%),
    #080a12;
  --panel: rgba(255, 255, 255, .045);
  --panel-2: #1a1e29;
  --panel-3: #222736;
  --glass: rgba(17, 20, 31, .9);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .15);
  --text: #eef0f5;
  --muted: #8b93a5;
  --accent: #7c5cff;
  --accent-2: #42c8f5;
  --accent-glow: rgba(124, 92, 255, .45);
  --accent-soft: rgba(124, 92, 255, .16);
  --green: #2ee06f;
  --green-soft: rgba(46, 224, 111, .14);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, .14);
  --red: #f04747;
  --red-soft: rgba(240, 71, 71, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 10px 34px rgba(3, 5, 12, .5);
  --shadow-2: 0 18px 54px rgba(3, 5, 12, .62);
  --motion-fast: 380ms;
  --motion-base: 820ms;
  --motion-blur: 12px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
::selection { background: var(--accent); color: #fff; }
:where(.tab-content, .guild-list, .modal-box, .accounts-checks, .dd-menu) {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 255, .62) rgba(255, 255, 255, .035);
}
:where(.tab-content, .guild-list, .modal-box, .accounts-checks, .dd-menu)::-webkit-scrollbar { width: 10px; height: 10px; }
:where(.tab-content, .guild-list, .modal-box, .accounts-checks, .dd-menu)::-webkit-scrollbar-track { background: rgba(255, 255, 255, .025); border-radius: 999px; }
:where(.tab-content, .guild-list, .modal-box, .accounts-checks, .dd-menu)::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent-2)) padding-box;
}

html { color-scheme: dark; height: 100%; }
html.dark-mode {
  --bg: #030407;
  --bg-gradient:
    radial-gradient(1100px 760px at 78% -20%, rgba(36, 43, 75, .42) 0%, transparent 58%),
    radial-gradient(900px 680px at 46% 54%, rgba(23, 75, 92, .14) 0%, transparent 62%),
    radial-gradient(900px 660px at -14% 112%, rgba(31, 22, 54, .32) 0%, transparent 56%),
    #030407;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: #0b0d12;
  --panel-3: #141821;
  --glass: rgba(5, 7, 11, .9);
  --border: rgba(207, 218, 255, .075);
  --border-strong: rgba(220, 228, 255, .14);
  --text: #f4f6fb;
  --muted: #7d8699;
  --accent: #8b68ff;
  --accent-2: #36bde8;
  --accent-glow: rgba(116, 87, 255, .38);
  --accent-soft: rgba(117, 86, 255, .14);
  --shadow-1: 0 12px 38px rgba(0, 0, 0, .62);
  --shadow-2: 0 24px 70px rgba(0, 0, 0, .76);
}
html.theme-shifting body,
html.theme-shifting .sidebar,
html.theme-shifting .field,
html.theme-shifting .settings-card,
html.theme-shifting .tabs,
html.theme-shifting .modal-box {
  transition: background 850ms var(--ease), border-color 850ms var(--ease), color 850ms var(--ease), box-shadow 850ms var(--ease);
}

body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  background-size: 175% 175%;
  animation: bg-pan 22s ease-in-out infinite alternate;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
@keyframes bg-pan {
  from { background-position: 18% 12%; }
  to   { background-position: 82% 88%; }
}

/* Starfield: two twinkling layers of dots, cheap box-shadow trick. */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: transparent;
  z-index: -1;
  pointer-events: none;
}
body::before {
  box-shadow:
    5vw 14vh 0 0 rgba(255,255,255,.6), 13vw 66vh 0 0 rgba(255,255,255,.4), 22vw 33vh 0 0 rgba(212,220,255,.55),
    28vw 84vh 0 0 rgba(255,255,255,.35), 34vw 7vh 0 0 rgba(255,255,255,.5), 42vw 52vh 0 0 rgba(190,205,255,.45),
    49vw 22vh 0 0 rgba(255,255,255,.55), 56vw 75vh 0 0 rgba(255,255,255,.4), 61vw 38vh 0 0 rgba(255,255,255,.6),
    69vw 87vh 0 0 rgba(200,215,255,.4), 75vw 14vh 0 0 rgba(255,255,255,.5), 82vw 57vh 0 0 rgba(255,255,255,.45),
    87vw 31vh 0 0 rgba(255,255,255,.55), 92vw 78vh 0 0 rgba(255,255,255,.35), 96vw 44vh 0 0 rgba(215,225,255,.5),
    9vw 91vh 0 0 rgba(255,255,255,.4), 38vw 96vh 0 0 rgba(255,255,255,.35), 85vw 4vh 0 0 rgba(255,255,255,.45);
  animation: twinkle-a 9s ease-in-out infinite alternate;
}
body::after {
  width: 1.5px; height: 1.5px;
  box-shadow:
    4vw 44vh 0 0 rgba(160,175,255,.4), 12vw 24vh 0 0 rgba(255,255,255,.3), 19vw 56vh 0 0 rgba(255,255,255,.35),
    25vw 6vh 0 0 rgba(140,160,255,.35), 32vw 62vh 0 0 rgba(255,255,255,.3), 39vw 17vh 0 0 rgba(120,200,245,.35),
    46vw 89vh 0 0 rgba(255,255,255,.3), 53vw 46vh 0 0 rgba(255,255,255,.25), 58vw 9vh 0 0 rgba(150,170,255,.4),
    66vw 67vh 0 0 rgba(255,255,255,.3), 72vw 35vh 0 0 rgba(120,200,245,.3), 79vw 83vh 0 0 rgba(255,255,255,.35),
    86vw 48vh 0 0 rgba(255,255,255,.25), 90vw 19vh 0 0 rgba(160,175,255,.35), 94vw 64vh 0 0 rgba(255,255,255,.3),
    8vw 77vh 0 0 rgba(120,200,245,.3), 26vw 48vh 0 0 rgba(255,255,255,.25), 57vw 94vh 0 0 rgba(255,255,255,.3);
  animation: twinkle-b 11s ease-in-out infinite alternate;
}
@keyframes twinkle-a { from { opacity: 1; } to { opacity: .3; } }
@keyframes twinkle-b { from { opacity: .35; } to { opacity: 1; } }
body.dashboard-active::before,
body.dashboard-active::after { opacity: .62; }
body.bg-paused,
body.bg-paused::before,
body.bg-paused::after,
body.bg-paused .aurora-blob { animation-play-state: paused !important; }

/* Aurora blobs behind everything. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.aurora::before {
  content: "";
  position: absolute;
  width: 110vmax;
  height: 110vmax;
  left: calc(50% - 55vmax);
  top: calc(50% - 55vmax);
  opacity: .32;
  background: conic-gradient(from 30deg, transparent 0 13%, rgba(73, 84, 210, .14) 22%, transparent 34% 53%, rgba(39, 175, 207, .11) 64%, transparent 76% 100%);
  filter: blur(74px);
  animation: mesh-rotate 38s linear infinite;
}
.aurora-depth,
.aurora-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.aurora-depth {
  inset: -12%;
  opacity: .58;
  background:
    radial-gradient(ellipse 36% 30% at 18% 22%, rgba(101, 73, 224, .24), transparent 72%),
    radial-gradient(ellipse 34% 42% at 82% 34%, rgba(29, 146, 186, .18), transparent 72%),
    radial-gradient(ellipse 46% 32% at 55% 88%, rgba(155, 48, 123, .10), transparent 75%);
  filter: blur(28px) saturate(1.22);
  animation: depth-breathe 13s ease-in-out infinite alternate;
}
.aurora-noise {
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  mix-blend-mode: soft-light;
}
@keyframes mesh-rotate { to { transform: rotate(360deg) scale(1.06); } }
@keyframes depth-breathe {
  from { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .48; }
  to { transform: translate3d(3%, 2%, 0) scale(1.1); opacity: .72; }
}
.aurora::after {
  content: "";
  position: absolute;
  width: 58vw;
  height: 180vh;
  left: -72vw;
  top: -42vh;
  opacity: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(88, 105, 255, .04) 32%, rgba(66, 200, 245, .17) 50%, rgba(124, 92, 255, .05) 68%, transparent 100%);
  filter: blur(34px);
  transform: rotate(19deg);
  animation: light-sweep 10s cubic-bezier(.4, 0, .2, 1) infinite;
}
.aurora-grid,
.aurora-orbit {
  position: absolute;
  inset: -24%;
  pointer-events: none;
}
.aurora-grid {
  opacity: .22;
  background-image:
    linear-gradient(rgba(112, 137, 255, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 200, 245, .09) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 68%);
  transform: perspective(760px) rotateX(64deg) translateY(18%);
  animation: grid-drift 16s linear infinite;
}
.aurora-orbit {
  inset: -18%;
  border: 1px solid rgba(103, 154, 255, .13);
  border-radius: 44%;
  box-shadow: 0 0 90px rgba(85, 103, 255, .09), inset 0 0 80px rgba(66, 200, 245, .05);
  transform: rotate(-14deg);
  animation: orbit-drift 14s cubic-bezier(.45, .05, .55, .95) infinite alternate;
}
@keyframes light-sweep {
  0%, 12% { left: -72vw; opacity: 0; }
  22% { opacity: .62; }
  68% { opacity: .42; }
  82%, 100% { left: 126vw; opacity: 0; }
}
@keyframes grid-drift {
  from { background-position: 0 0, 0 0; transform: perspective(760px) rotateX(64deg) translate3d(0, 18%, 0); }
  to { background-position: 144px 72px, 72px 144px; transform: perspective(760px) rotateX(64deg) translate3d(-6%, 14%, 0); }
}
@keyframes orbit-drift {
  from { opacity: .36; transform: rotate(-14deg) scale(.96); }
  to { opacity: .8; transform: rotate(16deg) scale(1.08); }
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  opacity: .52;
  filter: blur(68px) saturate(1.18);
  will-change: transform, filter;
}
.aurora-a { width: 46vw; height: 46vw; left: -12vw; top: -14vh; background: radial-gradient(circle, rgba(124,92,255,.5), transparent 65%); animation: drift-a 18s ease-in-out infinite alternate; }
.aurora-b { width: 38vw; height: 38vw; right: -10vw; top: 6vh; background: radial-gradient(circle, rgba(66,200,245,.4), transparent 65%); animation: drift-b 21s ease-in-out infinite alternate; }
.aurora-c { width: 34vw; height: 34vw; left: 22vw; bottom: -16vh; background: radial-gradient(circle, rgba(240,71,150,.28), transparent 65%); animation: drift-a 24s ease-in-out infinite alternate-reverse; }
.aurora-d { width: 26vw; height: 26vw; right: 14vw; bottom: 4vh; background: radial-gradient(circle, rgba(46,224,111,.22), transparent 65%); animation: drift-b 27s ease-in-out infinite alternate-reverse; }
@keyframes drift-a {
  from { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  48%  { transform: translate3d(7vw, 4vh, 0) rotate(14deg) scale(1.08); }
  to   { transform: translate3d(-10vw, 9vh, 0) rotate(32deg) scale(1.16); }
}
@keyframes drift-b {
  from { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  42%  { transform: translate3d(-5vw, 7vh, 0) rotate(-10deg) scale(1.13); }
  to   { transform: translate3d(10vw, -8vh, 0) rotate(-28deg) scale(1.06); }
}
body.dashboard-active .aurora-blob { opacity: .44; }
html.dark-mode .aurora::before { opacity: .2; filter: blur(92px) saturate(.9); }
html.dark-mode .aurora-depth { opacity: .38; filter: blur(42px) saturate(.84); }
html.dark-mode .aurora-grid { opacity: .1; }
html.dark-mode .aurora-orbit { opacity: .26; border-color: rgba(111, 127, 190, .09); }
html.dark-mode .aurora-blob { opacity: .29; filter: blur(92px) saturate(.82); }
html.dark-mode body.dashboard-active .aurora-blob { opacity: .25; }
html.dark-mode body::before,
html.dark-mode body::after { opacity: .42; }

/* ------------------------------------------------------------------ utils */
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: "Cascadia Code", "Consolas", monospace; }
.error { color: var(--red); font-size: 13px; }
.success-note { color: var(--green); font-size: 13px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------- scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--panel-3);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #2d3446; background-clip: padding-box; border: 2px solid transparent; }

/* ------------------------------------------------------------- theme flip */
.theme-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  min-width: 112px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(11, 14, 22, .76);
  backdrop-filter: blur(16px) saturate(135%);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255,255,255,.06);
  cursor: pointer;
  padding: 4px 9px 4px 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  transition: transform var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); border-color: rgba(117, 196, 255, .48); color: var(--text); }
.theme-toggle-track {
  width: 38px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(65, 191, 229, .52), rgba(124, 92, 255, .62));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f4f6ff;
  background: #111520;
  box-shadow: 0 3px 9px rgba(0,0,0,.45);
  transition: transform 720ms cubic-bezier(.2,.8,.2,1), background var(--motion-fast) var(--ease);
}
html:not(.dark-mode) .theme-toggle-thumb { transform: translateX(14px) rotate(180deg); background: #5c43df; }
html.dark-mode .theme-toggle { background: rgba(4, 6, 10, .86); }

html.dark-mode .sidebar,
html.dark-mode .mobile-topbar { background: rgba(5, 7, 11, .9); }
html.dark-mode .tabs { background: rgba(7, 9, 14, .64); border-color: rgba(224, 230, 255, .07); }
html.dark-mode .field,
html.dark-mode .settings-card,
html.dark-mode .ticket-card,
html.dark-mode .person-card,
html.dark-mode .log-entry { background: linear-gradient(145deg, rgba(255,255,255,.032), rgba(255,255,255,.012)); }
html.dark-mode input[type="text"],
html.dark-mode input[type="search"],
html.dark-mode input[type="number"],
html.dark-mode input[type="password"],
html.dark-mode input[type="datetime-local"],
html.dark-mode textarea,
html.dark-mode select { background: rgba(1, 2, 5, .68); border-color: rgba(218, 226, 255, .09); }
html.dark-mode .modal-box { background: rgba(7, 9, 14, .94); }

/* ------------------------------------------------------------ boot loader */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
}
.orbit {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: orbit-spin 900ms linear infinite;
  display: none;
}
.boot-orbit { display: block; width: 40px; height: 40px; border-width: 3px; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.boot-status { color: var(--muted); font-size: 13px; opacity: 0; transition: opacity var(--motion-fast) var(--ease); }
.boot-status.visible { opacity: 1; }

/* ------------------------------------------------------------------ login */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: min(380px, 100%);
  padding: 34px 30px 28px;
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: rise-in var(--motion-base) var(--ease-out);
}
@keyframes rise-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(14px) scale(.985); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
.login-mark {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 26px var(--accent-glow);
}
.login-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: .3px; }
.login-card .muted { margin: 0 0 18px; }
.login-card input {
  width: 100%;
  margin-bottom: 10px;
}
.login-hint { margin-top: 14px !important; margin-bottom: 0 !important; font-size: 12px !important; }
.login-card .error { margin: 10px 0 0; }

/* ----------------------------------------------------------- form controls */
input[type="text"], input[type="search"], input[type="number"], input[type="password"],
input[type="datetime-local"], textarea, select {
  background: rgba(10, 12, 20, .55);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  min-height: 38px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[readonly] { opacity: .65; cursor: default; }
textarea { width: 100%; min-height: 74px; resize: vertical; }
input[type="color"] {
  inline-size: 52px; block-size: 36px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 12, 20, .55);
  cursor: pointer;
}
input[type="checkbox"] {
  appearance: none;
  accent-color: var(--accent);
  width: 17px; height: 17px;
  flex: 0 0 17px;
  display: inline-grid;
  place-content: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 5px;
  background: rgba(8, 10, 18, .72);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 180ms var(--ease-out);
}
input[type="checkbox"]:checked {
  border-color: rgba(200, 190, 255, .9);
  background: linear-gradient(135deg, var(--accent), #5d3df0);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 5px 14px rgba(124, 92, 255, .24);
}
input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:active { transform: scale(.9); }
input[type="checkbox"][hidden] { display: none; }
label { font-size: 13px; color: var(--text); display: block; margin-bottom: 6px; }
label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 7px; }
label input[type="checkbox"] { vertical-align: -3px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  line-height: 1;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .17);
  padding: 0 15px;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent), var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 5px 14px rgba(3, 5, 12, .18);
  transition: transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease),
              background var(--motion-fast) var(--ease), background-position var(--motion-base) var(--ease-out), border-color var(--motion-fast) var(--ease),
              opacity var(--motion-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn::after {
  content: "";
  position: absolute;
  inset: -70% -30%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,.42) 50%, transparent 58%);
  filter: blur(8px);
  transform: translateX(-58%) skewX(-18deg);
}
.btn:hover:not(:disabled)::after { animation: button-sheen 680ms var(--ease-out); }
@keyframes button-sheen {
  0% { opacity: 0; transform: translateX(-58%) skewX(-18deg); }
  28% { opacity: .52; }
  100% { opacity: 0; transform: translateX(58%) skewX(-18deg); }
}
.btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.018); border-color: rgba(145, 214, 255, .58); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 12px 26px rgba(3, 5, 12, .32), 0 0 0 1px rgba(66, 200, 245, .08); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.965); transition-duration: 120ms; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .tab:focus-visible, .tab-group:focus-visible, .actions-trigger:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.tab.active:focus-visible, .tab-group.active:focus-visible {
  outline: 1px solid rgba(255, 255, 255, .65);
  outline-offset: -3px;
}
.btn-primary {
  border-color: rgba(207, 197, 255, .48);
  background: linear-gradient(110deg, #6041e8 0%, var(--accent) 38%, #8f72ff 52%, #5d3df0 100%);
  background-size: 220% 100%;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 20px rgba(124, 92, 255, .28);
}
.btn-primary:hover:not(:disabled) { background-position: 100% 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 10px 28px rgba(124, 92, 255, .4); }
.btn-danger {
  background: var(--red-soft);
  border-color: rgba(240, 71, 71, .35);
  color: #ff8a8a;
}
.btn-danger:hover:not(:disabled) { background: rgba(240, 71, 71, .24); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 4px 10px; font-size: 15px; line-height: 1; }

/* -------------------------------------------------------------- app shell */
.app {
  display: grid;
  grid-template-columns: 292px 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(125%);
  min-height: 0;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}
.sidebar-head h2 { margin: 0; font-size: 17px; letter-spacing: .3px; }
.conn-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(240, 71, 71, .7);
  transition: background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.conn-dot.live { background: var(--green); box-shadow: 0 0 8px rgba(46, 224, 111, .8); }

.global-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 18px 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
}

/* Switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.switch .slider::before {
  content: "";
  position: absolute;
  left: 3px; top: 50%;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #aab1c2;
  transform: translateY(-50%);
  transition: transform var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translate(15px, -50%); background: #fff; }

/* Search boxes */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(10, 12, 20, .55);
  border: 1px solid var(--border);
  transition: border-color var(--motion-fast) var(--ease);
  margin-bottom: 0;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box span { color: var(--muted); font-size: 14px; }
.search-box input {
  background: transparent;
  border: none;
  box-shadow: none !important;
  padding: 8px 0;
  flex: 1;
  min-width: 0;
}
.guild-search-wrap { margin: 0 18px 10px; }

/* Guild list */
.guild-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 10px;
  min-height: 0;
}
.guild-list-empty { padding: 12px 10px; }
.guild-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
  animation: guild-in .5s var(--ease-out) backwards;
  position: relative;
}
@keyframes guild-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
.guild-item:hover { background: var(--panel); }
.guild-item.active {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, .4);
}
.guild-item.is-hidden { opacity: .55; }
.guild-item.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  animation: orbit-spin 800ms linear infinite;
}
.guild-item > div { min-width: 0; flex: 1; }
.gi-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-id { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-hide-btn {
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.guild-item:hover .guild-hide-btn { opacity: 1; }
.guild-hide-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* Avatars (guild icons, user avatars) */
.avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  flex: none;
  object-fit: cover;
  background: var(--panel-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
}
img.avatar { color: transparent; }
.avatar-round { border-radius: 50%; }

/* Skeletons */
.guild-skeleton { pointer-events: none; }
.skeleton-block, .skeleton-line {
  background: linear-gradient(100deg, var(--panel-2) 40%, var(--panel-3) 50%, var(--panel-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-line { height: 10px; border-radius: 5px; width: 80%; }
.skeleton-line.short { width: 45%; }

/* Sidebar footer */
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.show-hidden-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.show-hidden-btn:not(.has-hidden) { display: none; }
.show-hidden-btn:hover { color: var(--text); border-color: var(--accent); }
.show-hidden-btn.active { color: var(--text); background: var(--accent-soft); border-style: solid; border-color: rgba(124, 92, 255, .4); }
.show-hidden-eye {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
  flex: none;
}
.show-hidden-eye::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
}
.show-hidden-label { flex: 1; text-align: left; }
.hidden-count-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}
.sidebar-user { display: flex; flex-direction: column; gap: 6px; }
.sidebar-user-btn {
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.sidebar-user-btn:hover { color: var(--text); border-color: var(--accent); }

/* ------------------------------------------------------------------- main */
.main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.empty-state {
  margin: auto;
  text-align: center;
  animation: rise-in var(--motion-base) var(--ease-out);
}
.empty-state-glyph {
  font-size: 40px;
  width: 84px; height: 84px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--border-strong);
  color: var(--accent-2);
}
.empty-state h2 { margin: 0 0 6px; }

.guild-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 18px 22px 0;
}

/* Header */
.guild-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
}
.guild-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
}
.guild-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--muted);
}
.guild-header-copy { min-width: 0; }
.guild-header h2 { margin: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-refresh { margin-left: auto; }
.header-refresh .refresh-icon { display: inline-block; transition: transform .5s var(--ease); }
.header-refresh.refreshing .refresh-icon { animation: orbit-spin 800ms linear infinite; }
.save-indicator {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
  min-width: 64px;
}
.save-indicator.show { opacity: 1; transform: none; }

/* ----------------------------------------------------------------- tabs */
.tab-groups, .tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(15, 18, 29, .92);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.tabs { margin-bottom: 16px; }
.tab-group, .tab {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.tab { font-size: 12.5px; padding: 6px 12px; }
.tab-group:hover, .tab:hover { color: var(--text); transform: translateY(-1px); }
.tab-group.active, .tab.active { color: #fff; }
.tab-slider {
  position: absolute;
  top: 0; left: 0;
  z-index: 0;
  border-radius: 10px;
  background: linear-gradient(110deg, #5d3df0 0%, var(--accent) 38%, var(--accent-2) 52%, #6846ef 100%);
  background-size: 240% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 16px rgba(124, 92, 255, .28);
  opacity: 0;
  transition: transform var(--motion-base) cubic-bezier(.22, .72, .18, 1), width var(--motion-base) cubic-bezier(.22, .72, .18, 1),
              height var(--motion-base) var(--ease-out), opacity var(--motion-fast) var(--ease);
}
.tab-slider::after {
  content: "";
  position: absolute;
  inset: -11px -28px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 255, .7) 34%, rgba(66, 200, 245, .82) 52%, transparent 72%);
  filter: blur(15px);
  transform: scaleX(.58);
}
.tab-slider.ready { opacity: 1; }
.tab-slider.moving { animation: tab-colour-flow 980ms cubic-bezier(.22, .72, .18, 1); }
.tab-slider.moving::after { animation: tab-motion-trail 980ms cubic-bezier(.22, .72, .18, 1); }
.tab-slider.moving.moving-backward::after { animation-name: tab-motion-trail-back; }
@keyframes tab-colour-flow {
  0% { background-position: 0 0; box-shadow: 0 4px 12px rgba(124, 92, 255, .22); }
  46% { background-position: 100% 0; box-shadow: 0 6px 30px rgba(66, 200, 245, .42); }
  72% { background-position: 70% 0; box-shadow: 0 5px 24px rgba(124, 92, 255, .36); }
  100% { background-position: 35% 0; box-shadow: 0 4px 16px rgba(124, 92, 255, .28); }
}
@keyframes tab-motion-trail {
  0% { opacity: 0; transform: translateX(-64%) scaleX(.32); }
  24% { opacity: .94; }
  64% { opacity: .6; transform: translateX(16%) scaleX(1.8); }
  100% { opacity: 0; transform: translateX(54%) scaleX(.72); }
}
@keyframes tab-motion-trail-back {
  0% { opacity: 0; transform: translateX(64%) scaleX(.32); }
  24% { opacity: .94; }
  64% { opacity: .6; transform: translateX(-16%) scaleX(1.8); }
  100% { opacity: 0; transform: translateX(-54%) scaleX(.72); }
}

/* ------------------------------------------------------------ tab content */
.content-group { display: contents; }
.tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  padding: 4px 4px 40px 0;
}
.tab-content h3 {
  margin: 26px 0 12px;
  font-size: 14px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--accent-2);
}
.tab-content h3:first-child { margin-top: 0; }

/* Gates: animated hide/show for dependent sections */
[data-gate] {
  transition: opacity 190ms var(--ease), transform 190ms var(--ease);
}
[data-gate].gating-out { opacity: 0; transform: translateY(-4px); }
[data-gate].gated-off { display: none; }

/* Field grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.grid:has(> .field:only-child) { grid-template-columns: minmax(0, 250px); }
.grid + .grid { margin-top: 14px; }
.grid-toggles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.field {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.field:focus-within { border-color: rgba(124, 92, 255, .55); background: rgba(124, 92, 255, .055); }
.field:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .13); }
.field:has(.dd-open) {
  position: relative;
  z-index: 80;
  transform: translateY(-2px);
}
.field.wide { grid-column: 1 / -1; }
.field label { margin-bottom: 6px; font-weight: 600; }
.field small, .field .muted { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 400; }
.field .muted { margin-top: 0; margin-bottom: 8px; }
.field input[type="text"], .field input[type="number"], .field input[type="password"],
.field input[type="datetime-local"], .field select { width: 100%; }
.field code {
  background: rgba(124, 92, 255, .14);
  color: #c9b8ff;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}
.grid-toggles .field { display: flex; align-items: center; min-height: 52px; padding: 9px 12px; }
.grid-toggles .field label { margin: 0; font-weight: 500; }
.antispam-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}
.antispam-settings > [data-gate],
.antispam-settings > [data-gate] > .grid { display: contents; }
.antispam-settings > [data-gate].gated-off { display: none; }
.antispam-settings .field {
  min-height: 76px;
  padding: 10px 12px;
}
.antispam-settings .field label { margin-bottom: 6px; }

/* Page headings */
.page-heading { margin-bottom: 18px; }
.page-heading h2 { margin: 2px 0 4px; font-size: 21px; }
.page-heading .muted { margin: 0; }
.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* Ticket settings: grouped, readable controls instead of a full-width strip. */
.ticket-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: start;
}
.settings-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  animation: settings-card-in 520ms var(--ease-out) backwards;
}
.settings-card:nth-child(2) { animation-delay: 70ms; }
.settings-card:nth-child(3) { animation-delay: 140ms; }
@keyframes settings-card-in {
  from { opacity: 0; transform: translateY(10px); border-color: rgba(124, 92, 255, .22); }
  to { opacity: 1; transform: none; border-color: var(--border); }
}
.settings-card-general { grid-row: span 2; }
.settings-card-permissions { grid-column: 1 / -1; }
.settings-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.settings-card-head > div { display: flex; align-items: center; gap: 9px; }
.settings-card-head h3 { margin: 0; }
.settings-card-head p { max-width: 290px; margin: 1px 0 0; color: var(--muted); font-size: 12.5px; text-align: right; }
.settings-card-index {
  display: inline-grid;
  place-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(66, 200, 245, .28);
  border-radius: 9px;
  background: rgba(66, 200, 245, .08);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
}
.ticket-general-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.setting-field-wide { grid-column: 1 / -1; }
.setting-field-input { background: rgba(7, 9, 16, .32); }
.setting-toggle { display: flex; min-height: 72px; padding: 12px; }
.setting-toggle label { display: flex; align-items: flex-start; gap: 4px; width: 100%; margin: 0; cursor: pointer; }
.setting-toggle label > span { display: flex; flex-direction: column; gap: 2px; }
.setting-toggle strong { font-size: 13px; }
.setting-toggle small { margin: 0; line-height: 1.4; }
.ticket-permissions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.setting-toggle-compact { min-height: 48px; align-items: center; }
.setting-toggle-compact label { align-items: center; }
.setting-toggle-compact label > span { font-weight: 600; }

@media (max-width: 1180px) {
  .ticket-settings-layout { grid-template-columns: 1fr; }
  .settings-card-general { grid-row: auto; }
  .settings-card-permissions { grid-column: auto; }
  .ticket-permissions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .ticket-general-grid, .ticket-permissions-grid { grid-template-columns: 1fr; }
  .setting-field-wide { grid-column: auto; }
  .settings-card-head { flex-direction: column; }
  .settings-card-head p { max-width: none; text-align: left; }
}

/* Bypass groups */
.bypass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.bypass-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.bypass-group h4 { margin: 0 0 4px; font-size: 13.5px; }
.bypass-group > .muted { margin-bottom: 10px; }
.bypass-group .field { border: none; background: transparent; padding: 8px 0 0; }
.bypass-group-spam { grid-column: 1 / -1; }
.bypass-group-spam .field { display: inline-block; width: calc(50% - 8px); vertical-align: top; }
@media (max-width: 720px) { .bypass-group-spam .field { width: 100%; display: block; } }

/* --------------------------------------------------------------- dropdown */
.picker { min-width: 0; }
.dd { position: relative; min-width: 0; }
.dd-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  background: rgba(10, 12, 20, .55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.dd-toggle:hover { border-color: var(--border-strong); }
.dd-open .dd-toggle { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd-placeholder { color: var(--muted); }
.dd-caret { color: var(--muted); font-size: 11px; transition: transform var(--motion-fast) var(--ease); }
.dd-open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 5px);
  left: 0;
  width: min(100%, 520px);
  min-width: min(280px, 100%);
  max-height: 260px;
  overflow-y: auto;
  background: rgba(12, 15, 23, .985);
  backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .72), 0 0 0 1px rgba(124, 92, 255, .1), inset 0 1px 0 rgba(255,255,255,.055);
  padding: 6px;
  isolation: isolate;
  animation: dd-in 320ms var(--ease-out);
}
.dd-menu.dd-menu-up { top: auto; bottom: calc(100% + 5px); transform-origin: bottom; }
@keyframes dd-in {
  from { opacity: 0; filter: blur(7px); transform: translateY(-8px) scale(.985); }
  70% { opacity: 1; filter: blur(0); transform: translateY(1px) scale(1.002); }
  to   { opacity: 1; transform: none; }
}
.dd-menu.dd-menu-up { animation-name: dd-in-up; }
@keyframes dd-in-up {
  from { opacity: 0; filter: blur(7px); transform: translateY(8px) scale(.985); }
  70% { opacity: 1; filter: blur(0); transform: translateY(-1px) scale(1.002); }
  to { opacity: 1; transform: none; }
}
.dd-search {
  width: 100%;
  margin-bottom: 5px;
  padding: 7px 10px;
  font-size: 13px;
  background: rgba(3, 5, 9, .94) !important;
}
.dd-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd-item:hover { background: var(--panel-3); }
.dd-item.dd-selected { background: var(--accent-soft); color: #d9ccff; }
.dd-empty { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.dd-add .dd-toggle {
  border-style: dashed;
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 11px;
  width: auto;
}
.dd-add .dd-toggle:hover { color: var(--text); border-color: var(--accent); }

/* ------------------------------------------------------------------ chips */
.chip-picker { display: flex; flex-direction: column; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  animation: chip-in 200ms var(--ease-out);
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: none; }
}
.chip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip-x {
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 18px; height: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.chip-x:hover { color: #fff; background: var(--red); }
.chip-picker input[type="text"] { max-width: 220px; font-size: 13px; }

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid transparent;
  width: fit-content;
}
.pill:empty { display: none; }
.pill-paid, .warn-none { background: var(--green-soft); color: var(--green); border-color: rgba(46, 224, 111, .3); }
.pill-owes, .warn-max { background: var(--red-soft); color: #ff8a8a; border-color: rgba(240, 71, 71, .3); }
.warn-some { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 185, 66, .3); }
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--accent-soft);
  color: #c9b8ff;
  border: 1px solid rgba(124, 92, 255, .35);
}
.optional-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: 1px;
}

/* -------------------------------------------------------------- role cards */
.role-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.role-card h4 { margin: 0 0 10px; font-size: 13.5px; }
.add-role-card { border-style: dashed; }

/* -------------------------------------------------------------- action row */
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.action-row input[type="text"] { flex: 1; min-width: 160px; }
.action-row .emoji-input { flex: 0 0 130px; min-width: 130px; }
.daily-dono-add-row { align-items: flex-end; }
.target-input-wrap { flex: 2 1 300px; min-width: 230px; }
.target-input-wrap label { margin-bottom: 6px; font-weight: 700; }
.target-input-wrap input { width: 100%; }
.target-input-wrap small {
  display: block;
  min-height: 17px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  transition: color var(--motion-fast) var(--ease);
}
.target-input-wrap small.resolved { color: var(--green); }
.target-input-wrap small.invalid { color: #ff8a8a; }
.daily-dono-add-row > #daily-dono-new-amount { flex: 1 1 190px; margin-bottom: 22px; }
.daily-dono-add-row > .btn { margin-bottom: 22px; }
.destination-status { font-size: 12.5px; color: var(--muted); }
.destination-status.ready { color: var(--green); }

/* ---------------------------------------------------------- list headings */
.list-heading, .lb-heading, .logs-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}
.list-heading h3, .lb-heading h3, .logs-heading h3 { margin: 0 0 4px; }
.list-heading p { margin: 0; }
.list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.summary-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ person cards */
.person-list { display: flex; flex-direction: column; gap: 10px; }
.empty-note { padding: 22px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.person-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  animation: rise-in 380ms var(--ease-out) backwards;
  transition: border-color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.person-card:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, .06); transform: translateX(3px); }
.person-card .avatar { width: 40px; height: 40px; border-radius: 12px; }
.donation-rank {
  width: 34px;
  flex: 0 0 34px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .3px;
  text-align: center;
}
.person-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
  flex: 1;
}
.person-name strong { font-size: 14px; }
.person-name small { color: var(--muted); font-size: 11.5px; }
.payment-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  margin-left: auto;
}
.payment-col small { color: var(--muted); font-size: 11px; }
.payment-col strong { font-size: 15px; }
.person-actions, .warn-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Warn cards */
.warn-card { flex-direction: column; align-items: stretch; }
.warn-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.warn-head .person-name { flex: 1; }
.warn-count { margin-left: auto; }
.next-action-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(10, 12, 20, .4);
  border-radius: var(--radius-sm);
}
.next-action-row small { flex: none; }
.next-action { font-size: 13px; }
.warn-history summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.warn-history summary:hover { color: var(--text); }
.warn-history ul { margin: 8px 0 0; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.warn-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 6px 10px;
  background: rgba(10, 12, 20, .4);
  border-radius: var(--radius-sm);
}
.warn-when { flex: none; }

/* Skip cards */
.skip-card { flex-direction: column; align-items: stretch; }
.skip-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.skip-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  background: rgba(10, 12, 20, .4);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.skip-meta-item small { color: var(--muted); font-size: 11px; }
.skip-meta-item span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skip-reason {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  background: rgba(10, 12, 20, .4);
  border-radius: var(--radius-sm);
}
.skip-reason small { color: var(--muted); font-size: 11px; }
.skip-reason span { font-size: 13px; white-space: pre-wrap; }
.request-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.request-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 7px 13px;
  cursor: pointer;
  transition: filter var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.request-btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.request-btn:disabled { opacity: .5; cursor: not-allowed; }
.request-accept { background: var(--green-soft); color: var(--green); border-color: rgba(46, 224, 111, .35); }
.request-deny { background: var(--red-soft); color: #ff8a8a; border-color: rgba(240, 71, 71, .35); }
.request-deny-reason { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 185, 66, .35); }

/* ------------------------------------------------------------- pause panel */
.pause-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.pause-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.pause-title { font-weight: 700; font-size: 14.5px; }
.pause-panel input[type="text"] { width: 150px; }
.pause-control { margin: 0; cursor: pointer; }
.pause-control input { display: none; }
.pause-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 185, 66, .35);
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.pause-control input:checked + .pause-button {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(46, 224, 111, .35);
}
.pause-icon { font-size: 12px; }

/* ------------------------------------------------------------ ticket cards */
.ticket-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.ticket-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  animation: rise-in 380ms var(--ease-out) backwards;
}
.ticket-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ticket-card-head input[type="text"] { flex: 1; min-width: 140px; }
.ticket-card-head .emoji-input, .ticket-card-emoji { flex: 0 0 110px; min-width: 110px; }
.ticket-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ticket-card-grid .field { background: rgba(10, 12, 20, .3); }
.ticket-card-section-title {
  margin: 18px 0 0 !important;
  font-size: 12.5px !important;
}
.ticket-panel-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 200px;
}
.ticket-panel-summary strong { font-size: 15px; }
.ticket-panel-summary > span:last-child { color: var(--muted); font-size: 12.5px; }
.ticket-summary-title { font-weight: 700; }

/* Overview */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.overview-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.overview-head h2 { margin: 0; font-size: 16px; }
.overview-empty { color: var(--muted); font-size: 13px; padding: 14px 4px; }
.overview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.overview-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.overview-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.overview-table tr:last-child td { border-bottom: none; }
.actions-cell { position: relative; width: 44px; text-align: right; }
.actions-trigger {
  font: inherit;
  font-size: 16px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px; height: 28px;
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.actions-trigger:hover { color: var(--text); border-color: var(--border-strong); }
.actions-menu {
  position: absolute;
  z-index: 25;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: #12151f;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  padding: 5px;
  display: flex;
  flex-direction: column;
  animation: dd-in 150ms var(--ease-out);
}
.actions-menu.open-up { top: auto; bottom: calc(100% + 4px); }
.action-item {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
}
.action-item:hover { background: var(--panel-3); }
.action-item.danger { color: #ff8a8a; }
.action-item.danger:hover { background: var(--red-soft); }

/* Panel editors */
.editor-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 14px 0;
}
.editor-heading h2 { margin: 2px 0 0; font-size: 19px; }
.editor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0;
}
.editor-row .field { flex: 1 1 220px; min-width: 200px; }
.editor-row .field.wide { flex-basis: 100%; }
.editor-row .wide-grow { flex: 2 1 300px; }
.editor-row.three-col .field { flex: 1 1 180px; }
.editor-row .grow { flex: 1; min-width: 240px; }
.inline-label { flex: none; font-weight: 600; padding-top: 10px; }

.publish-step {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.publish-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.publish-heading small { display: block; color: var(--muted); }
.step-number {
  width: 28px; height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.publish-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.publish-option {
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  background: rgba(10, 12, 20, .4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.publish-option strong { color: var(--text); }
.publish-option:hover { border-color: var(--border-strong); }
.publish-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #cfc2ff;
}
.submit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Panel publish buttons */
.publish-row, .multi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.publish-btn, .multi-action-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  transition: filter var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.publish-btn:hover:not(:disabled), .multi-action-btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.publish-btn:disabled, .multi-action-btn:disabled { opacity: .5; cursor: wait; }
.publish-btn--update, .multi-action-btn--update {
  background: rgba(66, 200, 245, .14);
  color: var(--accent-2);
  border-color: rgba(66, 200, 245, .35);
}
.publish-btn--post, .multi-action-btn--post {
  background: linear-gradient(135deg, var(--accent), #5d3df0);
  color: #fff;
}
.dirty-banner {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 185, 66, .35);
  color: var(--amber);
  font-size: 12.5px;
}

/* Access rules */
.access-rule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.access-rule-target { flex: 2 1 160px; min-width: 150px; }
.access-rule-action { flex: 1 1 100px; min-width: 100px; }
.access-rule-btn {
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 28px; height: 30px;
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.access-rule-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* Transcripts */
.transcripts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.transcripts-toolbar p { margin: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table td small { display: block; color: var(--muted); font-size: 11px; }
.data-table tr:hover td { background: rgba(255, 255, 255, .02); }
.data-table-actions { text-align: right; white-space: nowrap; }
.data-table-actions .btn { text-decoration: none; }

/* ------------------------------------------------------------- leaderboard */
.lb-pager { display: flex; align-items: center; gap: 10px; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  animation: rise-in 340ms var(--ease-out) backwards;
}
.lb-row:nth-child(1) .lb-rank { color: #ffd54a; }
.lb-row:nth-child(2) .lb-rank { color: #cfd6e4; }
.lb-row:nth-child(3) .lb-rank { color: #e59b5c; }
.lb-rank {
  font-weight: 800;
  font-size: 15px;
  width: 44px;
  flex: none;
  color: var(--muted);
}
.lb-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.lb-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name small { color: var(--muted); font-size: 11.5px; }
.lb-stats { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.lb-stats small { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------------- logs */
.logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.logs-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.logs-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.logs-filter:hover { color: var(--text); border-color: var(--border-strong); }
.logs-filter.active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, .45);
}
.logs-filter-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  padding: 1px 7px;
}
.logs-search { flex: 1; min-width: 180px; }
.logs-list { display: flex; flex-direction: column; gap: 8px; }
.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  animation: rise-in 300ms var(--ease-out) backwards;
}
.log-entry.log-moderation { border-left-color: var(--accent-2); }
.log-entry.log-automod { border-left-color: var(--amber); }
.log-entry.log-website { border-left-color: var(--accent); }
.log-entry.log-bot { border-left-color: var(--muted); }
.log-kind { font-size: 16px; flex: none; margin-top: 1px; }
.log-copy { flex: 1; min-width: 0; }
.log-copy strong { font-size: 13.5px; }
.log-copy p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.log-people {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12px;
}
.log-people b {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-right: 5px;
}
.log-entry time { flex: none; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ----------------------------------------------------------------- toasts */
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 52px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  cursor: pointer;
  max-width: 340px;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #161a26;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-2);
  box-shadow: var(--shadow-1);
  animation: toast-in 260ms var(--ease-out);
  transition: opacity 190ms var(--ease), transform 190ms var(--ease);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.leaving { opacity: 0; transform: translateX(12px); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------- modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 6, 12, .66);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: fade-in 200ms var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: min(660px, 100%);
  max-height: min(84vh, 780px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  background: rgba(18, 21, 31, .88);
  backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  padding: 20px 22px;
  animation: rise-in 300ms var(--ease-out);
}
#accounts-modal .modal-box { width: min(820px, 100%); }
.profile-box, .text-prompt-box { width: min(480px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-box h3 { margin: 18px 0 10px; font-size: 13.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent-2); }
.check-label { display: flex; align-items: center; gap: 8px; margin: 0; }
.accounts-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.accounts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.accounts-row > div:last-child { display: flex; gap: 6px; }
.accounts-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  padding: 6px;
  background: rgba(10, 12, 20, .4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.accounts-check {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12.5px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.accounts-check:hover { background: var(--panel-3); }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 38px; }
.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
}
.password-toggle-btn:hover { background: var(--panel-3); }
.text-prompt-box textarea { width: 100%; margin-top: 8px; }
.text-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ------------------------------------------------------------ mobile shell */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(125%);
  border-bottom: 1px solid var(--border);
}
.mobile-topbar-title { font-weight: 700; flex: 1; }
.mobile-menu-btn {
  width: 38px; height: 34px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-bars { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu-bars i { width: 16px; height: 2px; border-radius: 2px; background: var(--text); display: block; }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(4, 6, 12, .6);
  backdrop-filter: blur(5px);
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0; top: 0; bottom: 0;
    width: min(300px, 84vw);
    transform: translateX(-102%);
    transition: transform var(--motion-base) var(--ease-out);
    box-shadow: var(--shadow-2);
  }
  .app.sidebar-open .sidebar { transform: none; }
  .guild-panel { padding: 12px 12px 0; }
  .guild-header h2 { font-size: 17px; }
  .header-refresh span:last-child { display: none; }
  .payment-col { margin-left: 0; text-align: left; width: 100%; }
  .daily-dono-add-row > #daily-dono-new-amount,
  .daily-dono-add-row > .btn { margin-bottom: 0; }
  .modal { padding: 10px; }
  .modal-box { padding: 16px; max-height: 92vh; }
  .toast-region { left: 16px; align-items: stretch; }
  .toast { max-width: none; }
}

/* Automod rule tester */
#automod-tester #automod-test-input { width: 100%; margin-bottom: 8px; font-family: var(--mono, monospace); }
.automod-test-result { margin-top: 10px; }
.automod-test-result .automod-test-clean { color: #4ade80; font-weight: 600; }
.automod-test-result .automod-test-hit { color: #f87171; font-weight: 600; margin-bottom: 6px; }
.automod-test-list { margin: 0; padding-left: 20px; }
.automod-test-list li { margin: 3px 0; font-size: 13px; }
.automod-test-action { font-family: var(--mono, monospace); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: rgba(248,113,113,.18); color: #fca5a5; }

/* Discord OAuth login button + divider */
.btn-discord { background: #5865F2; color: #fff; border-color: #5865F2; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-discord:hover:not(:disabled) { background: #4752c4; border-color: #4752c4; }
.login-discord-icon { font-size: 15px; }
.login-divider { display: flex; align-items: center; text-align: center; color: var(--muted, #8b93a7); font-size: 12px; margin: 12px 0; gap: 10px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
