:root {
  /* Discord's actual dark theme palette */
  --bg-primary: #17131f;
  --bg-secondary: #121018;
  --bg-tertiary: #0b0910;
  --bg-floating: #09070d;
  --bg-modifier-hover: rgba(78, 80, 88, 0.4);
  --bg-modifier-selected: rgba(78, 80, 88, 0.6);
  --bg-input: #0f0c15;

  --text-normal: #e9e5ef;
  --text-muted: #aaa3b5;
  --text-faint: #766f80;
  --text-link: #00a8fc;
  --header-primary: #ffffff;

  --brand: #a33cff;
  --brand-hover: #b85cff;
  --brand-subtle: rgba(163, 60, 255, 0.16);
  --green: #23a55a;
  --green-hover: #1a8245;
  --red: #da373c;
  --red-hover: #b02e32;
  --yellow: #f0b132;

  --border: #2a2333;
  --border-subtle: #1b1622;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;

  --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* ---- Motion system: every transition/animation in the site pulls from
     these so pacing feels related instead of ad-hoc per component. ---- */
  --motion-fast: 140ms;
  --motion-normal: 220ms;
  --motion-slow: 220ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

/* Always reserve the scrollbar's width, even on pages/panels short enough
   not to need one. Without this, switching between a tall panel (scrollbar
   present) and a short one (no scrollbar) changes the available content
   width and the whole page visibly shifts sideways. */
html { scroll-behavior: auto; scrollbar-gutter: stable; overflow-y: scroll; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font-family: var(--font-body);
  line-height: 1.5;
  font-size: 15px;
  position: relative;
}

/* Atmospheric background: a fixed layer sitting behind all content so cards
   and text keep exactly the same contrast as before, but the page itself
   isn't a flat, single-tone fill anymore. Two soft, static glows plus a very
   faint grain texture (SVG noise, no animation, negligible cost). */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1100px 560px at 18% -8%, rgba(88,101,242,0.09), transparent 60%),
    radial-gradient(900px 620px at 100% 12%, rgba(88,101,242,0.05), transparent 65%),
    radial-gradient(700px 500px at 92% 96%, rgba(59,165,92,0.045), transparent 60%),
    var(--bg-tertiary);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- Scroll reveal system ----------
   Applied via JS (main.js: initScrollReveal) which toggles .is-revealed on
   IntersectionObserver entry. Each element starts in its own hidden/offset
   state per data-reveal value, then animates to its natural position once,
   using the shared --motion-slow timing so everything feels related. */
[data-reveal] { transition: opacity var(--motion-slow) var(--ease), transform var(--motion-slow) var(--ease); }
[data-reveal="up"] { opacity: 0; transform: translateY(22px); }
[data-reveal="left"] { opacity: 0; transform: translateX(-22px); }
[data-reveal="right"] { opacity: 0; transform: translateX(22px); }
[data-reveal="scale"] { opacity: 0; transform: scale(0.94); }
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* Stagger: children of a [data-stagger] container reveal in sequence rather
   than all at once. main.js assigns each child an incremental transition-delay. */
[data-stagger] > [data-reveal] { transition-delay: calc(var(--stagger-i, 0) * 30ms); }

/* Count-up number targets — no visual change, just a hook main.js queries. */
[data-count-to] { font-variant-numeric: tabular-nums; }

/* ---------- Nav: scroll-aware state lives on .nav-shell ---------- */
.nav { transition: background-color var(--motion-normal) var(--ease), border-color var(--motion-normal) var(--ease), padding var(--motion-normal) var(--ease); }
body.scrolled .nav { background: transparent; border-bottom-color: transparent; margin: 0; padding: 14px 0; position: static; top: auto; z-index: auto; }
.nav .links a { position: relative; }
.nav .links a.active { color: var(--header-primary); }
.nav .links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -16px; height: 2px; background: var(--brand);
  border-radius: 2px;
}

/* ---------- Delayed page loader ---------- */
#site-loader {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  background: rgba(9, 7, 13, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 160ms ease, visibility 0s linear 160ms;
}
#site-loader.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
#site-loader.hiding { opacity: 0; visibility: hidden; pointer-events: none; }
.site-loader-logo { width: 54px; height: 54px; object-fit: contain; }
.site-loader-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.13); border-top-color: var(--brand);
  animation: swagLoaderSpin .7s linear infinite;
}
.site-loader-text { color: var(--text-muted); font-size: .82rem; }
@keyframes swagLoaderSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .site-loader-spinner { animation: none; border-top-color: rgba(255,255,255,.35); } }

/* ---------- Skeleton loaders ---------- */
.skeleton-line {
  height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--bg-modifier-hover) 25%, var(--bg-modifier-selected) 50%, var(--bg-modifier-hover) 75%);
  background-size: 200% 100%; animation: skeletonShimmer 1.6s ease-in-out infinite;
}
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Button loading state ---------- */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: btnSpin 0.6s linear infinite;
}
.btn-ghost.is-loading::after { border-color: rgba(219,222,225,0.3); border-top-color: var(--text-normal); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ---------- Server-switching page transition ---------- */
body.page-leaving { opacity: 0; transform: translateY(-6px); transition: opacity var(--motion-normal) var(--ease), transform var(--motion-normal) var(--ease); }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 700; color: var(--header-primary); margin: 0 0 0.4em; letter-spacing: -0.01em; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  animation: navIn var(--motion-slow) var(--ease);
}
@keyframes navIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--header-primary); }
.nav .brand .dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  animation: brandBreathe 4s var(--ease) infinite;
}
@keyframes brandBreathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(88,101,242,0); } 50% { box-shadow: 0 0 0 5px rgba(88,101,242,0.12); } }
@media (prefers-reduced-motion: reduce) { .nav .brand .dot { animation: none; } }
.nav .brand .dot::after { content: ''; width: 10px; height: 10px; border-radius: 3px; background: #fff; }
.nav .links { display: flex; align-items: center; gap: 18px; }
.nav .links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
.nav .links a:hover { color: var(--text-normal); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--bg-secondary); font-size: 0.85rem; }
.user-chip img { width: 24px; height: 24px; border-radius: 50%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 500; font-size: 0.9rem;
  transition: background-color var(--motion-fast) ease, opacity var(--motion-fast) ease, transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.btn-primary, .btn-danger { transition: background-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease); }
.btn-primary:hover, .btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.28); }
.btn:active { transform: translateY(1px) scale(0.98); box-shadow: none; }
.btn-primary { background: var(--brand); color: #fff; }
.hero-split .btn-primary, .hero .btn-primary, .cta-band .btn-primary { position: relative; overflow: hidden; }
.hero-split .btn-primary::after, .hero .btn-primary::after, .cta-band .btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: btnSweep 5s ease-in-out infinite;
}
@keyframes btnSweep { 0%, 88% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .hero-split .btn-primary::after, .hero .btn-primary::after, .cta-band .btn-primary::after { display: none; } }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: var(--bg-modifier-hover); color: var(--text-normal); }
.btn-ghost:hover { background: var(--bg-modifier-selected); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-hover); }
.btn-warn { background: rgba(240, 177, 50, 0.15); color: var(--yellow); border: 1px solid rgba(240, 177, 50, 0.3); }
.btn-warn:hover { background: rgba(240, 177, 50, 0.25); }
.btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Hero (landing) ---------- */
.hero { padding: 80px 0 56px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--bg-secondary); font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 800; line-height: 1.1; color: var(--header-primary); }
.hero h1 .grad { color: var(--brand); }
.hero p.sub { max-width: 560px; margin: 20px auto 32px; color: var(--text-muted); font-size: 1.05rem; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- New asymmetric hero layout ---------- */
.hero-split { position: relative; display: flex; align-items: stretch; gap: 48px; padding: 64px 0 40px; overflow: hidden; }
.hero-split .hero-copy { flex: 1.05 1 0; min-width: 0; }
.hero-split .preview-mock { flex: 0.95 1 0; min-width: 0; align-self: stretch; }
@media (max-width: 900px) { .hero-split { flex-direction: column; padding: 40px 0 24px; } }

/* Background motion layer: a faint dot-grid that drifts almost
   imperceptibly slowly, plus one soft ambient glow that drifts on its own
   and a second that follows the cursor a small amount. Transform/opacity
   only, one coherent system rather than several stacked effects. */
.hero-bg { position: absolute; inset: -40px -24px; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-bg .grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 40%, transparent 80%);
  animation: heroGridDrift 50s linear infinite;
}
.hero-bg .glow-ambient {
  position: absolute; width: 480px; height: 480px; border-radius: 50%; top: -120px; right: -60px;
  background: radial-gradient(circle, rgba(88,101,242,0.14), transparent 70%);
  animation: heroGlowDrift 16s var(--ease) infinite alternate;
  will-change: transform;
}
.hero-bg .glow-cursor {
  position: absolute; width: 420px; height: 420px; border-radius: 50%; left: 8%; top: 10%;
  background: radial-gradient(circle, rgba(88,101,242,0.10), transparent 70%);
  transform: translate(var(--gx, 0px), var(--gy, 0px)); transition: transform 0.7s var(--ease);
  will-change: transform;
}
@keyframes heroGridDrift { from { background-position: 0 0; } to { background-position: 260px 130px; } }
@keyframes heroGlowDrift { from { transform: translate(0, 0); } to { transform: translate(-24px, 18px); } }
@media (prefers-reduced-motion: reduce), (max-width: 700px) {
  .hero-bg .grid { animation: none; }
  .hero-bg .glow-ambient { animation: none; }
  .hero-bg .glow-cursor { display: none; }
}

.hero-split > div, .hero-split .preview-mock { position: relative; z-index: 1; }

/* Hero entrance: plays once on load (not scroll-triggered — it's above the
   fold), each line/element staggered a little after the last. */
.hero-anim { opacity: 0; transform: translateY(16px); animation: heroIn var(--motion-slow) var(--ease) forwards; }
@keyframes heroIn { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .hero-anim { opacity: 1; transform: none; animation: none; } }

.hero-split .kicker {
  display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 18px;
  padding: 7px 14px 7px 11px; border-radius: 999px; background: rgba(88,101,242,0.08); border: 1px solid rgba(88,101,242,0.25);
}
.hero-split .kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(88,101,242,0.18); }
.hero-split h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); font-weight: 800; line-height: 1.12; color: var(--header-primary); text-align: left; margin-bottom: 18px; }
.hero-split h1 .grad { color: var(--brand); }
.hero-split p.lead { color: var(--text-muted); font-size: 1.02rem; max-width: 480px; margin-bottom: 26px; }
.hero-split .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-check-list { display: flex; flex-direction: column; gap: 10px; }
.hero-check-list .item { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; color: var(--text-normal); }
.hero-check-list .mark { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-top: 8px; position: relative; }
.hero-check-list .mark::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; background: var(--brand); opacity: 0.5;
  animation: markPulse 2.4s var(--ease) infinite;
}
.hero-check-list .item:nth-child(2) .mark::after { animation-delay: 0.6s; }
.hero-check-list .item:nth-child(3) .mark::after { animation-delay: 1.2s; }
@keyframes markPulse { 0% { transform: scale(0.6); opacity: 0.5; } 100% { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-check-list .mark::after { animation: none; display: none; } }

/* ---------- Product preview mockup (pure CSS, no fake screenshot) ---------- */
.preview-mock { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px; box-shadow: 0 30px 70px rgba(0,0,0,0.45); transition: transform var(--motion-slow) var(--ease); position: relative; overflow: hidden; display: flex; flex-direction: column; }
.preview-mock::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--brand), #8b5cf6, var(--brand)); background-size: 200% 100%; animation: accentDrift 6s linear infinite; }
@keyframes accentDrift { to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { .preview-mock::before { animation: none; } }
.preview-mock:hover { transform: translateY(-4px); }

/* ---------- Closing CTA band ---------- */
.cta-band {
  margin: 72px 0 48px; padding: 48px 40px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(88,101,242,0.14), rgba(88,101,242,0.03));
  border: 1px solid rgba(88,101,242,0.22); text-align: center; position: relative; overflow: hidden;
}
.cta-band h2 { margin: 0 0 10px; font-size: 1.7rem; }
.cta-band p { color: var(--text-muted); margin: 0 0 22px; font-size: 0.95rem; }
.cta-band .cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 0; }
.preview-mock-topbar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.preview-mock-topbar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.preview-mock-brand { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.preview-mock-brand .sq { width: 16px; height: 16px; border-radius: 5px; background: var(--brand); }
.preview-mock-brand .bar { width: 46px; height: 8px; border-radius: 3px; background: var(--border); }
.preview-mock-user { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--border); }
.preview-mock-body { background: var(--bg-tertiary); border-radius: var(--radius); padding: 16px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.preview-mock-heading { width: 120px; height: 10px; border-radius: 3px; background: var(--border); margin-bottom: 14px; }
.preview-mock-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 16px; }
.preview-mock-card { background: var(--bg-secondary); border-radius: 6px; padding: 10px 9px; height: 54px; display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }
.preview-mock-card .l1 { width: 70%; height: 6px; border-radius: 2px; background: var(--border); }
.preview-mock-card .l2 { width: 45%; height: 6px; border-radius: 2px; background: var(--brand-subtle); }
.preview-mock-card.accent .l2 { background: var(--green); opacity: 0.6; }
.preview-mock-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--border-subtle); }
.preview-mock-row:first-of-type { border-top: none; }
.preview-mock-row .av { width: 22px; height: 22px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.preview-mock-row .l1 { flex: 1; height: 7px; border-radius: 2px; background: var(--border); max-width: 120px; }
.preview-mock-row .pill { width: 44px; height: 14px; border-radius: 999px; background: var(--brand-subtle); animation: pillPulse 3.2s ease-in-out infinite; }
.preview-mock-row .pill.green { background: rgba(35,165,90,0.18); }
.preview-mock-row:nth-child(2) .pill { animation-delay: 0.4s; }
.preview-mock-row:nth-child(3) .pill { animation-delay: 0.8s; }
@keyframes pillPulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .preview-mock-row .pill { animation: none; } }

/* ---------- How it works strip ---------- */
.steps-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 60px 0 40px; }
@media (max-width: 800px) { .steps-strip { grid-template-columns: 1fr; } }
.step-card { padding: 4px 0; }
.step-card .num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-subtle); color: var(--brand); font-weight: 700; font-size: 0.85rem; margin-bottom: 14px; }
.step-card h3 { font-size: 1rem; margin-bottom: 6px; }
.step-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

.marquee-wrap {
  overflow: hidden; margin: 8px 0 50px; padding: 4px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marqueeScroll 28s linear infinite; }
@keyframes marqueeScroll { from { transform: translateX(-50%); } to { transform: translateX(0%); } }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.module-chip-strip { display: flex; flex-wrap: nowrap; gap: 8px; padding-right: 8px; }
.module-chip-strip span { padding: 7px 14px; border-radius: 999px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* ---------- Feature / module grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 64px 0; }
.feature-card {
  background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 24px; transition: background-color var(--motion-normal) var(--ease), border-color var(--motion-normal) var(--ease), transform var(--motion-normal) var(--ease), box-shadow var(--motion-normal) var(--ease);
}
.feature-card .feature-icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; background: rgba(88,101,242,0.12); color: var(--brand);
  transition: transform var(--motion-normal) var(--ease);
}
.feature-card .feature-icon svg { width: 19px; height: 19px; }
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }
.feature-card:hover { background: #303236; border-color: rgba(88,101,242,0.35); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.25); }
.feature-card h3 { font-size: 1.02rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

.page-head { padding: 40px 0 12px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head-row .btn { flex-shrink: 0; }
.page-head h1 { font-size: 1.8rem; }
.page-head p { color: var(--text-muted); }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 26px 0 60px; }
.server-card {
  background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  transition: background-color 0.15s;
}
.server-card:hover { background: #303236; }
.server-card img.icon-lg { width: 52px; height: 52px; border-radius: var(--radius); object-fit: cover; }
.server-card .icon-fallback {
  width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  background: var(--brand); font-weight: 700; color: #fff;
}
.server-card h3 { font-size: 1rem; margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-owner { background: rgba(240, 177, 50, 0.15); color: var(--yellow); }
.badge-staff { background: rgba(0, 168, 252, 0.15); color: var(--text-link); }
.badge-member { background: var(--brand-subtle); color: #a3aafc; }

/* ---------- Dashboard layout ---------- */
.dash-header { padding: 28px 0 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.dash-header .server-id { display: flex; align-items: center; gap: 14px; }
.dash-header img.icon-md, .dash-header .icon-md-fallback { width: 42px; height: 42px; border-radius: var(--radius); }
.dash-header .icon-md-fallback { display: flex; align-items: center; justify-content: center; background: var(--brand); font-weight: 700; color: #fff; }
.dash-header h1 { font-size: 1.4rem; }
.dash-header .meta { color: var(--text-muted); font-size: 0.84rem; }

.tabs { display: flex; gap: 6px; margin: 8px 0 24px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 15px; border-radius: var(--radius-sm); background: transparent; border: none;
  color: var(--text-muted); font-weight: 500; font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
}
.tab-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.tab-btn.active { background: var(--bg-secondary); color: var(--header-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Perfectly even two/three-up layout — every section that splits into
   columns (form + list, form + preview, field pairs) uses the same 1:1
   ratio so nothing looks lopsided. Use .grid-2-wide for the rare case
   where the left column should intentionally lead. */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2-wide { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-2, .grid-2-wide, .grid-3, .feature-grid { grid-template-columns: 1fr; } }

/* Equal-height columns: when a grid-2 pairs two cards side by side (a form
   next to a list, a panel next to a preview) they should read as one
   balanced row, not two mismatched boxes. */
.grid-2 > .card, .grid-2-wide > .card { display: flex; flex-direction: column; height: 100%; }
.grid-2 > .card > *:last-child, .grid-2-wide > .card > *:last-child { margin-bottom: 0; }

.card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px; }
.card h3 { font-size: 0.98rem; display: flex; align-items: center; gap: 8px; }

/* Consistent vertical rhythm between stacked sections inside a module panel,
   regardless of whether the next block is a .card, .grid-2, or .grid-3 —
   previously only .card + .card had spacing, so a card followed by a grid
   sat flush against it. */
.module-panel > .card, .module-panel > .grid-2, .module-panel > .grid-2-wide, .module-panel > .grid-3, .module-panel > .collapsible {
  margin-bottom: 18px;
}
.module-panel > *:last-child { margin-bottom: 0; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-pill {
  flex: 1; min-width: 130px; background: var(--bg-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-pill .label { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-pill .value { font-family: var(--font-mono); font-size: 1.4rem; margin-top: 4px; color: var(--header-primary); }

/* Quests */
.quest-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px; border-radius: var(--radius); background: var(--bg-primary); border: 1px solid var(--border-subtle); margin-bottom: 10px;
}
.quest-item .reward { font-family: var(--font-mono); color: var(--green); font-weight: 600; }

/* Lists / tables */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border-subtle);
}
.list-row:last-child { border-bottom: none; }
.list-row .name { font-weight: 600; font-size: 0.88rem; color: var(--text-normal); }
.list-row .sub { color: var(--text-muted); font-size: 0.78rem; }
.list-row .spacer { flex: 1; }

img.avatar, .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }

/* ---------- Form controls ---------- */
input[type=text], input[type=number], input[type=url], input[type=password], textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-input);
  border: 1px solid transparent; color: var(--text-normal); font-family: var(--font-body); font-size: 0.88rem;
  transition: border-color 0.15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--brand); }
label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted); margin: 18px 0 7px; }
label:first-of-type { margin-top: 0; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* Small muted counter under a title/description field, e.g. "42 / 256" */
.char-counter { display: block; text-align: right; font-size: 0.7rem; color: var(--text-faint); margin-top: 4px; font-family: var(--font-mono); }
.char-counter.near-limit { color: var(--yellow); }
.char-counter.over-limit { color: #ff8a8d; }

/* Hex color input paired with a real native color-picker swatch */
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type=text] { flex: 1; }
.color-field input[type=color] {
  -webkit-appearance: none; appearance: none; width: 40px; height: 40px; flex-shrink: 0;
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; cursor: pointer;
}
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-field input[type=color]::-webkit-color-swatch { border: none; border-radius: 3px; }
.color-field input[type=color]::-moz-color-swatch { border: none; border-radius: 3px; }

/* A row that's just "Label" + toggle switch, aligned and spaced like the
   rest of the form instead of relying on ad-hoc inline styles. */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 6px; }
.toggle-row:first-child { margin-top: 0; }
.toggle-row .toggle-row-label { font-size: 0.88rem; color: var(--text-normal); font-weight: 500; }
.toggle-row .toggle-row-label .sub { display: block; font-size: 0.76rem; color: var(--text-muted); font-weight: 400; margin-top: 2px; text-transform: none; letter-spacing: normal; }

/* Hide native selects once JS enhances them; fall back gracefully without JS */
select { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid transparent; color: var(--text-normal); font-family: var(--font-body); font-size: 0.88rem; }

.msg-bubble { padding: 10px 14px; border-radius: var(--radius); background: var(--bg-primary); margin-bottom: 8px; font-size: 0.86rem; }
.msg-bubble .who { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 3px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--bg-floating); border: 1px solid var(--border);
  padding: 13px 20px; border-radius: var(--radius); font-size: 0.86rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translateY(20px); opacity: 0; transition: all 0.25s ease; z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(218,55,60,0.5); color: #ff8a8d; }
.toast.success { border-color: rgba(35,165,90,0.5); color: #5fd68e; }

/* ---------- Notifications (Yarhm-inspired) ---------- */
.notif-stack {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 500; align-items: center;
  pointer-events: none;
}
.notif {
  width: 380px; max-width: calc(100vw - 32px); pointer-events: auto;
  background: linear-gradient(160deg, #26272b, #38393f);
  border-radius: 10px; border: 1.5px solid var(--border);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  transform: translateY(-70px) scale(0.55); opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  box-shadow: 0 14px 34px rgba(0,0,0,0.45);
}
.notif.show { transform: translateY(0) scale(1); opacity: 1; }
.notif.closing { transform: translateY(-50px) scale(0.85); opacity: 0; transition: all 0.25s ease; }
.notif .notif-icon { width: 20px; height: 20px; flex-shrink: 0; }
.notif .notif-icon svg { width: 100%; height: 100%; }
.notif .notif-text { flex: 1; font-size: 0.86rem; color: #fff; line-height: 1.35; min-height: 1.2em; }
.notif .notif-close {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; line-height: 1; transition: background 0.12s;
}
.notif .notif-close:hover { background: var(--bg-modifier-hover); }
.notif.success { border-color: var(--green); }
.notif.success .notif-icon { color: var(--green); }
.notif.error { border-color: var(--red); }
.notif.error .notif-icon { color: var(--red); }
.notif.info { border-color: var(--brand); }
.notif.info .notif-icon { color: var(--brand); }

.empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); }

footer { padding: 36px 0 56px; text-align: center; color: var(--text-faint); font-size: 0.8rem; }

.dim { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Modules grid (Maki-style browser) ---------- */
.module-cat { margin-bottom: 22px; }
.module-cat-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; }
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 1000px) { .module-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .module-grid { grid-template-columns: 1fr; } }
.module-card {
  background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  padding: 13px; transition: background-color var(--motion-normal) var(--ease), border-color var(--motion-normal) var(--ease), transform var(--motion-normal) var(--ease);
  display: flex; flex-direction: column; gap: 3px; min-height: 108px;
  animation: cardIn var(--motion-slow) var(--ease) backwards;
}
.module-card:hover { background: #303236; border-color: rgba(88,101,242,0.3); transform: translateY(-2px); }
.module-card:nth-child(1) { animation-delay: 0ms; }
.module-card:nth-child(2) { animation-delay: 40ms; }
.module-card:nth-child(3) { animation-delay: 80ms; }
.module-card:nth-child(4) { animation-delay: 120ms; }
.module-card:nth-child(n+5) { animation-delay: 150ms; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.module-icon { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), #8b8ff7); margin-bottom: 4px; }
.module-card .module-name { font-weight: 600; font-size: 0.82rem; color: var(--header-primary); }
.module-card .module-desc { color: var(--text-muted); font-size: 0.72rem; line-height: 1.35; flex: 1; margin-top: 2px; }
.module-card .module-status { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 8px; }
.module-card .module-status.soon { color: var(--text-faint); }
.module-card.soon { opacity: 0.55; }
.module-card.soon:hover { background: var(--bg-secondary); }
.module-edit-btn { margin-top: 10px; width: 100%; justify-content: center; }

/* ---------- Automod ---------- */
.automod-rule { border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--bg-primary); }
.automod-rule-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.automod-rule-head h4 { margin: 0; font-size: 0.9rem; color: var(--header-primary); }

/* Square toggle switch (rounded corners, sliding thumb) — the single source
   of truth for every toggle in the dashboard. Full definition lives in the
   "Refined toggle" section further down; this comment is just a landmark. */

.automod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .automod-grid { grid-template-columns: 1fr; } }
.role-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 0.78rem; background: var(--bg-primary); border: 1px solid var(--border-subtle); cursor: pointer; user-select: none; transition: all 0.12s; }
.role-chip:hover { background: var(--bg-modifier-hover); }
.role-chip.selected { background: var(--brand-subtle); border-color: var(--brand); color: #a3aafc; }

/* ---------- Embed builder ---------- */
.embed-builder-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 950px) { .embed-builder-layout { grid-template-columns: 1fr; } }
.embed-field-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 700px) { .embed-field-row { grid-template-columns: 1fr; } }
.embed-field-row .field-actions { display: flex; gap: 4px; }
.icon-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--bg-primary); border: 1px solid var(--border-subtle); color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; transition: all 0.15s; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(218,55,60,0.15); color: #ff8a8d; border-color: rgba(218,55,60,0.3); }
.icon-btn.neutral:hover { background: var(--bg-modifier-hover); color: var(--text-normal); border-color: var(--border); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn:disabled:hover { background: var(--bg-primary); color: var(--text-muted); border-color: var(--border-subtle); }
.icon-btn svg { width: 15px; height: 15px; }

.discord-preview { background: var(--bg-primary); border-radius: var(--radius); padding: 18px; position: sticky; top: 20px; }
.discord-preview .content-line { font-size: 0.9rem; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.discord-embed-box { display: flex; background: #2b2d31; border-radius: 4px; overflow: hidden; }
.discord-embed-accent { width: 4px; flex-shrink: 0; background: var(--brand); }
.discord-embed-body { padding: 12px 16px; flex: 1; min-width: 0; }
.discord-embed-author { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: #fff; }
.discord-embed-author img { width: 20px; height: 20px; border-radius: 50%; }
.discord-embed-title { font-weight: 700; font-size: 0.98rem; color: #fff; margin-bottom: 6px; }
.discord-embed-desc { font-size: 0.86rem; color: #dbdee1; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.discord-embed-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.discord-embed-field { min-width: 0; }
.discord-embed-field.full { grid-column: 1 / -1; }
.discord-embed-field .fname { font-weight: 700; font-size: 0.82rem; color: #fff; margin-bottom: 2px; }
.discord-embed-field .fvalue { font-size: 0.82rem; color: #dbdee1; white-space: pre-wrap; word-break: break-word; }
.discord-embed-thumb { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; float: right; margin-left: 12px; }
.discord-embed-image { width: 100%; border-radius: 4px; margin-top: 8px; display: block; }
.discord-embed-footer { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: #b5bac1; margin-top: 8px; }
.discord-embed-footer img { width: 18px; height: 18px; border-radius: 50%; }
.discord-embed-empty { color: var(--text-faint); font-size: 0.85rem; font-style: italic; padding: 8px 0; }

/* ---------- Preview components (Discord message row) ---------- */
/* Everything a real posted panel can contain: the author line, the message
   body, an embed, and — the part that used to be missing — the actual
   button row / dropdown members would click. These are rendered wherever a
   panel gets posted (tickets, role menus, birthdays, giveaways, boosters)
   so what you see really is what gets sent, buttons included. */
.discord-msg-row { display: flex; gap: 14px; }
.discord-msg-row .discord-msg-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.discord-msg-row .discord-msg-avatar svg { width: 20px; height: 20px; color: #fff; }
.discord-msg-body { flex: 1; min-width: 0; }
.discord-msg-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; }
.discord-msg-head .bot-name { font-weight: 600; font-size: 0.92rem; color: #fff; }
.discord-msg-head .bot-badge { background: var(--brand); color: #fff; font-size: 0.6rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.02em; }
.discord-msg-head .msg-time { font-size: 0.72rem; color: var(--text-faint); }

.discord-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.discord-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 3px;
  font-size: 0.85rem; font-weight: 500; border: none; cursor: pointer; color: #fff;
  transition: filter 0.12s ease, transform 0.05s ease; font-family: var(--font-body);
}
.discord-btn:active { transform: translateY(1px); }
.discord-btn:hover { filter: brightness(1.12); }
.discord-btn.primary { background: var(--brand); }
.discord-btn.secondary { background: #4e5058; }
.discord-btn.success { background: var(--green); }
.discord-btn.danger { background: var(--red); }
.discord-btn.disabled-look { opacity: 0.55; cursor: not-allowed; }
.discord-select-mock {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  padding: 9px 12px; border-radius: 8px; background: #383a40; border: 1px solid #46484e; color: var(--text-muted);
  font-size: 0.85rem; max-width: 280px; cursor: pointer;
}
.discord-select-mock .cdd-chevron-mock { width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg) translateY(-2px); flex-shrink: 0; }
.preview-live-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 10px;
}
.preview-live-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(35,165,90,0.2); }
.preview-hint { font-size: 0.74rem; color: var(--text-faint); margin-top: 10px; text-align: center; }

/* ---------- List toolbar (search + status filter chips) ---------- */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.list-toolbar .list-search { flex: 1; min-width: 140px; }
.list-toolbar .list-search input { margin: 0; }
.filter-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  padding: 7px 13px; border-radius: 999px; font-size: 0.78rem; font-weight: 500; cursor: pointer; user-select: none;
  background: var(--bg-primary); border: 1px solid var(--border-subtle); color: var(--text-muted); transition: all 0.12s;
  white-space: nowrap;
}
.filter-chip:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.filter-chip.active { background: var(--brand-subtle); border-color: var(--brand); color: #a3aafc; }
.list-empty-filtered { text-align: center; padding: 20px; color: var(--text-faint); font-size: 0.85rem; }
.scroll-list { max-height: 420px; overflow-y: auto; padding-right: 2px; }
.scroll-list::-webkit-scrollbar { width: 8px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.scroll-list::-webkit-scrollbar-track { background: transparent; }

.template-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border-subtle); }
.template-row:last-child { border-bottom: none; }
.template-row .spacer { flex: 1; }

/* ---------- Module panel navigation ---------- */
.back-to-modules { margin-bottom: 18px; }
.module-panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.module-panel-head h2 { margin: 0; font-size: 1.25rem; }
.module-unavailable-note { background: rgba(218,55,60,0.1); border: 1px solid rgba(218,55,60,0.25); border-radius: var(--radius); padding: 14px 16px; font-size: 0.85rem; color: #ff8a8d; margin-bottom: 16px; }
.module-global-note { background: rgba(240,177,50,0.1); border: 1px solid rgba(240,177,50,0.25); border-radius: var(--radius); padding: 14px 16px; font-size: 0.85rem; color: var(--yellow); margin-bottom: 16px; }

/* ---------- Analytics chart ---------- */
.chart-wrap { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 10px 0; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--brand); min-height: 2px; }
.chart-bar.joins { background: var(--green); }
.chart-label { font-size: 0.64rem; color: var(--text-faint); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; }
.chart-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.code-box { background: var(--bg-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--font-mono); font-size: 0.82rem; word-break: break-all; color: var(--text-link); }

.user-browse-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border-subtle); }
.user-browse-row:last-child { border-bottom: none; }
.user-browse-row .spacer { flex: 1; }
.user-browse-row .qa-btn { padding: 6px 11px; font-size: 0.74rem; }

/* ---------- Command bar ---------- */
.cmdbar-wrap { position: relative; }
.cmdbar {
  position: relative; min-height: 48px; padding: 13px 15px; border-radius: var(--radius); background: var(--bg-input);
  border: 1px solid transparent; font-family: var(--font-mono); font-size: 0.9rem;
  line-height: 1.7; white-space: pre-wrap; word-break: break-word; outline: none; cursor: text;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease; color: var(--text-normal);
  background-image: linear-gradient(var(--bg-input), var(--bg-input)), linear-gradient(120deg, var(--brand), var(--text-link), var(--brand));
  background-origin: border-box; background-clip: padding-box, border-box;
  background-size: 100% 100%, 300% 100%; background-position: 0 0, 0 0;
}
.cmdbar:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--brand-subtle), 0 4px 24px rgba(88, 101, 242, 0.25);
  animation: cmdbarGradientMove 4s ease infinite;
}
@keyframes cmdbarGradientMove {
  0% { background-position: 0 0, 0% 0; }
  100% { background-position: 0 0, 100% 0; }
}
.cmdbar:empty:before { content: attr(data-placeholder); color: var(--text-faint); font-family: var(--font-body); }
.tok {
  display: inline-block; padding: 2px 9px; margin: 1px 3px 1px 0; border-radius: var(--radius-sm); font-weight: 600;
  animation: tokPop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tokPop { from { transform: scale(0.85); opacity: 0.5; } to { transform: scale(1); opacity: 1; } }
.tok-command { background: var(--brand-subtle); color: #a3aafc; }
.tok-user { background: rgba(0, 168, 252, 0.16); color: #6ec9fb; }
.tok-duration { background: rgba(240, 177, 50, 0.16); color: var(--yellow); }
.tok-channel { background: rgba(35, 165, 90, 0.16); color: #5fd68e; }
.tok-role { background: rgba(218, 55, 60, 0.16); color: #ff8a8d; }
.tok-ticket { background: var(--bg-modifier-hover); color: var(--text-normal); }

.cmdbar-suggest {
  position: fixed; left: 0; top: 0;
  background: var(--bg-floating); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-y: auto; z-index: 10050; max-height: 300px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
  display: none;
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top center;
  transition: opacity var(--motion-normal) var(--ease), transform var(--motion-normal) var(--ease);
}
.cmdbar-suggest.open { display: block; }
.cmdbar-suggest.open.cmdbar-suggest-visible { opacity: 1; transform: translateY(0) scale(1); }
.cmdbar-suggest::-webkit-scrollbar { width: 7px; }
.cmdbar-suggest::-webkit-scrollbar-track { background: transparent; }
.cmdbar-suggest::-webkit-scrollbar-thumb { background: #46484e; border-radius: 4px; }
.cmdbar-suggest::-webkit-scrollbar-thumb:hover { background: #55575e; }
.cmdbar-suggest { scrollbar-width: thin; scrollbar-color: #46484e transparent; }
.cmdbar-suggest-item { padding: 10px 14px; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background 0.12s, padding-left 0.12s; }
.cmdbar-suggest-item.active, .cmdbar-suggest-item:hover { background: var(--bg-modifier-hover); padding-left: 18px; }
.cmdbar-suggest-item img { width: 20px; height: 20px; border-radius: 50%; }
.cmdbar-suggest-item small { color: var(--text-muted); margin-left: auto; font-family: var(--font-mono); }

.cmdbar-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 10px; }
.cmdbar-hint .tok { font-size: 0.72rem; padding: 1px 7px; }

.cmdbar-panel { margin-top: 22px; }
.cmdbar-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Custom dropdown (progressively replaces <select>) ---------- */
.cdd { position: relative; margin-bottom: 0; }
.cdd-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.cdd-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-input);
  border: 1px solid transparent; color: var(--text-normal); font-family: var(--font-body); font-size: 0.88rem;
  cursor: pointer; transition: border-color 0.15s, background 0.15s; user-select: none;
}
.cdd-trigger:hover { background: #232428; }
.cdd-trigger.open { border-color: var(--brand); }
.cdd-trigger .cdd-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdd-trigger .cdd-chevron { flex-shrink: 0; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg) translateY(-2px); transition: transform 0.15s; }
.cdd-trigger.open .cdd-chevron { transform: rotate(-135deg) translateY(1px); }
.cdd.disabled .cdd-trigger { opacity: 0.5; cursor: not-allowed; }

/* Small round color swatch shown next to role-type options, both in the
   closed trigger (selected value) and in each row of the open menu. */
.cdd-option-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,0.06); }
.cdd-option-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cdd-menu {
  position: fixed; z-index: 2000; display: none; flex-direction: column;
  background: var(--bg-floating); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  padding: 6px; overflow: hidden;
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top center;
  transition: opacity 0.15s cubic-bezier(0.2, 0, 0.2, 1), transform 0.15s cubic-bezier(0.2, 0, 0.2, 1);
}
.cdd-menu.open { display: flex; }
.cdd-menu.flip-up { transform-origin: bottom center; transform: translateY(6px) scale(0.98); }
.cdd-menu.open.cdd-menu-visible { opacity: 1; transform: translateY(0) scale(1); }

/* The search box is pinned at the top and never scrolls; only the option
   list below it does, in its own scroll area with a slim dark scrollbar. */
.cdd-search-wrap { position: relative; flex-shrink: 0; margin-bottom: 6px; }
.cdd-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-faint); pointer-events: none; display: flex;
}
.cdd-search-icon svg { width: 100%; height: 100%; }
.cdd-search {
  width: 100%; padding: 8px 10px 8px 32px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid transparent; color: var(--text-normal); font-size: 0.85rem;
}
.cdd-search:focus { outline: none; border-color: var(--brand); }

.cdd-options-wrap { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.cdd-options-wrap::-webkit-scrollbar { width: 7px; }
.cdd-options-wrap::-webkit-scrollbar-track { background: transparent; }
.cdd-options-wrap::-webkit-scrollbar-thumb { background: #46484e; border-radius: 4px; }
.cdd-options-wrap::-webkit-scrollbar-thumb:hover { background: #55575e; }
.cdd-options-wrap { scrollbar-width: thin; scrollbar-color: #46484e transparent; }

.cdd-option {
  padding: 9px 10px; border-radius: var(--radius-sm); font-size: 0.86rem; cursor: pointer;
  color: var(--text-normal); display: flex; align-items: center; gap: 9px;
  transition: background 0.1s;
}
.cdd-option:hover, .cdd-option.highlighted { background: var(--bg-modifier-hover); }
.cdd-option.selected { color: #a3aafc; font-weight: 600; }
.cdd-option.selected .cdd-option-text::after { content: ' ✓'; color: var(--brand); font-weight: 700; }
.cdd-empty { padding: 10px; text-align: center; color: var(--text-faint); font-size: 0.82rem; }

/* ---------- Multi-select dropdown ---------- */
.multiselect-option { cursor: pointer; }
.multiselect-option .toggle { flex-shrink: 0; }
.multiselect-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 2px; border-top: 1px solid var(--border-subtle); margin-top: 6px; flex-shrink: 0; }
.multiselect-clear { background: none; border: none; color: #a3aafc; font-size: 0.78rem; cursor: pointer; text-decoration: underline; padding: 0; }
.multiselect-count { font-size: 0.74rem; color: var(--text-faint); }

/* ---------- Collapsible sections (accordion) ---------- */
.collapsible { border: 1px solid var(--border-subtle); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; background: var(--bg-primary); }
.collapsible-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; cursor: pointer; user-select: none; }
.collapsible-header:hover { background: var(--bg-modifier-hover); }
.collapsible-header h4 { margin: 0; font-size: 0.88rem; color: var(--header-primary); }
.collapsible-header .sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.collapsible-chevron { flex-shrink: 0; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform 0.2s ease; margin-left: 12px; }
.collapsible.open .collapsible-chevron { transform: rotate(-135deg); }
.collapsible-body { max-height: 0; overflow: hidden; transition: max-height var(--motion-normal) var(--ease); padding: 0 16px; }
.collapsible.open .collapsible-body { max-height: 2400px; padding: 2px 16px 18px; }

/* ---------- Variable picker chips ---------- */
.var-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.var-chip {
  padding: 3px 9px; border-radius: 6px; background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-link); cursor: pointer; transition: background 0.12s;
}
.var-chip:hover { background: var(--bg-modifier-hover); }

/* ---------- Fetch / refresh button ---------- */
.fetch-btn { display: inline-flex; align-items: center; gap: 8px; }
.fetch-btn .fetch-icon { width: 14px; height: 14px; display: inline-block; }
.fetch-btn .fetch-icon svg { width: 100%; height: 100%; }
.fetch-btn.spinning .fetch-icon { animation: fetchSpin 0.6s ease; }
@keyframes fetchSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---------- Refined toggle (square, rounded corners, animated slide) ----------
   This is the ONE toggle style used everywhere in the dashboard — every
   on/off setting (Enabled checkboxes, Automod rules, Levels, Starboard,
   ticket types dropdown, embed timestamp, etc.) renders through this same
   markup: <label class="toggle"><input type="checkbox">...<span class="slider"></span></label> */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .slider {
  position: absolute; inset: 0; background: #4e5058; border-radius: 6px; cursor: pointer;
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.toggle .slider:before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 4px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.toggle input:checked + .slider { background: var(--green); }
.toggle input:checked + .slider:before { transform: translateX(18px); }
.toggle input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--brand-subtle); }
.toggle.disabled, .toggle:has(input:disabled) { opacity: 0.5; }
.toggle:has(input:disabled) .slider { cursor: not-allowed; }

/* ---------- Level role rewards / automation builder ---------- */
.level-reward-row, .automation-action-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.leaderboard-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border-subtle); }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.automation-card { border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--bg-primary); }
.automation-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.automation-action-block { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }

/* ---------- Modal dialogs (confirmation flows) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
  z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-secondary); border-radius: var(--radius-lg); width: 440px; max-width: 92vw;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  transform: scale(0.96); transition: transform 0.15s ease;
}
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--border-subtle); }
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.82rem; }
.modal-body { padding: 18px 22px; }
.modal-footer { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-warn-list { max-height: 130px; overflow-y: auto; margin-bottom: 16px; font-size: 0.84rem; color: var(--text-muted); background: var(--bg-primary); border-radius: var(--radius-sm); padding: 10px 12px; }
.modal-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-action-grid .btn { width: 100%; }

/* ---------- Picker modal: a button that opens a searchable list + Confirm,
   used in place of a plain <select> for automation triggers/actions and
   similar "pick one of these" choices where a confirm step reads better
   than an instant-commit dropdown. ---------- */
.picker-trigger { cursor: pointer; }
.picker-modal-list { max-height: 320px; overflow-y: auto; padding-right: 2px; margin: 0 -4px; padding: 2px 4px; }
.picker-modal-list::-webkit-scrollbar { width: 7px; }
.picker-modal-list::-webkit-scrollbar-track { background: transparent; }
.picker-modal-list::-webkit-scrollbar-thumb { background: #46484e; border-radius: 4px; }
.picker-modal-list::-webkit-scrollbar-thumb:hover { background: #55575e; }
.picker-modal-list { scrollbar-width: thin; scrollbar-color: #46484e transparent; }
.picker-modal-option { flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
.picker-modal-option .cdd-option-text { font-weight: 600; }
.picker-modal-option-desc { font-size: 0.76rem; color: var(--text-muted); font-weight: 400; }
.picker-modal-search { margin-bottom: 10px; }

/* ---------- Section divider: a labelled rule used to split one card into
   readable sections without resorting to a second, visually disconnected
   card (e.g. the automation editor's "Name/When" vs "Then do" halves). ---------- */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 16px; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }
.section-divider span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }

/* ---------- Picker modal: the "button -> popup with a list + confirm"
   pattern used for automation trigger/action selection instead of a plain
   <select>. Built on top of the existing modal + cdd-option styling so it
   matches the rest of the dashboard exactly. ---------- */
.picker-trigger { justify-content: space-between; }
.picker-modal-list { max-height: 320px; overflow-y: auto; padding-right: 2px; margin: 0 -4px; padding-left: 4px; padding-right: 6px; }
.picker-modal-list::-webkit-scrollbar { width: 7px; }
.picker-modal-list::-webkit-scrollbar-track { background: transparent; }
.picker-modal-list::-webkit-scrollbar-thumb { background: #46484e; border-radius: 4px; }
.picker-modal-option-desc { margin-left: auto; font-size: 0.74rem; color: var(--text-muted); flex-shrink: 0; }
.picker-modal-option.selected { background: var(--brand-subtle); }

/* ---------- Section divider: splits one card into logical sections without
   resorting to a second, visually disconnected card. ---------- */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 16px; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }
.section-divider span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }

/* ---------- Unsaved-changes bar (Discord-style) ---------- */
.unsaved-bar {
  position: fixed; left: 50%; bottom: -80px; transform: translateX(-50%);
  background: var(--bg-floating); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 14px 22px; display: flex; align-items: center; gap: 22px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5); z-index: 150; transition: bottom 0.25s ease;
  max-width: calc(100vw - 40px);
}
.unsaved-bar.show { bottom: 24px; }
.unsaved-bar .unsaved-text { font-size: 0.86rem; color: var(--text-normal); white-space: nowrap; }
.unsaved-bar .unsaved-actions { display: flex; gap: 8px; }

/* ---------- Music: player controls row ---------- */
.music-controls-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Music: drag-and-drop upload zone ---------- */
.music-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg); background: var(--bg-primary);
  padding: 36px 20px; text-align: center; cursor: pointer; margin-top: 14px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.music-dropzone:hover { border-color: var(--text-muted); background: #232428; }
.music-dropzone.drag-over { border-color: var(--brand); background: var(--brand-subtle); transform: scale(1.01); }
.music-dropzone-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; transition: transform 0.2s ease; }
.music-dropzone.drag-over .music-dropzone-icon { transform: scale(1.2) translateY(-3px); }
.music-dropzone-text { font-size: 0.95rem; color: var(--text-normal); line-height: 1.6; }
.music-dropzone-sub { color: var(--text-muted); font-size: 0.85rem; }
.music-dropzone-types, .music-dropzone-limit { font-size: 0.76rem; color: var(--text-faint); margin-top: 10px; }
.music-dropzone-limit { margin-top: 4px; }

/* ---------- Music: per-file upload progress item ---------- */
.music-upload-item {
  background: var(--bg-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 10px; animation: musicItemIn 0.2s ease;
}
.music-upload-item .name { font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.music-upload-item .size { color: var(--text-faint); font-weight: 400; font-size: 0.78rem; }
.music-upload-progress-track { height: 6px; border-radius: 3px; background: var(--bg-modifier-hover); overflow: hidden; }
.music-upload-progress-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width 0.2s ease; width: 0%; }
.music-upload-item.success .music-upload-progress-fill { background: var(--green); }
.music-upload-item.error .music-upload-progress-fill { background: var(--red); }
.music-upload-status { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.music-upload-item.success .music-upload-status { color: #3ba55c; }
.music-upload-item.error .music-upload-status { color: #ff8a8d; }
.music-upload-check {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 0.68rem; animation: musicCheckIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.music-upload-retry { margin-left: auto; background: none; border: none; color: #a3aafc; font-size: 0.78rem; cursor: pointer; text-decoration: underline; }

@keyframes musicItemIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes musicCheckIn { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

/* ---------- Music: library track rows entering/leaving ---------- */
.music-track-row { animation: musicItemIn 0.25s ease; }
.music-track-row.removing { animation: musicTrackOut 0.18s ease forwards; }
@keyframes musicTrackOut { to { opacity: 0; transform: translateX(8px) scale(0.98); } }

/* ================================================================
   Minecraft plugin connections
   Private OWNER_ID-only integration pages and verification module.
   ================================================================ */
.minecraft-secret-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(114, 92, 255, 0.58);
  box-shadow: 0 8px 24px rgba(88, 71, 220, 0.18);
}
.minecraft-secret-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,.16) 48%, transparent 76%);
  transform: translateX(-125%);
  transition: transform .55s ease;
}
.minecraft-secret-button:hover::after { transform: translateX(125%); }
.minecraft-secret-dot,
.minecraft-panel-badge span,
.mc-plugin-status span,
.mc-connection-state span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #78e6a5;
  box-shadow: 0 0 0 4px rgba(70, 211, 125, .12), 0 0 14px rgba(70, 211, 125, .55);
  display: inline-block;
  flex: 0 0 auto;
}

.minecraft-module-card {
  border-color: rgba(124, 92, 255, .48) !important;
  background:
    radial-gradient(circle at 88% 4%, rgba(124, 92, 255, .22), transparent 40%),
    linear-gradient(145deg, rgba(38, 33, 65, .88), var(--bg-secondary));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 44px rgba(33, 22, 82, .12);
}
.minecraft-module-card .module-icon {
  background: linear-gradient(135deg, #8870ff, #4a43ce) !important;
  box-shadow: 0 9px 26px rgba(104, 80, 242, .33);
}
.minecraft-module-card .module-icon::before { content: 'MC'; font-size: .66rem; font-weight: 900; color: #fff; letter-spacing: -.03em; }

.minecraft-panel-shell { display: grid; gap: 18px; margin-top: 18px; }
.minecraft-panel-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 26px;
  border: 1px solid rgba(124, 92, 255, .38);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 20%, rgba(124, 92, 255, .24), transparent 38%),
    linear-gradient(145deg, #242231, #1f2025 72%);
  box-shadow: 0 22px 60px rgba(0,0,0,.18);
}
.minecraft-panel-hero h2 { margin: 4px 0 8px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.minecraft-panel-hero p { margin: 0; max-width: 720px; color: var(--text-muted); line-height: 1.6; }
.minecraft-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #aaf2c2;
  background: rgba(55, 180, 103, .1);
  border: 1px solid rgba(65, 211, 119, .24);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}
.minecraft-connection-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.minecraft-connection-summary > div {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}
.minecraft-connection-summary span { display: block; color: var(--text-faint); font-size: .73rem; text-transform: uppercase; letter-spacing: .045em; margin-bottom: 7px; }
.minecraft-connection-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .94rem; }
.minecraft-send-card { max-width: none; }
.minecraft-send-card select { margin: 8px 0 14px; }

.minecraft-connect-page { padding-bottom: 60px; }
.mc-connect-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 245px;
  gap: 36px;
  padding: clamp(28px, 5vw, 54px);
  margin: 18px 0 38px;
  border: 1px solid rgba(124, 92, 255, .34);
  border-radius: 22px;
  background:
    linear-gradient(115deg, rgba(22, 23, 30, .97) 0 52%, rgba(44, 34, 88, .93)),
    var(--bg-secondary);
  box-shadow: 0 34px 90px rgba(0,0,0,.26);
}
.mc-connect-hero::before {
  content: '';
  position: absolute;
  width: 390px;
  height: 390px;
  right: -120px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(134, 96, 255, .32), transparent 68%);
  pointer-events: none;
}
.mc-connect-hero > div:first-child { position: relative; z-index: 1; max-width: 760px; }
.mc-connect-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; margin: 10px 0 14px; letter-spacing: -.045em; }
.mc-connect-hero p { margin: 0; color: var(--text-muted); font-size: .98rem; line-height: 1.7; max-width: 700px; }
.mc-connect-hero code, .mc-secure-note code { color: #c6baff; background: rgba(124,92,255,.12); border: 1px solid rgba(124,92,255,.2); border-radius: 5px; padding: 2px 5px; }
.mc-back-link { color: #bcb3ff; font-size: .82rem; font-weight: 650; text-decoration: none; }
.mc-back-link:hover { color: #fff; }
.mc-eyebrow { color: #9e8cff; font-size: .69rem; font-weight: 850; letter-spacing: .115em; text-transform: uppercase; }
.mc-hero-orbit { position: relative; width: 160px; height: 160px; flex: 0 0 160px; }
.mc-hero-orbit::before, .mc-hero-orbit::after {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 1px solid rgba(173, 151, 255, .28);
  animation: mcOrbitSpin 16s linear infinite;
}
.mc-hero-orbit::after { inset: 31px; border-style: dashed; animation-direction: reverse; animation-duration: 11s; }
.mc-hero-orbit > span { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #8e74ff; box-shadow: 0 0 18px #8e74ff; z-index: 2; }
.mc-hero-orbit > span:nth-child(1) { left: 7px; top: 76px; }
.mc-hero-orbit > span:nth-child(2) { right: 25px; top: 20px; background: #4fd3a0; box-shadow: 0 0 18px #4fd3a0; }
.mc-hero-orbit > span:nth-child(3) { right: 12px; bottom: 39px; background: #55a8ff; box-shadow: 0 0 18px #55a8ff; }
.mc-hero-core {
  position: absolute;
  inset: 43px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(145deg, #9078ff, #493cc1);
  box-shadow: 0 17px 44px rgba(86, 60, 210, .5), inset 0 1px 0 rgba(255,255,255,.26);
  transform: rotate(-7deg);
}
@keyframes mcOrbitSpin { to { transform: rotate(360deg); } }

.mc-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 17px; }
.mc-section-head.compact { margin-bottom: 14px; }
.mc-section-head h2 { margin: 4px 0 0; font-size: 1.38rem; }
.mc-count-pill { padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: var(--bg-secondary); font-size: .75rem; }
.mc-plugin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 17px; }
.mc-plugin-card {
  --mc-accent: #7c5cff;
  position: relative;
  overflow: hidden;
  min-height: 395px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--mc-accent) 35%, var(--border));
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--mc-accent) 20%, transparent), transparent 42%),
    linear-gradient(150deg, #292a30, #222329 70%);
  box-shadow: 0 22px 55px rgba(0,0,0,.17);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.mc-plugin-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--mc-accent) 65%, var(--border)); box-shadow: 0 30px 70px rgba(0,0,0,.25); }
.mc-plugin-card::after { content:''; position:absolute; width:170px; height:170px; right:-85px; bottom:-100px; border-radius:50%; background: var(--mc-accent); opacity:.09; filter: blur(2px); }
.mc-plugin-card-top { display:flex; justify-content:space-between; align-items:center; gap:16px; position:relative; z-index:1; }
.mc-plugin-logo { width:52px; height:52px; display:grid; place-items:center; border-radius:15px; color:#fff; font-weight:900; font-size:1.25rem; background:linear-gradient(145deg, color-mix(in srgb, var(--mc-accent) 82%, white), var(--mc-accent)); box-shadow:0 13px 30px color-mix(in srgb, var(--mc-accent) 33%, transparent); }
.mc-plugin-status { display:inline-flex; align-items:center; gap:8px; padding:7px 10px; border:1px solid var(--border); border-radius:999px; background:rgba(18,19,23,.55); color:var(--text-muted); font-size:.7rem; font-weight:720; }
.mc-plugin-status span { background:#9a9da6; box-shadow:0 0 0 4px rgba(154,157,166,.09); }
.mc-plugin-status.connected { color:#9ce9b7; border-color:rgba(70,211,125,.23); background:rgba(55,180,103,.08); }
.mc-plugin-status.connected span { background:#58db8a; box-shadow:0 0 0 4px rgba(70,211,125,.12),0 0 14px rgba(70,211,125,.45); }
.mc-plugin-card h3 { margin:24px 0 8px; font-size:1.25rem; position:relative; z-index:1; }
.mc-plugin-card > p { margin:0; color:var(--text-muted); line-height:1.58; font-size:.87rem; position:relative; z-index:1; }
.mc-feature-list { display:flex; gap:7px; flex-wrap:wrap; margin:18px 0; position:relative; z-index:1; }
.mc-feature-list span { padding:6px 8px; border-radius:7px; border:1px solid var(--border-subtle); color:var(--text-muted); background:rgba(17,18,22,.34); font-size:.68rem; }
.mc-current-connection { padding:11px 12px; border-radius:9px; border:1px solid rgba(124,92,255,.2); background:rgba(124,92,255,.075); margin-bottom:14px; position:relative; z-index:1; }
.mc-current-connection span { display:block; font-size:.67rem; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em; }
.mc-current-connection strong { display:block; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.82rem; }
.mc-connect-btn { width:100%; margin-top:auto; position:relative; z-index:1; }
.mc-connections-card { margin-top:26px; padding:23px; border:1px solid var(--border-subtle); border-radius:18px; background:var(--bg-secondary); }
.mc-empty-connection { color:var(--text-muted); padding:25px; text-align:center; border:1px dashed var(--border); border-radius:var(--radius); background:var(--bg-primary); }
.mc-connection-list { display:grid; gap:9px; }
.mc-connection-row { display:flex; align-items:center; gap:13px; padding:13px; border:1px solid var(--border-subtle); border-radius:10px; background:var(--bg-primary); }
.mc-connection-icon { width:39px; height:39px; display:grid; place-items:center; border-radius:10px; background:rgba(124,92,255,.14); color:#b9acff; font-size:.69rem; font-weight:900; }
.mc-connection-copy { min-width:0; flex:1; }
.mc-connection-copy strong, .mc-connection-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mc-connection-copy strong { font-size:.86rem; }
.mc-connection-copy span { margin-top:4px; color:var(--text-faint); font-size:.73rem; }
.mc-connection-state { display:inline-flex; align-items:center; gap:7px; color:#8be8ad; font-size:.72rem; white-space:nowrap; }

.mc-link-modal { width:min(520px, calc(100vw - 28px)); }
.mc-step-dots { display:flex; justify-content:center; gap:7px; margin-bottom:14px; }
.mc-step-dots span { width:24px; height:4px; border-radius:99px; background:var(--border); transition:background .2s ease,width .2s ease; }
.mc-step-dots span.active { width:34px; background:#8068ff; }
.mc-link-step label { display:block; margin-bottom:8px; font-size:.8rem; font-weight:650; }
.mc-link-step input { width:100%; }
.mc-code-input { font-size:1.45rem !important; letter-spacing:.32em; text-align:center; font-variant-numeric:tabular-nums; font-weight:800; }
.mc-command-card { margin-top:18px; padding:13px 15px; border:1px solid rgba(124,92,255,.22); border-radius:10px; background:rgba(124,92,255,.07); display:flex; flex-direction:column; gap:8px; color:var(--text-muted); font-size:.78rem; }
.mc-command-card code { color:#d4ccff; font-size:.95rem; }
.mc-secure-note { margin-top:15px; padding:12px; display:flex; gap:9px; align-items:flex-start; border-radius:9px; color:var(--text-muted); background:rgba(57,184,104,.07); border:1px solid rgba(70,211,125,.18); font-size:.76rem; line-height:1.5; }
.mc-secure-note > span { color:#63df91; font-weight:900; }

@media (max-width: 760px) {
  .mc-connect-hero { min-height: auto; }
  .mc-hero-orbit { display:none; }
  .minecraft-panel-hero { align-items:flex-start; flex-direction:column; }
  .minecraft-connection-summary { grid-template-columns:1fr; }
  .mc-connection-state { display:none; }
}

/* Minecraft control center */
.minecraft-control-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.minecraft-card-heading,.minecraft-console-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.minecraft-card-heading h3,.minecraft-console-toolbar h3 { margin:4px 0 6px; }
.minecraft-runtime-badge { min-width:128px; display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:10px 14px; border:1px solid var(--border); border-radius:999px; background:rgba(255,255,255,.04); text-transform:uppercase; letter-spacing:.055em; font-size:.76rem; }
.minecraft-runtime-pulse { width:9px; height:9px; border-radius:50%; background:#8991a7; box-shadow:0 0 0 4px rgba(137,145,167,.12); }
.minecraft-runtime-badge.status-online { border-color:rgba(63,211,143,.34); color:#83efba; background:rgba(32,167,105,.10); }
.minecraft-runtime-badge.status-online .minecraft-runtime-pulse { background:#3fd38f; box-shadow:0 0 0 4px rgba(63,211,143,.14),0 0 16px rgba(63,211,143,.45); animation:mcPulse 1.7s ease-in-out infinite; }
.minecraft-runtime-badge.status-starting { border-color:rgba(247,190,72,.36); color:#ffd477; background:rgba(203,140,22,.10); }
.minecraft-runtime-badge.status-starting .minecraft-runtime-pulse { background:#f7be48; animation:mcPulse .9s ease-in-out infinite; }
.minecraft-runtime-badge.status-stopping { border-color:rgba(255,135,82,.34); color:#ffb18d; background:rgba(210,90,36,.10); }
.minecraft-runtime-badge.status-stopping .minecraft-runtime-pulse { background:#ff8752; animation:mcPulse .7s ease-in-out infinite; }
.minecraft-runtime-badge.status-stopped { color:#a5adbf; }
@keyframes mcPulse { 50% { opacity:.42; transform:scale(.78); } }
.swag-switch { display:inline-flex; cursor:pointer; flex:0 0 auto; }
.swag-switch input { position:absolute; opacity:0; pointer-events:none; }
.swag-switch-track { width:48px; height:27px; display:block; border-radius:999px; background:#30374a; border:1px solid rgba(255,255,255,.09); padding:3px; transition:.2s ease; }
.swag-switch-thumb { display:block; width:19px; height:19px; border-radius:50%; background:#d6daea; box-shadow:0 2px 8px rgba(0,0,0,.35); transition:.2s cubic-bezier(.2,.8,.2,1); }
.swag-switch input:checked + .swag-switch-track { background:linear-gradient(135deg,#7358ff,#4b8cff); border-color:rgba(152,130,255,.65); }
.swag-switch input:checked + .swag-switch-track .swag-switch-thumb { transform:translateX(21px); background:white; }
.swag-switch input:focus-visible + .swag-switch-track { outline:3px solid rgba(124,92,255,.28); outline-offset:3px; }
.minecraft-security-note { margin-top:18px; padding:13px 14px; border:1px solid rgba(124,92,255,.20); background:rgba(124,92,255,.07); border-radius:12px; color:var(--text-muted); line-height:1.5; font-size:.84rem; }
.minecraft-security-note span { color:#bfb2ff; font-weight:750; margin-right:7px; }
.minecraft-console-card { overflow:hidden; padding:0; }
.minecraft-console-toolbar { padding:20px 22px 16px; border-bottom:1px solid var(--border); }
.minecraft-console-toolbar p { margin:0; }
.minecraft-console-actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.minecraft-console-screen { min-height:320px; max-height:490px; overflow:auto; background:#090b11; padding:15px 17px; color:#d9deec; font:500 .79rem/1.65 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; scrollbar-color:#343b50 #090b11; }
.minecraft-console-line { display:grid; grid-template-columns:74px minmax(0,1fr); gap:9px; white-space:pre-wrap; overflow-wrap:anywhere; border-radius:5px; padding:1px 5px; }
.minecraft-console-line:hover { background:rgba(255,255,255,.035); }
.minecraft-console-line.command { color:#d6cfff; }
.minecraft-console-line.error { color:#ff9d9d; }
.minecraft-console-time { color:#697188; user-select:none; }
.minecraft-console-empty { min-height:290px; display:grid; place-items:center; color:#697188; text-align:center; }
.command-state { display:inline-flex; margin-left:7px; padding:1px 6px; border-radius:999px; font-size:.66rem; font-style:normal; text-transform:uppercase; letter-spacing:.04em; background:#232838; color:#9fa7bb; }
.command-state.completed { color:#7ce9af; background:rgba(41,171,107,.14); }
.command-state.failed { color:#ff9999; background:rgba(218,69,69,.14); }
.command-state.dispatched { color:#ffd27d; background:rgba(205,146,33,.14); }
.minecraft-console-command { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; border-top:1px solid #242938; background:#11141d; padding:12px 14px; }
.minecraft-console-prompt { font:800 1.2rem ui-monospace,monospace; color:#8069ff; }
.minecraft-console-command input { margin:0; border-color:transparent; background:transparent; font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
.minecraft-console-command input:focus { border-color:rgba(124,92,255,.38); background:rgba(255,255,255,.025); }
.minecraft-console-foot { display:flex; justify-content:space-between; gap:18px; padding:9px 17px 12px; color:var(--text-faint); font-size:.72rem; background:#11141d; }
@media(max-width:780px) { .minecraft-control-grid{grid-template-columns:1fr}.minecraft-console-toolbar{flex-direction:column}.minecraft-console-foot{flex-direction:column;gap:4px}.minecraft-console-line{grid-template-columns:58px minmax(0,1fr)} }

/* ========================================================================
   SWAG custom interaction system
   Every interactive control has a dashboard-native visual treatment. Native
   elements remain underneath for forms, keyboard input and accessibility,
   but browser/OS default appearance is removed everywhere.
   ======================================================================== */
:root {
  --control-bg: rgba(17, 18, 20, 0.78);
  --control-bg-hover: rgba(35, 36, 40, 0.92);
  --control-border: rgba(148, 155, 164, 0.20);
  --control-border-hover: rgba(148, 155, 164, 0.34);
  --control-ring: rgba(88, 101, 242, 0.28);
  --control-shadow: 0 1px 0 rgba(255,255,255,0.035) inset, 0 7px 18px rgba(0,0,0,0.16);
  --control-shadow-focus: 0 0 0 4px var(--control-ring), 0 10px 25px rgba(0,0,0,0.24);
  --control-height: 43px;
  --control-radius: 10px;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[role="button"]:focus-visible,
.cdd-trigger:focus-visible,
.tab:focus-visible,
.tab-btn:focus-visible,
.icon-btn:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 4px var(--control-ring) !important;
}

.btn {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 650;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 6px 15px rgba(0,0,0,0.18);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), transparent 60%);
  transition: opacity var(--motion-fast) ease;
}
.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn-primary {
  background: linear-gradient(180deg, #6975f5 0%, var(--brand) 55%, #4b56d4 100%);
  border-color: rgba(133, 144, 255, 0.50);
  box-shadow: 0 1px 0 rgba(255,255,255,0.19) inset, 0 8px 20px rgba(54, 65, 190, 0.30);
}
.btn-primary:hover { background: linear-gradient(180deg, #7580f7 0%, #616df3 55%, #515dcc 100%); }
.btn-ghost {
  background: linear-gradient(180deg, rgba(78,80,88,0.44), rgba(54,56,62,0.44));
  border-color: rgba(148,155,164,0.20);
  box-shadow: 0 1px 0 rgba(255,255,255,0.045) inset, 0 5px 12px rgba(0,0,0,0.12);
}
.btn-ghost:hover {
  background: linear-gradient(180deg, rgba(92,95,104,0.60), rgba(64,66,73,0.58));
  border-color: rgba(148,155,164,0.32);
}
.btn-danger {
  background: linear-gradient(180deg, #e34b50 0%, var(--red) 58%, #b72d32 100%);
  border-color: rgba(255,120,124,0.38);
}
.btn-danger:hover { background: linear-gradient(180deg, #ec585d 0%, #df4146 58%, #bc3035 100%); }
.btn-warn {
  background: linear-gradient(180deg, rgba(240,177,50,0.24), rgba(150,101,22,0.22));
  border-color: rgba(240,177,50,0.40);
  color: #ffd889;
}
.btn-sm { min-height: 34px; padding: 7px 12px; border-radius: 9px; }
.btn:disabled, button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* Text, numeric, URL, date and password fields */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),
textarea {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: var(--control-height);
  padding: 10px 13px;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: linear-gradient(180deg, rgba(20,21,24,0.92), var(--control-bg));
  color: var(--header-primary);
  caret-color: #9fa7ff;
  box-shadow: var(--control-shadow);
  transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]):hover,
textarea:hover {
  border-color: var(--control-border-hover);
  background: linear-gradient(180deg, rgba(27,28,32,0.96), rgba(20,21,24,0.92));
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]):focus,
textarea:focus {
  outline: none;
  border-color: rgba(112,124,255,0.86);
  box-shadow: var(--control-shadow-focus);
  background: rgba(19,20,23,0.98);
}
input::placeholder, textarea::placeholder { color: #70757f; opacity: 1; }
input:disabled, textarea:disabled, select:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: rgba(237,66,69,0.85) !important;
  box-shadow: 0 0 0 4px rgba(237,66,69,0.15) !important;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--header-primary);
  -webkit-box-shadow: 0 0 0 1000px #17181b inset, var(--control-shadow-focus);
  transition: background-color 9999s ease-out;
}
textarea {
  min-height: 106px;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: #4d5058 transparent;
}
textarea::-webkit-scrollbar { width: 8px; }
textarea::-webkit-scrollbar-thumb { background: #4d5058; border-radius: 999px; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="datetime-local"], input[type="date"], input[type="time"] {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23949ba4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  width: 24px;
  height: 24px;
}

/* Fully custom checkbox and radio visuals. */
input[type="checkbox"]:not(.cdd-native),
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  vertical-align: middle;
  border: 1px solid rgba(148,155,164,0.38);
  background: linear-gradient(180deg, rgba(35,36,40,0.96), rgba(22,23,26,0.96));
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 3px 8px rgba(0,0,0,0.20);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) ease;
}
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"] { border-radius: 999px; }
input[type="checkbox"]::before {
  content: '';
  width: 11px;
  height: 8px;
  transform: scale(0) rotate(-45deg);
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  margin-top: -2px;
  transition: transform var(--motion-fast) var(--ease);
}
input[type="radio"]::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  transform: scale(0);
  transition: transform var(--motion-fast) var(--ease);
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: #7d87ff;
  background: linear-gradient(180deg, #707bf7, #515dcc);
  box-shadow: 0 0 0 3px rgba(88,101,242,0.16), 0 4px 10px rgba(49,58,178,0.32);
}
input[type="checkbox"]:checked::before { transform: scale(1) rotate(-45deg); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--control-ring);
}
input[type="checkbox"]:active,
input[type="radio"]:active { transform: scale(0.92); }

/* Reassert the dashboard switch styling over the generic checkbox skin. */
.toggle input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  width: 0;
  min-width: 0;
  height: 0;
  margin: 0;
  border: 0;
  box-shadow: none;
  display: block;
}
.toggle input[type="checkbox"]::before { display: none; }
.toggle .slider {
  background: linear-gradient(180deg, #555861, #41434a);
  border: 1px solid rgba(148,155,164,0.22);
  box-shadow: 0 1px 0 rgba(255,255,255,0.07) inset, 0 5px 12px rgba(0,0,0,0.18);
}
.toggle input:checked + .slider {
  background: linear-gradient(180deg, #36b76d, #218d51);
  border-color: rgba(97,218,144,0.35);
}

/* Range, color and file fields */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #8d67f6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 3px 8px rgba(0,0,0,0.22);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 19px;
  height: 19px;
  margin-top: -6px;
  border-radius: 50%;
  border: 3px solid #6975f5;
  background: #f4f5ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.38);
}
input[type="range"]::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #8d67f6);
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid #6975f5;
  background: #f4f5ff;
}
input[type="file"] {
  width: 100%;
  padding: 7px;
  border: 1px dashed rgba(148,155,164,0.30);
  border-radius: var(--control-radius);
  background: rgba(17,18,20,0.62);
  color: var(--text-muted);
}
input[type="file"]::file-selector-button {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(148,155,164,0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(90,93,103,0.62), rgba(55,57,64,0.62));
  color: var(--header-primary);
  font-weight: 650;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
}
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 43px;
  height: 43px;
  padding: 4px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(35,36,40,0.96), rgba(22,23,26,0.96));
  box-shadow: var(--control-shadow);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }

/* Native select is a styled fallback. JS replaces it with .cdd everywhere. */
select {
  -webkit-appearance: none;
  appearance: none;
  min-height: var(--control-height);
  padding: 10px 42px 10px 13px;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background-color: var(--control-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23949ba4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  box-shadow: var(--control-shadow);
}
.cdd-trigger {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  border-color: var(--control-border);
  background: linear-gradient(180deg, rgba(29,30,34,0.94), rgba(19,20,23,0.94));
  box-shadow: var(--control-shadow);
  padding: 10px 13px;
}
.cdd-trigger:hover {
  border-color: var(--control-border-hover);
  background: linear-gradient(180deg, rgba(38,39,44,0.98), rgba(25,26,30,0.98));
}
.cdd-trigger.open {
  border-color: rgba(112,124,255,0.86);
  box-shadow: var(--control-shadow-focus);
}
.cdd-menu {
  border-radius: 12px;
  border-color: rgba(148,155,164,0.24);
  background: rgba(17,18,20,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 22px 55px rgba(0,0,0,0.62), 0 1px 0 rgba(255,255,255,0.05) inset;
  padding: 7px;
}
.cdd-option { border-radius: 8px; padding: 10px; }
.cdd-option:hover, .cdd-option.highlighted { background: rgba(88,101,242,0.14); }
.cdd-option.selected { background: rgba(88,101,242,0.11); color: #c3c8ff; }
.cdd-search { border: 1px solid var(--control-border); border-radius: 8px; }

/* Custom dialog replacing browser confirm(), prompt() and alert(). */
body.wui-dialog-open { overflow: hidden; }
.wui-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5,6,8,0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms ease;
}
.wui-dialog-layer.is-open { opacity: 1; pointer-events: auto; }
.wui-dialog {
  position: relative;
  width: min(500px, 100%);
  overflow: hidden;
  border: 1px solid rgba(148,155,164,0.24);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(47,49,55,0.99), rgba(27,28,32,0.99));
  box-shadow: 0 34px 90px rgba(0,0,0,0.66), 0 1px 0 rgba(255,255,255,0.06) inset;
  transform: translateY(12px) scale(0.975);
  transition: transform 190ms var(--ease);
}
.wui-dialog-layer.is-open .wui-dialog { transform: translateY(0) scale(1); }
.wui-dialog-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), #9b6df8, transparent);
}
.wui-dialog-danger .wui-dialog-accent { background: linear-gradient(90deg, transparent, #ed4245, #f07d65, transparent); }
.wui-dialog-warning .wui-dialog-accent { background: linear-gradient(90deg, transparent, #f0b132, #ffd47a, transparent); }
.wui-dialog-header {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  gap: 13px;
  align-items: start;
  padding: 24px 24px 15px;
}
.wui-dialog-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #b9beff;
  background: rgba(88,101,242,0.14);
  border: 1px solid rgba(88,101,242,0.24);
}
.wui-dialog-danger .wui-dialog-icon { color: #ff9a9d; background: rgba(237,66,69,0.13); border-color: rgba(237,66,69,0.25); }
.wui-dialog-warning .wui-dialog-icon { color: #ffd889; background: rgba(240,177,50,0.13); border-color: rgba(240,177,50,0.25); }
.wui-dialog-icon svg { width: 21px; height: 21px; }
.wui-dialog-heading h2 { margin: 1px 0 4px; font-size: 1.08rem; }
.wui-dialog-heading p { margin: 0; color: var(--text-muted); font-size: 0.86rem; line-height: 1.55; }
.wui-dialog-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.wui-dialog-close:hover { background: rgba(78,80,88,0.42); border-color: rgba(148,155,164,0.18); color: var(--header-primary); }
.wui-dialog-close svg { width: 17px; height: 17px; }
.wui-dialog-body { padding: 3px 24px 10px; }
.wui-dialog-field { margin: 0; text-transform: none; letter-spacing: 0; }
.wui-dialog-field > span:first-child { display: block; margin-bottom: 8px; color: var(--text-normal); font-size: 0.78rem; font-weight: 700; }
.wui-dialog-field small { display: block; margin-top: 7px; color: var(--text-faint); font-size: 0.73rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.wui-field-error { display: block; min-height: 18px; margin-top: 6px; color: #ff8d90; font-size: 0.74rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
.wui-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 24px 22px;
}
.wui-dialog-footer .btn { min-width: 96px; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 560px) {
  .wui-dialog-layer { padding: 12px; align-items: end; }
  .wui-dialog { width: 100%; border-radius: 16px 16px 12px 12px; }
  .wui-dialog-header { grid-template-columns: 38px 1fr 32px; padding: 21px 18px 13px; }
  .wui-dialog-icon { width: 38px; height: 38px; }
  .wui-dialog-body { padding: 3px 18px 8px; }
  .wui-dialog-footer { padding: 10px 18px 18px; }
  .wui-dialog-footer .btn { flex: 1; }
}

/* Custom multi-select dropdowns */
.wui-multi { position: relative; min-width: 0; }
.wui-multi-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
.wui-multi-trigger {
  width: 100%;
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: linear-gradient(180deg, rgba(29,30,34,0.94), rgba(19,20,23,0.94));
  color: var(--text-normal);
  box-shadow: var(--control-shadow);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.wui-multi-trigger:hover { border-color: var(--control-border-hover); background: linear-gradient(180deg, rgba(38,39,44,0.98), rgba(25,26,30,0.98)); }
.wui-multi-trigger.is-open { border-color: rgba(112,124,255,0.86); box-shadow: var(--control-shadow-focus); }
.wui-multi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wui-multi-chevron { width: 9px; height: 9px; flex: 0 0 auto; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg) translateY(-2px); transition: transform var(--motion-fast) ease; }
.wui-multi-trigger.is-open .wui-multi-chevron { transform: rotate(-135deg) translateY(1px); }
.wui-multi-panel {
  position: fixed;
  z-index: 4000;
  display: none;
  flex-direction: column;
  padding: 7px;
  border: 1px solid rgba(148,155,164,0.24);
  border-radius: 12px;
  background: rgba(17,18,20,0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 22px 55px rgba(0,0,0,0.62), 0 1px 0 rgba(255,255,255,0.05) inset;
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top center;
  transition: opacity 150ms ease, transform 150ms var(--ease);
}
.wui-multi-panel.flip-up { transform-origin: bottom center; transform: translateY(6px) scale(0.985); }
.wui-multi-panel.is-open { display: flex; }
.wui-multi-panel.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.wui-multi-search-wrap { flex: 0 0 auto; padding-bottom: 6px; }
.wui-multi-search { min-height: 38px !important; padding: 8px 10px !important; border-radius: 8px !important; }
.wui-multi-options { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4d5058 transparent; }
.wui-multi-options::-webkit-scrollbar { width: 7px; }
.wui-multi-options::-webkit-scrollbar-thumb { background: #4d5058; border-radius: 999px; }
.wui-multi-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-normal);
  cursor: pointer;
  text-align: left;
}
.wui-multi-option:hover, .wui-multi-option:focus-visible { background: rgba(88,101,242,0.14); outline: none; }
.wui-multi-option.is-selected { background: rgba(88,101,242,0.10); color: #c3c8ff; }
.wui-multi-check {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: grid;
  place-content: center;
  border: 1px solid rgba(148,155,164,0.38);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(35,36,40,0.96), rgba(22,23,26,0.96));
}
.wui-multi-check::before { content: ''; width: 10px; height: 7px; border-left: 2px solid white; border-bottom: 2px solid white; transform: scale(0) rotate(-45deg); transition: transform var(--motion-fast) var(--ease); margin-top: -2px; }
.wui-multi-option.is-selected .wui-multi-check { border-color: #7d87ff; background: linear-gradient(180deg, #707bf7, #515dcc); }
.wui-multi-option.is-selected .wui-multi-check::before { transform: scale(1) rotate(-45deg); }
.wui-multi-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 3px 1px; border-top: 1px solid var(--border-subtle); margin-top: 6px; }
.wui-multi-clear { padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: #abb1ff; cursor: pointer; font-weight: 650; }
.wui-multi-clear:hover { background: rgba(88,101,242,0.12); }
.wui-multi-empty { padding: 16px 10px; color: var(--text-faint); text-align: center; font-size: 0.82rem; }


/* ======================================================================
   SWAG rebrand
   ====================================================================== */
body { background: var(--bg-tertiary); }
body::before {
  background: radial-gradient(900px 460px at 82% -12%, rgba(163,60,255,.10), transparent 65%), var(--bg-tertiary);
}
body::after { display:none; }

.nav-shell { z-index:100; }
.nav { animation:none; }
body.scrolled .nav { background:transparent; }
.nav .brand { gap:9px; letter-spacing:.08em; font-size:.94rem; }
.brand-mark { width:34px; height:34px; object-fit:contain; flex:0 0 auto; }
.nav .brand .dot { display:none; }

.card, .feature-card, .server-card, .subcard, .workflow-item, .list-row {
  box-shadow:none;
}
.card, .server-card { border-color:var(--border-subtle); }
.btn { letter-spacing:0; box-shadow:none; }
.btn-primary { background:var(--brand); }
.btn-primary:hover { background:var(--brand-hover); }
.hero-split .btn-primary::after, .hero .btn-primary::after, .cta-band .btn-primary::after { display:none; }
.nav .brand, .btn, .card, .server-card { animation:none!important; }

/* Landing page: direct product layout, no fake dashboard mockup. */
.swag-landing { padding-bottom:64px; }
.swag-hero {
  display:grid; grid-template-columns:minmax(0,1.08fr) minmax(320px,.92fr); align-items:center;
  gap:64px; min-height:640px; padding:68px 0 72px; border-bottom:1px solid var(--border-subtle);
}
.swag-hero-copy { max-width:680px; }
.swag-hero .kicker { color:#cf8cff; font-size:.78rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; margin-bottom:18px; }
.swag-hero h1 { font-size:clamp(2.55rem,6vw,5.2rem); line-height:.98; letter-spacing:-.055em; max-width:780px; margin-bottom:24px; }
.swag-hero .lead { max-width:620px; color:var(--text-muted); font-size:1.08rem; line-height:1.65; margin:0 0 28px; }
.swag-hero .cta-row { display:flex; gap:10px; flex-wrap:wrap; }
.swag-hero-notes { display:flex; gap:18px; flex-wrap:wrap; margin-top:25px; color:var(--text-faint); font-size:.82rem; }
.swag-hero-notes span { position:relative; padding-left:13px; }
.swag-hero-notes span::before { content:''; position:absolute; left:0; top:.62em; width:4px; height:4px; border-radius:50%; background:#b95cff; }
.swag-hero-mark { display:grid; place-items:center; min-height:420px; }
.swag-hero-mark img { width:min(100%,520px); height:auto; border-radius:24px; box-shadow:0 28px 80px rgba(0,0,0,.38); }

.swag-section { padding:72px 0; }
.swag-section-head { display:flex; justify-content:space-between; align-items:end; gap:28px; margin-bottom:26px; }
.swag-section-head h2 { font-size:clamp(1.8rem,3vw,2.6rem); margin:3px 0 0; }
.swag-section-head p { color:var(--text-muted); margin:0; }
.swag-module-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--border-subtle); border-radius:16px; overflow:hidden; background:var(--bg-secondary); }
.swag-module-card { min-height:190px; padding:26px; border-right:1px solid var(--border-subtle); }
.swag-module-card:last-child { border-right:0; }
.swag-module-card h3 { margin-bottom:10px; font-size:1.02rem; }
.swag-module-card p { margin:0; color:var(--text-muted); line-height:1.6; font-size:.9rem; }

.swag-workflow { display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid var(--border-subtle); border-bottom:1px solid var(--border-subtle); }
.swag-workflow > div { padding:34px 26px; border-right:1px solid var(--border-subtle); }
.swag-workflow > div:last-child { border-right:0; }
.swag-workflow span { color:#b865ff; font-family:var(--font-mono); font-size:.75rem; }
.swag-workflow h3 { margin:18px 0 6px; }
.swag-workflow p { color:var(--text-muted); margin:0; }
.swag-cta { margin-top:72px; display:flex; align-items:center; justify-content:space-between; gap:24px; padding:32px; border:1px solid var(--border); border-radius:16px; background:#110d18; }
.swag-cta h2 { margin:0 0 4px; }
.swag-cta p { margin:0; color:var(--text-muted); }

footer { color:var(--text-faint); }

@media (max-width:900px) {
  .swag-hero { grid-template-columns:1fr; min-height:0; padding:48px 0 56px; gap:32px; }
  .swag-hero-mark { min-height:0; order:-1; }
  .swag-hero-mark img { width:min(68vw,360px); }
  .swag-module-grid { grid-template-columns:repeat(2,1fr); }
  .swag-module-card:nth-child(2) { border-right:0; }
  .swag-module-card:nth-child(-n+2) { border-bottom:1px solid var(--border-subtle); }
}
@media (max-width:620px) {
  .container { padding-left:16px; padding-right:16px; }
  .nav .links { gap:8px; }
  .user-chip { display:none; }
  .swag-hero h1 { font-size:clamp(2.3rem,13vw,3.5rem); }
  .swag-section-head, .swag-cta { align-items:flex-start; flex-direction:column; }
  .swag-module-grid, .swag-workflow { grid-template-columns:1fr; }
  .swag-module-card, .swag-module-card:nth-child(2), .swag-workflow > div { border-right:0; border-bottom:1px solid var(--border-subtle); }
  .swag-module-card:last-child, .swag-workflow > div:last-child { border-bottom:0; }
}

.mc-hero-core img,.mc-plugin-logo img{display:block;width:100%;height:100%;object-fit:contain}.mc-hero-core,.mc-plugin-logo{overflow:hidden}

/* ---------- Server browser ---------- */
.server-browser-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 22px}.server-search-wrap{position:relative;flex:1;max-width:560px}.server-search-wrap>svg{position:absolute;left:13px;top:50%;width:18px;height:18px;transform:translateY(-50%);color:var(--text-muted);pointer-events:none}.server-search-wrap input{width:100%;padding-left:42px;padding-right:42px;margin:0}.server-search-clear{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:32px;height:32px;border:0;border-radius:9px;background:transparent;color:var(--text-muted);font-size:22px;line-height:1;cursor:pointer}.server-search-clear:hover{background:var(--bg-modifier-hover);color:var(--text-normal)}.server-result-count{flex:0 0 auto;color:var(--text-muted);font-size:.84rem;font-weight:600}.server-card{display:flex;align-items:center;gap:14px;min-height:100px}.server-card-copy{min-width:0;flex:1}.server-card-copy h3{margin:0 0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.server-card-meta{display:flex;align-items:center;gap:9px;color:var(--text-muted);font-size:.76rem}.server-card-arrow{font-size:1.25rem;color:var(--text-faint);transition:transform .18s ease,color .18s ease}.server-card:hover .server-card-arrow{transform:translateX(4px);color:var(--text-normal)}.server-card[hidden]{display:none!important}@media(max-width:640px){.server-browser-toolbar{align-items:stretch;flex-direction:column}.server-search-wrap{max-width:none}.server-result-count{padding-left:2px}.server-card-meta span:last-child{display:none}}

.cmdbar-suggest.flip-up{transform-origin:bottom center}.cmdbar-suggest-item{width:100%;border:0;background:transparent;color:inherit;text-align:left}.cmdbar-suggest-item span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmdbar-suggest-item small{max-width:58%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}


/* ---------- Server cards: contained, left-aligned layout ---------- */
.server-grid{
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  align-items:stretch;
}
.server-card{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  max-width:100%;
  min-height:112px;
  overflow:hidden;
  flex-direction:row;
  align-items:center;
  text-align:left;
}
.server-card img.icon-lg,.server-card .icon-fallback{
  flex:0 0 52px;
  width:52px;
  height:52px;
}
.server-card-copy{
  min-width:0;
  width:100%;
  overflow:hidden;
  text-align:left;
}
.server-card-copy h3{
  display:block;
  width:100%;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
}
.server-card-meta{
  min-width:0;
  max-width:100%;
  flex-wrap:wrap;
  overflow:hidden;
  justify-content:flex-start;
}
.server-card-meta>span{
  max-width:100%;
}
.server-card-arrow{
  flex:0 0 auto;
  margin-left:auto;
}
@media(max-width:640px){
  .server-grid{grid-template-columns:1fr}
  .server-card{padding:17px;min-height:96px}
}

/* ---------- OWNER_ID server connection controls ---------- */
.owner-server-control-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
}
.owner-server-control-copy{min-width:0;flex:1}
.owner-server-control-copy h2{margin:0 0 6px}
.owner-server-control-copy p{margin:0}

/* ---------- Ticket workspace containment ---------- */
.ticket-page-head,
.ticket-stat-grid,
.ticket-main-tabs,
.ticket-inbox-card,
.ticket-panel-layout,
.ticket-panel-sidebar,
.ticket-panel-editor,
.ticket-editor-head,
.ticket-editor-tabs,
.ticket-editor-panels,
.ticket-toolbar,
.ticket-work-item{
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
}
.ticket-page-head>div,
.ticket-editor-head>div,
.ticket-section-head>div{
  min-width:0;
  max-width:100%;
}
.ticket-page-head h2,
.ticket-page-head p,
.ticket-editor-head h3,
.ticket-editor-head p,
.ticket-section-head h3,
.ticket-section-head p{
  overflow-wrap:anywhere;
}
.ticket-page-head .btn{flex:0 0 auto;max-width:100%}
.ticket-main-tabs,
.ticket-editor-tabs{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  width:100%;
  gap:8px;
  padding:6px;
  overflow:hidden;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius);
  background:var(--bg-secondary);
}
.ticket-main-tabs .tab-btn,
.ticket-editor-tabs .tab-btn{
  width:100%;
  min-width:0;
  max-width:100%;
  white-space:normal;
  text-align:center;
  overflow-wrap:anywhere;
}
.ticket-toolbar>*{min-width:0;max-width:100%;width:100%}
.ticket-toolbar .cdd,.ticket-toolbar select{min-width:0!important;max-width:100%!important;width:100%!important}
.ticket-work-item{overflow:hidden}
.ticket-work-title,.ticket-work-subline,.ticket-assignment,.ticket-action-row{min-width:0;max-width:100%}
.ticket-work-title strong{max-width:100%}
.ticket-work-controls{min-width:0;max-width:100%}
.ticket-action-row .btn{max-width:100%;white-space:normal;text-align:center}
.ticket-editor-head,.ticket-section-head{flex-wrap:wrap}
@media(max-width:700px){
  .ticket-main-tabs,.ticket-editor-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ticket-page-head{align-items:flex-start}
  .ticket-page-head .btn{width:100%;justify-content:center}
  .owner-server-control-card .btn{width:100%;justify-content:center}
}

/* Scrollable checkbox groups used by channel and role selectors. */
.check-scroll{max-height:190px;overflow:auto;border:1px solid var(--border);border-radius:10px;padding:8px;background:var(--surface-2)}
.check-scroll label{display:flex;align-items:center;gap:8px;padding:7px;margin:0;border-radius:7px;min-width:0}
.check-scroll label:hover{background:rgba(255,255,255,.035)}
.check-scroll input[type="checkbox"]{flex:0 0 auto}
