/* ─── RESET & ROOT ─────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg-deep:      #1a1c1f;
      --bg-base:      #23272a;
      --bg-surface:   #2c2f33;
      --bg-elevated:  #36393f;
      --bg-card:      #2e3136;
      --border:       #40444b;
      --border-glow:  rgba(255,255,255,0.07);

      --accent-red:    #ff3c3c;
      --accent-orange: #ff7b00;
      --accent-yellow: #ffd600;
      --accent-green:  #43b581;
      --accent-teal:   #00c9a7;
      --accent-blue:   #5865f2;
      --accent-purple: #9b59b6;

      --text-primary:   #ffffff;
      --text-secondary: #b9bbbe;
      --text-muted:     #72767d;

      --tier-free:    #72767d;
      --tier-premium: #ffd600;
      --tier-vip:     #ff7b00;
      --tier-friend:  #ff3c3c;

      --radius-sm:  8px;
      --radius-md:  14px;
      --radius-lg:  20px;
      --radius-xl:  28px;

      --font-display: 'Nunito', sans-serif;
      --font-mono:    'Space Mono', monospace;

      --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
      --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
      --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
      --glow-blue:  0 0 20px rgba(88,101,242,0.35);
      --glow-green: 0 0 20px rgba(67,181,129,0.35);
      --glow-red:   0 0 20px rgba(255,60,60,0.35);
    }

    html { scroll-behavior: smooth; }

    body {
      background: var(--bg-deep);
      color: var(--text-primary);
      font-family: var(--font-display);
      min-height: 100vh;
      overflow-x: hidden;
    }

    /* ─── SCROLLBAR ─────────────────────────────────────────────────── */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: var(--bg-base); }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

    /* ─── UTILITY ───────────────────────────────────────────────────── */
    .hidden   { display: none !important; }
    .sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

    /* ─── NOISE TEXTURE OVERLAY ─────────────────────────────────────── */
    body::before {
      content: '';
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
      background-size: 180px;
      opacity: 0.4;
    }

    /* ═══════════════════════════════════════════════════════════════════
       LOGIN SCREEN
    ═══════════════════════════════════════════════════════════════════ */
    /* ═══════════════════════════════════════════════════════════════════
       GLOBAL FOOTER
    ═══════════════════════════════════════════════════════════════════ */
    #global-footer {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
      background: rgba(17,18,20,0.92); backdrop-filter: blur(8px);
      border-top: 1px solid var(--border);
      padding: 8px 20px;
      font-size: 11px; color: var(--text-muted);
      font-family: var(--font-mono);
    }
    .global-footer-inner {
      display: flex; flex-direction: row; align-items: center; justify-content: space-between;
      max-width: 1100px; margin: 0 auto; width: 100%; gap: 6px;
    }
    .global-footer-row { line-height: 1.5; }
    .global-footer-links { display: flex; align-items: center; gap: 6px; line-height: 1.5; }
    @media (max-width: 600px) {
      #global-footer { padding: 5px 20px 7px; }
      .global-footer-inner { flex-direction: column; align-items: flex-start; gap: 2px; }
    }
    #global-footer a {
      color: var(--accent-blue); text-decoration: none; font-weight: 700;
    }
    #global-footer a:hover { text-decoration: underline; }

    /* ═══════════════════════════════════════════════════════════════════
       LANDING PAGE
    ═══════════════════════════════════════════════════════════════════ */
    #login-screen {
      position: fixed; inset: 0; z-index: 100;
      display: flex; flex-direction: column;
      background:
        radial-gradient(circle at 1px 1px, rgba(88,101,242,0.12) 1px, transparent 0),
        var(--bg-deep);
      background-size: 36px 36px, auto;
      overflow-y: auto; overflow-x: hidden;
    }

    /* Hide dashboard footer while landing is visible */
    body:has(#login-screen:not(.hidden)) #global-footer { display: none; }

    /* ── Atmospheric background glows ────────────────────────────────── */
    .lp-glow {
      position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
    }
    .lp-glow-1 {
      width: 900px; height: 700px; top: -150px; left: 50%;
      transform: translateX(-50%);
      background: radial-gradient(ellipse at center, rgba(88,101,242,0.14) 0%, transparent 65%);
      animation: glowFade 7s ease-in-out infinite;
    }
    .lp-glow-2 {
      width: 500px; height: 500px; bottom: 60px; right: -80px;
      background: radial-gradient(circle, rgba(255,60,60,0.09) 0%, transparent 65%);
      animation: glowFade 9s ease-in-out infinite reverse;
    }
    .lp-glow-3 {
      width: 420px; height: 420px; bottom: 250px; left: -100px;
      background: radial-gradient(circle, rgba(0,201,167,0.07) 0%, transparent 65%);
      animation: glowFade 11s ease-in-out infinite;
    }

    /* ── Landing Nav ──────────────────────────────────────────────────── */
    #landing-nav {
      position: sticky; top: 0; z-index: 50; flex-shrink: 0;
      background: rgba(26,28,31,0.88); backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(88,101,242,0.1);
    }
    .landing-nav-inner {
      display: flex; align-items: center; justify-content: space-between;
      max-width: 1100px; margin: 0 auto; padding: 16px 32px;
    }
    .landing-logo {
      font-size: 22px; font-weight: 900; letter-spacing: -0.5px; color: var(--text-primary);
    }
    .landing-logo span { color: var(--accent-red); }
    .btn-add-discord {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 9px 22px;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      color: #fff; font-family: var(--font-display); font-size: 13px; font-weight: 800;
      border-radius: var(--radius-md); text-decoration: none;
      box-shadow: 0 0 20px rgba(88,101,242,0.3);
      transition: transform 0.15s, box-shadow 0.15s;
    }
    .btn-add-discord:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(88,101,242,0.45); }
    .btn-add-discord:active { transform: scale(0.97); }

    /* ── Landing Main ─────────────────────────────────────────────────── */
    .landing-main {
      position: relative; z-index: 1;
      display: flex; flex-direction: column; align-items: center; text-align: center;
      max-width: 1100px; margin: 0 auto; padding: 72px 32px 60px; width: 100%;
    }

    /* Tagline pill */
    .lp-tagline {
      position: relative; z-index: 1;
      font-size: 11px; font-weight: 700; letter-spacing: 2.5px;
      text-transform: uppercase; color: var(--accent-blue);
      margin-bottom: 28px;
      padding: 6px 18px; background: rgba(88,101,242,0.08);
      border: 1px solid rgba(88,101,242,0.2); border-radius: 99px;
      animation: heroSlideUp 0.6s 0.05s both ease-out;
    }

    /* Avatar */
    .lp-logo-wrap {
      width: 80px; height: 80px;
      background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
      border-radius: var(--radius-lg);
      display: flex; align-items: center; justify-content: center;
      margin: 0 auto 28px; overflow: hidden;
      box-shadow: 0 6px 28px rgba(255,123,0,0.35);
      animation: heroSlideUp 0.5s both ease-out, logoFloat 3s 0.5s ease-in-out infinite;
    }

    /* Headline */
    .lp-title {
      font-size: clamp(32px, 5.5vw, 58px);
      font-weight: 900; letter-spacing: -1.5px; line-height: 1.1;
      margin-bottom: 20px; max-width: 780px;
      animation: heroSlideUp 0.6s 0.15s both ease-out;
    }
    .lp-title-accent {
      background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-teal) 50%, var(--accent-blue) 100%);
      background-size: 200%;
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      background-clip: text;
      animation: gradientFlow 5s ease-in-out infinite;
    }

    /* Subtitle */
    .lp-subtitle {
      color: var(--text-secondary); font-size: 16px;
      line-height: 1.7; margin-bottom: 20px;
      max-width: 520px; margin-left: auto; margin-right: auto;
      animation: heroSlideUp 0.6s 0.25s both ease-out;
    }

    /* Stats bar */
    .lp-stats-bar {
      display: inline-flex; align-items: center;
      margin: 0 auto 24px;
      padding: 9px 22px;
      background: rgba(255,255,255,0.025);
      border: 1px solid rgba(255,255,255,0.07);
      border-radius: 99px;
      animation: heroSlideUp 0.6s 0.35s both ease-out;
    }
    .lp-stat {
      display: flex; flex-direction: column; align-items: center; padding: 0 18px;
    }
    .lp-stat-num {
      font-size: 17px; font-weight: 900; color: var(--text-primary);
      line-height: 1.1; letter-spacing: -0.5px;
    }
    .lp-stat-lbl {
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 1px; color: var(--text-muted);
    }
    .lp-stat-sep {
      width: 1px; height: 28px; background: rgba(255,255,255,0.08); flex-shrink: 0;
    }

    /* CTA wrapper */
    .lp-cta-wrap {
      width: 100%; max-width: 400px; margin: 0 auto;
      animation: heroSlideUp 0.6s 0.45s both ease-out;
    }

    .btn-discord {
      display: flex; align-items: center; justify-content: center; gap: 12px;
      width: 100%; padding: 16px 24px;
      background: #5865f2; color: #fff;
      font-family: var(--font-display); font-size: 16px; font-weight: 800;
      border: none; border-radius: var(--radius-md);
      cursor: pointer; text-decoration: none;
      box-shadow: 0 4px 20px rgba(88,101,242,0.45), 0 0 0 3px rgba(88,101,242,0.15);
      transition: transform 0.15s, box-shadow 0.15s;
      letter-spacing: 0.3px; margin-bottom: 16px;
    }
    .btn-discord:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(88,101,242,0.55), 0 0 0 3px rgba(88,101,242,0.2); }
    .btn-discord:active { transform: scale(0.96); }
    .btn-discord svg { width: 22px; height: 22px; flex-shrink: 0; }

    .login-error-msg {
      display: none; margin: -8px 0 12px;
      padding: 10px 14px; border-radius: var(--radius-sm);
      background: rgba(237,66,69,0.15); border: 1px solid rgba(237,66,69,0.4);
      color: var(--text-error, #ed4245); font-size: 13px; text-align: center;
    }

    .lp-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

    /* ── Session-exists card (already logged in) ─────────────────────── */
    #session-exists-card {
      background: var(--bg-card); border: 1.5px solid var(--border);
      border-radius: var(--radius-md); padding: 20px 20px 16px;
      margin-bottom: 12px; text-align: center;
    }
    .sec-label {
      font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
      color: var(--text-muted); margin-bottom: 12px;
    }
    .sec-identity {
      display: flex; align-items: center; gap: 12px;
      background: var(--bg-surface); border: 1px solid var(--border);
      border-radius: var(--radius-sm); padding: 10px 14px;
      margin-bottom: 16px;
    }
    .sec-avatar {
      width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
      background: var(--bg-elevated) center/cover no-repeat;
      display: flex; align-items: center; justify-content: center;
      font-size: 18px; font-weight: 800; color: #fff;
    }
    .sec-name {
      font-size: 15px; font-weight: 800; color: var(--text-primary);
      text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .sec-continue-btn { margin-bottom: 10px !important; }
    .sec-switch-link {
      display: block; font-size: 12px; color: var(--text-muted);
      text-decoration: none; transition: color 0.12s;
    }
    .sec-switch-link:hover { color: var(--text-primary); }

    /* ── Feature Cards ────────────────────────────────────────────────── */
    .lp-features {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 12px; width: 100%; margin-top: 64px; align-items: stretch;
    }
    @media (max-width: 720px) {
      .lp-features { grid-template-columns: 1fr; gap: 10px; }
      .landing-nav-inner { padding: 14px 20px; }
      .landing-main { padding: 48px 20px 40px; }
      .lp-title { letter-spacing: -1px; }
    }
    .lp-feature-card {
      --lp-fc-color: #5865f2;
      background: var(--bg-card);
      border: 1.5px solid rgba(255,255,255,0.06);
      border-radius: var(--radius-md); padding: 18px 16px; text-align: left;
      transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
      position: relative; overflow: hidden;
      animation: heroSlideUp 0.6s both ease-out;
    }
    /* Top accent stripe */
    .lp-feature-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: var(--lp-fc-color); opacity: 0.5; transition: opacity 0.2s;
    }
    .lp-feature-card:hover::before { opacity: 1; }
    /* Shimmer sweep on hover */
    .lp-feature-card::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.04) 50%, transparent 65%);
      transform: translateX(-120%); transition: transform 0.55s ease;
    }
    .lp-feature-card:hover::after { transform: translateX(120%); }
    .lp-feature-card:hover {
      border-color: var(--lp-fc-color);
      transform: translateY(-3px);
      box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 18px -6px var(--lp-fc-color);
    }
    /* Card stagger animation */
    .lp-feature-card:nth-child(1) { animation-delay: 0.45s; }
    .lp-feature-card:nth-child(2) { animation-delay: 0.55s; }
    .lp-feature-card:nth-child(3) { animation-delay: 0.65s; }
    .lp-feature-card:nth-child(4) { animation-delay: 0.75s; }
    .lp-feature-card:nth-child(5) { animation-delay: 0.85s; }
    .lp-feature-card:nth-child(6) { animation-delay: 0.95s; }
    /* Per-card accent color variables */
    .lp-fc-red    { --lp-fc-color: var(--accent-red); }
    .lp-fc-blue   { --lp-fc-color: var(--accent-blue); }
    .lp-fc-green  { --lp-fc-color: var(--accent-green); }
    .lp-fc-orange { --lp-fc-color: var(--accent-orange); }
    .lp-fc-purple { --lp-fc-color: var(--accent-purple); }
    .lp-fc-teal   { --lp-fc-color: var(--accent-teal); }
    /* Icon circle — per-card tinted background */
    .lp-feature-icon {
      width: 36px; height: 36px; border-radius: 9px;
      background: rgba(88,101,242,0.1);
      display: flex; align-items: center; justify-content: center;
      font-size: 17px; margin-bottom: 12px;
      transition: transform 0.2s;
    }
    .lp-feature-card:hover .lp-feature-icon { transform: scale(1.12) rotate(-4deg); }
    .lp-fc-red    .lp-feature-icon { background: rgba(255,60,60,0.12); }
    .lp-fc-blue   .lp-feature-icon { background: rgba(88,101,242,0.12); }
    .lp-fc-green  .lp-feature-icon { background: rgba(67,181,129,0.12); }
    .lp-fc-orange .lp-feature-icon { background: rgba(255,123,0,0.12); }
    .lp-fc-purple .lp-feature-icon { background: rgba(155,89,182,0.12); }
    .lp-fc-teal   .lp-feature-icon { background: rgba(0,201,167,0.12); }
    .lp-feature-title { font-size: 14px; font-weight: 900; color: var(--text-primary); margin-bottom: 6px; }
    .lp-feature-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

    /* ── Security Trust Section ──────────────────────────────────────── */
    .lp-security-section {
      width: 100%; margin-top: 72px;
      background: linear-gradient(135deg, rgba(32,34,37,0.9) 0%, rgba(22,24,27,0.95) 100%);
      border: 1.5px solid rgba(87,242,135,0.18);
      border-radius: var(--radius-lg);
      padding: 48px 40px;
      text-align: center;
      position: relative; overflow: hidden;
      box-shadow: 0 0 60px rgba(87,242,135,0.04), inset 0 1px 0 rgba(87,242,135,0.08);
    }
    .lp-security-section::before {
      content: '';
      position: absolute; inset: 0;
      background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(87,242,135,0.06) 0%, transparent 65%);
      pointer-events: none;
    }
    .lp-security-badge {
      display: inline-flex; align-items: center; gap: 7px;
      font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
      color: #57f287;
      padding: 5px 16px; margin-bottom: 20px;
      background: rgba(87,242,135,0.08);
      border: 1px solid rgba(87,242,135,0.22);
      border-radius: 99px;
    }
    .lp-security-badge svg { width: 13px; height: 13px; flex-shrink: 0; }
    .lp-security-title {
      font-size: clamp(20px, 3vw, 28px); font-weight: 900;
      letter-spacing: -0.5px; line-height: 1.2;
      color: var(--text-primary); margin-bottom: 12px;
    }
    .lp-security-sub {
      font-size: 14px; color: var(--text-secondary); line-height: 1.7;
      max-width: 560px; margin: 0 auto 40px;
    }
    .lp-security-grid {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 20px; text-align: left;
    }
    @media (max-width: 720px) {
      .lp-security-grid { grid-template-columns: 1fr; }
      .lp-security-section { padding: 36px 24px; }
    }
    .lp-sec-item {
      background: rgba(255,255,255,0.025);
      border: 1px solid rgba(87,242,135,0.1);
      border-radius: var(--radius-md);
      padding: 24px 20px;
      transition: border-color 0.15s, background 0.15s;
    }
    .lp-sec-item:hover {
      border-color: rgba(87,242,135,0.28);
      background: rgba(87,242,135,0.04);
    }
    .lp-sec-icon {
      width: 40px; height: 40px; border-radius: 10px;
      background: rgba(87,242,135,0.1);
      border: 1px solid rgba(87,242,135,0.2);
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 14px; color: #57f287;
    }
    .lp-sec-icon svg { width: 18px; height: 18px; }
    .lp-sec-label {
      font-size: 14px; font-weight: 800; color: var(--text-primary);
      margin-bottom: 8px; line-height: 1.3;
    }
    .lp-sec-desc {
      font-size: 12.5px; color: var(--text-muted); line-height: 1.7; margin: 0;
    }

    /* ── Landing Footer ───────────────────────────────────────────────── */
    .landing-footer {
      position: relative; z-index: 1;
      border-top: 1px solid rgba(88,101,242,0.1);
      padding: 24px 32px; margin-top: auto; flex-shrink: 0;
    }
    .landing-footer-inner {
      display: flex; flex-direction: row; flex-wrap: wrap;
      align-items: center; justify-content: space-between;
      max-width: 1100px; margin: 0 auto; gap: 12px;
    }
    @media (max-width: 600px) {
      .landing-footer { padding: 20px; }
      .landing-footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    }
    .landing-footer-text {
      font-size: 12px; color: var(--text-muted); font-family: var(--font-mono);
    }
    .landing-footer-text a { color: var(--accent-blue); text-decoration: none; font-weight: 700; }
    .landing-footer-text a:hover { text-decoration: underline; }
    .landing-footer-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
    .landing-footer-links a {
      font-size: 12px; font-weight: 700; color: var(--accent-blue);
      text-decoration: none; transition: color 0.15s;
    }
    .landing-footer-links a:hover { text-decoration: underline; }

    /* ═══════════════════════════════════════════════════════════════════
       DASHBOARD LAYOUT
    ═══════════════════════════════════════════════════════════════════ */
    #dashboard {
      display: flex; min-height: 100vh;
      position: relative; z-index: 1;
      animation: fadeIn 0.45s ease;
    }

    /* ─── SIDEBAR ACCOUNT BLOCK ─────────────────────────────────────── */
    .sidebar-account {
      padding: 14px 14px 4px; border-bottom: none;
      display: flex; flex-direction: column;
      box-sizing: border-box; width: 100%;
    }

    /* Collapse toggle pinned top-right — now inside header row */
    .acct-header-row .sidebar-toggle { margin-left: auto; flex-shrink: 0; }

    /* Profile card */
    .acct-profile-card {
      background: linear-gradient(135deg, rgba(88,101,242,0.1), rgba(155,89,182,0.07));
      border: 1.5px solid rgba(88,101,242,0.22);
      border-radius: var(--radius-md);
      padding: 14px; margin-bottom: 10px;
      position: relative; overflow: hidden;
      box-shadow: 0 4px 16px -4px rgba(88,101,242,0.2);
    }
    .acct-profile-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 0px;
      background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-red));
      border-radius: 1px 1px 0 0;
    }

    /* Avatar LEFT + name MIDDLE (toggle far right) */
    .acct-header-row {
      display: flex; align-items: center; gap: 10px;
      width: 100%;
    }
    .account-avatar {
      width: 40px; height: 40px; flex-shrink: 0;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; font-weight: 800; color: #fff;
      border: 2px solid rgba(88,101,242,0.45);
      letter-spacing: -0.5px;
      box-shadow: 0 0 0 4px rgba(88,101,242,0.1), 0 4px 14px rgba(88,101,242,0.3);
    }
    .acct-header-info { min-width: 0; flex: 1; }
    .acct-uname {
      font-size: 13px; font-weight: 800; color: var(--text-primary);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      line-height: 1.2;
    }
    .acct-uid {
      font-size: 10px; color: var(--text-muted);
      font-family: var(--font-mono); margin-top: 2px;
    }
    .acct-tier-inline {
      display: inline-flex; margin-top: 4px;
    }

    /* Server selector (compact) */
    .acct-server-btn {
      display: flex; align-items: center; gap: 8px;
      width: 100%; padding: 8px 10px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: var(--radius-sm);
      cursor: pointer; color: var(--text-primary);
      font-family: var(--font-display); font-size: 12px; font-weight: 700;
      transition: all 0.15s; text-align: left;
      margin-bottom: 6px;
    }
    .acct-server-btn:hover { border-color: rgba(88,101,242,0.6); background: var(--bg-elevated); box-shadow: 0 0 12px -4px rgba(88,101,242,0.3); }
    .acct-server-btn:active { transform: scale(0.98); }
    .acct-server-icon {
      width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      display: flex; align-items: center; justify-content: center;
      font-size: 9px; font-weight: 800; color: #fff;
    }
    .acct-server-name {
      flex: 1; min-width: 0;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .acct-chevron { font-size: 10px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; }

    /* Upgrade CTA */
    .acct-upgrade-btn {
      display: flex; align-items: center; gap: 8px;
      width: 100%; padding: 9px 10px;
      background: linear-gradient(135deg, rgba(255,214,0,0.08), rgba(255,123,0,0.05));
      border: 1.5px solid rgba(255,214,0,0.25);
      border-radius: var(--radius-sm);
      cursor: pointer; font-family: var(--font-display);
      font-size: 12px; font-weight: 700; color: var(--tier-premium);
      transition: all 0.15s; text-align: left;
    }
    .acct-upgrade-btn:hover { background: rgba(255,214,0,0.12); border-color: rgba(255,214,0,0.4); }
    .acct-upgrade-btn:active { transform: scale(0.98); }
    .acct-upgrade-btn .acct-upgrade-label { flex: 1; }
    .acct-upgrade-btn .acct-upgrade-trial {
      font-size: 9px; font-weight: 800; letter-spacing: 0.3px;
      background: var(--accent-green); color: #fff;
      padding: 2px 6px; border-radius: 99px;
    }

    /* Collapsed sidebar */
    #sidebar.collapsed .sidebar-account     { padding: 8px 6px; }
    #sidebar.collapsed .acct-profile-card   { padding: 8px; margin-bottom: 6px; background: transparent; border-color: transparent; }
    #sidebar.collapsed .acct-profile-card::before { display: none; }
    #sidebar.collapsed .acct-server-btn,
    #sidebar.collapsed .acct-upgrade-btn    { display: none; }
    #sidebar.collapsed .acct-header-row     { flex-direction: column; align-items: center; gap: 6px; }
    #sidebar.collapsed .acct-header-info    { display: none; }
    #sidebar.collapsed .acct-tier-inline    { display: none; }
    #sidebar.collapsed .acct-header-row .sidebar-toggle { margin-left: 0; }
    #sidebar.collapsed .account-avatar      { width: 34px; height: 34px; font-size: 13px; }

    /* ─── SERVER SELECT SCREEN ──────────────────────────────────────── */
    /* Now a flex sibling of #sidebar inside #dashboard */
    #server-select-screen {
      flex: 1; min-width: 0; min-height: 0; overflow-y: auto;
      background:
        radial-gradient(circle at 1px 1px, rgba(88,101,242,0.12) 1px, transparent 0),
        var(--bg-deep);
      background-size: 36px 36px, auto;
      display: flex; flex-direction: column;
      padding-bottom: 36px;
    }
    #server-select-screen.hidden { display: none; }
    #main-content.hidden         { display: none; }

    /* ─── SIDEBAR SERVER-SELECT MODE ────────────────────────────────── */
    /* When user is on server-select: show only account info + sign out  */
    #sidebar.ss-mode .sidebar-nav,
    #sidebar.ss-mode .upgrade-banner,
    #sidebar.ss-mode .acct-server-btn,
    #sidebar.ss-mode .acct-upgrade-btn,
    #sidebar.ss-mode .acct-tier-inline { display: none !important; }

    /* No-guild mode: hide all guild-specific nav items, show only user-level sections (Roblox etc.) */
    #sidebar.no-guild [data-guild-only] { display: none !important; }
    #sidebar.no-guild .upgrade-banner  { display: none !important; }

    .ss-header {
      display: flex; align-items: center; gap: 16px;
      padding: 20px 32px; border-bottom: 1px solid rgba(88,101,242,0.2);
      background: rgba(26,28,31,0.88); backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      flex-shrink: 0; position: sticky; top: 0; z-index: 10;
    }
    .ss-logo { flex-shrink: 0; }
    .ss-title { font-size: 22px; font-weight: 900; margin: 0; letter-spacing: -0.5px; }
    .ss-sub   { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }
    .ss-signout {
      margin-left: auto; font-size: 12px; font-weight: 700;
      color: var(--text-muted); background: none; border: 2px solid var(--border);
      border-radius: var(--radius-sm); padding: 7px 14px; cursor: pointer;
      font-family: var(--font-display); transition: all 0.12s;
    }
    .ss-signout:hover { color: var(--text-primary); border-color: var(--text-muted); }

    .ss-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 14px; padding: 32px 32px 16px;
      align-content: start;
    }

    /* Roblox auth banner on server-select screen */
    .ss-roblox-banner {
      display: flex; align-items: center; justify-content: space-between;
      gap: 14px; margin: 22px 0 24px; padding: 18px 20px;
      background: var(--bg-card); border: 1.5px solid var(--border);
      border-radius: var(--radius-md); flex-wrap: wrap;
      width: 100%;
    }
    .ss-roblox-left { display: flex; align-items: center; gap: 12px; }
    .ss-roblox-icon { font-size: 28px; line-height: 1; }
    .ss-roblox-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
    .ss-roblox-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
    .ss-roblox-btn {
      font-size: 12px; font-weight: 700; padding: 7px 16px;
      border-radius: 6px; border: 1.5px solid var(--accent-blue);
      background: transparent; color: var(--accent-blue); cursor: pointer;
      white-space: nowrap; transition: all 0.12s;
    }
    .ss-roblox-btn:hover { background: var(--accent-blue); color: #fff; }
    .ss-roblox-btn.linked { border-color: var(--accent-green); color: var(--accent-green); }
    .ss-roblox-btn.linked:hover { background: var(--accent-green); color: #fff; }

    /* Stacked Roblox account avatar circles inside the Roblox grid card */
    .ss-roblox-avatars { display: flex; align-items: center; margin: 1px 0; }
    .ss-roblox-avatar {
        width: 26px; height: 26px; border-radius: 50%;
        border: 2px solid var(--bg-card);
        object-fit: cover; flex-shrink: 0;
    }
    .ss-roblox-avatars .ss-roblox-avatar + .ss-roblox-avatar { margin-left: -7px; }
    .ss-roblox-avatar-fb {
        background: var(--bg-elevated); color: var(--text-muted);
        font-size: 10px; font-weight: 800;
        display: flex; align-items: center; justify-content: center;
    }
    .ss-roblox-card:hover { border-color: rgba(195,7,63,0.7); box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 20px -8px rgba(195,7,63,0.4); }

    .ss-card {
      background: var(--bg-card); border: 1.5px solid rgba(255,255,255,0.08);
      border-radius: var(--radius-lg);
      display: flex; flex-direction: row; align-items: stretch; gap: 0;
      overflow: hidden;
      transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
      min-height: 90px;
    }
    .ss-card:hover {
      border-color: rgba(88,101,242,0.6);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 20px -8px rgba(88,101,242,0.4);
    }

    /* Left: coloured icon strip — full card height */
    .ss-card-icon {
      width: 72px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; font-weight: 900; color: #fff;
    }

    /* Right: info + button */
    .ss-card-body {
      flex: 1; min-width: 0;
      display: flex; flex-direction: column; justify-content: space-between;
      padding: 14px 14px;
      gap: 8px;
    }
    .ss-card-info { display: flex; flex-direction: column; gap: 3px; }
    .ss-card-name { font-size: 14px; font-weight: 800; color: var(--text-primary);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ss-card-meta { font-size: 11px; color: var(--text-muted); }
    /* Group divider between bot-installed and setup-needed servers */
    .ss-divider {
      grid-column: 1 / -1;
      display: flex; align-items: center; gap: 12px;
      padding: 8px 0; margin: 4px 0;
      color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
      text-transform: uppercase;
    }
    .ss-divider::before,
    .ss-divider::after {
      content: ''; flex: 1;
      height: 1px; background: var(--border);
    }

    .ss-card-tier      { margin-top: 1px; display: flex; flex-direction: column; gap: 4px; }
    .ss-card-meta-row  { display: flex; align-items: center; gap: 5px; }
    .ss-meta-label     { font-size: 10px; font-weight: 700; color: var(--text-muted); min-width: 30px; }

    /* User rank badges on server cards */
    .ss-rank-badge {
      font-size: 10px; font-weight: 700;
      padding: 2px 7px; border-radius: 99px;
      display: inline-flex; align-items: center; gap: 3px;
      letter-spacing: 0.2px; white-space: nowrap;
    }
    .ss-rank-owner    { background: rgba(245,200,0,0.15);   color: #f5c800; border: 1px solid rgba(245,200,0,0.35); }
    .ss-rank-admin    { background: rgba(237,66,69,0.12);   color: var(--accent-red,#ed4245); border: 1px solid rgba(237,66,69,0.3); }
    .ss-rank-moderator{ background: rgba(0,201,167,0.12);   color: var(--accent-teal,#00c9a7); border: 1px solid rgba(0,201,167,0.3); }
    .ss-rank-member   { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

    .ss-btn {
      width: 100%; padding: 8px; border-radius: var(--radius-sm);
      font-size: 12px; font-weight: 800; cursor: pointer; border: none;
      font-family: var(--font-display); transition: all 0.12s;
      background: var(--accent-blue); color: #fff;
    }
    .ss-btn:hover { opacity: 0.9; transform: translateY(-1px); }
    .ss-btn.setup {
      background: transparent; color: var(--accent-orange);
      border: 2px solid var(--accent-orange);
    }
    .ss-btn.setup:hover { background: rgba(255,123,0,0.1); }

    /* ─── SIDEBAR HEADER (collapse btn) ─────────────────────────────── */
    .sidebar-header {
      padding: 10px 14px;
      border-bottom: 2px solid var(--border);
      display: flex; align-items: center; justify-content: flex-end;
      flex-shrink: 0;
    }
    #sidebar.collapsed .sidebar-header { justify-content: center; padding: 10px 6px; }

    /* ─── SETTINGS INFO BOX ─────────────────────────────────────────── */
    .settings-info {
      background: rgba(88,101,242,0.07);
      border: 1.5px solid rgba(88,101,242,0.2);
      border-left: 3px solid var(--accent-blue);
      border-radius: var(--radius-sm);
      padding: 10px 14px;
      margin-bottom: 20px;
      font-size: 12px; line-height: 1.55; color: var(--text-secondary);
    }
    .settings-info strong { color: var(--text-primary); font-weight: 700; }
    .settings-info code {
      background: var(--bg-elevated); padding: 1px 5px;
      border-radius: 4px; font-size: 11px; color: var(--accent-teal);
      border: 1px solid var(--border);
    }
    .settings-info .info-vars { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }

    /* ─── PRESENCE ENABLE TOGGLE (top of card) ─────────────────────── */
    .presence-enable-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 10px 14px; margin: -24px -28px 18px;
      background: var(--bg-surface);
      border-bottom: 2px solid var(--border);
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .presence-enable-row .pe-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
    .presence-enable-row .pe-sub   { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
    @media (max-width: 768px) {
      .presence-enable-row { margin: -18px -16px 16px; border-radius: 0; }
      .sidebar-account     { padding: 12px; }
      .account-avatar      { width: 44px; height: 44px; font-size: 16px; }
    }
    /* ─── SIDEBAR ───────────────────────────────────────────────────── */
    #sidebar {
      width: 260px; min-width: 260px;
      background:
        radial-gradient(circle at 1px 1px, rgba(88,101,242,0.08) 1px, transparent 0),
        radial-gradient(ellipse at 50% 0%, rgba(88,101,242,0.11) 0%, transparent 55%),
        linear-gradient(180deg, #14161a 0%, #1b1e22 100%);
      background-size: 36px 36px, auto, auto;
      border-right: 1px solid rgba(88,101,242,0.18);
      display: flex; flex-direction: column;
      position: sticky; top: 0; height: 100vh;
      overflow-y: auto; overflow-x: hidden;
      overscroll-behavior: contain;
      z-index: 10;
      box-shadow: 4px 0 32px rgba(0,0,0,0.35);
      transition: width 0.25s cubic-bezier(0.4,0,0.2,1),
                  min-width 0.25s cubic-bezier(0.4,0,0.2,1);
    }

    /* ── COLLAPSED STATE ─────────────────────────────────────────── */
    #sidebar.collapsed { width: 68px; min-width: 68px; }

    /* Hide text-only elements when collapsed */
    #sidebar.collapsed .tier-badge,
    #sidebar.collapsed .nav-label,
    #sidebar.collapsed .nav-item span:not(.nav-icon),
    #sidebar.collapsed .nav-badge,
    #sidebar.collapsed .upgrade-banner,
    #sidebar.collapsed .btn-logout-text {
      opacity: 0;
      width: 0; height: 0;
      overflow: hidden;
      pointer-events: none;
    }

    /* Center items when collapsed */
    #sidebar.collapsed .sidebar-nav     { padding: 12px 8px; }
    #sidebar.collapsed .nav-item        { justify-content: center; padding: 12px 0; gap: 0; }
    #sidebar.collapsed .nav-icon        { width: 24px; height: 24px; font-size: 20px; }
    #sidebar.collapsed .sidebar-footer  { padding: 8px; }
    #sidebar.collapsed .btn-logout      { padding: 10px 0; justify-content: center; }

    /* Tooltip on collapsed nav items */
    #sidebar.collapsed .nav-item { position: relative; }
    #sidebar.collapsed .nav-item::after {
      content: attr(data-label);
      position: absolute; left: calc(100% + 12px); top: 50%;
      transform: translateY(-50%);
      background: #1e2126; color: var(--text-primary);
      font-size: 12px; font-weight: 700;
      padding: 6px 12px; border-radius: var(--radius-sm);
      border: 1px solid rgba(88,101,242,0.25);
      white-space: nowrap; pointer-events: none;
      opacity: 0; transition: opacity 0.15s;
      box-shadow: 0 4px 20px rgba(0,0,0,0.5); z-index: 100;
    }
    #sidebar.collapsed .nav-item:hover::after { opacity: 1; }

    /* Sidebar toggle button */
    .sidebar-toggle {
      margin-left: auto; flex-shrink: 0;
      width: 28px; height: 28px;
      background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
      border-radius: var(--radius-sm);
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; color: var(--text-muted);
      font-size: 14px; line-height: 1;
      transition: all 0.15s, transform 0.25s cubic-bezier(0.4,0,0.2,1);
      user-select: none; flex-shrink: 0;
    }
    .sidebar-toggle:hover { background: rgba(88,101,242,0.15); color: var(--text-primary); border-color: rgba(88,101,242,0.4); }
    .sidebar-toggle:active { transform: scale(0.9); }
    #sidebar.collapsed .sidebar-toggle { margin-left: 0; transform: rotate(180deg); }
    #sidebar.collapsed .sidebar-toggle:active { transform: rotate(180deg) scale(0.9); }

    .sidebar-header {
      padding: 18px 16px 18px 20px;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      display: flex; align-items: center; gap: 12px;
      flex-shrink: 0;
      background: rgba(0,0,0,0.18);
    }

    .sidebar-logo {
      width: 42px; height: 42px; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
      border-radius: 12px;
      display: flex; align-items: center; justify-content: center;
      font-size: 20px;
      box-shadow: 0 4px 16px rgba(255,60,60,0.45), 0 0 0 2px rgba(255,123,0,0.2);
    }
    .sidebar-logo-text {
      flex: 1; min-width: 0;
      overflow: hidden;
      transition: opacity 0.2s, width 0.25s;
      white-space: nowrap;
    }
    .sidebar-logo-text h2 {
      font-size: 15px; font-weight: 900; letter-spacing: -0.3px;
    }
    .sidebar-logo-text h2 span { color: var(--accent-red); }
    .sidebar-logo-text p {
      font-size: 11px; color: var(--text-muted);
      font-family: var(--font-mono); margin-top: 1px;
    }

    /* User profile strip */
    .sidebar-user {
      padding: 14px 20px;
      border-bottom: 2px solid var(--border);
      display: flex; align-items: center; gap: 10px;
      transition: padding 0.25s;
    }
    .user-avatar {
      width: 36px; height: 36px; border-radius: 50%;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; font-weight: 800; flex-shrink: 0;
      border: 2px solid var(--border);
    }
    .user-info { min-width: 0; }
    .user-info .name {
      font-size: 13px; font-weight: 800;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .user-info .tag {
      font-size: 10px; color: var(--text-muted);
      font-family: var(--font-mono);
    }

    /* Tier badge */
    .tier-badge {
      margin-left: auto; flex-shrink: 0;
      padding: 3px 8px; border-radius: 99px;
      font-size: 10px; font-weight: 800;
      letter-spacing: 0.5px; text-transform: uppercase;
      border: 2px solid;
    }
    .tier-FREE    { color: var(--tier-free);    border-color: var(--tier-free);    background: rgba(114,118,125,0.12); }
    .tier-PREMIUM { color: var(--tier-premium); border-color: var(--tier-premium); background: rgba(255,214,0,0.12); }
    .tier-VIP     { color: var(--tier-vip);     border-color: var(--tier-vip);     background: rgba(255,123,0,0.12); }
    .tier-FRIEND  { color: var(--tier-friend);  border-color: var(--tier-friend);  background: rgba(255,60,60,0.12); }

    /* ─── CARD-TIER PILL (injected by TierGuard) ────────────────────── */
    /* Single source of truth for every tier-gated feature pill.
       TierGuard._syncCardTierPill() reads settings_tier.json → element_id
       and appends this span next to the feature's anchor (toggle-label,
       tier-section-title, or card-title). Never hardcode this in HTML. */
    .card-tier-pill {
      display: inline-flex; align-items: center; gap: 3px;
      margin-left: auto; flex-shrink: 0;
      padding: 1px 6px; border-radius: 99px;
      font-size: 7.7px; font-weight: 800;
      letter-spacing: 0.45px; text-transform: uppercase;
      border: 1.5px solid currentColor;
      background: var(--bg-elevated);
      vertical-align: middle;
      opacity: 0.92;
      white-space: nowrap;
      line-height: 1.2;
    }
    .card-tier-pill.tier-premium { color: var(--tier-premium); background: rgba(255,214,0,0.12); }
    .card-tier-pill.tier-vip     { color: var(--tier-vip);     background: rgba(255,123,0,0.12); }
    .card-tier-pill.tier-friend  { color: var(--tier-friend);  background: rgba(255,60,60,0.12); }
    .card-tier-pill .ctp-icon    { font-size: 7.7px; line-height: 1; }

    /* When the pill is injected into a .toggle-label (inline context) it
       should sit next to the text, not push to the right. */
    .toggle-label > .card-tier-pill,
    .tier-section-title > .card-tier-pill,
    .card-title       > .card-tier-pill {
      margin-left: 6px;
    }

    /* ─── TIER LOCK BANNER ──────────────────────────────────────────── */
    /* Inline gate notice shown inside quota-based cards (e.g. embed
       builder presets, competition presets) when the server tier cannot
       use the feature. The upgrade button opens TierPopup. */
    .tier-lock-banner {
      display: none; align-items: flex-start; gap: 10px;
      padding: 10px 14px; margin: 8px 0 4px;
      border-radius: var(--radius-sm);
      border: 1.5px dashed;
    }
    .tier-lock-banner[data-tier="PREMIUM"] {
      background: rgba(255,214,0,0.06);
      border-color: rgba(255,214,0,0.3);
    }
    .tier-lock-banner[data-tier="VIP"] {
      background: rgba(255,123,0,0.06);
      border-color: rgba(255,123,0,0.3);
    }
    .tier-lock-banner[data-tier="FRIEND"] {
      background: rgba(255,60,60,0.06);
      border-color: rgba(255,60,60,0.3);
    }
    .tier-lock-icon { font-size: 15px; flex-shrink: 0; line-height: 1.5; }
    .tier-lock-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
    .tier-lock-msg  { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
    .tier-lock-banner[data-tier="PREMIUM"] .tier-lock-msg strong { color: var(--tier-premium); }
    .tier-lock-banner[data-tier="VIP"]     .tier-lock-msg strong { color: var(--tier-vip); }
    .tier-lock-banner[data-tier="FRIEND"]  .tier-lock-msg strong { color: var(--tier-friend); }
    .tier-lock-cta {
      flex-shrink: 0;
      padding: 3px 10px; font-size: 11px; font-weight: 800;
      font-family: var(--font-display); border-radius: 99px; cursor: pointer;
      border: 1.5px solid; background: transparent;
      transition: background 0.15s;
    }
    .tier-lock-banner[data-tier="PREMIUM"] .tier-lock-cta { color: var(--tier-premium); border-color: rgba(255,214,0,0.4); }
    .tier-lock-banner[data-tier="PREMIUM"] .tier-lock-cta:hover { background: rgba(255,214,0,0.12); }
    .tier-lock-banner[data-tier="VIP"]     .tier-lock-cta { color: var(--tier-vip); border-color: rgba(255,123,0,0.4); }
    .tier-lock-banner[data-tier="VIP"]     .tier-lock-cta:hover { background: rgba(255,123,0,0.12); }
    .tier-lock-banner[data-tier="FRIEND"]  .tier-lock-cta { color: var(--tier-friend); border-color: rgba(255,60,60,0.4); }
    .tier-lock-banner[data-tier="FRIEND"]  .tier-lock-cta:hover { background: rgba(255,60,60,0.12); }

    /* ─── TIER POPUP (upgrade modal) ─────────────────────────────────── */
    /* Injected once by TierPopup.show() — replaces the old inline lock
       banner. Content lives in js/tier_popup.js (placeholder) and will
       later be fetched from a shared upgrade page. */
    .tp-modal {
      position: fixed; inset: 0; z-index: 10000;
      display: none; align-items: center; justify-content: center;
      padding: 20px;
    }
    .tp-modal.tp-open { display: flex; }
    .tp-backdrop {
      position: absolute; inset: 0;
      background: rgba(0,0,0,0.65);
      backdrop-filter: blur(3px);
      animation: tpFadeIn 0.15s ease-out;
    }
    .tp-dialog {
      position: relative;
      max-width: 480px; width: 100%;
      max-height: calc(100vh - 40px);
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: 0 20px 60px rgba(0,0,0,0.5);
      padding: 28px 28px 22px;
      overflow-y: auto;
      animation: tpSlideIn 0.2s ease-out;
    }
    .tp-close {
      position: absolute; top: 10px; right: 12px;
      background: transparent; border: none;
      color: var(--text-muted);
      font-size: 26px; line-height: 1; cursor: pointer;
      padding: 4px 10px; border-radius: var(--radius-sm);
      transition: background 0.15s, color 0.15s;
    }
    .tp-close:hover { background: var(--bg-surface); color: var(--text-primary); }
    .tp-header {
      display: flex; align-items: center; gap: 12px;
      margin-bottom: 8px;
    }
    .tp-icon {
      font-size: 32px; line-height: 1; flex-shrink: 0;
    }
    .tp-title {
      margin: 0; font-size: 20px; font-weight: 800;
      font-family: var(--font-display);
      color: var(--text-primary);
    }
    .tp-lede {
      margin: 8px 0 16px; font-size: 13px;
      color: var(--text-secondary); line-height: 1.55;
    }
    .tp-perks {
      list-style: none; padding: 0; margin: 0 0 20px;
      display: flex; flex-direction: column; gap: 8px;
    }
    .tp-perks li {
      display: flex; align-items: flex-start; gap: 10px;
      font-size: 13px; color: var(--text-primary); line-height: 1.45;
    }
    .tp-check {
      display: inline-flex; align-items: center; justify-content: center;
      width: 18px; height: 18px; flex-shrink: 0;
      border-radius: 50%;
      background: rgba(87,242,135,0.15);
      color: var(--accent-green);
      font-size: 11px; font-weight: 900;
      margin-top: 1px;
    }
    .tp-actions {
      display: flex; gap: 10px; flex-wrap: wrap;
      margin-top: 4px;
    }
    .tp-btn {
      flex: 1; min-width: 120px;
      padding: 10px 16px; font-size: 13px; font-weight: 700;
      font-family: var(--font-display);
      border-radius: var(--radius-sm); cursor: pointer;
      border: 1.5px solid transparent;
      transition: background 0.15s, transform 0.1s;
    }
    .tp-btn:active { transform: translateY(1px); }
    .tp-btn-primary {
      background: var(--accent-blue); color: #fff;
      border-color: var(--accent-blue);
    }
    .tp-btn-primary:hover { filter: brightness(1.1); }
    .tp-btn-secondary {
      background: transparent; color: var(--text-secondary);
      border-color: var(--border);
    }
    .tp-btn-secondary:hover { background: var(--bg-surface); color: var(--text-primary); }
    .tp-footnote {
      margin: 14px 0 0; font-size: 11px;
      color: var(--text-muted); text-align: center; font-style: italic;
    }
    @keyframes tpFadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes tpSlideIn {
      from { opacity: 0; transform: translateY(10px) scale(0.98); }
      to   { opacity: 1; transform: translateY(0)    scale(1);    }
    }

    /* ─── STYLED SELECT (dropdown chevron indicator) ────────────────── */
    /* Covers #dashboard selects + any modal selects appended to body    */
    #dashboard select,
    .funny-picker-cat-select {
      -webkit-appearance: none;
      appearance: none;
      /* !important needed to beat inline background: shorthand resets */
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888899'/%3E%3C/svg%3E") !important;
      background-repeat: no-repeat !important;
      background-position: right 12px center !important;
      background-size: 10px 7px !important;
      padding-right: 34px !important;
      cursor: pointer;
    }

    /* Nav */
    .sidebar-nav { padding: 6px 12px 16px; flex: 1; }
    .nav-label {
      font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
      text-transform: uppercase; color: rgba(110,120,145,0.85);
      padding: 0 12px 7px; margin-top: 22px;
      display: flex; align-items: center; gap: 8px;
    }
    .nav-label::after {
      content: ''; flex: 1; height: 1px;
      background: linear-gradient(90deg, rgba(88,101,242,0.25), transparent);
    }

    .nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 5px 14px; border-radius: var(--radius-md);
      cursor: pointer; font-size: 14px; font-weight: 700;
      color: var(--text-secondary); margin-bottom: 1px;
      border: 1.5px solid transparent;
      transition: all 0.15s ease; user-select: none;
      position: relative;
    }
    .nav-item:hover {
      background: rgba(255,255,255,0.05); color: var(--text-primary);
      border-color: rgba(255,255,255,0.08);
    }
    .nav-item.active {
      background: linear-gradient(90deg, rgba(88,101,242,0.2) 0%, rgba(88,101,242,0.07) 100%);
      color: var(--text-primary);
      border-color: rgba(88,101,242,0.45);
      box-shadow: inset 3px 0 0 0 var(--accent-blue), 0 2px 16px -6px rgba(88,101,242,0.45);
    }
    .nav-item.active .nav-icon { color: var(--accent-blue); filter: drop-shadow(0 0 5px rgba(88,101,242,0.6)); }
    .nav-item:active { transform: scale(0.96); }

    .nav-icon {
      width: 20px; height: 20px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px;
    }
    .nav-badge {
      margin-left: auto;
      background: var(--accent-red); color: #fff;
      font-size: 9px; font-weight: 800;
      padding: 2px 6px; border-radius: 99px;
    }
    .nav-item.admin-item { border-color: rgba(255,60,60,0.25); }
    .nav-item.admin-item.active { border-color: rgba(255,60,60,0.6); box-shadow: 0 4px 16px -4px rgba(255,60,60,0.45); }

    /* Server Images — secondary utility link, smaller than main nav */
    .nav-item[data-view="image-library"] {
      font-size: 12px; font-weight: 600;
      padding: 8px 12px;
    }

    /* Upgrade banner */
    .upgrade-banner {
      margin: 12px;
      background: linear-gradient(135deg, rgba(255,214,0,0.1), rgba(255,123,0,0.06));
      border: 1.5px solid rgba(255,214,0,0.3);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      position: relative;
    }
    .upgrade-banner::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 0px;
      background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
      border-radius: var(--radius-md) var(--radius-md) 0 0;
      opacity: 0.7;
    }
    .upgrade-banner h4 { font-size: 13px; font-weight: 800; color: var(--tier-premium); margin-bottom: 4px; }
    .upgrade-banner p  { font-size: 11px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 10px; }
    .btn-upgrade {
      display: block; width: 100%; padding: 9px;
      background: linear-gradient(135deg, var(--tier-premium), var(--tier-vip));
      color: var(--bg-deep); font-family: var(--font-display);
      font-size: 12px; font-weight: 900;
      border: none; border-radius: var(--radius-sm);
      cursor: pointer; text-decoration: none; text-align: center;
      letter-spacing: 0.3px;
      box-shadow: 0 4px 16px rgba(255,214,0,0.25);
      transition: transform 0.15s, box-shadow 0.15s;
    }
    .btn-upgrade:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,214,0,0.35); }
    .btn-upgrade:active { transform: scale(0.95); }

    .sidebar-footer {
      padding: 12px; padding-bottom: 48px; border-top: 1px solid rgba(255,255,255,0.05);
    }
    .btn-logout {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 10px; border-radius: var(--radius-sm);
      background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
      color: var(--text-muted); font-family: var(--font-display);
      font-size: 13px; font-weight: 700;
      cursor: pointer; transition: all 0.15s;
    }
    .btn-logout:hover { border-color: rgba(255,60,60,0.4); color: var(--accent-red); background: rgba(255,60,60,0.06); }
    .btn-logout:active { transform: scale(0.96); }

    /* ─── SERVER SELECTOR ──────────────────────────────────────────── */
    .server-selector {
      padding: 10px 12px;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      position: relative;
    }
    .server-selector-btn {
      display: flex; align-items: center; gap: 10px;
      width: 100%; padding: 9px 12px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.09);
      border-radius: var(--radius-md);
      cursor: pointer; color: var(--text-primary);
      font-family: var(--font-display); font-size: 13px; font-weight: 700;
      transition: all 0.15s; user-select: none; text-align: left;
    }
    .server-selector-btn:hover { border-color: rgba(88,101,242,0.6); background: var(--bg-elevated); box-shadow: 0 0 14px -4px rgba(88,101,242,0.35); }
    .server-selector-btn:active { transform: scale(0.98); }
    .server-selector-btn.open { border-color: var(--accent-blue); box-shadow: 0 0 18px -4px rgba(88,101,242,0.5); }

    .server-icon {
      width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; font-weight: 800; color: #fff;
      border: 1.5px solid rgba(255,255,255,0.1);
      overflow: hidden;
    }
    .server-icon img { width: 100%; height: 100%; object-fit: cover; }

    .server-selector-info { flex: 1; min-width: 0; overflow: hidden; }
    .server-selector-info .server-name {
      font-size: 13px; font-weight: 800;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .server-selector-info .server-sub {
      font-size: 10px; color: var(--text-muted); margin-top: 1px;
      font-family: var(--font-mono);
    }
    .server-chevron {
      flex-shrink: 0; color: var(--text-muted); font-size: 11px;
      transition: transform 0.2s;
    }
    .server-selector-btn.open .server-chevron { transform: rotate(180deg); }

    /* Dropdown — fixed so it escapes sidebar overflow clipping */
    .server-dropdown {
      position: fixed;
      background: var(--bg-elevated);
      border: 2px solid var(--accent-blue);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-lg), var(--glow-blue);
      z-index: 1100;
      overflow: hidden;
      width: 236px;
      animation: fadeIn 0.15s ease;
      display: none;
    }
    .server-dropdown.open { display: block; }

    .server-dropdown-header {
      padding: 8px 12px 6px;
      font-size: 10px; font-weight: 800; letter-spacing: 1px;
      text-transform: uppercase; color: var(--text-muted);
      border-bottom: 1px solid var(--border);
    }
    .server-option {
      display: flex; align-items: center; gap: 10px;
      padding: 9px 12px; cursor: pointer;
      transition: background 0.1s;
      border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .server-option:last-child { border-bottom: none; }
    .server-option:hover { background: rgba(88,101,242,0.1); }
    .server-option.selected { background: rgba(88,101,242,0.15); }
    .server-option:active { transform: scale(0.98); }
    .server-option .s-name { font-size: 13px; font-weight: 700; }
    .server-option .s-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; font-family: var(--font-mono); }
    .server-option .s-check { margin-left: auto; color: var(--accent-blue); font-size: 14px; }

    /* Collapsed sidebar — hide text in server selector */
    #sidebar.collapsed .server-selector { padding: 8px; }
    #sidebar.collapsed .server-selector-btn { justify-content: center; padding: 8px; gap: 0; border-color: transparent; background: transparent; }
    #sidebar.collapsed .server-selector-btn:hover { background: var(--bg-elevated); border-color: var(--border); }
    #sidebar.collapsed .server-selector-info,
    #sidebar.collapsed .server-chevron { display: none; }

    /* Dev toggle button */
    .btn-dev-toggle {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 9px; margin-bottom: 8px;
      border-radius: var(--radius-sm);
      background: rgba(255,214,0,0.07);
      border: 2px dashed rgba(255,214,0,0.35);
      color: var(--accent-yellow);
      font-family: var(--font-display); font-size: 12px; font-weight: 800;
      cursor: pointer; transition: all 0.15s; letter-spacing: 0.3px;
    }
    .btn-dev-toggle:hover { background: rgba(255,214,0,0.14); border-color: var(--accent-yellow); }
    .btn-dev-toggle:active { transform: scale(0.96); }
    #sidebar.collapsed .btn-dev-toggle { padding: 9px 0; gap: 0; }
    #sidebar.collapsed .btn-dev-toggle-text { display: none; }

    /* Selected server banner in main header */
    .selected-server-badge {
      display: flex; align-items: center; gap: 8px;
      padding: 6px 12px 6px 8px;
      background: var(--bg-card); border: 2px solid var(--border);
      border-radius: var(--radius-md); font-size: 13px; font-weight: 700;
    }
    .selected-server-badge .s-icon {
      width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 800;
    }
    #main-content {
      flex: 1; overflow-y: auto; overflow-x: hidden;
      padding: 24px 28px 60px;
      background:
        radial-gradient(circle at 1px 1px, rgba(88,101,242,0.12) 1px, transparent 0),
        var(--bg-deep);
      background-size: 36px 36px, auto;
      min-width: 0;
    }

    .page-header {
      margin-bottom: 28px;
      padding-bottom: 20px;
      border-bottom: 1px solid rgba(88,101,242,0.22);
      display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    }
    .page-header-left h1 {
      font-size: 26px; font-weight: 900; letter-spacing: -0.5px;
      display: flex; align-items: center; gap: 12px;
    }
    .page-header-left h1 .icon { font-size: 24px; }
    .page-header-left p {
      color: var(--text-secondary); font-size: 14px; margin-top: 4px;
    }
    .page-header-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

    /* Views */
    .view { display: none; }
    .view.active { display: block; animation: fadeIn 0.3s ease; max-width: 800px; }

    /* ─── CARDS ─────────────────────────────────────────────────────── */
    .card {
      background: var(--bg-card);
      border: 1.5px solid rgba(255,255,255,0.07);
      border-radius: var(--radius-lg);
      padding: 24px 28px;
      margin-bottom: 20px;
      box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-glow) inset;
      transition: border-color 0.2s, box-shadow 0.2s;
      position: relative;
      overflow: hidden;
    }
    .card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 55%, transparent 85%);
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
      opacity: 0.4; pointer-events: none;
    }
    .card:hover {
      border-color: rgba(88,101,242,0.3);
      box-shadow: var(--shadow-md), 0 0 24px -8px rgba(88,101,242,0.2);
    }
    .card:hover::before { opacity: 0.7; }
    .card-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 20px; padding-bottom: 16px;
      border-bottom: 1px solid rgba(88,101,242,0.18);
    }
    .card-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 4; }
    .card-header-badge { flex: 1; display: flex; justify-content: flex-end; flex-shrink: 0; }
    .card-header-icon {
      width: 36px; height: 36px;
      background: rgba(88,101,242,0.12);
      border: 1.5px solid rgba(88,101,242,0.28);
      border-radius: var(--radius-sm);
      display: flex; align-items: center; justify-content: center; font-size: 18px;
    }
    .card-title { font-size: 16px; font-weight: 800; }
    .card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

    /* Grid layouts */
    .grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

    /* ─── FORM CONTROLS ─────────────────────────────────────────────── */
    .form-group { margin-bottom: 20px; }
    .form-group:last-child { margin-bottom: 0; }

    label {
      display: block; font-size: 13px; font-weight: 700;
      color: var(--text-secondary); margin-bottom: 6px;
      letter-spacing: 0.2px;
    }

    input[type="text"], input[type="number"], select, textarea {
      width: 100%; padding: 11px 14px;
      background: var(--bg-surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-family: var(--font-display); font-size: 14px;
      outline: none;
      transition: border-color 0.15s, box-shadow 0.15s;
      appearance: none;
    }
    input:focus, select:focus, textarea:focus {
      border-color: rgba(88,101,242,0.8);
      box-shadow: 0 0 0 3px rgba(88,101,242,0.18), 0 0 14px -3px rgba(88,101,242,0.35);
    }
    select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2372767d' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 14px center;
      padding-right: 40px; cursor: pointer;
    }
    textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
    input::placeholder, textarea::placeholder { color: var(--text-muted); }

    .input-hint {
      font-size: 11px; color: var(--text-muted);
      margin-top: 5px; line-height: 1.4; font-family: var(--font-mono);
    }
    .input-hint code {
      background: var(--bg-elevated); padding: 1px 5px;
      border-radius: 4px; font-size: 10px;
      border: 1px solid var(--border);
    }

    /* Toggle switch */
    .toggle-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 0;
      border-bottom: 1px solid rgba(88,101,242,0.1);
    }
    .toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
    .toggle-row:first-child { padding-top: 0; }
    .toggle-info { padding-right: 20px; flex: 1; min-width: 0; }
    .toggle-info .toggle-label { font-size: 14px; font-weight: 700; }
    .toggle-info .toggle-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

    .toggle {
      position: relative; width: 46px; height: 26px; flex-shrink: 0;
    }
    .toggle input { opacity: 0; width: 0; height: 0; }
    .toggle-track {
      position: absolute; inset: 0;
      background: var(--bg-elevated);
      border: 2px solid var(--border);
      border-radius: 99px; cursor: pointer;
      transition: background 0.2s, border-color 0.2s;
    }
    .toggle-track::after {
      content: '';
      position: absolute; top: 2px; left: 2px;
      width: 18px; height: 18px; border-radius: 50%;
      background: var(--text-muted);
      transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
    }
    .toggle input:checked + .toggle-track {
      background: var(--accent-green);
      border-color: var(--accent-green);
      box-shadow: 0 0 14px rgba(67,181,129,0.45);
    }
    .toggle input:checked + .toggle-track::after {
      transform: translateX(20px);
      background: #fff;
    }

    /* Buttons */
    .btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      padding: 11px 20px;
      font-family: var(--font-display); font-size: 14px; font-weight: 800;
      border: 2px solid transparent; border-radius: var(--radius-sm);
      cursor: pointer; text-decoration: none; letter-spacing: 0.2px;
      transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
      user-select: none;
    }
    .btn:active { transform: scale(0.95); }

    .btn-primary {
      background: var(--accent-blue); color: #fff;
      box-shadow: 0 3px 12px rgba(88,101,242,0.4), 0 0 0 1px rgba(88,101,242,0.2);
    }
    .btn-primary:hover { box-shadow: 0 6px 22px rgba(88,101,242,0.6), 0 0 0 1px rgba(88,101,242,0.35); transform: translateY(-1px); }

    .btn-success {
      background: var(--accent-green); color: #fff;
      box-shadow: 0 3px 12px rgba(67,181,129,0.4), 0 0 0 1px rgba(67,181,129,0.2);
    }
    .btn-success:hover { box-shadow: 0 6px 22px rgba(67,181,129,0.55), 0 0 0 1px rgba(67,181,129,0.35); transform: translateY(-1px); }

    .btn-danger {
      background: var(--accent-red); color: #fff;
      box-shadow: 0 3px 12px rgba(255,60,60,0.4), 0 0 0 1px rgba(255,60,60,0.2);
    }
    .btn-danger:hover { box-shadow: 0 6px 22px rgba(255,60,60,0.55), 0 0 0 1px rgba(255,60,60,0.35); transform: translateY(-1px); }

    .btn-ghost {
      background: transparent; color: var(--text-secondary);
      border-color: var(--border);
    }
    .btn-ghost:hover { border-color: var(--text-muted); color: var(--text-primary); background: var(--bg-elevated); }

    .btn-warning {
      background: var(--accent-yellow); color: var(--bg-deep);
      box-shadow: 0 3px 12px rgba(255,214,0,0.3);
    }
    .btn-warning:hover { box-shadow: 0 5px 20px rgba(255,214,0,0.45); transform: translateY(-1px); }

    .btn-sm { padding: 7px 14px; font-size: 12px; }
    .btn-lg { padding: 14px 28px; font-size: 16px; }

    .save-row {
      display: flex; align-items: center; justify-content: flex-end; gap: 10px;
      margin-top: 20px; padding-top: 20px;
      border-top: 2px solid var(--border);
    }
    /* All save-row buttons are consistently sized — no manual btn-sm needed */
    .save-row .btn {
      padding: 9px 18px; font-size: 13px;
    }

    /* Status indicator */
    .status-dot {
      width: 8px; height: 8px; border-radius: 50%;
      display: inline-block; margin-right: 6px;
    }
    .status-online  { background: var(--accent-green); box-shadow: 0 0 6px rgba(67,181,129,0.6); }
    .status-offline { background: var(--text-muted); }
    .status-dnd     { background: var(--accent-red); box-shadow: 0 0 6px rgba(255,60,60,0.6); }
    .status-idle    { background: var(--accent-yellow); box-shadow: 0 0 6px rgba(255,214,0,0.6); }

    /* Tag/chip */
    .chip {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 10px; border-radius: 99px;
      font-size: 11px; font-weight: 700;
      background: var(--bg-elevated);
      border: 1.5px solid var(--border);
      color: var(--text-secondary);
    }

    /* ─── STAT CARDS ─────────────────────────────────────────────────── */
    .stat-card {
      background: var(--bg-card);
      border: 1.5px solid rgba(255,255,255,0.07);
      border-radius: var(--radius-md);
      padding: 20px 24px;
      position: relative; overflow: hidden;
      transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    }
    .stat-card:hover { transform: translateY(-2px); }
    .stat-card::before {
      content: '';
      position: absolute; top: 0; left: 0; right: 0; height: 3px;
      border-radius: 2px 2px 0 0;
    }
    .stat-card.blue::before   { background: var(--accent-blue); }
    .stat-card.green::before  { background: var(--accent-green); }
    .stat-card.red::before    { background: var(--accent-red); }
    .stat-card.yellow::before { background: var(--accent-yellow); }
    .stat-card.teal::before   { background: var(--accent-teal); }
    .stat-card.purple::before { background: var(--accent-purple); }
    .stat-card.blue:hover   { border-color: rgba(88,101,242,0.45);  box-shadow: 0 8px 24px -6px rgba(88,101,242,0.4); }
    .stat-card.green:hover  { border-color: rgba(67,181,129,0.45);  box-shadow: 0 8px 24px -6px rgba(67,181,129,0.4); }
    .stat-card.red:hover    { border-color: rgba(255,60,60,0.45);   box-shadow: 0 8px 24px -6px rgba(255,60,60,0.4); }
    .stat-card.yellow:hover { border-color: rgba(255,214,0,0.45);   box-shadow: 0 8px 24px -6px rgba(255,214,0,0.35); }
    .stat-card.teal:hover   { border-color: rgba(0,201,167,0.45);   box-shadow: 0 8px 24px -6px rgba(0,201,167,0.4); }
    .stat-card.purple:hover { border-color: rgba(155,89,182,0.45);  box-shadow: 0 8px 24px -6px rgba(155,89,182,0.4); }

    .stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
    .stat-value { font-size: 32px; font-weight: 900; letter-spacing: -1px; margin: 4px 0; font-family: var(--font-mono); }
    .stat-sub   { font-size: 12px; color: var(--text-secondary); }
    .stat-icon  { position: absolute; right: 18px; top: 18px; font-size: 28px; opacity: 0.25; }

    /* ─── TABLE ─────────────────────────────────────────────────────── */
    .data-table { width: 100%; border-collapse: collapse; }
    .data-table th {
      text-align: left; font-size: 11px; font-weight: 800;
      color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px;
      padding: 10px 14px; border-bottom: 2px solid var(--border);
    }
    .data-table td {
      padding: 12px 14px; font-size: 13px;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }
    .data-table tr:last-child td { border-bottom: none; }
    .data-table tr:hover td { background: rgba(255,255,255,0.02); }
    .data-table .mono { font-family: var(--font-mono); font-size: 12px; }

    /* ─── PRESENCE SELECTOR ─────────────────────────────────────────── */
    .presence-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    }
    .presence-option {
      padding: 14px 10px;
      background: var(--bg-surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      cursor: pointer; text-align: center;
      transition: all 0.15s;
      user-select: none;
    }
    .presence-option:hover { border-color: var(--text-muted); background: var(--bg-elevated); }
    .presence-option.selected { border-color: var(--accent-blue); background: rgba(88,101,242,0.1); box-shadow: var(--glow-blue); }
    .presence-option:active { transform: scale(0.95); }
    .presence-option .p-icon { font-size: 22px; margin-bottom: 6px; }
    .presence-option .p-label { font-size: 12px; font-weight: 700; }

    /* ═══════════════════════════════════════════════════════════════════
       SUBSCRIPTION PAGE
    ═══════════════════════════════════════════════════════════════════ */
    .sub-current-plan {
      position: relative; overflow: hidden;
    }
    .sub-plan-glow {
      position: absolute; top: -60px; right: -60px;
      width: 200px; height: 200px; border-radius: 50%;
      background: radial-gradient(circle, rgba(114,118,125,0.1) 0%, transparent 70%);
      pointer-events: none; transition: background 0.4s;
    }
    .sub-plan-icon {
      width: 64px; height: 64px; border-radius: var(--radius-lg); flex-shrink: 0;
      background: rgba(114,118,125,0.1); border: 2px solid rgba(114,118,125,0.25);
      display: flex; align-items: center; justify-content: center; font-size: 28px;
      transition: all 0.3s;
    }
    .sub-plan-status { flex-shrink: 0; }
    .sub-status-pill {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 6px 14px; border-radius: 99px;
      font-size: 12px; font-weight: 800; letter-spacing: 0.3px;
      border: 2px solid;
    }
    .sub-status-pill.free    { color: var(--accent-green); border-color: rgba(67,181,129,0.3); background: rgba(67,181,129,0.08); }
    .sub-status-pill.premium { color: var(--tier-premium); border-color: rgba(255,214,0,0.3); background: rgba(255,214,0,0.08); }
    .sub-status-pill.vip     { color: var(--tier-vip);     border-color: rgba(255,123,0,0.3); background: rgba(255,123,0,0.08); }
    .sub-status-pill.friend  { color: var(--tier-friend);  border-color: rgba(255,60,60,0.3); background: rgba(255,60,60,0.08); }

    .sub-renewal-info {
      margin-top: 16px; padding-top: 16px;
      border-top: 1px solid var(--border);
    }
    .sub-renewal-row {
      display: flex; justify-content: space-between; align-items: center;
      font-size: 13px; color: var(--text-secondary); padding: 4px 0;
    }

    /* Billing Toggle */
    .sub-billing-toggle {
      display: inline-flex; margin-left: auto;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: 99px; padding: 3px; gap: 2px;
    }
    .sub-toggle-opt {
      padding: 6px 14px; border-radius: 99px; border: none;
      background: transparent; color: var(--text-muted);
      font-family: var(--font-display); font-size: 12px; font-weight: 700;
      cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 6px;
    }
    .sub-toggle-opt.active {
      background: var(--accent-blue); color: #fff;
      box-shadow: 0 2px 8px rgba(88,101,242,0.3);
    }
    .sub-toggle-opt:not(.active):hover { color: var(--text-primary); background: var(--bg-elevated); }
    .sub-save-badge {
      background: var(--accent-green); color: #fff;
      font-size: 9px; font-weight: 800; padding: 2px 6px;
      border-radius: 99px; letter-spacing: 0.3px;
    }

    /* Plan Cards Grid */
    .sub-plans-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    }
    .sub-plan-card {
      background: var(--bg-card); border: 1.5px solid rgba(255,255,255,0.07);
      border-radius: var(--radius-lg); overflow: hidden;
      position: relative; display: flex; flex-direction: column;
      transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    }
    .sub-plan-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.14); box-shadow: var(--shadow-md); }
    .sub-plan-card.featured {
      border-color: rgba(255,214,0,0.5);
      box-shadow: 0 0 40px rgba(255,214,0,0.12), 0 8px 32px rgba(0,0,0,0.3);
    }
    .sub-plan-card.featured:hover { box-shadow: 0 0 55px rgba(255,214,0,0.2), 0 12px 40px rgba(0,0,0,0.35); border-color: rgba(255,214,0,0.7); }
    .sub-plan-card.current-plan { border-color: rgba(67,181,129,0.5); box-shadow: 0 0 24px -8px rgba(67,181,129,0.3); }

    .sub-card-ribbon {
      position: absolute; top: 12px; right: -32px;
      background: linear-gradient(135deg, var(--tier-premium), var(--accent-orange));
      color: var(--bg-deep); font-size: 9px; font-weight: 900;
      padding: 4px 40px; letter-spacing: 1px;
      transform: rotate(45deg); z-index: 2;
      box-shadow: 0 2px 8px rgba(255,214,0,0.3);
    }

    .sub-card-accent {
      height: 4px; width: 100%; flex-shrink: 0;
    }
    .sub-card-body {
      padding: 24px 20px 20px; flex: 1;
      display: flex; flex-direction: column;
    }
    .sub-card-top { text-align: center; margin-bottom: 20px; }
    .sub-card-emoji { font-size: 36px; margin-bottom: 8px; }
    .sub-card-tier { font-size: 20px; font-weight: 900; letter-spacing: -0.3px; }
    .sub-card-price { margin: 10px 0 6px; }
    .sub-price-amount {
      font-size: 36px; font-weight: 900; letter-spacing: -1px;
      font-family: var(--font-mono);
    }
    .sub-price-period { font-size: 14px; color: var(--text-muted); font-weight: 600; }
    .sub-card-tagline { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
    .sub-trial-badge {
      display: inline-flex; align-items: center; gap: 4px;
      margin-top: 8px; padding: 5px 12px;
      background: rgba(67,181,129,0.1); border: 1.5px solid rgba(67,181,129,0.25);
      border-radius: 99px; font-size: 11px; font-weight: 700;
      color: var(--accent-green); letter-spacing: 0.1px;
    }

    .sub-card-features {
      flex: 1; padding: 16px 0;
      border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
    }
    .sub-feat {
      display: flex; align-items: center; gap: 8px;
      font-size: 13px; font-weight: 600; color: var(--text-secondary);
      padding: 5px 0;
    }
    .sub-feat strong { color: var(--text-primary); }
    .sub-feat.muted { opacity: 0.45; }
    .sub-feat-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 13px; }
    .sub-feat-icon.yes  { color: var(--accent-green); }
    .sub-feat-icon.no   { color: var(--text-muted); }
    .sub-feat-icon.star { color: var(--tier-premium); }
    .sub-feat-icon.fire { font-size: 12px; }

    .sub-card-bottom { margin-top: auto; }
    .sub-card-btn { width: 100%; padding: 12px; font-size: 14px; }
    .sub-btn-vip {
      background: linear-gradient(135deg, var(--tier-vip), var(--accent-red));
      color: #fff; border: none;
      box-shadow: 0 3px 14px rgba(255,123,0,0.3);
    }
    .sub-btn-vip:hover { box-shadow: 0 5px 22px rgba(255,123,0,0.45); transform: translateY(-1px); }

    /* FAQ */
    .sub-faq-list { display: flex; flex-direction: column; gap: 2px; }
    .sub-faq-item {
      border-radius: var(--radius-sm); cursor: pointer;
      transition: background 0.12s;
    }
    .sub-faq-item:hover { background: var(--bg-surface); }
    .sub-faq-q {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 8px; font-size: 14px; font-weight: 700;
      color: var(--text-primary); user-select: none;
    }
    .sub-faq-arrow {
      font-size: 16px; color: var(--text-muted);
      transition: transform 0.2s; flex-shrink: 0;
    }
    .sub-faq-item.open .sub-faq-arrow { transform: rotate(90deg); }
    .sub-faq-a {
      max-height: 0; overflow: hidden;
      padding: 0 8px; font-size: 13px; color: var(--text-secondary);
      line-height: 1.6; transition: max-height 0.3s ease, padding 0.3s ease;
    }
    .sub-faq-item.open .sub-faq-a {
      max-height: 200px; padding: 0 8px 14px;
    }

    /* Checkout Modal */
    .sub-checkout-overlay {
      position: fixed; inset: 0; z-index: 5000;
      background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
      display: none; align-items: center; justify-content: center;
    }
    .sub-checkout-modal {
      background: var(--bg-card); border: 2px solid var(--border);
      border-radius: var(--radius-xl); padding: 32px;
      width: min(440px, 92vw); position: relative;
      box-shadow: var(--shadow-lg), 0 0 80px rgba(0,0,0,0.4);
      animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
    }
    .sub-checkout-close {
      position: absolute; top: 16px; right: 16px;
      width: 32px; height: 32px; border-radius: 8px;
      background: var(--bg-surface); border: 2px solid var(--border);
      color: var(--text-muted); font-size: 14px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.12s;
    }
    .sub-checkout-close:hover { color: var(--text-primary); border-color: var(--text-muted); }
    .sub-checkout-header { text-align: center; margin-bottom: 24px; }
    .sub-checkout-icon { font-size: 40px; margin-bottom: 8px; }
    .sub-checkout-title { font-size: 22px; font-weight: 900; letter-spacing: -0.3px; }
    .sub-checkout-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

    .sub-checkout-summary {
      background: var(--bg-surface); border: 1.5px solid var(--border);
      border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px;
    }
    .sub-summary-row {
      display: flex; justify-content: space-between; align-items: center;
      padding: 6px 0; font-size: 13px; color: var(--text-secondary);
    }
    .sub-summary-row.total {
      border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px;
      color: var(--text-primary);
    }

    .sub-checkout-server { margin-bottom: 20px; }
    .sub-trial-notice {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 10px 14px; margin-bottom: 16px;
      background: rgba(67,181,129,0.08); border: 1.5px solid rgba(67,181,129,0.2);
      border-radius: var(--radius-sm);
      font-size: 12px; color: var(--accent-green); line-height: 1.5; font-weight: 600;
    }
    .sub-trial-notice svg { flex-shrink: 0; margin-top: 1px; }
    .sub-server-display {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 14px; margin-top: 6px;
      background: var(--bg-surface); border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
    }
    .sub-server-icon {
      width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; font-weight: 800; color: #fff;
    }

    .sub-checkout-pay-btn {
      width: 100%; padding: 14px; font-size: 15px; font-weight: 900;
      background: linear-gradient(135deg, var(--tier-premium), var(--accent-orange));
      color: var(--bg-deep); border: none; border-radius: var(--radius-md);
      cursor: pointer; font-family: var(--font-display);
      display: flex; align-items: center; justify-content: center; gap: 8px;
      box-shadow: 0 4px 20px rgba(255,214,0,0.3);
      transition: transform 0.15s, box-shadow 0.15s;
    }
    .sub-checkout-pay-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(255,214,0,0.45); }
    .sub-checkout-pay-btn:active { transform: scale(0.97); }
    .sub-checkout-pay-btn.vip-btn {
      background: linear-gradient(135deg, var(--tier-vip), var(--accent-red));
      box-shadow: 0 4px 20px rgba(255,123,0,0.3);
    }
    .sub-checkout-pay-btn.vip-btn:hover { box-shadow: 0 6px 28px rgba(255,123,0,0.45); }

    .sub-checkout-pay-btn .loading-spinner { border-top-color: var(--bg-deep); }

    @media (max-width: 900px) {
      .sub-plans-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    }
    @media (max-width: 600px) {
      .sub-checkout-modal { padding: 24px 18px; }
    }

    /* ═══════════════════════════════════════════════════════════════════
       UGC CODES FOR BOOSTERS
    ═══════════════════════════════════════════════════════════════════ */
    .ugc-service-status {
      border-radius: var(--radius-lg); padding: 20px 24px;
      margin-bottom: 20px; border: 2px solid;
      position: relative; overflow: hidden;
    }
    .ugc-service-status.running {
      background: rgba(67,181,129,0.06); border-color: rgba(67,181,129,0.3);
    }
    .ugc-service-status.stopped {
      background: rgba(114,118,125,0.06); border-color: var(--border);
    }
    .ugc-status-header {
      display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
    }
    .ugc-status-dot {
      width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    }
    .ugc-status-dot.live {
      background: var(--accent-green);
      box-shadow: 0 0 8px rgba(67,181,129,0.6);
      animation: pulse 2s infinite;
    }
    .ugc-status-dot.off { background: var(--text-muted); }
    .ugc-status-label { font-size: 15px; font-weight: 800; }
    .ugc-status-label.live { color: var(--accent-green); }
    .ugc-status-label.off  { color: var(--text-muted); }

    .ugc-stats-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
      margin-bottom: 14px;
    }
    .ugc-stat-box {
      background: var(--bg-surface); border: 1.5px solid var(--border);
      border-radius: var(--radius-sm); padding: 10px 12px; text-align: center;
    }
    .ugc-stat-box .ugc-stat-val {
      font-size: 22px; font-weight: 900; font-family: var(--font-mono);
      letter-spacing: -0.5px;
    }
    .ugc-stat-box .ugc-stat-lbl {
      font-size: 10px; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
    }

    .ugc-codes-preview {
      display: flex; gap: 10px; margin-top: 10px;
    }
    .ugc-codes-col {
      flex: 1; min-width: 0;
    }
    .ugc-codes-col-header {
      font-size: 10px; font-weight: 800; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
    }
    .ugc-codes-list {
      background: var(--bg-surface); border: 1.5px solid var(--border);
      border-radius: var(--radius-sm); padding: 8px 10px;
      max-height: 140px; overflow-y: auto;
      font-family: var(--font-mono); font-size: 10px;
      color: var(--text-secondary); line-height: 1.5;
      word-break: break-all;
    }

    .ugc-code-counter {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 10px; border-radius: 99px;
      background: var(--bg-elevated); border: 1.5px solid var(--border);
      font-size: 12px; font-weight: 700; font-family: var(--font-mono);
      color: var(--accent-teal); margin-top: 6px;
    }

    .ugc-service-locked > *:not(.ugc-service-status) {
      opacity: 0.35; pointer-events: none; filter: grayscale(0.3);
    }


    /* ═══════════════════════════════════════════════════════════════════
       EMBED BUILDER
    ═══════════════════════════════════════════════════════════════════ */
    .eb-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
    @media (max-width: 900px) { .eb-grid { grid-template-columns: 1fr; } }

    .eb-section {
      border: 1.5px solid var(--border); border-radius: var(--radius-sm);
      margin-bottom: 10px; overflow: hidden;
    }
    .eb-section-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 8px 12px; background: var(--bg-surface); cursor: pointer;
      user-select: none; transition: background 0.12s;
    }
    .eb-section-header:hover { background: var(--bg-elevated); }
    .eb-section-title {
      font-size: 12px; font-weight: 800; color: var(--text-secondary);
      text-transform: uppercase; letter-spacing: 0.5px;
    }
    .eb-section-arrow {
      font-size: 12px; color: var(--text-muted);
      transition: transform 0.2s;
    }
    .eb-section.open .eb-section-arrow { transform: rotate(90deg); }
    .eb-section-body {
      max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
    }
    .eb-section.open .eb-section-body {
      max-height: 800px; overflow: visible;
    }
    .eb-section-inner { padding: 10px 12px; }

    .eb-field-row {
      background: var(--bg-surface); border: 1.5px solid var(--border);
      border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px;
      position: relative;
    }
    .eb-field-remove {
      position: absolute; top: 6px; right: 6px;
      width: 22px; height: 22px; border-radius: 4px;
      background: rgba(255,60,60,0.1); border: 1px solid rgba(255,60,60,0.2);
      color: var(--accent-red); font-size: 12px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.12s;
    }
    .eb-field-remove:hover { background: rgba(255,60,60,0.2); border-color: var(--accent-red); }

    .eb-add-field {
      display: flex; align-items: center; justify-content: center; gap: 6px;
      width: 100%; padding: 8px; border: 2px dashed var(--border);
      border-radius: var(--radius-sm); background: transparent;
      color: var(--text-muted); font-family: var(--font-display);
      font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.12s;
    }
    .eb-add-field:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(88,101,242,0.05); }

    /* Live preview */
    .eb-preview-wrap {
      background: #36393f; border-radius: var(--radius-md);
      padding: 16px; position: sticky; top: 24px;
    }
    .eb-pv-msg-row { display: flex; gap: 12px; }
    .eb-pv-avatar {
      width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
      display: flex; align-items: center; justify-content: center; font-size: 18px;
    }
    .eb-pv-body { flex: 1; min-width: 0; }
    .eb-pv-username { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
    .eb-pv-timestamp { font-size: 11px; color: #72767d; margin-left: 6px; }
    .eb-pv-content { font-size: 14px; color: #dcddde; line-height: 1.5; margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
    .eb-pv-embed {
      display: flex; border-radius: 4px; overflow: hidden;
      max-width: 520px; margin-top: 4px;
      background: #2f3136;
    }
    .eb-pv-embed-bar { width: 4px; flex-shrink: 0; }
    .eb-pv-embed-inner { padding: 10px 14px 10px 12px; flex: 1; min-width: 0; display: flex; gap: 16px; }
    .eb-pv-embed-content { flex: 1; min-width: 0; }
    .eb-pv-author { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
    .eb-pv-author-icon { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
    .eb-pv-author-name { font-size: 12px; font-weight: 600; color: #fff; }
    .eb-pv-title { font-size: 14px; font-weight: 700; color: #00aff4; margin-bottom: 4px; }
    .eb-pv-title a { color: #00aff4; text-decoration: none; }
    .eb-pv-title a:hover { text-decoration: underline; }
    .eb-pv-desc { font-size: 13px; color: #dcddde; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
    .eb-pv-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
    .eb-pv-field { min-width: 0; }
    .eb-pv-field.full { grid-column: 1 / -1; }
    .eb-pv-field-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 1px; }
    .eb-pv-field-value { font-size: 13px; color: #dcddde; line-height: 1.35; }
    .eb-pv-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
    .eb-pv-image { max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 8px; object-fit: contain; }
    .eb-pv-footer { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: #72767d; }
    .eb-pv-footer-icon { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
    .eb-pv-empty { color: #72767d; font-size: 13px; text-align: center; padding: 20px 0; }

    /* ═══════════════════════════════════════════════════════════════════
       REUSABLE MESSAGE TEMPLATE BLOCK
    ═══════════════════════════════════════════════════════════════════ */
    .msg-block-tabs {
      display: flex; border-radius: var(--radius-sm); overflow: hidden;
      border: 2px solid var(--border); margin-bottom: 14px;
    }
    .msg-tab-btn {
      flex: 1; padding: 8px 0; text-align: center;
      font-family: var(--font-display); font-size: 12px; font-weight: 800;
      letter-spacing: 0.3px; cursor: pointer; border: none;
      background: var(--bg-surface); color: var(--text-muted);
      transition: all 0.15s;
    }
    .msg-tab-btn:first-child { border-right: 1px solid var(--border); }
    .msg-tab-btn:hover { color: var(--text-primary); }
    .msg-tab-btn.active {
      background: var(--accent-blue); color: #fff;
    }
    .msg-embed-only { transition: opacity 0.2s, max-height 0.3s; }
    .msg-block[data-mode="message"] .msg-embed-only {
      opacity: 0; max-height: 0; overflow: hidden; pointer-events: none; margin: 0 !important; padding: 0 !important; border: none !important;
    }
    .msg-preview-btn {
      display: inline-flex; align-items: center; gap: 7px;
      padding: 9px 18px;
      background: var(--accent-blue); border: none;
      border-radius: var(--radius-sm);
      font-family: var(--font-display); font-size: 13px; font-weight: 800;
      color: #fff; cursor: pointer; transition: background 0.12s, transform 0.1s;
      letter-spacing: 0.2px;
    }
    .msg-preview-btn:hover  { background: #4752c4; }
    .msg-preview-btn:active { transform: scale(0.98); }

    /* Preview Modal */
    .msg-preview-overlay {
      position: fixed; inset: 0; z-index: 5000;
      background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
      display: none; align-items: center; justify-content: center;
    }
    .msg-preview-modal {
      background: var(--bg-card); border: 2px solid var(--border);
      border-radius: var(--radius-xl); padding: 0;
      width: min(520px, 92vw); max-height: 80vh; overflow-y: auto;
      box-shadow: var(--shadow-lg);
      animation: slideUp 0.25s cubic-bezier(0.34,1.56,0.64,1);
    }
    .msg-preview-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px; border-bottom: 2px solid var(--border);
    }
    .msg-preview-header h3 { font-size: 15px; font-weight: 900; }
    .msg-preview-close {
      width: 28px; height: 28px; border-radius: 6px;
      background: var(--bg-surface); border: 1.5px solid var(--border);
      color: var(--text-muted); font-size: 13px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.12s;
    }
    .msg-preview-close:hover { color: var(--text-primary); border-color: var(--text-muted); }
    .msg-preview-body { padding: 20px; }

    /* Discord embed preview in modal */
    .msg-pv-discord {
      background: #2f3136; border-radius: 8px; padding: 14px; font-size: 14px;
      color: #dcddde; line-height: 1.5;
      font-family: 'gg sans', 'Noto Sans', Helvetica, Arial, sans-serif;
    }
    .msg-pv-embed {
      display: flex; border-radius: 4px; overflow: hidden;
      background: #2f3136; margin-top: 4px;
    }
    .msg-pv-embed-bar {
      width: 4px; flex-shrink: 0; border-radius: 4px 0 0 4px;
    }
    .msg-pv-embed-body {
      padding: 10px 14px; flex: 1; min-width: 0;
    }
    .msg-pv-embed-body .title { font-weight: 700; color: #fff; margin-bottom: 4px; }
    .msg-pv-embed-body .desc { font-size: 13px; color: #b9bbbe; line-height: 1.5; white-space: pre-wrap; }
    .msg-pv-embed-body .footer { font-size: 11px; color: #72767d; margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.06); }
    .msg-pv-ping { color: #7289da; font-weight: 500; }
    .msg-pv-plain { white-space: pre-wrap; }
    /* ─── LOADING ───────────────────────────────────────────────────── */
    .loading-spinner {
      display: inline-block; width: 18px; height: 18px;
      border: 3px solid rgba(255,255,255,0.15);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }

    /* ─── ADMIN BADGE ───────────────────────────────────────────────── */
    .admin-flag {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 10px; border-radius: 99px;
      background: rgba(255,60,60,0.12); border: 2px solid rgba(255,60,60,0.3);
      font-size: 11px; font-weight: 800; color: var(--accent-red);
      letter-spacing: 0.5px; text-transform: uppercase;
    }

    /* ─── WELCOME MESSAGE PREVIEW ───────────────────────────────────── */
    .msg-preview {
      background: var(--bg-surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 14px 16px;
      font-size: 13px; line-height: 1.6;
      color: var(--text-secondary); margin-top: 10px;
      min-height: 70px;
      border-left: 4px solid var(--accent-blue);
    }
    .msg-preview strong { color: var(--text-primary); }

    /* ─── RADIO OPTION ──────────────────────────────────────────────── */
    .radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
    .radio-option {
      display: flex; align-items: center; gap: 8px;
      padding: 10px 16px;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); cursor: pointer;
      font-size: 13px; font-weight: 700; color: var(--text-secondary);
      transition: all 0.15s; user-select: none;
    }
    .radio-option:hover { border-color: var(--text-muted); color: var(--text-primary); }
    .radio-option input { display: none; }
    .radio-option.selected {
      border-color: var(--accent-blue); color: var(--text-primary);
      background: rgba(88,101,242,0.1);
    }
    .radio-option:active { transform: scale(0.96); }

    /* ─── PROGRESS BAR ──────────────────────────────────────────────── */
    .progress-bar {
      height: 8px; background: var(--bg-elevated);
      border-radius: 99px; overflow: hidden; margin-top: 6px;
    }
    .progress-fill {
      height: 100%; border-radius: 99px;
      background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
      transition: width 0.5s ease;
    }

    /* ─── VIEW LOADER OVERLAY ───────────────────────────────────────── */
    #view-loader-overlay {
      display: none;
      position: fixed;
      top: 0; bottom: 0;
      left: 260px; right: 0;         /* sits flush right of the sidebar */
      z-index: 500;
      flex-direction: column;
      align-items: center; justify-content: center; gap: 16px;
      background: var(--bg-base);
    }
    /* Collapsed sidebar */
    #sidebar.collapsed ~ #view-loader-overlay { left: 68px; }
    /* Tablet (769–1024px): sidebar narrows to 220px */
    @media (min-width: 769px) and (max-width: 1024px) {
      #view-loader-overlay { left: 220px; }
    }
    /* Mobile: full overlay (sidebar is off-canvas) */
    @media (max-width: 768px) {
      #view-loader-overlay { left: 0; }
    }
    #view-loader-overlay.vl-visible {
      display: flex;
    }
    #view-loader-overlay .vl-label {
      font-size: 13px; color: var(--text-muted);
    }

    /* ─── KEYFRAMES ─────────────────────────────────────────────────── */
    @keyframes fadeIn     { from { opacity: 0; }                      to { opacity: 1; } }
    @keyframes slideUp    { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
    @keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
    @keyframes slideOutRight { to { opacity: 0; transform: translateX(40px); } }
    @keyframes spin       { to { transform: rotate(360deg); } }
    @keyframes logoFloat  {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      50%      { transform: translateY(-6px) rotate(3deg); }
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0.5; }
    }
    @keyframes shimmer {
      from { background-position: -200% 0; }
      to   { background-position:  200% 0; }
    }
    @keyframes heroSlideUp {
      from { opacity: 0; transform: translateY(22px); }
      to   { opacity: 1; transform: none; }
    }
    @keyframes gradientFlow {
      0%   { background-position: 0% center; }
      50%  { background-position: 100% center; }
      100% { background-position: 0% center; }
    }
    @keyframes glowPulse {
      0%, 100% { opacity: 0.6; transform: scale(1); }
      50%       { opacity: 1;   transform: scale(1.08); }
    }
    @keyframes glowFade {
      0%, 100% { opacity: 0.55; }
      50%       { opacity: 1; }
    }

    /* Skeleton loader */
    .skeleton {
      background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-surface) 50%, var(--bg-elevated) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
      border-radius: var(--radius-sm);
    }

    /* ─── CHARACTER COUNTER ─────────────────────────────────────────── */
    .char-counter-wrap {
      display: flex; align-items: center; gap: 10px;
      margin-top: 8px;
    }
    .char-bar {
      flex: 1; height: 6px; background: var(--bg-elevated);
      border-radius: 99px; overflow: hidden;
    }
    .char-bar-fill {
      height: 100%; border-radius: 99px;
      background: var(--accent-green);
      transition: width 0.2s, background 0.2s;
    }
    .char-bar-fill.warn   { background: var(--accent-yellow); }
    .char-bar-fill.danger { background: var(--accent-red); box-shadow: 0 0 8px rgba(255,60,60,0.5); }
    .char-count-label {
      font-size: 11px; font-weight: 800; font-family: var(--font-mono);
      color: var(--text-muted); white-space: nowrap; transition: color 0.2s;
      min-width: 60px; text-align: right;
    }
    .char-count-label.warn   { color: var(--accent-yellow); }
    .char-count-label.danger { color: var(--accent-red); }
    .char-count-breakdown {
      font-size: 10px; color: var(--text-muted); margin-top: 4px;
      font-family: var(--font-mono); line-height: 1.5;
    }
    .char-count-breakdown span { color: var(--text-secondary); }

    /* ─── PRESET ROWS ───────────────────────────────────────────────── */
    .preset-row {
      display: grid; grid-template-columns: auto 1fr 90px auto;
      gap: 8px; align-items: center;
      padding: 10px 12px;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); margin-bottom: 8px;
      transition: border-color 0.15s;
    }
    .preset-row:last-child { margin-bottom: 0; }
    .preset-row:hover { border-color: var(--text-muted); }
    .preset-row.disabled-row { opacity: 0.45; }
    .preset-drag { color: var(--text-muted); cursor: grab; font-size: 14px; padding: 0 2px; user-select: none; }
    .preset-row input[type="text"] {
      padding: 7px 10px; font-size: 12px; margin: 0;
      background: var(--bg-elevated);
    }
    .preset-row select {
      padding: 7px 28px 7px 8px; font-size: 11px; margin: 0;
      background: var(--bg-elevated);
    }

    /* ─── RANDOM WORD BANKS ─────────────────────────────────────────── */
    .random-bank {
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
      transition: border-color 0.15s;
    }
    .random-bank:last-child { margin-bottom: 0; }
    .random-bank:focus-within { border-color: var(--accent-blue); }
    .random-bank-header {
      display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
    }
    .random-bank-tag {
      font-size: 11px; font-weight: 800; font-family: var(--font-mono);
      background: rgba(88,101,242,0.15); color: var(--accent-blue);
      border: 1.5px solid rgba(88,101,242,0.3);
      padding: 3px 8px; border-radius: 99px; cursor: pointer;
      user-select: none; transition: all 0.15s; flex-shrink: 0;
    }
    .random-bank-tag:hover {
      background: rgba(88,101,242,0.3); transform: scale(1.05);
    }
    .random-bank-tag:active { transform: scale(0.95); }
    .random-bank-label { font-size: 12px; color: var(--text-muted); }
    .random-bank input[type="text"] {
      padding: 7px 10px; font-size: 12px; margin: 0; font-family: var(--font-mono);
    }
    .random-words-preview {
      display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
    }
    .word-chip {
      font-size: 10px; font-weight: 700; padding: 2px 8px;
      background: var(--bg-elevated); border: 1.5px solid var(--border);
      border-radius: 99px; color: var(--text-secondary);
      font-family: var(--font-mono);
    }

    /* ═══════════════════════════════════════════════════════════════════
       DISCORD MENTION AUTOCOMPLETE
    ═══════════════════════════════════════════════════════════════════ */
    .mention-popup {
      position: fixed;
      z-index: 9000;
      background: var(--bg-elevated);
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) inset;
      min-width: 240px; max-width: 340px;
      max-height: 260px; overflow-y: auto;
      overflow-x: hidden;
      animation: mentionSlideIn 0.12s cubic-bezier(0.34,1.4,0.64,1);
      display: none;
    }
    .mention-popup.visible { display: block; }

    @keyframes mentionSlideIn {
      from { opacity: 0; transform: translateY(6px) scale(0.97); }
      to   { opacity: 1; transform: none; }
    }

    .mention-header {
      padding: 6px 12px 5px;
      font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
      text-transform: uppercase; color: var(--text-muted);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 6px;
    }
    .mention-header-icon { font-size: 12px; }

    .mention-item {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 12px; cursor: pointer;
      transition: background 0.08s;
      position: relative;
    }
    .mention-item:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }
    .mention-item:hover,
    .mention-item.active {
      background: rgba(88,101,242,0.18);
    }
    .mention-item.active::before {
      content: '';
      position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
      background: var(--accent-blue); border-radius: 0 2px 2px 0;
    }

    /* Icon badge per mention type */
    .mention-badge {
      width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; font-weight: 800;
    }
    .mention-badge.channel { background: rgba(88,101,242,0.15); color: var(--accent-blue); }
    .mention-badge.user    { border-radius: 50%; background: rgba(67,181,129,0.15); color: var(--accent-green); font-size: 11px; }
    .mention-badge.role    { background: rgba(255,123,0,0.15); color: var(--tier-vip); font-size: 10px; border-radius: 6px; }
    .mention-badge.emoji   { background: rgba(255,214,0,0.12); font-size: 16px; border-radius: 6px; }
    .mention-badge.var     { background: rgba(0,201,167,0.12); color: var(--accent-teal); font-size: 10px; font-family: var(--font-mono); border-radius: 6px; }

    .mention-info { flex: 1; min-width: 0; }
    .mention-name {
      font-size: 13px; font-weight: 700; color: var(--text-primary);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .mention-sub {
      font-size: 10px; color: var(--text-muted); margin-top: 1px;
      font-family: var(--font-mono);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    /* Highlight the typed portion */
    .mention-name mark {
      background: none; color: var(--accent-blue); font-weight: 900;
    }

    .mention-shortcut {
      font-size: 10px; color: var(--text-muted); flex-shrink: 0;
      font-family: var(--font-mono);
    }

    /* "N more — type to filter" footer shown in popup when list is truncated */
    .mention-more {
      padding: 6px 12px; font-size: 10px; color: var(--text-muted);
      text-align: center; font-style: italic;
      border-top: 1px solid rgba(255,255,255,0.06);
      border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    .mention-empty {
      padding: 14px 12px; font-size: 12px; color: var(--text-muted);
      text-align: center; font-style: italic;
    }

    /* Trigger character highlight inside inputs */
    .mention-trigger-hint {
      font-size: 10px; color: var(--text-muted);
      margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap;
    }
    .trigger-chip {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 2px 7px; border-radius: 99px;
      background: var(--bg-elevated); border: 1.5px solid var(--border);
      font-family: var(--font-mono); font-size: 10px; font-weight: 700;
      color: var(--text-secondary);
    }

    /* Mobile: make popup full-width-ish */
    @media (max-width: 768px) {
      .mention-popup { min-width: 200px; max-width: calc(100vw - 32px); }
    }

    /* Mobile top bar (hidden on desktop) */
    #mobile-topbar {
      display: none;
      position: fixed; top: 0; left: 0; right: 0; z-index: 200;
      height: 56px; background: var(--bg-base);
      border-bottom: 2px solid var(--border);
      align-items: center; gap: 12px; padding: 0 16px;
      box-shadow: var(--shadow-sm);
    }
    #mobile-topbar .m-logo {
      width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
      display: flex; align-items: center; justify-content: center; font-size: 17px;
    }
    #mobile-topbar .m-title { font-size: 15px; font-weight: 900; flex: 1; }
    #mobile-topbar .m-title span { color: var(--accent-red); }
    #mobile-topbar .m-server {
      font-size: 11px; color: var(--text-muted); font-family: var(--font-mono);
      max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .mobile-menu-btn {
      width: 36px; height: 36px; border-radius: var(--radius-sm);
      background: var(--bg-surface); border: 2px solid var(--border);
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 4px; cursor: pointer; flex-shrink: 0;
    }
    .mobile-menu-btn span {
      display: block; width: 18px; height: 2px;
      background: var(--text-secondary); border-radius: 2px;
      transition: all 0.2s;
    }
    .mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
    .mobile-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

    /* Sidebar drawer overlay */
    #sidebar-backdrop {
      display: none; position: fixed; inset: 0; z-index: 149;
      background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
    }

    @media (max-width: 768px) {
      /* ── Stop #dashboard creating a stacking context that traps fixed children ── */
      #dashboard {
        position: static !important;
        z-index: auto !important;
        animation: none !important;
        flex-direction: column;
        padding-top: 56px;
      }

      /* Server select screen — no extra padding needed; #dashboard already has padding-top: 56px */
      #server-select-screen { padding-top: 0; }

      /* ── Show the mobile topbar ── */
      #mobile-topbar {
        display: flex !important;
        z-index: 1000;
      }

      /* ── Hide the mobile topbar on the landing page (landing-nav serves as the header) ── */
      body:has(#login-screen:not(.hidden)) #mobile-topbar { display: none !important; }

      /* ── Sidebar: off-canvas drawer ── */
      #sidebar {
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        width: 280px !important; min-width: 280px !important;
        height: 100dvh;
        padding-top: 56px;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1) !important;
        z-index: 999 !important;
        overflow-y: auto;
      }
      #sidebar.mobile-open  { transform: translateX(0) !important; }

      /* ── Backdrop ── */
      #sidebar-backdrop         { z-index: 998; }
      #sidebar-backdrop.visible { display: block; }

      /* ── Hide desktop collapse toggle; use hamburger instead ── */
      .sidebar-toggle { display: none; }

      /* ── Always show full sidebar text inside the drawer ── */
      #sidebar.collapsed .user-info,
      #sidebar.collapsed .tier-badge,
      #sidebar.collapsed .nav-label,
      #sidebar.collapsed .nav-item span:not(.nav-icon),
      #sidebar.collapsed .nav-badge,
      #sidebar.collapsed .upgrade-banner,
      #sidebar.collapsed .btn-logout-text,
      #sidebar.collapsed .btn-dev-toggle-text,
      #sidebar.collapsed .btn-tier-toggle-text,
      #sidebar.collapsed .server-selector-info,
      #sidebar.collapsed .server-chevron,
      #sidebar.collapsed .acct-header-info,
      #sidebar.collapsed .acct-tier-inline,
      #sidebar.collapsed .acct-server-btn,
      #sidebar.collapsed .acct-upgrade-btn {
        opacity: 1 !important; width: auto !important; height: auto !important;
        overflow: visible !important; pointer-events: auto !important; display: flex !important;
      }
      #sidebar.collapsed .acct-profile-card {
        padding: 14px !important; margin-bottom: 10px !important;
        background: linear-gradient(135deg, rgba(88,101,242,0.08), rgba(155,89,182,0.06)) !important;
        border-color: rgba(88,101,242,0.18) !important;
      }
      #sidebar.collapsed .acct-profile-card::before { display: block !important; }
      #sidebar.collapsed .sidebar-nav     { padding: 16px 12px !important; }
      #sidebar.collapsed .nav-item        { justify-content: flex-start !important; padding: 11px 14px !important; gap: 10px !important; }
      #sidebar.collapsed .nav-icon        { width: 20px !important; height: 20px !important; font-size: 16px !important; }
      #sidebar.collapsed .sidebar-footer  { padding: 12px !important; }
      #sidebar.collapsed .btn-logout      { padding: 10px !important; justify-content: center !important; }
      #sidebar.collapsed .server-selector { padding: 10px 12px !important; }
      #sidebar.collapsed .server-selector-btn {
        justify-content: flex-start !important; padding: 9px 12px !important;
        gap: 10px !important; border-color: var(--border) !important;
        background: var(--bg-surface) !important;
      }

      /* ── Main content ── */
      #main-content { padding: 16px 14px 60px; width: 100%; min-width: 0; overflow-x: hidden; }

      /* ── Grids ── */
      .grid-2, .grid-3       { grid-template-columns: 1fr !important; }
      .presence-grid         { grid-template-columns: 1fr 1fr !important; }
      .preset-fields         { grid-template-columns: 1fr !important; }

      /* ── Page header ── */
      .page-header           { flex-direction: column; align-items: flex-start; gap: 10px; }
      .page-header-right     { width: 100%; flex-wrap: wrap; }
      .page-header-left h1   { font-size: 21px; }

      /* ── Cards ── */
      .card                  { padding: 18px 16px; }
      .card-header           { flex-wrap: wrap; gap: 10px; }
      .premium-banner        { margin: -16px -16px 16px; }

      /* ── Save rows ── */
      .save-row              { flex-wrap: wrap; }
      .save-row .btn         { flex: 1; min-width: 120px; justify-content: center; }

      /* ── Toggles: bigger tap targets ── */
      .toggle-row            { padding: 16px 0; gap: 16px; }
      .toggle                { width: 50px; height: 28px; flex-shrink: 0; }
      .toggle-track::after   { width: 20px; height: 20px; }
      .toggle input:checked + .toggle-track::after { transform: translateX(22px); }

      /* ── Inputs & buttons ── */
      input[type="text"], input[type="number"], select, textarea { padding: 12px 14px; font-size: 15px; }
      select                 { padding-right: 40px; }
      .btn                   { padding: 13px 18px; font-size: 14px; }
      .btn-sm                { padding: 10px 14px; font-size: 13px; }

      /* ── Cog status table: show all cols, let wrap handle overflow ── */
      #cog-table                 { min-width: 0 !important; width: 100%; table-layout: auto; }
      #cog-table th,
      #cog-table td              { font-size: 11px !important; padding: 8px 6px !important; white-space: nowrap; }
      #cog-table .cog-col-hide   { display: table-cell; }

      /* ── All table wraps: contain + scroll only when needed ── */
      .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
      }
      .data-table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
      }
      /* Card containing the table must not overflow outside its box */
      .data-table-wrap + * { min-width: 0; }
      .card { overflow: hidden; }

      /* ── Stat cards ── */
      .stat-value            { font-size: 26px; }

      /* ── Random word fields ── */
      .random-word-field     { flex-direction: column; gap: 6px; }
      .var-chip              { margin-top: 0; align-self: flex-start; }

      /* ── Login card ── */
      .login-card            { padding: 36px 28px; }

      /* ── Hide desktop-only badge ── */
      .selected-server-badge { display: none !important; }

      /* ── Admin panel: comprehensive overflow containment ── */
      #view-admin            { min-width: 0; width: 100%; overflow: hidden; }
      #view-admin .grid-2    { grid-template-columns: 1fr !important; min-width: 0; }
      #view-admin .card      { overflow: hidden; min-width: 0; width: 100%; box-sizing: border-box; }
      #view-admin .card *    { max-width: 100%; box-sizing: border-box; }

      /* All inputs inside admin: never wider than card */
      #view-admin input, #view-admin select, #view-admin textarea {
        max-width: 100%; min-width: 0; width: 100%;
      }

      /* Radio group: 2×2 grid */
      .radio-group           { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; }
      .radio-option          { justify-content: center; text-align: center; min-width: 0; }

      /* Server ID + lookup button: stack vertically */
      #tier-server-id-row    { flex-direction: column !important; }
      #tier-server-id-row .btn { width: 100%; justify-content: center; }

      /* DB result + bot log: self-scrolling mono block */
      #db-result, #bot-action-log {
        font-size: 10px !important; overflow-x: auto;
        word-break: break-all; white-space: pre-wrap; width: 100%;
      }

      /* Server list rows: wrap Leave button */
      #server-management-list > div { flex-wrap: wrap; }
      #server-management-list .btn  { width: 100%; margin-top: 4px; }

      /* ── Competition page — mobile overrides ────────────────────── */

      /* Channel + end date/time + emoji row: each field to its own full-width line */
      #view-competition .comp-top-row {
        flex-direction: column !important;
      }
      #view-competition .comp-top-row > .form-group {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
      }

      /* Competition page Date/Time inputs force-wrap correctly */
      #view-competition .eb-schedule-dt-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
      }
      #view-competition .eb-schedule-date-input,
      #view-competition .eb-schedule-time-input {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }

      /* ── Global mobile layout for toggle-row settings ───────────────
         Any toggle-row that contains a select / channel input / role
         input / number input / button stacks into two rows: label fills
         the full width on top, control wraps below and right-aligns. */
      .view .toggle-row:has(select),
      .view .toggle-row:has(.channel-combo-input),
      .view .toggle-row:has(.role-tag-input),
      .view .toggle-row:has(input[type="number"]),
      .view .toggle-row:has(input[type="text"]:not(.pill-tag)),
      .view .toggle-row:has(> .btn),
      .view .toggle-row:has(> div > .btn),
      .view .toggle-row:has(.user-id-input),
      .view .toggle-row:has(.tier-badge) {
        flex-wrap: wrap;
        gap: 10px;
      }
      .view .toggle-row:has(select) > .toggle-info,
      .view .toggle-row:has(.channel-combo-input) > .toggle-info,
      .view .toggle-row:has(.role-tag-input) > .toggle-info,
      .view .toggle-row:has(input[type="number"]) > .toggle-info,
      .view .toggle-row:has(input[type="text"]:not(.pill-tag)) > .toggle-info,
      .view .toggle-row:has(> .btn) > .toggle-info,
      .view .toggle-row:has(> div > .btn) > .toggle-info,
      .view .toggle-row:has(.user-id-input) > .toggle-info,
      .view .toggle-row:has(.tier-badge) > .toggle-info {
        flex: 1 1 100%;
        min-width: 0;
        padding-right: 0;
      }
      /* Right-side control container: sits below on its own line, contents
         right-aligned. Full-width inputs inside still fill; small buttons
         hug the right edge. */
      .view .toggle-row:has(select) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(.channel-combo-input) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(.role-tag-input) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(input[type="number"]) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(input[type="text"]:not(.pill-tag)) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(> .btn) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(> div > .btn) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(.user-id-input) > :not(.toggle-info):not(.toggle),
      .view .toggle-row:has(.tier-badge) > :not(.toggle-info):not(.toggle) {
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 1 !important;
        box-sizing: border-box !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
      }
      /* Wide inputs inside those containers fill to 100% — pure toggles
         and small buttons keep their natural width. */
      .view .toggle-row select,
      .view .toggle-row .channel-combo-input,
      .view .toggle-row .role-tag-input,
      .view .toggle-row .comp-role-input,
      .view .toggle-row .user-id-input,
      .view .toggle-row input[type="number"],
      .view .toggle-row input[type="text"]:not(.pill-tag) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }
      /* Prefixed input pattern (e.g. "$" + novote): when a text input
         shares its wrapper with a sibling prefix span, use flex:1 so it
         fills the remaining space instead of forcing a new line. */
      .view .toggle-row > div:has(> span + input[type="text"]) {
        flex-wrap: nowrap !important;
      }
      .view .toggle-row > div:has(> span + input[type="text"]) > input[type="text"]:not(.pill-tag) {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
      }

      /* Preset bar: select goes full-width, buttons wrap below */
      #comp-preset-bar .card > div:last-child { flex-wrap: wrap; }
      #comp-preset-bar select { width: 100% !important; min-width: 0 !important; }

      /* ── Image picker modals (funny_cmds, competition) ───────────────
         Smaller thumbnails + generous vertical spacing on mobile.
         Inline styles use aspect-ratio which some older mobile engines
         resolve to 0-height — force explicit height so tiles cannot
         collapse and overlap each other. */
      #funny-img-picker-modal > div,
      #comp-img-picker-modal > div {
        width: 94% !important;
        max-width: 94% !important;
        height: 86vh !important;
        max-height: 86vh !important;
      }
      #funny-img-picker-modal .hide-scrollbar,
      #comp-img-picker-modal .comp-picker-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        column-gap: 12px !important;
        row-gap: 20px !important;
        width: 100% !important;
        min-width: 0 !important;
        align-items: start !important;
        grid-auto-rows: 120px !important;
      }
      .funny-picker-img-div,
      .comp-picker-img {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 120px !important;
        aspect-ratio: auto !important;
        box-sizing: border-box !important;
        position: relative !important;
      }
    }


    /* ── Tablet: 769–1024px ── */
    @media (min-width: 769px) and (max-width: 1024px) {
      #sidebar               { width: 220px; min-width: 220px; }
      #main-content          { padding: 24px 24px 60px; }
      .grid-3                { grid-template-columns: 1fr 1fr; }
      .presence-grid         { grid-template-columns: 1fr 1fr; }
    }

    /* ─── TIER DEV TOGGLE BUTTON ────────────────────────────────────── */
    .btn-tier-toggle {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 9px; margin-bottom: 8px;
      border-radius: var(--radius-sm);
      background: rgba(0,201,167,0.07);
      border: 2px dashed rgba(0,201,167,0.35);
      color: var(--accent-teal);
      font-family: var(--font-display); font-size: 12px; font-weight: 800;
      cursor: pointer; transition: all 0.15s; letter-spacing: 0.3px;
    }
    .btn-tier-toggle:hover { background: rgba(0,201,167,0.14); border-color: var(--accent-teal); }
    .btn-tier-toggle:active { transform: scale(0.96); }
    #sidebar.collapsed .btn-tier-toggle { padding: 9px 0; gap: 0; }
    #sidebar.collapsed .btn-tier-toggle-text { display: none; }

    /* ─── PREMIUM GATE ──────────────────────────────────────────────── */
    .premium-gate { position: relative; }

    /* The card itself dims when locked */
    .premium-gate.locked {
      opacity: 0.55;
      pointer-events: none;
      filter: saturate(0.3);
      user-select: none;
    }

    /* A thin amber banner at the top of the card */
    .premium-banner {
      display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
      padding: 9px 14px; margin: -20px -28px 18px;
      background: rgba(255,214,0,0.08);
      border-top: 2px solid rgba(255,214,0,0.2);
      border-bottom: 2px solid rgba(255,214,0,0.2);
      border-radius: 0;
    }
    .premium-banner-icon { font-size: 15px; flex-shrink: 0; }
    .premium-banner-text {
      flex: 1; min-width: 0; font-size: 12px; font-weight: 700;
      color: var(--tier-premium); word-break: break-word;
    }
    .premium-banner a {
      flex-shrink: 0; font-size: 11px; font-weight: 800;
      color: var(--tier-premium); text-decoration: none;
      border: 1.5px solid rgba(255,214,0,0.4);
      padding: 3px 9px; border-radius: 99px;
      transition: all 0.15s; pointer-events: all; white-space: nowrap;
    }
    .premium-banner a:hover { background: rgba(255,214,0,0.15); }
    .premium-gate { position: relative; overflow: hidden; }
    .premium-gate.locked .premium-banner { pointer-events: all; }
    .premium-gate.locked .premium-banner a { pointer-events: all; }

    /* ─── COMPACT STATUS ROW ────────────────────────────────────────── */
    .status-row {
      display: flex; gap: 6px; flex-wrap: wrap;
    }
    .status-pill {
      display: flex; align-items: center; gap: 6px;
      padding: 7px 12px; border-radius: 99px;
      cursor: pointer; font-size: 12px; font-weight: 700;
      background: var(--bg-surface); border: 2px solid var(--border);
      color: var(--text-secondary); transition: all 0.12s; user-select: none;
    }
    .status-pill:hover { border-color: var(--text-muted); color: var(--text-primary); }
    .status-pill.selected { border-color: var(--accent-blue); background: rgba(88,101,242,0.12); color: var(--text-primary); }
    .status-pill:active { transform: scale(0.95); }
    .status-dot-sm { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
    .dot-online  { background: var(--accent-green); box-shadow: 0 0 5px rgba(67,181,129,0.7); }
    .dot-idle    { background: var(--accent-yellow); box-shadow: 0 0 5px rgba(255,214,0,0.7); }
    .dot-dnd     { background: var(--accent-red); box-shadow: 0 0 5px rgba(255,60,60,0.7); }
    .dot-invis   { background: var(--text-muted); }

    /* Preset status select — tiny inline */
    .preset-status-select {
      padding: 5px 22px 5px 8px; font-size: 11px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2372767d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 8px center;
      min-width: 72px;
    }

    /* VIP add-preset button */
    .btn-add-preset {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 9px; margin-top: 8px;
      background: rgba(255,123,0,0.07);
      border: 2px dashed rgba(255,123,0,0.35);
      border-radius: var(--radius-sm);
      color: var(--tier-vip); font-family: var(--font-display);
      font-size: 12px; font-weight: 800; cursor: pointer;
      transition: all 0.15s; user-select: none;
    }
    .btn-add-preset:hover { background: rgba(255,123,0,0.14); border-color: var(--tier-vip); }
    .btn-add-preset:active { transform: scale(0.97); }
    .btn-add-preset:disabled { opacity: 0.4; cursor: not-allowed; }

    /* Word pool validation feedback */
    .rw-pool-meta {
      display: flex; align-items: center; justify-content: space-between;
      margin-top: 3px;
    }
    .rw-pool-count {
      font-size: 9px; font-family: var(--font-mono); color: var(--text-muted);
    }
    .rw-pool-count.warn  { color: var(--accent-yellow); }
    .rw-pool-count.over  { color: var(--accent-red); font-weight: 800; }
    .rotation-options-wrap {
      transition: opacity 0.2s;
    }
    .rotation-options-wrap.dimmed {
      opacity: 0.4;
    }

    /* ─── COMPACT RANDOM WORD POOLS ─────────────────────────────────── */
    .rw-pool-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }
    .rw-pool-item {
      background: var(--bg-surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 7px 10px;
      transition: border-color 0.15s;
    }
    .rw-pool-item:focus-within { border-color: var(--accent-blue); }
    .rw-pool-item-top {
      display: flex; align-items: center; gap: 6px; margin-bottom: 5px;
    }
    .rw-var-chip {
      font-size: 10px; font-weight: 800; font-family: var(--font-mono);
      background: rgba(88,101,242,0.15); color: var(--accent-blue);
      border: 1.5px solid rgba(88,101,242,0.3);
      padding: 2px 6px; border-radius: 99px;
      cursor: pointer; user-select: none; flex-shrink: 0;
      transition: all 0.12s; white-space: nowrap;
    }
    .rw-var-chip:hover { background: rgba(88,101,242,0.28); transform: scale(1.04); }
    .rw-var-chip:active { transform: scale(0.94); }
    .rw-var-chip.copied { background: rgba(67,181,129,0.2) !important; border-color: var(--accent-green) !important; color: var(--accent-green) !important; }
    .rw-pool-label { font-size: 10px; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rw-pool-item input {
      width: 100%; font-size: 11px; padding: 5px 8px;
      font-family: var(--font-mono); background: var(--bg-elevated);
    }
    @media (max-width: 768px) {
      .rw-pool-grid { grid-template-columns: 1fr; }
    }

    /* ─── PRESET ITEMS WITH INLINE CHAR COUNTER ─────────────────────── */
    .preset-item {
      background: var(--bg-surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      margin-bottom: 6px;
      transition: border-color 0.15s;
    }
    .preset-item:last-child { margin-bottom: 0; }
    .preset-item-row {
      display: grid; grid-template-columns: 22px 100px 1fr auto;
      align-items: center; gap: 7px;
    }
    .preset-num {
      width: 22px; height: 22px; border-radius: 6px;
      background: var(--bg-elevated); border: 1.5px solid var(--border);
      display: flex; align-items: center; justify-content: center;
      font-size: 10px; font-weight: 800; color: var(--text-muted); flex-shrink: 0;
    }
    .preset-item select { font-size: 11px; padding: 6px 26px 6px 8px; }
    .preset-item input[type="text"] { font-size: 12px; padding: 6px 10px; }
    .preset-char-row {
      display: flex; align-items: center; gap: 6px;
      margin-top: 5px; padding-left: 29px;
    }
    .preset-char-track {
      flex: 1; height: 3px; background: var(--bg-elevated);
      border-radius: 99px; overflow: hidden;
    }
    .preset-char-fill {
      height: 100%; border-radius: 99px; background: var(--accent-green);
      transition: width 0.15s, background 0.15s;
    }
    .preset-char-fill.warn   { background: var(--accent-yellow); }
    .preset-char-fill.danger { background: var(--accent-red); }
    .preset-char-num {
      font-size: 9px; font-family: var(--font-mono); color: var(--text-muted);
      white-space: nowrap; flex-shrink: 0; min-width: 44px; text-align: right;
    }
    .preset-char-num.warn   { color: var(--accent-yellow); }
    .preset-char-num.danger { color: var(--accent-red); font-weight: 800; }
    @media (max-width: 768px) {
      .preset-item-row { grid-template-columns: 22px 1fr auto; }
      .preset-item-row select { grid-column: 2; }
      .preset-item-row input[type="text"] { grid-column: 1 / -1; margin-top: 4px; }
    }

    /* ─── CHAR COUNTER ──────────────────────────────────────────────── */
    .activity-text-wrap { position: relative; }
    .char-counter-bar {
      display: flex; align-items: center; gap: 10px;
      margin-top: 6px;
    }
    .char-counter-track {
      flex: 1; height: 6px; background: var(--bg-elevated);
      border-radius: 99px; overflow: hidden;
    }
    .char-counter-fill {
      height: 100%; border-radius: 99px;
      background: var(--accent-green);
      transition: width 0.2s ease, background 0.2s ease;
    }
    .char-counter-fill.warn  { background: var(--accent-yellow); }
    .char-counter-fill.over  { background: var(--accent-red); }

    .char-counter-label {
      font-size: 11px; font-family: var(--font-mono);
      color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
      transition: color 0.2s;
    }
    .char-counter-label.warn { color: var(--accent-yellow); }
    .char-counter-label.over { color: var(--accent-red); font-weight: 800; }

    .char-counter-detail {
      font-size: 10px; color: var(--text-muted); margin-top: 4px;
      font-family: var(--font-mono); line-height: 1.5;
    }
    .char-counter-detail .over-word { color: var(--accent-red); font-weight: 700; }

    /* ─── COLOR WHEEL INPUT ─────────────────────────────────────────── */
    .color-wheel-wrap {
      position: relative; width: 42px; height: 42px; flex-shrink: 0;
    }
    .color-wheel-input {
      width: 42px; height: 42px;
      border-radius: 50%; border: 3px solid var(--border);
      cursor: pointer; padding: 0; overflow: hidden;
      background: none; outline: none;
      -webkit-appearance: none; appearance: none;
    }
    .color-wheel-input::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
    .color-wheel-input::-webkit-color-swatch { border: none; border-radius: 50%; }
    .color-wheel-input::-moz-color-swatch { border: none; border-radius: 50%; }

    /* ─── DISCORD EMBED PREVIEW ─────────────────────────────────────── */
    .discord-embed-preview {
      display: flex; border-radius: 6px; overflow: hidden;
      background: #2f3136; border: 1px solid rgba(255,255,255,0.06);
      max-width: 100%;
    }
    .dep-bar  { width: 4px; flex-shrink: 0; }
    .dep-body { padding: 10px 14px 10px 10px; flex: 1; min-width: 0; }
    .dep-author {
      display: flex; align-items: center; gap: 7px; margin-bottom: 6px;
    }
    .dep-author-avatar {
      width: 20px; height: 20px; border-radius: 50%;
      background: linear-gradient(135deg,#ff3c3c,#ff7b00);
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; flex-shrink: 0;
    }
    .dep-author-name { font-size: 13px; font-weight: 700; color: #fff; }
    .dep-description  { font-size: 14px; color: #dcddde; line-height: 1.5; word-break: break-word; }
    .dep-mention {
      background: rgba(88,101,242,0.3); color: #c9cdfb;
      border-radius: 3px; padding: 0 2px;
      font-weight: 500; cursor: default;
    }
    .dep-image { max-width: 100%; border-radius: 4px; margin-top: 10px; display: block; }
    .dep-footer {
      display: flex; align-items: center; gap: 5px;
      font-size: 11px; color: #72767d; margin-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.06); padding-top: 6px;
    }
    .dep-footer-avatar {
      width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
      background: linear-gradient(135deg,#ff3c3c,#ff7b00);
      display: flex; align-items: center; justify-content: center;
      font-size: 8px;
    }

    /* ─── HUG IMAGE GRID ───────────────────────────────────────────── */
    .hug-img-grid {
      display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
    }
    .hug-img-slot {
      border: 2px solid var(--border); border-radius: var(--radius-sm);
      cursor: pointer; overflow: hidden; transition: border-color 0.12s, transform 0.12s;
      text-align: center;
    }
    .hug-img-slot:hover  { border-color: var(--accent-blue); transform: translateY(-1px); }
    .hug-img-slot.selected { border-color: var(--accent-blue); box-shadow: 0 0 0 1px rgba(88,101,242,0.3); }
    .hug-img-thumb {
      width: 100%; aspect-ratio: 1;
      display: flex; align-items: center; justify-content: center;
      font-size: 26px;
    }
    .hug-img-label { font-size: 10px; padding: 4px; background: var(--bg-surface); color: var(--text-muted); }
    .hug-img-label code { font-size: 10px; }
    .slap-img-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
    .slap-img-slot  { border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; overflow: hidden; transition: border-color 0.12s, transform 0.12s; text-align: center; }
    .slap-img-slot:hover { border-color: var(--accent-blue); transform: translateY(-1px); }
    .slap-img-slot.selected { border-color: var(--accent-blue); box-shadow: 0 0 0 1px rgba(88,101,242,0.3); }
    .slap-img-thumb { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 26px; }
    .slap-img-label { font-size: 10px; padding: 4px; background: var(--bg-surface); color: var(--text-muted); }
    .slap-img-label code { font-size: 10px; }

    /* ═══════════════════════════════════════════════════════════════════
       REUSABLE IMAGE LIBRARY BLOCK
    ═══════════════════════════════════════════════════════════════════ */
    .img-lib-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
    .img-lib-slot {
      border: 2px solid var(--border); border-radius: var(--radius-sm);
      cursor: pointer; overflow: hidden; transition: border-color 0.12s, transform 0.12s; text-align: center;
    }
    .img-lib-slot:hover { border-color: var(--accent-blue); transform: translateY(-1px); }
    .img-lib-slot.selected { border-color: var(--accent-blue); box-shadow: 0 0 0 1px rgba(88,101,242,0.3); }
    .img-lib-thumb {
      width: 100%; aspect-ratio: 1;
      display: flex; align-items: center; justify-content: center; font-size: 26px;
    }
    .img-lib-label { font-size: 10px; padding: 4px; background: var(--bg-surface); color: var(--text-muted); }
    .img-lib-label code { font-size: 10px; }
    .img-lib-delete-cat {
      padding: 7px 12px; font-size: 11px; font-weight: 700;
      background: transparent; border: 2px solid rgba(255,60,60,0.3);
      border-radius: var(--radius-sm); color: var(--accent-red);
      cursor: pointer; font-family: var(--font-display); transition: all 0.12s;
      white-space: nowrap; flex-shrink: 0;
    }
    .img-lib-delete-cat:hover { background: rgba(255,60,60,0.1); border-color: var(--accent-red); }

    /* ═══════════════════════════════════════════════════════════════════
       SERVER IMAGES — REDESIGNED PANEL
    ═══════════════════════════════════════════════════════════════════ */
    .simg-layout { padding: 4px 0 12px; }

    /* ─ Category tab pills row ─ */
    .simg-tabs-row {
      display: flex; align-items: center; gap: 10px;
      margin-bottom: 18px; flex-wrap: wrap;
    }
    .simg-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
    .simg-tab {
      padding: 5px 16px; font-size: 12px; font-weight: 700;
      font-family: var(--font-display); line-height: 1.4;
      background: var(--bg-elevated); border: 1.5px solid var(--border);
      border-radius: 99px; color: var(--text-secondary);
      cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s;
      white-space: nowrap;
    }
    .simg-tab:hover { border-color: var(--accent-blue); color: var(--text-primary); }
    .simg-tab.active {
      background: var(--accent-blue); border-color: var(--accent-blue); color: #fff;
    }
    .simg-add-tab {
      background: transparent; border-style: dashed;
      border-color: var(--text-muted); color: var(--text-muted);
    }
    .simg-add-tab:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(88,101,242,0.06); }
    .simg-cat-counter {
      font-size: 11px; font-weight: 700; color: var(--text-secondary);
      font-family: var(--font-mono); white-space: nowrap; cursor: default;
    }
    .simg-cat-counter.maxed { color: var(--accent-red); }
    .simg-cat-limit-note {
      font-size: 10px; font-weight: 700; color: var(--accent-red);
      text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap;
    }

    /* ─ Inline new-category form ─ */
    .simg-tabs-actions { display: flex; align-items: center; gap: 6px; }
    .simg-new-cat-form { display: flex; align-items: center; gap: 5px; }
    .simg-new-cat-input {
      padding: 5px 12px; font-size: 12px; width: 150px;
      background: var(--bg-surface); border: 1.5px solid var(--border);
      border-radius: 99px; color: var(--text-primary); outline: none;
      font-family: var(--font-display);
    }
    .simg-new-cat-input:focus { border-color: var(--accent-blue); }
    .simg-confirm-btn {
      width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
      background: var(--accent-blue); border: none; color: #fff;
      cursor: pointer; font-size: 14px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.12s;
    }
    .simg-confirm-btn:hover { background: #4752c4; }
    .simg-cancel-btn {
      width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
      background: var(--bg-elevated); border: 1.5px solid var(--border);
      color: var(--text-muted); cursor: pointer; font-size: 14px;
      display: flex; align-items: center; justify-content: center;
      transition: border-color 0.12s, color 0.12s;
    }
    .simg-cancel-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }

    /* ─ Stats / actions bar ─ */
    .simg-stats-bar {
      display: flex; align-items: center; justify-content: space-between;
      gap: 14px; margin-bottom: 14px;
    }
    .simg-stats-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
    .simg-stat-label {
      font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap;
    }
    .simg-stat-track {
      flex: 1; height: 4px; background: var(--bg-elevated);
      border-radius: 99px; overflow: hidden; min-width: 40px;
    }
    .simg-stat-fill {
      height: 100%; background: var(--accent-blue); border-radius: 99px; transition: width 0.3s;
    }
    .simg-stat-fill.maxed { background: var(--accent-red); }
    .simg-stat-count {
      font-size: 11px; font-weight: 700; color: var(--text-muted);
      font-family: var(--font-mono); white-space: nowrap; flex-shrink: 0;
    }
    .simg-stat-count.maxed { color: var(--accent-red); }
    .simg-del-cat-btn {
      display: flex; align-items: center; gap: 5px;
      padding: 5px 12px; font-size: 11px; font-weight: 700;
      background: transparent; border: 1.5px solid rgba(255,60,60,0.3);
      border-radius: 99px; color: var(--accent-red); cursor: pointer;
      transition: all 0.12s; white-space: nowrap; font-family: var(--font-display);
      flex-shrink: 0;
    }
    .simg-del-cat-btn:hover { background: rgba(255,60,60,0.1); border-color: var(--accent-red); }

    /* ─ Image grid ─ */
    .simg-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 10px; margin-bottom: 14px;
    }
    .simg-thumb {
      position: relative; aspect-ratio: 1; overflow: hidden;
      border-radius: var(--radius-sm); background: var(--bg-elevated);
      border: 2px solid var(--border); transition: border-color 0.12s;
    }
    .simg-thumb:hover { border-color: var(--accent-blue); }
    .simg-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .simg-thumb.simg-thumb-broken .simg-thumb-img { display: none; }
    .simg-thumb-overlay {
      position: absolute; inset: 0;
      background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 55%, transparent 100%);
      opacity: 0; transition: opacity 0.15s;
      display: flex; align-items: flex-end; padding: 7px;
    }
    .simg-thumb:hover .simg-thumb-overlay { opacity: 1; }
    .simg-thumb-tag {
      font-size: 10px; font-family: var(--font-mono); color: #fff;
      background: rgba(0,0,0,0.55); padding: 2px 6px; border-radius: 5px;
    }
    .simg-del-img-btn {
      position: absolute; top: 6px; right: 6px;
      background: rgba(0,0,0,0.65); border: 1.5px solid rgba(255,255,255,0.15);
      border-radius: 50%; width: 22px; height: 22px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; color: #fff; padding: 0; transition: background 0.12s, border-color 0.12s;
    }
    .simg-del-img-btn:hover { background: var(--accent-red); border-color: var(--accent-red); }

    /* ─ Upload progress ─ */
    .simg-upload-progress {
      margin-bottom: 12px; padding: 10px 12px;
      background: var(--bg-elevated); border-radius: var(--radius-sm);
      display: flex; flex-direction: column; gap: 7px;
    }
    .simg-upload-progress-bar {
      height: 3px; border-radius: 99px;
      background: var(--bg-surface); overflow: hidden; position: relative;
    }
    .simg-upload-progress-bar::after {
      content: ''; position: absolute; top: 0; bottom: 0;
      width: 40%; background: var(--accent-blue); border-radius: 99px;
      animation: simg-scan 1.2s ease-in-out infinite;
    }
    @keyframes simg-scan {
      0%   { left: -40%; }
      100% { left: 100%; }
    }
    .simg-upload-progress-label {
      font-size: 11px; font-weight: 700; color: var(--text-muted);
    }

    /* ─ Upload tile ─ */
    .simg-upload-tile {
      aspect-ratio: 1; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 6px;
      border: 2px dashed var(--border); border-radius: var(--radius-sm);
      color: var(--text-muted); font-size: 11px; font-weight: 700;
      cursor: pointer; transition: all 0.15s; font-family: var(--font-display);
    }
    .simg-upload-tile:hover {
      border-color: var(--accent-blue); color: var(--accent-blue);
      background: rgba(88,101,242,0.06);
    }

    /* ─ Empty states ─ */
    .simg-grid-empty {
      grid-column: 1 / -1;
      display: flex; flex-direction: column; align-items: center; gap: 8px;
      padding: 28px 16px; color: var(--text-muted); font-size: 13px; text-align: center;
    }
    .simg-empty-cats {
      display: flex; flex-direction: column; align-items: center;
      gap: 10px; padding: 44px 20px; color: var(--text-muted); text-align: center;
    }
    .simg-empty-icon { font-size: 36px; line-height: 1; }
    .simg-empty-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); }
    .simg-empty-sub { font-size: 12px; max-width: 300px; line-height: 1.6; }
    .simg-empty-sub strong { color: var(--text-primary); }

    /* ─ Placeholder hints ─ */
    .simg-hints {
      font-size: 11px; color: var(--text-muted); line-height: 1.9;
    }
    .simg-hints code { font-family: var(--font-mono); font-size: 10px; }

    /* Compact toggle row (Entertainment menus) */
    .compact-toggle-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 5px 4px; border-radius: 6px;
    }
    .compact-toggle-row:hover { background: var(--bg-surface); }
    .compact-toggle-label {
      font-size: 13px; font-weight: 600; color: var(--text-primary);
    }

    /* ─── DISCORD COLOR PICKER ──────────────────────────────────────── */
    .cp-row {
      display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
      position: relative;
    }
    .cp-wheel-btn {
      width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
      background: var(--bg-surface); border: 2px solid var(--border);
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: border-color 0.12s, background 0.12s;
    }
    .cp-wheel-btn:hover { border-color: var(--accent-blue); background: var(--bg-elevated); }
    .cp-swatches {
      display: flex; gap: 5px; flex-wrap: nowrap;
      padding: 3px 0;
      overflow: visible;
    }
    .cp-swatch {
      width: 20px; height: 20px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
      border: 2px solid transparent; transition: transform 0.1s, border-color 0.1s;
    }
    .cp-swatch:hover  { transform: scale(1.15); border-color: rgba(255,255,255,0.4); }
    .cp-swatch.active { border-color: #fff; transform: scale(1.1); }

    /* Floating popup — positioned above the row */
    .cp-popup {
      display: none;
      position: absolute; bottom: calc(100% + 8px); left: 0;
      padding: 12px 12px; width: 320px;
      background: #1e2124; border: 2px solid rgba(255,255,255,0.12);
      border-radius: 12px; z-index: 200;
      box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    }
    .cp-popup.cp-disabled { opacity: 0.45; pointer-events: none; }
    .cp-wrap { position: relative; }
    .cp-section-label {
      font-size: 10px; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
    }
    /* Popup swatches — all 10 in one row with breathing room */
    .cp-popup .cp-swatches {
      display: grid; grid-template-columns: repeat(10, 20px);
      gap: 5px; padding: 3px 0; overflow: visible;
    }
    .cp-popup .cp-swatch { width: 20px; height: 20px; }

    /* Canvas */
    .cp-canvas {
      width: 100%; height: 150px; border-radius: 6px; cursor: crosshair;
      display: block; margin-bottom: 8px; border: 1px solid rgba(255,255,255,0.08);
    }

    /* Hue slider */
    .cp-hue-slider {
      width: 100%; height: 12px; border-radius: 6px; cursor: pointer;
      margin-bottom: 8px; outline: none; border: none;
      background: linear-gradient(to right,#ff0000,#ffff00,#00ff00,#00ffff,#0000ff,#ff00ff,#ff0000);
      -webkit-appearance: none; appearance: none;
    }
    .cp-hue-slider::-webkit-slider-thumb {
      -webkit-appearance: none; width: 14px; height: 14px;
      border-radius: 50%; background: #fff;
      border: 2px solid rgba(0,0,0,0.4); cursor: pointer;
    }

    /* Inputs row — tight fields, all digits visible */
    .cp-inputs-row {
      display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 5px;
    }
    .cp-input-group { display: flex; flex-direction: column; gap: 2px; }
    .cp-hex-input, .cp-rgb-input {
      background: #111214; border: 1px solid rgba(255,255,255,0.15);
      border-radius: 6px; padding: 2px 4px; color: #fff;
      font-family: var(--font-mono); font-size: 11px; font-weight: 600;
      width: 100%; box-sizing: border-box; text-align: center;
      min-width: 0; appearance: none; -webkit-appearance: none;
      line-height: 1; height: auto;
    }
    .cp-hex-input:focus, .cp-rgb-input:focus { outline: none; border-color: var(--accent-blue); }
    .cp-input-label {
      font-size: 9px; color: var(--text-muted); text-align: center;
      font-weight: 700; text-transform: uppercase;
    }
    .cp-apply-row {
      display: flex; align-items: center; gap: 8px; margin-top: 10px;
      padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08);
    }
    .cp-live-color {
      width: 36px; height: 36px; border-radius: 6px; border: 2px solid rgba(255,255,255,0.15);
      flex-shrink: 0;
    }
    .cp-apply-btn {
      flex: 1; padding: 8px 16px; font-size: 12px; font-weight: 800;
      font-family: var(--font-display); border-radius: var(--radius-sm);
      background: var(--accent-blue); color: #fff; border: none; cursor: pointer;
      transition: background 0.12s;
    }
    .cp-apply-btn:hover { background: #4752c4; }

    /* ─── DISCORD COLOR PICKER END ──────────────────────────────────── */
    /* ─── ROLE TAG FIELD ─────────────────────────────────────────────── */
    /* Wrapper used when inline pills live inside the field (embed builder etc.) */
    .role-tag-field {
      position: relative;
      display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
      padding: 4px 8px;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); cursor: text;
      transition: border-color 0.12s;
    }
    .role-tag-field:focus-within { border-color: var(--accent-blue); }
    /* Single-input role selector (no wrapper border needed — input has its own) */
    .comp-role-input {
      display: block; width: 100%; box-sizing: border-box;
      padding: 7px 10px; font-size: 13px;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); color: var(--text-primary);
      font-family: var(--font-display); outline: none;
      transition: border-color 0.12s;
    }
    .comp-role-input:focus { border-color: var(--accent-blue); }
    .comp-role-input:disabled { opacity: 0.5; cursor: not-allowed; }
    .comp-role-input::placeholder { color: var(--text-muted); }
    .role-tag-list { display: contents; }
    .role-tag {
      display: inline-flex; align-items: center; gap: 4px;
      background: rgba(88,101,242,0.18); border: 1.5px solid rgba(88,101,242,0.4);
      border-radius: 99px; padding: 1px 7px 1px 5px;
      font-size: 12px; font-weight: 700; color: #c9cdfb;
      white-space: nowrap; line-height: 1.5;
    }
    .role-tag-remove {
      cursor: pointer; color: rgba(201,205,251,0.6);
      font-size: 13px; line-height: 1; margin-left: 1px;
      transition: color 0.1s;
    }
    .role-tag-remove:hover { color: #fff; }
    .role-tag-input {
      flex: 1; min-width: 80px; background: none; border: none;
      outline: none; color: var(--text-primary); font-family: var(--font-display);
      font-size: 13px; padding: 2px 0; line-height: 1.4;
    }
    .role-tag-input::placeholder { color: var(--text-muted); }
    .role-tag-dropdown {
      display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
      background: var(--bg-elevated); border: 2px solid var(--border);
      border-radius: var(--radius-sm); z-index: 60;
      max-height: 160px; overflow-y: auto;
    }
    .role-tag-option {
      padding: 8px 12px; cursor: pointer;
      font-size: 13px; font-weight: 600; color: var(--text-primary);
      display: flex; align-items: center; gap: 6px;
    }
    .role-tag-option:hover { background: var(--bg-surface); }
    .role-tag-at { color: var(--accent-blue); font-weight: 800; }

    /* ─── CHANNEL COMBOBOX ───────────────────────────────────────────── */
    .channel-combo-input {
      max-width: 400px; width: 100%;
      padding: 7px 10px; font-size: 13px;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); color: var(--text-primary);
      font-family: var(--font-display); outline: none;
      transition: border-color 0.12s;
    }
    .channel-combo-input:focus { border-color: var(--accent-blue); }
    .channel-combo-input:disabled { opacity: 0.5; cursor: not-allowed; }

    /* ─── PILL INPUT ROW ─────────────────────────────────────────────── */
    .pill-input-row {
      display: flex; align-items: center; gap: 8px;
      max-width: 400px;
    }
    .pill-input-row .role-tag-input {
      flex: 1; max-width: none;
      padding: 7px 10px; font-size: 13px;
      background: var(--bg-surface); border: 2px solid var(--border);
      border-radius: var(--radius-sm); outline: none;
      transition: border-color 0.12s;
    }
    .pill-input-row .role-tag-input:focus { border-color: var(--accent-blue); }

    /* ─── PILL TAGS (channels + roles) ──────────────────────────────── */
    .pill-list {
      display: flex; flex-wrap: wrap; gap: 5px;
      margin-top: 6px; min-height: 0;
    }
    .pill-tag {
      display: inline-flex; align-items: center; gap: 4px;
      border-radius: 99px; padding: 2px 8px 2px 6px;
      font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.5;
    }
    .channel-pill {
      background: rgba(88,101,242,0.15); border: 1.5px solid rgba(88,101,242,0.35);
      color: #a5b4fc;
    }
    .role-pill {
      background: rgba(255,123,0,0.12); border: 1.5px solid rgba(255,123,0,0.3);
      color: #ffb86c;
    }
    .pill-remove {
      cursor: pointer; background: none; border: none; padding: 0;
      font-size: 14px; line-height: 1; margin-left: 1px;
      color: rgba(255,255,255,0.4); transition: color 0.1s;
    }
    .pill-remove:hover { color: #fff; }

    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20%       { transform: translateX(-6px); }
      40%       { transform: translateX(6px); }
      60%       { transform: translateX(-4px); }
      80%       { transform: translateX(4px); }
    }
    .shake { animation: shake 0.4s ease; }

    /* ─── UNSAVED CHANGES ────────────────────────────────────────────── */
    .view-save-btn {
      opacity: 0.5;
      filter: grayscale(100%);
      pointer-events: none;
      transition: all 0.25s ease;
    }
    .view-save-btn.is-dirty {
      opacity: 1;
      filter: none;
      pointer-events: auto;
      box-shadow: 0 0 16px rgba(88,101,242,0.4);
    }
    
    .unsaved-bar {
      position: fixed;
      bottom: 20px;
      left: calc(260px + (100% - 260px) / 2); /* centered in main content */
      transform: translate(-50%, 150%);
      background: var(--bg-card);
      border: 2px solid var(--accent-blue);
      border-radius: var(--radius-lg);
      padding: 12px 20px;
      box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 24px rgba(88,101,242,0.15);
      z-index: 1000;
      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .unsaved-bar.visible {
      transform: translate(-50%, 0);
    }
    .unsaved-bar-content {
      display: flex;
      align-items: center;
      gap: 20px;
    }
    .unsaved-bar-text {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .unsaved-bar-actions {
      display: flex;
      gap: 10px;
    }
    .unsaved-bar-actions .btn {
      padding: 8px 16px;
      font-size: 13px;
    }

    @media (max-width: 768px) {
      .unsaved-bar {
        left: 50%;
        bottom: 10px;
        width: calc(100% - 20px);
        padding: 12px;
      }
      .unsaved-bar-content {
        flex-direction: column;
        gap: 12px;
        width: 100%;
      }
      .unsaved-bar-actions {
        width: 100%;
      }
      .unsaved-bar-actions .btn {
        flex: 1;
      }
    }

.unsaved-bar.success { border-color: var(--accent-green); box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 24px rgba(48,209,88,0.15); } .unsaved-bar.success .unsaved-bar-text { color: var(--accent-green); }

/* ═══════════════════════════════════════════════════════════════════
   EMBED BUILDER
═══════════════════════════════════════════════════════════════════ */
.eb-section {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.eb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.eb-section-header:hover { background: var(--bg-elevated); }
.eb-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.eb-section-arrow {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.eb-section.open .eb-section-arrow { transform: rotate(90deg); }
.eb-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.eb-section.open .eb-section-body {
  max-height: 900px;
  overflow: visible;
}
.eb-section-inner { padding: 10px 12px; }

/* Field rows */
.eb-field-row {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}
.eb-field-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255,60,60,0.1);
  border: 1px solid rgba(255,60,60,0.2);
  color: var(--accent-red);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.eb-field-remove:hover {
  background: rgba(255,60,60,0.2);
  border-color: var(--accent-red);
}

/* Add field button */
.eb-add-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
.eb-add-field:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(88,101,242,0.05);
}

/* Live preview panel */
.eb-preview-wrap {
  background: #36393f;
  border-radius: var(--radius-md);
  padding: 16px;
}
.eb-pv-msg-row { display: flex; gap: 12px; }
.eb-pv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.eb-pv-body { flex: 1; min-width: 0; }
.eb-pv-username { font-size: 14px; font-weight: 700; color: #fff; }
.eb-pv-timestamp { font-size: 11px; color: #72767d; margin-left: 6px; }
.eb-pv-content {
  font-size: 14px;
  color: #dcddde;
  line-height: 1.5;
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.eb-pv-embed {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  max-width: 520px;
  margin-top: 4px;
  background: #2f3136;
}
.eb-pv-embed-bar { width: 4px; flex-shrink: 0; }
.eb-pv-embed-inner {
  padding: 10px 14px 10px 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 16px;
}
.eb-pv-embed-content { flex: 1; min-width: 0; }

.eb-pv-author { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.eb-pv-author-icon { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.eb-pv-author-name { font-size: 12px; font-weight: 600; color: #fff; }
.eb-pv-title { font-size: 14px; font-weight: 700; color: #00aff4; margin-bottom: 4px; }
.eb-pv-title a { color: #00aff4; text-decoration: none; }
.eb-pv-title a:hover { text-decoration: underline; }
.eb-pv-desc { font-size: 13px; color: #dcddde; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.eb-pv-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.eb-pv-field { min-width: 0; }
.eb-pv-field.full { grid-column: 1 / -1; }
.eb-pv-field-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 1px; }
.eb-pv-field-value { font-size: 13px; color: #dcddde; line-height: 1.35; }
.eb-pv-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.eb-pv-image { max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 8px; object-fit: contain; }
.eb-pv-footer { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: #72767d; }
.eb-pv-footer-icon { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.eb-pv-empty { color: #72767d; font-size: 13px; text-align: center; padding: 20px 0; }
/* Mention pills inside preview */
.eb-pv-mention {
  display: inline;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 500;
  cursor: default;
  white-space: nowrap;
}
.eb-pv-channel {
  background: rgba(88, 101, 242, 0.15);
  color: #dee0fc;
}
.eb-pv-role {
  /* color and background set inline via role color */
  background: rgba(88, 101, 242, 0.15);
  color: #dee0fc;
}

/* Send status message */
.eb-status-msg { border-radius: var(--radius-sm); }
.eb-status-success { background: rgba(67,181,129,0.1); color: var(--accent-green); border: 1px solid rgba(67,181,129,0.25); }
.eb-status-error   { background: rgba(255,60,60,0.08); color: var(--accent-red);   border: 1px solid rgba(255,60,60,0.2);   }
.eb-status-info    { background: rgba(88,101,242,0.08); color: var(--accent-blue);  border: 1px solid rgba(88,101,242,0.2);  }
.eb-status-warn    { background: rgba(255,166,0,0.08);  color: var(--accent-orange);border: 1px solid rgba(255,166,0,0.2);  }


/* ── Embed Builder — Schedule date/time inputs ───────────────────────── */
.eb-schedule-dt-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.eb-schedule-date-input,
.eb-schedule-time-input {
  flex: 1;
  background: var(--input-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.eb-schedule-date-input:focus,
.eb-schedule-time-input:focus {
  border-color: var(--accent-blue);
}
/* Override browser colour-scheme for dark inputs */
.eb-schedule-date-input,
.eb-schedule-time-input {
  color-scheme: dark;
}

/* ── Embed Builder — Scheduled Messages card ─────────────────────────── */
.eb-scheduled-job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.eb-scheduled-job:last-child {
  border-bottom: none;
}
.eb-scheduled-job-no-divider {
  border-bottom: none;
}
.eb-scheduled-job-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.eb-scheduled-job-time {
  font-size: 13px;
  color: var(--text-primary);
}
.eb-scheduled-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eb-scheduled-ch {
  color: var(--accent-blue);
  font-weight: 600;
}
.eb-scheduled-countdown {
  font-size: 12px;
  color: var(--accent-blue);
  font-weight: 600;
}
.eb-sched-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.eb-preview-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(88, 101, 242, 0.12);
  color: var(--accent-blue);
  white-space: nowrap;
  transition: background 0.15s;
}
.eb-preview-btn:hover {
  background: rgba(88, 101, 242, 0.22);
}
.eb-cancel-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(255, 60, 60, 0.12);
  color: var(--accent-red);
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.eb-cancel-btn:hover {
  background: rgba(255, 60, 60, 0.22);
}
/* Completed jobs section */
.eb-completed-section {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.eb-completed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.eb-completed-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.eb-clear-completed-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.eb-clear-completed-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.eb-scheduled-job.is-done {
  opacity: 0.65;
}
.eb-completed-status {
  font-size: 12px;
  font-weight: 600;
}
.eb-completed-status.ok { color: #57f287; }
.eb-completed-status.err { color: var(--accent-red); }
/* Scheduled job preview modal */
.et-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.et-modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  max-width: 580px;
  width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.et-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.et-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.et-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 3px;
  transition: color 0.12s, background 0.12s;
}
.et-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.et-modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: #36393f;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
/* Embed Builder — Preset bar */
.eb-preset-bar {
  margin-bottom: 8px;
}
.eb-preset-tier-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.eb-preset-tier-free {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.eb-preset-tier-premium {
  background: rgba(255, 185, 0, 0.15);
  color: #ffb900;
}
.eb-preset-tier-vip {
  background: rgba(88, 101, 242, 0.2);
  color: var(--accent-blue);
}
.eb-preset-tier-friend {
  background: rgba(87, 242, 135, 0.15);
  color: #57f287;
}
#eb-preset-select, #comp-preset-select {
  flex: 1;
  min-width: 140px;
  max-width: 260px;
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  background: var(--bg-card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2372767d' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
#eb-preset-select:hover, #comp-preset-select:hover {
  border-color: #5a5e65;
}
#eb-preset-select:focus, #comp-preset-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}
#eb-preset-select option, #comp-preset-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.eb-preset-fill-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.eb-preset-fill-btn:hover {
  background: #4752c4;
}
.eb-preset-delete-btn {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(237, 66, 69, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(237, 66, 69, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.eb-preset-delete-btn:hover {
  background: rgba(237, 66, 69, 0.25);
  border-color: rgba(237, 66, 69, 0.45);
}
.eb-save-preset-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.eb-save-preset-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
.eb-save-preset-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ══ ROBLOX AUTH VIEW ═══════════════════════════════════════════════════════ */

/* ── Hero (unlinked) ──────────────────────────────────────── */
.ra-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #1a0a0a 0%, #2d1010 50%, #1a1a2e 100%);
  border: 1.5px solid rgba(255,51,51,.25);
  margin-bottom: 16px;
}
.ra-hero-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 320px; height: 200px;
  background: radial-gradient(ellipse, rgba(255,51,51,.35) 0%, transparent 70%);
  pointer-events: none;
}
.ra-hero-inner {
  position: relative; display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 52px 32px 44px;
}
.ra-hero-logo {
  margin-bottom: 20px;
  filter: drop-shadow(0 0 16px rgba(255,51,51,.6));
  animation: ra-pulse 3s ease-in-out infinite;
}
@keyframes ra-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255,51,51,.5)); }
  50%       { filter: drop-shadow(0 0 24px rgba(255,51,51,.9)); }
}
.ra-hero-title {
  font-size: 22px; font-weight: 900; color: #fff;
  margin: 0 0 10px; letter-spacing: -0.4px;
}
.ra-hero-sub {
  font-size: 13px; color: rgba(255,255,255,.55); max-width: 380px;
  line-height: 1.7; margin: 0 0 28px;
}
.ra-connect-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 800; letter-spacing: 0.2px;
  background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,51,51,.4);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: var(--font-display);
}
.ra-connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,51,51,.55);
}
.ra-connect-btn:active { transform: translateY(0); }
.ra-connect-btn:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }
.ra-hero-note {
  margin-top: 12px; font-size: 11px; color: rgba(255,255,255,.3);
}

/* Steps row */
.ra-steps-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 20px 4px 8px; flex-wrap: wrap;
}
.ra-step {
  flex: 1; min-width: 140px; display: flex; align-items: flex-start;
  gap: 10px; padding: 14px 16px; background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: 10px;
}
.ra-step-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,51,51,.15); border: 1.5px solid rgba(255,51,51,.4);
  color: #ff6666; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.ra-step-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.ra-step-text strong { color: var(--text-primary); }
.ra-step-arrow {
  color: var(--text-muted); font-size: 18px;
  padding-top: 18px; flex-shrink: 0;
}

/* ── Account selector tabs ──────────────────────────────────── */
.ra-account-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.ra-account-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.5); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); transition: all 0.15s;
}
.ra-account-tab:hover {
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
}
.ra-account-tab.active {
  background: rgba(255,51,51,.15); border-color: rgba(255,51,51,.45);
  color: #fff;
}
.ra-tab-avatar {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid rgba(255,255,255,.2); flex-shrink: 0;
}
.ra-tab-avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,51,51,.2); color: rgba(255,255,255,.7);
  font-size: 11px; font-weight: 900;
}

/* ── Add Account button — matches ra-reauth-btn style ───────── */
.ra-add-account-btn {
  font-size: 12px; font-weight: 700; padding: 8px 16px;
  border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7); transition: all 0.15s;
  font-family: var(--font-display);
}
.ra-add-account-btn:hover {
  background: rgba(255,255,255,.15); color: #fff;
  border-color: rgba(255,255,255,.3);
}

/* ── Multi-account note ─────────────────────────────────────── */
.ra-multi-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 16px; border-radius: 10px; margin-bottom: 14px;
  background: rgba(88,101,242,.1); border: 1px solid rgba(88,101,242,.25);
  font-size: 12px; color: rgba(255,255,255,.6); line-height: 1.5;
}
.ra-multi-note-icon {
  flex-shrink: 0; font-size: 14px; color: #5865f2;
  font-style: normal; margin-top: 1px;
}

/* ── Profile hero (linked) ──────────────────────────────────── */
.ra-profile-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1.5px solid rgba(255,51,51,.2); margin-bottom: 16px;
}
.ra-profile-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a0a0a 0%, #2d1010 60%, #1a1a2e 100%);
}
.ra-profile-hero-content {
  position: relative; display: flex; align-items: center;
  gap: 20px; padding: 24px 28px; flex-wrap: wrap;
}

/* Avatar */
.ra-avatar-wrap { position: relative; flex-shrink: 0; }
.ra-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 3px solid rgba(255,51,51,.5);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4);
  box-shadow: 0 0 20px rgba(255,51,51,.3);
}
.ra-avatar-badge {
  position: absolute; bottom: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #43b581; color: #fff;
  font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #1a0a0a;
}

/* Profile text */
.ra-profile-info { flex: 1; min-width: 0; }
.ra-username {
  font-size: 20px; font-weight: 900; color: #fff;
  margin-bottom: 2px; letter-spacing: -0.3px;
}
.ra-display-name { font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 8px; }
.ra-verified-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(67,181,129,.15); border: 1px solid rgba(67,181,129,.3);
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; color: #43b581; font-weight: 600;
}
.ra-verified-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #43b581;
  animation: ra-dot-pulse 2s ease-in-out infinite;
}
@keyframes ra-dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Action buttons */
.ra-profile-btns { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.ra-reauth-btn {
  font-size: 12px; font-weight: 700; padding: 8px 16px;
  border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7); transition: all 0.15s;
  font-family: var(--font-display);
}
.ra-reauth-btn:hover {
  background: rgba(255,255,255,.15); color: #fff;
  border-color: rgba(255,255,255,.3);
}
.ra-revoke-btn {
  font-size: 12px; font-weight: 700; padding: 8px 16px;
  border-radius: 8px; cursor: pointer;
  background: transparent; border: 1.5px solid rgba(237,66,69,.5);
  color: #ed4245; transition: all 0.15s;
  font-family: var(--font-display);
}
.ra-revoke-btn:hover { background: rgba(237,66,69,.12); border-color: #ed4245; }

/* ── Guild card ──────────────────────────────────────────────── */
.ra-guilds-card {
  position: relative; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #1a0a0a 0%, #2d1010 60%, #1a1a2e 100%);
  border: 1.5px solid rgba(255,51,51,.2);
  padding: 22px 24px 20px;
  margin-top: 0;
}

.ra-guilds-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.ra-guilds-card-title-wrap { display: flex; align-items: center; gap: 12px; }
.ra-guilds-card-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,51,51,.15); border: 1.5px solid rgba(255,51,51,.3);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ra-guilds-card-title { font-size: 15px; font-weight: 800; color: #fff; }
.ra-guilds-card-sub   { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 2px; }

.ra-save-btn {
  font-size: 12px; font-weight: 800; padding: 8px 20px; flex-shrink: 0;
  border-radius: 8px; border: none; cursor: not-allowed; font-family: var(--font-display);
  background: rgba(88,101,242,.3); color: rgba(255,255,255,.35);
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  pointer-events: none;
}
.ra-save-btn.ra-save-btn--dirty {
  background: var(--accent-blue); color: #fff;
  opacity: 1; cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 14px rgba(88,101,242,.45);
}
.ra-save-btn.ra-save-btn--dirty:hover {
  box-shadow: 0 4px 20px rgba(88,101,242,.6);
  transform: translateY(-1px);
}

.ra-guilds-list { display: flex; flex-direction: column; gap: 6px; }

.ra-guild-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.06);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.ra-guild-row:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); }
.ra-guild-row--checked {
  background: rgba(88,101,242,.1);
  border-color: rgba(88,101,242,.4);
}
.ra-guild-cb { display: none; }

.ra-guild-icon { width: 38px; height: 38px; flex-shrink: 0; }
.ra-guild-icon-img {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; display: block;
}
.ra-guild-icon-abbr {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.ra-guild-name { flex: 1; font-size: 13px; color: rgba(255,255,255,.85); font-weight: 600; }

/* Custom toggle */
.ra-guild-toggle {
  width: 38px; height: 22px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.12);
  position: relative; transition: background 0.22s, border-color 0.22s;
}
.ra-guild-toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,.35);
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), background 0.22s;
}
.ra-guild-row--checked .ra-guild-toggle {
  background: rgba(88,101,242,.6); border-color: var(--accent-blue);
}
.ra-guild-row--checked .ra-guild-toggle-knob {
  transform: translateX(16px); background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.ra-no-guilds { font-size: 13px; color: rgba(255,255,255,.35); padding: 20px 0; text-align: center; }

/* Taken by another account — greyed out, non-interactive */
.ra-guild-row--taken {
  opacity: 0.45; cursor: not-allowed !important; pointer-events: auto;
  border-color: rgba(255,255,255,.06) !important;
}
.ra-guild-row--taken:hover { background: rgba(255,255,255,.04) !important; }
.ra-guild-row--taken input[type="checkbox"] { cursor: not-allowed; }
.ra-guild-taken-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  color: rgba(255,255,255,.4); background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12); border-radius: 6px;
  padding: 2px 8px; white-space: nowrap;
}

/* ── Require Roblox Auth — role pill ─────────────────────────────────────── */
.rra-role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 20px;
  background: rgba(var(--role-color, 88 101 242) / 0.15);
  border: 1.5px solid color-mix(in srgb, var(--role-color, #5865f2) 40%, transparent);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap;
}
.rra-role-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.rra-role-pill-x {
  background: none; border: none; cursor: pointer; padding: 0; margin-left: 2px;
  font-size: 14px; line-height: 1; color: rgba(255,255,255,.35);
  transition: color 0.1s;
}
.rra-role-pill-x:hover { color: #fff; }

/* ── Roblox Auth — mobile profile card ───────────────────────────────────── */
@media (max-width: 600px) {
  .ra-profile-hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 14px;
  }

  .ra-profile-info {
    width: 100%;
  }

  .ra-verified-pill {
    display: inline-flex;
    white-space: normal;
    word-break: break-word;
    justify-content: center;
  }

  .ra-profile-btns {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }

  .ra-reauth-btn,
  .ra-revoke-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}
