/* ==========================================================================
   Botify Hosting — design system
   Dark graphite + brand gold. Logical properties everywhere so Arabic (RTL)
   needs no duplicated rules.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Sora:wght@500;600;700;800&family=Tajawal:wght@400;500;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;

  --bg-0: #06070a;
  --bg-1: #0a0c11;
  --bg-2: #101319;
  --bg-3: #171b23;
  --bg-4: #1f242e;
  --surface-glass: rgba(16, 19, 25, 0.72);

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --line-brand: rgba(242, 176, 30, 0.32);

  --brand: #f2b01e;
  --brand-bright: #ffd35b;
  --brand-deep: #c8890a;
  --brand-soft: rgba(242, 176, 30, 0.12);
  --brand-glow: rgba(242, 176, 30, 0.35);

  --success: #3ddc97;
  --success-soft: rgba(61, 220, 151, 0.12);
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, 0.12);
  --warn: #ffb020;
  --info: #58a6ff;
  --info-soft: rgba(88, 166, 255, 0.12);
  --discord: #5865f2;

  --ink: #f6f8fb;
  --muted: #9aa3b2;
  --dim: #69717f;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 18px 45px rgba(242, 176, 30, 0.18);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 160ms var(--ease);
  --normal: 280ms var(--ease);
  --slow: 520ms var(--ease);

  --container: 1200px;
  --nav-h: 72px;
  --font-ui: 'Inter', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Tajawal', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg-0: #f7f8fa;
  --bg-1: #ffffff;
  --bg-2: #fcfcfd;
  --bg-3: #f1f3f7;
  --bg-4: #e5e9ef;
  --surface-glass: rgba(251, 252, 254, 0.86);
  --line: rgba(24, 36, 54, 0.085);
  --line-strong: rgba(24, 36, 54, 0.15);
  --line-brand: rgba(168, 113, 0, 0.3);
  --brand: #a87100;
  --brand-bright: #e0a51a;
  --brand-deep: #825600;
  --brand-soft: rgba(168, 113, 0, 0.09);
  --brand-glow: rgba(168, 113, 0, 0.22);
  --success: #16845a;
  --success-soft: rgba(22, 132, 90, 0.1);
  --danger: #c93b3b;
  --danger-soft: rgba(201, 59, 59, 0.09);
  --warn: #a86a00;
  --info: #2563b8;
  --ink: #16202e;
  --muted: #4d5a6b;
  --dim: #718096;
  --shadow-sm: 0 2px 8px rgba(24, 36, 54, 0.06);
  --shadow: 0 12px 30px rgba(24, 36, 54, 0.09);
  --shadow-lg: 0 24px 60px rgba(24, 36, 54, 0.13);
  --shadow-brand: 0 18px 45px rgba(168, 113, 0, 0.14);
}

/* Light mode keeps the same structure but lowers the contrast of every surface,
   so long sessions stay comfortable and nothing turns into a white glare. */
html[data-theme='light'] body {
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(224, 165, 26, 0.08), transparent 62%),
    radial-gradient(900px 540px at 100% 0%, rgba(37, 99, 184, 0.06), transparent 60%),
    var(--bg-0);
}
html[data-theme='light'] .card {
  background: linear-gradient(180deg, #ffffff, #fbfbfd);
  box-shadow: var(--shadow-sm);
}
html[data-theme='light'] .topbar.scrolled {
  box-shadow: 0 10px 30px rgba(24, 36, 54, 0.08);
}
html[data-theme='light'] .mock-window { box-shadow: inset 0 -70px 120px -80px rgba(168, 113, 0, 0.35); }
html[data-theme='light'] .mock-chip {
  background: rgba(255, 255, 255, 0.95); color: var(--ink); border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(24, 36, 54, 0.14);
}
html[data-theme='light'] .mock-title { color: #8a94a6; }
html[data-theme='light'] .plan-tag.alt {
  background: linear-gradient(135deg, #f3f5f9, #e7ebf2); color: var(--ink);
  border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(24, 36, 54, 0.1);
}
html[data-theme='light'] .console-shell {
  background: linear-gradient(180deg, #fbfcfe, #f3f5f9);
  box-shadow: 0 18px 44px rgba(24, 36, 54, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme='light'] .console,
html[data-theme='light'] .console .l-info { color: #243143; }
html[data-theme='light'] .console .l-warn { color: #956000; }
html[data-theme='light'] .console .l-error { color: #b52f2f; }
html[data-theme='light'] .console .l-success { color: #0f7a4c; }
html[data-theme='light'] .console .l-debug { color: #7a8699; }
html[data-theme='light'] .console .ts { color: #8390a3; }
html[data-theme='light'] .console mark { background: rgba(224, 165, 26, 0.28); color: #5a3b00; }
html[data-theme='light'] .console::-webkit-scrollbar-thumb { background: #d3dae4; border-color: #f3f5f9; }
html[data-theme='light'] .console::-webkit-scrollbar-thumb:hover { background: #bcc6d4; }
html[data-theme='light'] .log-line .lv { background: #c9d2de; }
html[data-theme='light'] .log-line:hover { background: rgba(24, 36, 54, 0.04); }
html[data-theme='light'] .diag-evidence code { background: #f3f5f9; color: #3c4a5e; }
html[data-theme='light'] .diag-raw-list { background: #f6f7fa; }
html[data-theme='light'] .diag-raw-line { color: #a83232; }
html[data-theme='light'] .diag-raw-list::-webkit-scrollbar-thumb { background: #d3dae4; }
html[data-theme='light'] .rank-badge.rank-silver { border-color: rgba(96, 112, 132, 0.4); color: #5c6a7d; background: rgba(96, 112, 132, 0.1); }
html[data-theme='light'] .rank-badge.rank-gold { border-color: rgba(168, 113, 0, 0.4); color: #8a5d00; background: rgba(168, 113, 0, 0.1); }
html[data-theme='light'] .rank-badge.rank-platinum { border-color: rgba(37, 99, 184, 0.35); color: #24589f; background: rgba(37, 99, 184, 0.09); }
html[data-theme='light'] .rank-badge.rank-diamond { border-color: rgba(14, 116, 144, 0.35); color: #0d6c86; background: rgba(14, 116, 144, 0.09); }
html[data-theme='light'] .rank-badge.rank-legend { border-color: rgba(190, 46, 92, 0.35); color: #b02a55; background: rgba(190, 46, 92, 0.09); }
html[data-theme='light'] ::-webkit-scrollbar-thumb { background: #d5dbe4; }
html[data-theme='light'] ::-webkit-scrollbar-thumb:hover { background: #bcc5d1; }
html[data-theme='light'] .modal-backdrop { background: rgba(33, 43, 58, 0.34); }
html[data-theme='light'] .side-scrim { background: rgba(33, 43, 58, 0.38); }
html[data-theme='light'] .li-divider { background: rgba(24, 36, 54, 0.08); }
html[data-theme='light'] .lvl-chip.lvl-error.on { color: #b52f2f; border-color: rgba(201, 59, 59, 0.42); }
html[data-theme='light'] .lvl-chip.lvl-warn.on { color: #956000; }
html[data-theme='light'] .lvl-chip.lvl-success.on { color: #0f7a4c; }
html[data-theme='light'] .btn-attention { color: #b52f2f; border-color: rgba(201, 59, 59, 0.45); }
html[data-theme='light'] .ctx-item.danger:hover { color: #b52f2f; }
html[data-theme='light'] .toast.success i { color: #0f7a4c; }
html[data-theme='light'] .toast.error i { color: #b52f2f; }


/* ---- reset --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
/* Author display rules (.btn, .tab-pane.active, .side-link…) would otherwise beat the
   UA [hidden] rule, so hidden permissions/nav items must be forced off explicitly. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[lang='ar'] body { font-family: var(--font-ar); letter-spacing: 0; }

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.18; font-weight: 800; letter-spacing: -0.025em; }
html[lang='ar'] h1, html[lang='ar'] h2, html[lang='ar'] h3, html[lang='ar'] h4 { line-height: 1.45; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

::selection { background: var(--brand); color: #14100a; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2b313d; background-clip: padding-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; inset-block-start: -60px; inset-inline-start: 16px; z-index: 200;
  background: var(--brand); color: #14100a; padding: 10px 18px; border-radius: 0 0 12px 12px;
  font-weight: 700; transition: inset-block-start var(--fast);
}
.skip-link:focus { inset-block-start: 0; }

/* ---- layout -------------------------------------------------------------------- */
.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - 40px, 1400px); margin-inline: auto; }
.section { padding-block: var(--sp-9); position: relative; }
.section-tight { padding-block: var(--sp-8); }
.stack > * + * { margin-block-start: var(--sp-4); }
.center { text-align: center; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
/* Component display rules win over the UA's [hidden] rule, so restore it globally. */
[hidden] { display: none !important; }
.grid { display: grid; gap: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.spacer { flex: 1; }

.section-head { max-width: 680px; margin-inline: auto; text-align: center; margin-block-end: var(--sp-7); }
.section-head.left { margin-inline: 0; text-align: start; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--line-brand);
  padding: 6px 14px; border-radius: var(--radius-pill); margin-block-end: var(--sp-4);
}
html[lang='ar'] .kicker { letter-spacing: 0; text-transform: none; }
.section-title { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; }
.section-sub { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); margin-block-start: var(--sp-3); }

/* ---- background decor ---------------------------------------------------------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ''; position: absolute; width: 60vw; height: 60vw; border-radius: 50%; filter: blur(120px); opacity: 0.4;
}
.aurora::before { background: radial-gradient(circle, rgba(242, 176, 30, 0.5), transparent 65%); inset-block-start: -25vw; inset-inline-start: -10vw; animation: drift 26s var(--ease) infinite alternate; }
.aurora::after { background: radial-gradient(circle, rgba(88, 166, 255, 0.28), transparent 65%); inset-block-end: -30vw; inset-inline-end: -15vw; animation: drift 32s var(--ease) infinite alternate-reverse; }
html[data-theme='light'] .aurora::before, html[data-theme='light'] .aurora::after { opacity: 0.2; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 8vh, 0) scale(1.18); }
}

.grid-lines {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

/* ---- top bar ------------------------------------------------------------------- */
.topbar {
  position: sticky; inset-block-start: 0; z-index: 90;
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-block-end: 1px solid transparent;
  transition: border-color var(--normal), background var(--normal), box-shadow var(--normal);
}
.topbar.scrolled { border-block-end-color: var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.topbar-inner { height: var(--nav-h); display: flex; align-items: center; gap: var(--sp-5); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  overflow: hidden; line-height: 0;
  border: 1px solid var(--line-brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 0, 0, 0.45);
  background: linear-gradient(145deg, #1b1e26, #0a0c11);
}
.brand-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
html[data-theme='light'] .brand-mark {
  background: linear-gradient(145deg, #fff8e8, #f6e7c2);
  box-shadow: 0 6px 16px rgba(168, 113, 0, 0.16);
}
.brand-text small { display: block; font-size: 10px; font-weight: 600; color: var(--dim); letter-spacing: 0.22em; text-transform: uppercase; }
html[lang='ar'] .brand-text small { letter-spacing: 0; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-inline-start: var(--sp-3); }
.nav-links a {
  padding: 9px 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14.5px;
  transition: color var(--fast), background var(--fast);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-3); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-2); margin-inline-start: auto; }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); }

@media (max-width: 960px) {
  .nav-links {
    position: fixed; inset-block-start: var(--nav-h); inset-inline: 0; flex-direction: column; align-items: stretch;
    gap: 2px; padding: var(--sp-4); margin: 0; background: var(--bg-1); border-block-end: 1px solid var(--line);
    box-shadow: var(--shadow-lg); transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform var(--normal), opacity var(--normal);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 14px 16px; font-size: 16px; }
  .nav-toggle { display: grid; place-items: center; }
}

/* ---- buttons -------------------------------------------------------------------
   A bevelled "pressed metal" look: layered gradients, an inner light edge, a soft
   drop shadow and a diagonal sheen that only travels on hover. Each variant just
   swaps the custom properties, so every button in the site upgrades at once. */
.btn {
  --btn-bg: var(--bg-3); --btn-fg: var(--ink); --btn-bd: var(--line);
  --btn-sheen: rgba(255, 255, 255, 0.24);
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.18);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 21px; border-radius: 14px; font-weight: 800; font-size: 14.5px; line-height: 1.2;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  box-shadow: var(--btn-shadow);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease),
              border-color 180ms var(--ease), color 180ms var(--ease), opacity 180ms var(--ease);
  white-space: nowrap; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
.btn::before {
  content: ''; position: absolute; inset-block: -25%; inset-inline-start: -65%; width: 45%; z-index: -1;
  background: linear-gradient(100deg, transparent, var(--btn-sheen), transparent);
  transform: skewX(-18deg); opacity: 0; pointer-events: none;
  transition: inset-inline-start 0.7s var(--ease), opacity 0.2s ease;
}
.btn:hover::before { inset-inline-start: 120%; opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.985); transition-duration: 70ms; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn[disabled], .btn.loading { pointer-events: none; opacity: 0.55; transform: none; }
.btn[disabled]::before, .btn.loading::before { display: none; }
.btn.loading::after {
  content: ''; width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-block-start-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary {
  --btn-bg: linear-gradient(160deg, #8a6f28 0%, #7a6123 46%, #6a5320 100%);
  --btn-fg: #f6e9c8; --btn-bd: rgba(242, 176, 30, 0.34);
  --btn-sheen: rgba(255, 255, 255, 0.14);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 10px -6px rgba(0, 0, 0, 0.5);
}
.btn-primary:hover {
  --btn-bg: linear-gradient(160deg, #96792d 0%, #856926 46%, #73591f 100%);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 5px 14px -8px rgba(0, 0, 0, 0.55);
}

.btn-secondary {
  --btn-bg: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  --btn-bd: var(--line-strong);
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.16);
}
.btn-secondary:hover {
  --btn-bg: linear-gradient(180deg, var(--bg-4), var(--bg-4));
  --btn-bd: var(--line-brand);
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 10px 24px -14px rgba(0, 0, 0, 0.6);
}
.btn-ghost {
  --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--muted);
  --btn-shadow: none; --btn-sheen: rgba(255, 255, 255, 0.14);
}
.btn-ghost:hover { --btn-bg: var(--bg-3); --btn-bd: var(--line); --btn-fg: var(--ink); }
.btn-outline {
  --btn-bg:
    linear-gradient(180deg, var(--bg-2), var(--bg-1)) padding-box,
    linear-gradient(140deg, var(--line-strong), var(--line) 48%, var(--line-strong)) border-box;
  --btn-bd: transparent;
  --btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}
.btn-outline:hover {
  --btn-fg: var(--brand);
  --btn-bg:
    linear-gradient(180deg, var(--brand-soft), var(--brand-soft)) padding-box,
    linear-gradient(140deg, var(--brand-bright), var(--brand) 55%, var(--brand-deep)) border-box;
  --btn-shadow: 0 0 0 3px rgba(242, 176, 30, 0.10), 0 12px 26px -16px rgba(242, 176, 30, 0.8);
}
.btn-danger {
  --btn-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(255, 92, 92, 0.17), rgba(255, 92, 92, 0.10));
  --btn-fg: var(--danger); --btn-bd: rgba(255, 92, 92, 0.34);
  --btn-sheen: rgba(255, 255, 255, 0.22);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px -4px rgba(255, 92, 92, 0.3);
}
.btn-danger:hover {
  --btn-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 55%),
    linear-gradient(180deg, rgba(255, 92, 92, 0.24), rgba(255, 92, 92, 0.15));
  --btn-bd: rgba(255, 92, 92, 0.6);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 26px -14px rgba(255, 92, 92, 0.7);
}
.btn-discord {
  --btn-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), transparent 48%),
    linear-gradient(160deg, #7a84ff, var(--discord) 48%, #4450d8);
  --btn-fg: #fff; --btn-bd: rgba(150, 158, 255, 0.5);
  --btn-sheen: rgba(255, 255, 255, 0.44);
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 6px rgba(20, 25, 80, 0.4),
    0 12px 28px -12px rgba(88, 101, 242, 0.85);
}
.btn-discord:hover {
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -2px 6px rgba(20, 25, 80, 0.4),
    0 18px 36px -12px rgba(88, 101, 242, 0.95);
}
.btn-lg { padding: 16px 30px; font-size: 16px; border-radius: 16px; gap: 11px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; gap: 7px; }
.btn-block { width: 100%; }
.btn-icon { padding: 11px; aspect-ratio: 1; gap: 0; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
  transition: color var(--fast), border-color var(--fast), background var(--fast), transform var(--fast);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--bg-3); transform: translateY(-1px); }

/* ---- language switcher --------------------------------------------------------- */
[data-lang-switcher] { position: relative; }
[data-theme-toggle] { position: relative; }
.theme-btn { width: auto; padding-inline: 10px; gap: 6px; display: inline-flex; align-items: center; justify-content: center; transition: color var(--fast), border-color var(--fast), background var(--fast), transform var(--fast); }
.theme-btn[aria-expanded='true'] { color: var(--brand); border-color: var(--line-brand); background: var(--brand-soft); }
.theme-caret { font-size: 9px; opacity: 0.6; transition: transform var(--fast); }
.theme-btn[aria-expanded='true'] .theme-caret { transform: rotate(180deg); }
.theme-menu { min-width: 190px; }
.theme-option > i:first-child { width: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.theme-option.active > i:first-child { color: var(--brand); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; color: var(--muted);
  font-size: 13.5px; font-weight: 600; transition: border-color var(--fast), color var(--fast);
}
.lang-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.lang-flag { display: inline-flex; line-height: 0; }
.lang-flag-img { display: block; width: 22px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28); }
.lang-current { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.lang-caret { font-size: 10px; opacity: 0.65; transition: transform var(--fast); }
.lang-btn[aria-expanded='true'] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 120;
  min-width: 196px; padding: 6px; background: var(--bg-1); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none; transform-origin: top;
  transition: opacity var(--fast), transform var(--fast);
}
html[dir='rtl'] .lang-menu { inset-inline-end: auto; inset-inline-start: 0; }
.lang-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
/* When the control sits near the bottom of the viewport the menu flips above it. */
.lang-menu.drop-up {
  inset-block-start: auto; inset-block-end: calc(100% + 8px);
  transform: translateY(6px) scale(0.98); transform-origin: bottom;
  overscroll-behavior: contain;
}
.lang-menu.drop-up.open { transform: translateY(0) scale(1); }

.lang-option {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 600; transition: background var(--fast), color var(--fast);
}
.lang-option:hover { background: var(--bg-3); color: var(--ink); }
.lang-option.active { color: var(--brand); background: var(--brand-soft); }
.lang-tick { margin-inline-start: auto; opacity: 0; font-size: 12px; }
.lang-option.active .lang-tick { opacity: 1; }

/* ---- cards / surfaces ---------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-6);
  position: relative; overflow: hidden;
}
.card-flat { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); }
.hover-card { transition: transform var(--normal), border-color var(--normal), box-shadow var(--normal); }
.hover-card:hover { transform: translateY(-6px); border-color: var(--line-brand); box-shadow: var(--shadow); }

/* ---- badges / chips ------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
}
.badge-brand { background: var(--brand-soft); border-color: var(--line-brand); color: var(--brand); }
.badge-success { background: var(--success-soft); border-color: rgba(61, 220, 151, 0.3); color: var(--success); }
.badge-danger { background: var(--danger-soft); border-color: rgba(255, 92, 92, 0.3); color: var(--danger); }
.badge-info { background: var(--info-soft); border-color: rgba(88, 166, 255, 0.3); color: var(--info); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.status-dot.on { background: var(--success); animation: pulse 2s infinite; }
.status-dot.pending { background: var(--warn); animation: pulse 1.4s infinite; }
.status-dot.off { background: var(--danger); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25); }
  70% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.points-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(242, 176, 30, 0.16), rgba(242, 176, 30, 0.06));
  border: 1px solid var(--line-brand); color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums;
}
.points-pill i { font-size: 13px; }

/* ---- hero ---------------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(64px, 11vh, 130px) clamp(56px, 8vh, 96px); overflow: hidden; }
.hero.has-banner { isolation: isolate; }
.hero.has-banner::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--hero-banner) center / cover no-repeat; opacity: .3;
}
.hero.has-banner::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--bg-0) 0%, transparent 35%, var(--bg-0) 100%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--sp-8); align-items: center; }
@media (max-width: 1040px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-title { font-size: clamp(38px, 6.4vw, 70px); font-weight: 900; letter-spacing: -0.04em; line-height: 1.04; }
html[lang='ar'] .hero-title { line-height: 1.3; letter-spacing: 0; }
.hero-title .accent {
  background: linear-gradient(105deg, var(--brand-bright), var(--brand) 55%, #ff9d3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title .line { display: block; }
.hero-sub { color: var(--muted); font-size: clamp(16px, 1.9vw, 19px); max-width: 560px; margin-block: var(--sp-5); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.hero-note { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13.5px; }
.hero-note i { color: var(--success); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay='1'] { transition-delay: 90ms; }
.reveal[data-delay='2'] { transition-delay: 180ms; }
.reveal[data-delay='3'] { transition-delay: 270ms; }
.reveal[data-delay='4'] { transition-delay: 360ms; }

/* ---- hero visual (terminal mock) ----------------------------------------------- */
.mock {
  position: relative; border-radius: var(--radius-xl); padding: 14px;
  background: linear-gradient(160deg, rgba(242, 176, 30, 0.16), rgba(255, 255, 255, 0.04) 40%, transparent);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
  animation: float 9s var(--ease) infinite alternate;
}
html[dir='rtl'] .mock { transform: perspective(1400px) rotateY(7deg) rotateX(3deg); }
@keyframes float { from { translate: 0 0; } to { translate: 0 -16px; } }
.mock-window { background: #08090d; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: inset 0 -70px 120px -80px rgba(242, 176, 30, 0.28); }
.mock-bar { display: flex; align-items: center; gap: 10px; padding: 15px 18px; background: #0d0f14; border-block-end: 1px solid var(--line); }
.mock-dot { width: 13px; height: 13px; border-radius: 50%; background: #2a2f3a; }
.mock-dot.r { background: #ff5f57; } .mock-dot.y { background: #febc2e; } .mock-dot.g { background: #28c840; }
.mock-title { margin-inline-start: 8px; font-size: 13px; color: var(--dim); font-family: var(--font-mono); }
.mock-body {
  padding: clamp(18px, 2.4vw, 28px); font-family: var(--font-mono); font-size: clamp(13px, 1.15vw, 15.5px);
  line-height: 2.1; min-height: 330px; direction: ltr; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.mock-line { color: #c3ccd9; white-space: pre-wrap; word-break: break-word; }
.mock-line .t { color: #576070; }
.mock-line .ok { color: var(--success); }
.mock-line .warn { color: var(--warn); }
.mock-line .info { color: var(--info); }
.mock-line .brand { color: var(--brand); }
.caret::after { content: '▋'; color: var(--brand); animation: blink 1.1s steps(2, start) infinite; margin-inline-start: 2px; }
@keyframes blink { to { visibility: hidden; } }

.mock-chip {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: rgba(10, 12, 17, 0.92); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; backdrop-filter: blur(8px);
}
.mock-chip.top { inset-block-start: -18px; inset-inline-end: -14px; animation: float 7s var(--ease) infinite alternate-reverse; }
.mock-chip.bottom { inset-block-end: -18px; inset-inline-start: -10px; animation: float 8s var(--ease) infinite alternate; }
.mock-chip i { color: var(--brand); font-size: 15px; }

/* ---- stats --------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-4); }
.stat { text-align: center; padding: var(--sp-5) var(--sp-4); border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-1); }
.stat-value { font-size: clamp(26px, 3.4vw, 38px); font-weight: 900; letter-spacing: -0.03em; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---- marquee ------------------------------------------------------------------- */
.marquee { overflow: hidden; position: relative; padding-block: var(--sp-5); border-block: 1px solid var(--line); background: var(--bg-1); }
.marquee::before, .marquee::after { content: ''; position: absolute; inset-block: 0; width: 120px; z-index: 2; pointer-events: none; }
.marquee::before { inset-inline-start: 0; background: linear-gradient(90deg, var(--bg-1), transparent); }
.marquee::after { inset-inline-end: 0; background: linear-gradient(-90deg, var(--bg-1), transparent); }
.marquee-track { display: flex; gap: var(--sp-7); width: max-content; animation: scroll 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 10px; color: var(--dim); font-weight: 700; font-size: 15px; white-space: nowrap; }
.marquee-item i { font-size: 20px; }
@keyframes scroll { to { transform: translateX(-50%); } }
html[dir='rtl'] .marquee-track { animation-name: scroll-rtl; }
@keyframes scroll-rtl { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ---- feature grid -------------------------------------------------------------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-5); }
.feature {
  padding: var(--sp-6); border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  transition: transform var(--normal), border-color var(--normal);
}
.feature:hover { transform: translateY(-6px); border-color: var(--line-brand); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 19px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--line-brand); margin-block-end: var(--sp-4);
}
.feature h3 { font-size: 18px; margin-block-end: 8px; }
.feature p { color: var(--muted); font-size: 14.5px; }

/* ---- steps --------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-5); }
.step { position: relative; padding: var(--sp-6); border-radius: var(--radius-lg); border: 1px dashed var(--line-strong); background: var(--bg-1); }
.step-num {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand-deep)); color: #17120a; margin-block-end: var(--sp-4);
}
.step h3 { font-size: 17px; margin-block-end: 6px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* ---- pricing ------------------------------------------------------------------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--sp-5); align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-5); border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line);
  transition: transform var(--normal), border-color var(--normal), box-shadow var(--normal);
}
.plan:hover { transform: translateY(-8px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.plan.featured {
  border-color: var(--line-brand);
  background: linear-gradient(180deg, rgba(242, 176, 30, 0.09), var(--bg-1) 45%);
  box-shadow: var(--shadow-brand);
}
.plan-tag {
  position: absolute; inset-block-start: -13px; inset-inline: 0; margin-inline: auto; width: max-content;
  padding: 5px 14px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand-deep)); color: #17120a;
  box-shadow: 0 6px 18px rgba(242, 176, 30, 0.35);
}
.plan-name { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; }
.plan-name .plan-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); font-size: 15px; }
.plan.featured .plan-icon { background: var(--brand-soft); border-color: var(--line-brand); color: var(--brand); }
.plan-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan-price .amount { font-size: 40px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.plan-price .unit { color: var(--muted); font-weight: 700; font-size: 14px; }
.plan-price .free { font-size: 30px; }
.plan-price .from { width: 100%; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
html[lang='ar'] .plan-price .from { text-transform: none; letter-spacing: 0; }
.plan-tag.alt {
  background: linear-gradient(135deg, #333a47, #1b1f27); color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
/* Each tier paints itself with the colour the store sends, so Silver reads silver and
   Platinum reads blue instead of four identical gold cards. */
.plan { --plan-accent: var(--brand); }
.plan.featured {
  border-color: color-mix(in srgb, var(--plan-accent) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--plan-accent) 11%, transparent), var(--bg-1) 45%);
  box-shadow: 0 18px 45px color-mix(in srgb, var(--plan-accent) 22%, transparent);
}
.plan.featured .plan-icon {
  background: color-mix(in srgb, var(--plan-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--plan-accent) 42%, transparent); color: var(--plan-accent);
}
.plan.featured .plan-tag {
  background: linear-gradient(135deg, var(--plan-accent), color-mix(in srgb, var(--plan-accent) 55%, #05070b));
  color: #17120a; box-shadow: 0 6px 18px color-mix(in srgb, var(--plan-accent) 35%, transparent);
}
.plan.featured .plan-price .amount { color: var(--plan-accent); }
.plan-list { display: flex; flex-direction: column; gap: 11px; font-size: 14.5px; color: var(--muted); }
.plan-list li { display: flex; align-items: flex-start; gap: 10px; }
.plan-row { display: flex; align-items: flex-start; gap: 10px; }
.plan-row i { color: var(--brand); margin-block-start: 4px; font-size: 13px; flex: none; }
.plan-list i { color: var(--success); margin-block-start: 4px; font-size: 13px; }
.plan .btn { margin-block-start: auto; }
.plan-current { text-align: center; color: var(--brand); font-weight: 800; font-size: 13.5px; padding: 10px; border: 1px dashed var(--line-brand); border-radius: var(--radius-sm); }
.plan-short { margin-block-start: 8px; text-align: center; color: var(--dim); font-size: 12.5px; }

/* ---- points band --------------------------------------------------------------- */
.points-band {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-7); align-items: center;
  padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-xl);
  background: radial-gradient(120% 140% at 0% 0%, rgba(242, 176, 30, 0.16), transparent 55%), var(--bg-1);
  border: 1px solid var(--line-brand); overflow: hidden; position: relative;
}
@media (max-width: 900px) { .points-band { grid-template-columns: 1fr; } }
.points-visual { position: relative; display: grid; place-items: center; min-height: 260px; }
.coin {
  width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; font-size: 46px; color: #17120a;
  background: conic-gradient(from 210deg, #ffd35b, #f2b01e, #a8720a, #ffd35b);
  box-shadow: 0 24px 60px rgba(242, 176, 30, 0.35), inset 0 -8px 20px rgba(0, 0, 0, 0.28);
  animation: coin 6s var(--ease) infinite;
}
@keyframes coin { 0%, 100% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-14px); } }
.coin-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--line-brand); animation: spin 26s linear infinite; }
.coin-ring.two { inset: 34px; animation-duration: 18s; animation-direction: reverse; }
.rule-list { display: flex; flex-direction: column; gap: var(--sp-3); margin-block: var(--sp-5); }
.rule-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.rule-list i { color: var(--brand); margin-block-start: 4px; }

/* ---- faq ----------------------------------------------------------------------- */
.faq { max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.faq details { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--sp-5); transition: border-color var(--fast), background var(--fast); }
.faq details[open] { border-color: var(--line-brand); background: var(--bg-2); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding-block: 20px; font-weight: 700; font-size: 16.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { color: var(--brand); transition: transform var(--normal); font-size: 14px; }
.faq details[open] summary i { transform: rotate(180deg); }
.faq-answer { padding-block: 16px 20px; color: var(--muted); font-size: 15px; border-block-start: 1px solid var(--line); }

/* ---- cta band ------------------------------------------------------------------ */
.cta-band {
  text-align: center; padding: clamp(36px, 7vw, 72px) var(--sp-5); border-radius: var(--radius-xl);
  background: radial-gradient(90% 130% at 50% 0%, rgba(242, 176, 30, 0.18), transparent 60%), var(--bg-1);
  border: 1px solid var(--line-brand); position: relative; overflow: hidden;
}
.cta-band h2 { font-size: clamp(26px, 4vw, 40px); margin-block-end: var(--sp-3); }
.cta-band p { color: var(--muted); max-width: 520px; margin-inline: auto; margin-block-end: var(--sp-5); }

/* ---- footer -------------------------------------------------------------------- */
.footer { border-block-start: 1px solid var(--line); background: var(--bg-1); padding-block: var(--sp-8) var(--sp-5); margin-block-start: var(--sp-9); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(120px, 1fr)); gap: var(--sp-6); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin-block-end: var(--sp-4); }
html[lang='ar'] .footer h4 { text-transform: none; letter-spacing: 0; }
.footer-col a { display: block; color: var(--muted); padding-block: 6px; font-size: 14.5px; transition: color var(--fast); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; justify-content: space-between;
  margin-block-start: var(--sp-7); padding-block-start: var(--sp-5); border-block-start: 1px solid var(--line);
  color: var(--dim); font-size: 13.5px;
}
/* Store signature in the footer: a gradient bolt, the brand name and one distinctive line.
   Also carries the Discord invite, because every Discord button on the site opens /discord. */
.footer-sign { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.footer-sign:hover { text-decoration: none; }
.footer-sign-mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 12px;
  color: #14100a; font-size: 16px;
  background: linear-gradient(140deg, var(--brand-bright), var(--brand) 55%, var(--brand-deep));
  box-shadow: 0 10px 24px -12px var(--brand-glow);
}
.footer-sign-copy { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; min-width: 0; }
.footer-sign-copy b { color: var(--ink); font-size: 14.5px; letter-spacing: 0.01em; }
.footer-sign-copy i {
  font-style: normal; font-size: 12px; font-weight: 600;
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme='light'] .footer-sign-copy i { background: linear-gradient(90deg, var(--brand), var(--brand-deep)); -webkit-background-clip: text; background-clip: text; }
.footer-meta { gap: var(--sp-3); }
.footer-discord {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2);
  color: var(--muted); font-size: 13px; font-weight: 600;
  transition: color var(--fast), border-color var(--fast), background var(--fast), transform var(--fast);
}
.footer-discord:hover { color: var(--ink); border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); text-decoration: none; }
.footer-discord i { color: var(--brand); font-size: 14px; }
@media (max-width: 640px) {
  .footer-bottom { align-items: flex-start; }
  .footer-meta { width: 100%; flex-wrap: wrap; }
}
.socials { display: flex; gap: 10px; }

/* ---- forms --------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2);
  border: 1px solid var(--line); color: var(--ink); font-size: 14.5px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--bg-1);
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.textarea { font-family: var(--font-mono); font-size: 13.5px; }
.select {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239aa3b2'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-inline-end: 38px;
}
html[dir='rtl'] .select { background-position: left 12px center; padding-inline-end: 14px; padding-inline-start: 38px; }
.field-hint { font-size: 12.5px; color: var(--dim); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 600; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 44px; height: 25px; border-radius: 999px; background: var(--bg-4); border: 1px solid var(--line-strong);
  position: relative; transition: background var(--fast), border-color var(--fast); flex: none;
}
.switch-track::after {
  content: ''; position: absolute; inset-block-start: 2px; inset-inline-start: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--muted); transition: transform var(--fast), background var(--fast);
}
.switch input:checked + .switch-track { background: var(--brand-soft); border-color: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(19px); background: var(--brand); }
html[dir='rtl'] .switch input:checked + .switch-track::after { transform: translateX(-19px); }
.switch-label { font-size: 14.5px; font-weight: 600; }

/* ---- modal --------------------------------------------------------------------- */
.modal-root { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: var(--sp-4); }
.modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 7, 0.72); backdrop-filter: blur(6px); animation: fade var(--fast) both; }
.modal {
  position: relative; width: min(560px, 100%); max-height: min(88vh, 760px); overflow: auto;
  background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-6); animation: pop var(--normal) both;
}
.modal-lg { width: min(880px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-block-end: var(--sp-5); }
.modal-head h3 { font-size: 20px; }
.modal-head p { color: var(--muted); font-size: 14px; margin-block-start: 4px; }
.modal-foot { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-block-start: var(--sp-6); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

/* ---- toasts -------------------------------------------------------------------- */
.toast-wrap { position: fixed; inset-block-start: calc(var(--nav-h) + 12px); inset-inline-end: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
html[dir='rtl'] .toast-wrap { inset-inline-end: auto; inset-inline-start: 18px; }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  animation: slide-in var(--normal) both; font-size: 14px; font-weight: 600;
}
.toast.out { animation: slide-out 220ms var(--ease) both; }
.toast i { margin-block-start: 3px; }
.toast.success { border-color: rgba(61, 220, 151, 0.35); } .toast.success i { color: var(--success); }
.toast.error { border-color: rgba(255, 92, 92, 0.35); } .toast.error i { color: var(--danger); }
.toast.info i { color: var(--info); }
.toast.warn i { color: var(--warn); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); } }
@keyframes slide-out { to { opacity: 0; transform: translateY(-14px) scale(0.96); } }

/* ---- app shell (dashboard / panel) --------------------------------------------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 304px minmax(0, 1fr); }
.app-side {
  background:
    radial-gradient(160% 140% at 0% 0%, rgba(242, 176, 30, 0.09), transparent 58%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-inline-end: 1px solid var(--line); padding: var(--sp-6) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-5); position: sticky; inset-block-start: 0; height: 100vh; z-index: 120;
  overflow: hidden;
  box-shadow: 12px 0 60px -40px rgba(242, 176, 30, 0.4);
}
.app-side .brand { padding-inline: 4px; margin-block-end: var(--sp-2); flex: none; }
.side-nav {
  display: flex; flex-direction: column; gap: 6px; margin-block-start: var(--sp-2);
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent;
}
.side-nav > * { flex: none; }
.side-link {
  display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-radius: 14px;
  border: 1px solid transparent;
  color: var(--muted); font-weight: 700; font-size: 15px;
  position: relative; overflow: hidden;
  transition: background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.side-link::before {
  content: ''; position: absolute; inset-inline-start: 0; inset-block: 18%; width: 2px; border-radius: 0 2px 2px 0;
  background: transparent; transition: background 180ms var(--ease);
}
.side-link:hover { background: var(--bg-3); color: var(--ink); }
.side-link.active {
  background: radial-gradient(120% 120% at 0% 0%, rgba(242, 176, 30, 0.16), transparent 70%), var(--brand-soft);
  color: var(--brand); border: 1px solid var(--line-brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.side-link.active::before { background: linear-gradient(180deg, var(--brand-bright), var(--brand)); }
.side-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav .badge.side-create { max-width: 100%; overflow: hidden; }
.side-nav .badge.side-create > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link i {
  width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center;
  border-radius: 9px; font-size: 13px; text-align: center;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line); color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.side-link:hover i { color: var(--ink); border-color: var(--line-strong); background: linear-gradient(180deg, var(--bg-4), var(--bg-3)); }
.side-link.active i {
  color: #1a1305; border-color: rgba(255, 226, 150, 0.5);
  background: linear-gradient(150deg, var(--brand-bright), var(--brand) 55%, var(--brand-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 14px -8px rgba(242, 176, 30, 0.8);
}
html[data-theme='light'] .side-link.active i { color: #fff; }
.side-foot { margin-block-start: auto; flex: none; display: flex; flex-direction: column; gap: var(--sp-3); padding-block-start: var(--sp-4); border-block-start: 1px solid var(--line); }
.user-chip {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: radial-gradient(140% 120% at 0% 0%, rgba(242, 176, 30, 0.12), transparent 70%), var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.user-chip img { width: 46px; height: 46px; border-radius: 50%; background: var(--bg-4); flex: none; object-fit: cover; border: 1px solid var(--line-brand); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-4); flex: none; object-fit: cover; }
.user-chip .who { min-width: 0; }
.user-chip .who b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { font-size: 12.5px; color: var(--dim); }
.side-foot .row { gap: var(--sp-2); flex-wrap: wrap; }
.side-logout {
  width: 100%; justify-content: flex-start; padding-inline: 16px; gap: 12px;
  --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--muted);
}
.side-logout:hover {
  --btn-bg: radial-gradient(120% 120% at 0% 0%, rgba(255, 92, 92, 0.16), transparent 70%);
  --btn-bd: rgba(255, 92, 92, 0.36); --btn-fg: var(--danger);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.side-logout i {
  width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center;
  border-radius: 9px; font-size: 13px; text-align: center;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line); color: var(--dim);
  transition: background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.side-logout:hover i {
  color: var(--danger); border-color: rgba(255, 92, 92, 0.4);
  background: linear-gradient(180deg, rgba(255, 92, 92, 0.16), rgba(255, 92, 92, 0.08));
  transform: none;
}
html[dir='rtl'] .side-logout:hover i { transform: none; }
.side-logout.side-dash:hover { --btn-bg: var(--bg-3); --btn-bd: var(--line-strong); --btn-fg: var(--ink); }
.side-logout.side-dash:hover i { color: var(--ink); border-color: var(--line-strong); background: linear-gradient(180deg, var(--bg-4), var(--bg-3)); }
html[dir='rtl'] .side-logout .fa-arrow-right-from-bracket { transform: scaleX(-1); }
html[dir='rtl'] .app-side {
  background:
    radial-gradient(160% 140% at 100% 0%, rgba(242, 176, 30, 0.09), transparent 58%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
html[dir='rtl'] .side-link.active {
  background: radial-gradient(120% 120% at 100% 0%, rgba(242, 176, 30, 0.16), transparent 70%), var(--brand-soft);
}
html[dir='rtl'] .user-chip {
  background: radial-gradient(140% 120% at 100% 0%, rgba(242, 176, 30, 0.12), transparent 70%), var(--bg-2);
}
html[dir='rtl'] .side-logout:hover {
  --btn-bg: radial-gradient(120% 120% at 100% 0%, rgba(255, 92, 92, 0.16), transparent 70%);
}
html[dir='rtl'] .side-logout.side-dash:hover { --btn-bg: var(--bg-3); }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-head {
  position: sticky; inset-block-start: 0; z-index: 60; display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6); background: var(--surface-glass); backdrop-filter: blur(16px);
  border-block-end: 1px solid var(--line); min-height: var(--nav-h); flex-wrap: wrap;
}
.app-head h1 { font-size: 20px; }
.app-head .sub { font-size: 13px; color: var(--dim); }
.app-body { padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-6); }
.side-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 110; }

@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .app-side {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: min(324px, 88vw);
    transform: translateX(-105%); transition: transform var(--normal); box-shadow: var(--shadow-lg);
  }
  html[dir='rtl'] .app-side { transform: translateX(105%); }
  .app-side.open, html[dir='rtl'] .app-side.open { transform: none; }
  .app-body, .app-head { padding-inline: var(--sp-4); }
}

@media (max-height: 720px) {
  .app-side { gap: var(--sp-4); padding-block: var(--sp-4); }
  .side-nav { gap: 3px; }
  .side-link { padding-block: 9px; }
  .user-chip { padding-block: 9px; }
}

/* ---- dashboard widgets --------------------------------------------------------- */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.widget { padding: var(--sp-5); border-radius: var(--radius-lg); background: var(--bg-1); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.widget-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.widget .label, .wallet .label { font-size: 12.5px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
html[lang='ar'] .widget .label, html[lang='ar'] .wallet .label { text-transform: none; letter-spacing: 0; }
.widget .value { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.widget .foot, .wallet .foot { font-size: 12.5px; color: var(--muted); }
.widget-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--brand); }

.wallet {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap;
  padding: var(--sp-6); border-radius: var(--radius-xl);
  background: radial-gradient(120% 160% at 100% 0%, rgba(242, 176, 30, 0.18), transparent 60%), var(--bg-1);
  border: 1px solid var(--line-brand);
}
.wallet-amount { display: flex; align-items: baseline; gap: 10px; }
.wallet-amount b { font-size: clamp(34px, 5vw, 48px); font-weight: 900; letter-spacing: -0.04em; color: var(--brand); font-variant-numeric: tabular-nums; }
.wallet-amount span { color: var(--muted); font-weight: 700; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); }
.server-card {
  padding: var(--sp-5); border-radius: var(--radius-lg); background: var(--bg-1); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--sp-4); transition: transform var(--normal), border-color var(--normal), box-shadow var(--normal);
}
.server-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.server-card-head { display: flex; align-items: center; gap: 12px; }
.server-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); font-size: 18px; flex: none; }
.server-card h3 { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card .meta { font-size: 12.5px; color: var(--dim); }
.server-metrics { display: flex; gap: var(--sp-4); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.server-metrics b { color: var(--ink); font-variant-numeric: tabular-nums; }
.server-actions { display: flex; gap: var(--sp-2); margin-block-start: auto; }
.server-actions .btn { flex: 1; }

.progress { height: 6px; border-radius: 999px; background: var(--bg-4); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-deep), var(--brand-bright)); transition: width var(--normal); }
.progress.ok > i { background: linear-gradient(90deg, #1f9c6b, var(--success)); }
.progress.hot > i { background: linear-gradient(90deg, #b83a3a, var(--danger)); }

.empty { text-align: center; padding: var(--sp-8) var(--sp-5); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--muted); }
.empty i { font-size: 40px; color: var(--brand); opacity: 0.6; margin-block-end: var(--sp-4); }
.empty h3 { font-size: 19px; margin-block-end: 8px; color: var(--ink); }

/* ---- panel: tabs, console, files ----------------------------------------------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-block-end: 1px solid var(--line); padding-block-end: 1px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: 12px 12px 0 0;
  color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; position: relative;
  transition: color var(--fast), background var(--fast);
}
.tab:hover { color: var(--ink); background: var(--bg-2); }
.tab.active { color: var(--brand); }
.tab.active::after { content: ''; position: absolute; inset-inline: 12px; inset-block-end: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fade 240ms var(--ease) both; }

.res-bar { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.res-item { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1; }
.res-item .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; }
.res-item .top b { color: var(--ink); font-variant-numeric: tabular-nums; }

.console-shell {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #0a0c11, #07080b);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.console {
  background: transparent; border: 0; border-radius: 0; padding: var(--sp-3) 0;
  font-family: var(--font-mono); font-size: 12.8px; line-height: 1.7; height: min(58vh, 620px);
  overflow: auto; white-space: pre-wrap; word-break: break-word; direction: ltr; text-align: start;
}
.console.nowrap { white-space: pre; }
.console::-webkit-scrollbar { width: 10px; height: 10px; }
.console::-webkit-scrollbar-thumb { background: #232733; border-radius: 8px; border: 2px solid #07080b; }
.console::-webkit-scrollbar-thumb:hover { background: #323847; }
.console .l-info { color: #c3ccd9; }
.console .l-warn { color: var(--warn); }
.console .l-error { color: #ff8080; }
.console .l-success { color: var(--success); }
.console .l-debug { color: var(--dim); }
.console .ts { color: #4a5261; margin-inline-end: 10px; font-variant-numeric: tabular-nums; }
.console mark { background: rgba(242, 176, 30, .26); color: #ffe6a8; border-radius: 4px; padding: 0 3px; }
.console-foot {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: 9px var(--sp-4); border-block-start: 1px solid var(--line);
  background: var(--bg-1); font-size: 12px;
}
.console-foot .is-hot { color: var(--danger); font-weight: 800; }
.console-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--sp-8) 0;
  color: var(--dim); font-size: 13px;
}
.console-empty i { font-size: 26px; opacity: .45; }
.log-line {
  display: block; padding-inline: var(--sp-4); position: relative;
  animation: logIn 180ms var(--ease) both;
}
.log-line:hover { background: rgba(255, 255, 255, .03); }
.log-line .lv {
  display: inline-block; width: 3px; height: 12px; border-radius: 2px; vertical-align: -1px;
  margin-inline-end: 9px; background: #2c3340;
}
.log-line.l-warn .lv { background: var(--warn); }
.log-line.l-error .lv { background: var(--danger); }
.log-line.l-success .lv { background: var(--success); }
.log-line.l-error { background: linear-gradient(90deg, rgba(255, 92, 92, .08), transparent 70%); }
@keyframes logIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; } }
.lvl-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: border-color var(--fast), background var(--fast), color var(--fast);
}
.lvl-chip b { font-variant-numeric: tabular-nums; color: var(--dim); font-weight: 800; }
.lvl-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.lvl-chip.on { background: var(--bg-4); color: var(--ink); border-color: var(--line-strong); }
.lvl-chip.lvl-error.on { border-color: rgba(255, 92, 92, .45); color: #ff8f8f; }
.lvl-chip.lvl-warn.on { border-color: rgba(255, 176, 32, .45); color: var(--warn); }
.lvl-chip.lvl-success.on { border-color: rgba(61, 220, 151, .4); color: var(--success); }
.btn-attention { border-color: rgba(255, 92, 92, .5); color: #ff8f8f; animation: attention 2.4s ease-in-out infinite; }
@keyframes attention { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, .32); } 50% { box-shadow: 0 0 0 6px rgba(255, 92, 92, 0); } }
#btnDash.is-live { border-color: rgba(61, 220, 151, .5); color: var(--success); }

.files { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: var(--sp-4); min-height: 420px; }
@media (max-width: 900px) { .files { grid-template-columns: 1fr; } }
.file-tree { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; overflow: auto; max-height: 60vh; }
.file-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-family: var(--font-mono); transition: background var(--fast), color var(--fast);
}
.file-row:hover { background: var(--bg-3); color: var(--ink); }
.file-row.active { background: var(--brand-soft); color: var(--brand); }
.file-row i { width: 16px; text-align: center; flex: none; }
.file-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .size { margin-inline-start: auto; font-size: 11px; color: var(--dim); flex: none; }
.file-more { display: flex; justify-content: center; padding: var(--sp-2) 0 var(--sp-1); }

.editor-shell { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.editor-host { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 420px; }
.editor-host .CodeMirror { height: 100%; min-height: 420px; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; }

/* ---- panel: server resource strip ------------------------------------------------ */
.app-main > .res-bar {
  padding: var(--sp-3) var(--sp-6); border-block-end: 1px solid var(--line);
  background: var(--bg-1); align-items: flex-start;
}
.log-line { display: block; }

/* ---- panel: file selection ------------------------------------------------------- */
.select-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  padding: 12px var(--sp-4); margin-block-end: var(--sp-3); border-radius: var(--radius-sm);
  background: var(--brand-soft); border: 1px solid var(--line-brand);
}
.select-bar b { color: var(--brand); font-variant-numeric: tabular-nums; }
.file-checkbox {
  width: 18px; height: 18px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 5px;
  display: none; align-items: center; justify-content: center; font-size: 11px; color: transparent;
  transition: background var(--fast), border-color var(--fast);
}
.file-checkbox.show { display: inline-flex; }
.file-checkbox.checked { background: var(--brand); border-color: var(--brand); color: #0b0d12; }
.file-checkbox.checked::after { content: '\2713'; font-weight: 900; }
.file-row.selected { background: var(--brand-soft); color: var(--ink); }
.file-actions { display: flex; gap: 4px; flex: none; opacity: 0; transition: opacity var(--fast); }
.file-row:hover .file-actions, .file-row.active .file-actions { opacity: 1; }
.file-actions .icon-btn { width: 28px; height: 28px; font-size: 11.5px; }

/* ---- panel: member permissions --------------------------------------------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-block-start: 10px; }
.perm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--muted); cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.perm-item:hover { border-color: var(--line); background: var(--bg-2); color: var(--ink); }
.perm-item input { accent-color: var(--brand); width: 17px; height: 17px; flex: none; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 14px; border-block-end: 1px solid var(--line); }
html[lang='ar'] .table th { text-transform: none; letter-spacing: 0; }
.table td { padding: 13px 14px; border-block-end: 1px solid var(--line); }
.table tr:last-child td { border-block-end: 0; }
.table tbody tr:hover td { background: var(--bg-2); }

/* ---- skeleton ------------------------------------------------------------------ */
.skeleton { position: relative; overflow: hidden; background: var(--bg-3); border-radius: var(--radius-sm); color: transparent !important; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---- auth + rules pages -------------------------------------------------------- */
.auth-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-8); align-items: center; padding-block: clamp(48px, 9vh, 110px); }
@media (max-width: 900px) { .auth-grid { grid-template-columns: 1fr; gap: var(--sp-6); } }
.auth-card {
  padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-xl);
  background: var(--surface-glass); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: clamp(26px, 3.6vw, 36px); margin-block-end: 8px; }
.auth-card .sub { color: var(--muted); margin-block-end: var(--sp-6); }
.auth-note { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; margin-block-start: var(--sp-4); }
.benefit-list { display: flex; flex-direction: column; gap: var(--sp-3); margin-block-start: var(--sp-5); }
.benefit-list li { display: flex; gap: 12px; align-items: center; color: var(--muted); font-weight: 600; }
.benefit-list i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); border: 1px solid var(--line-brand); color: var(--brand); flex: none; }
.auth-error {
  display: flex; gap: 10px; align-items: center; margin-block-end: var(--sp-4); padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid rgba(255, 92, 92, 0.3);
  color: var(--danger); font-size: 14px; font-weight: 600;
}

.prose { max-width: 820px; margin-inline: auto; }
.prose section { margin-block-end: var(--sp-6); }
.prose h2 { font-size: 20px; margin-block-end: 10px; display: flex; align-items: center; gap: 10px; }
.prose h2 .step-num { width: 30px; height: 30px; font-size: 14px; }
.prose p { color: var(--muted); font-size: 15.5px; line-height: 1.85; }
.prose .lead { font-size: 17px; color: var(--ink); }

/* ---- misc ---------------------------------------------------------------------- */
.divider { height: 1px; background: var(--line); border: 0; margin-block: var(--sp-5); }
.dot-sep::before { content: '·'; margin-inline: 8px; color: var(--dim); }
.copyable { cursor: pointer; }
.copyable:hover { color: var(--brand); }

/* ---- dashboard: money store, configurator, orders --------------------------------- */
.side-create { margin-block-end: var(--sp-3); }
.select-sm { padding-block: 8px; font-size: 13.5px; width: auto; min-width: 132px; }
.badge-warn { background: var(--brand-soft); border-color: var(--line-brand); color: var(--brand); }
.danger { color: var(--danger); font-weight: 700; }
.plan.picked { border-color: color-mix(in srgb, var(--plan-accent) 60%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--plan-accent) 22%, transparent); }

.configurator { margin-block-start: var(--sp-6); padding: var(--sp-5); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.config-head { display: flex; align-items: flex-start; gap: var(--sp-4); margin-block-end: var(--sp-5); }
.config-head > div { flex: 1; min-width: 0; }
.config-head h3 { font-size: 18px; }
.config-head p { font-size: 13.5px; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); }
.config-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-block-start: var(--sp-5); padding-block-start: var(--sp-4); border-block-start: 1px solid var(--line); }
.config-price b { display: block; font-size: 26px; font-weight: 900; color: var(--brand); line-height: 1.2; }
.config-price span { font-size: 12.5px; }
.config-note { display: block; margin-block-start: var(--sp-4); font-size: 12.5px; }
.pay-box { margin-block-start: var(--sp-5); padding: var(--sp-4); border: 1px dashed var(--line-brand); border-radius: var(--radius); background: var(--brand-soft); }
.pay-box h4 { font-size: 15px; margin-block-end: 6px; color: var(--brand); }
.code-pill { padding: 8px 14px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-strong); font-weight: 800; letter-spacing: .08em; }

.gift-pill, .rank-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 800; }
.gift-pill b { font-size: 14px; color: var(--brand); }
.rank-badge { border-color: var(--line-brand); background: var(--brand-soft); color: var(--brand); }
.rank-badge.rank-silver { border-color: #b8c2cc66; color: #b8c2cc; background: #b8c2cc1f; }
.rank-badge.rank-gold { border-color: #f2b01e66; color: #f2b01e; background: #f2b01e1f; }
.rank-badge.rank-platinum { border-color: #58a6ff66; color: #58a6ff; background: #58a6ff1f; }
.rank-badge.rank-diamond { border-color: #7dd3fc66; color: #7dd3fc; background: #7dd3fc1f; }
.rank-badge.rank-legend { border-color: #ff5c8a66; color: #ff5c8a; background: #ff5c8a1f; }

.bots-admin { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-4); margin-block-end: var(--sp-4); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.bots-admin .field { margin: 0; }
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--sp-4); }
.bot-card { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.bot-card:hover { border-color: var(--line-strong); transform: translateY(-4px); transition: transform var(--fast), border-color var(--fast); }
.bot-head { display: flex; align-items: center; gap: 12px; }
.bot-head > div { min-width: 0; }
.bot-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--brand); font-size: 15px; }
.bot-name { display: block; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-head .dim { display: block; font-size: 12.5px; }
.bot-desc { color: var(--muted); font-size: 13.5px; line-height: 1.65; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bot-meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); color: var(--dim); font-size: 12.5px; }
.bot-meta i { margin-inline-end: 5px; }
.bot-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: 12.5px; }
.bot-links a { color: var(--brand); font-weight: 700; }
.bot-card > .row { margin-block-start: auto; }

.starter-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.starter-banner .sb-icon { font-size: 22px; line-height: 1; }
.starter-banner b { display: block; font-size: 14px; margin-block-end: 2px; }
.starter-banner .dim { display: block; font-size: 12.5px; }

.server-actions .btn-icon { flex: 0 0 auto; }
.server-card.is-expired { border-color: rgba(255, 92, 92, .38); }

.detect-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: 12px 14px; margin-block-end: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); }
.detect-bar .dim { font-size: 12.5px; }
.expiry-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin: 0 var(--sp-6) var(--sp-4); padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line-brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13.5px; }
.expiry-bar.is-danger { border-color: rgba(255, 92, 92, .4); background: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   Checkout → invoice flow
   ========================================================================== */
.form-title { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-block-end: var(--sp-4); }
.form-title i { color: var(--brand); font-size: 15px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.field > span { font-size: 13.5px; font-weight: 700; color: var(--muted); }

.checkout-steps { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3); margin-block-end: var(--sp-6); }
.checkout-steps .step {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 14px; font-weight: 700;
  border-style: solid; background: var(--bg-1); color: var(--dim);
}
.checkout-steps .step-num { width: 26px; height: 26px; font-size: 12.5px; flex: none; }
.checkout-steps .step.active { border-color: var(--line-brand); background: var(--brand-soft); color: var(--brand); }
.checkout-steps .step.done { color: var(--success); border-color: rgba(61, 220, 151, .3); }
.checkout-steps .step.done .step-num { background: var(--success-soft); color: var(--success); border-color: rgba(61, 220, 151, .35); }

.checkout-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-summary { position: sticky; top: calc(var(--nav-h) + 16px); }
@media (max-width: 900px) { .checkout-summary { position: static; } }
.summary-banner { height: 140px; margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) var(--sp-5); background: var(--bg-3) center/cover no-repeat; border-block-end: 1px solid var(--line); }
.summary-head { display: flex; align-items: center; gap: var(--sp-3); margin-block-end: var(--sp-4); }
.summary-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--bg-3); border: 1px solid var(--line-brand); flex: none; }
.summary-head h2 { font-size: 20px; }
.summary-head p { font-size: 13.5px; }
.checkout-summary .plan-list { color: var(--muted); }
.checkout-total { font-size: 22px; font-weight: 900; color: var(--checkout-accent, var(--brand)); }
.checkout-form .field { margin-block-end: var(--sp-4); }
.checkout-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-block: var(--sp-4);
  border-radius: var(--radius-sm); background: var(--success-soft); border: 1px solid rgba(61, 220, 151, .28);
  color: var(--muted); font-size: 13px; line-height: 1.6;
}
.checkout-note i { color: var(--success); margin-block-start: 3px; }
.method-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.method-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-pill);
  background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--muted);
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.method-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.method-chip i { font-size: 14px; }
.method-chip.active { border-color: var(--line-brand); background: var(--brand-soft); color: var(--brand); }

/* ---- invoice --------------------------------------------------------------------- */
.invoice-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); margin-block-end: var(--sp-5);
}
.invoice-hero-bg { position: absolute; inset: 0; background: var(--bg-3) center/cover no-repeat; }
.invoice-hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(6, 7, 10, .92), rgba(6, 7, 10, .6)); }
html[data-theme='light'] .invoice-hero-bg::after { background: linear-gradient(120deg, rgba(255,255,255,.92), rgba(255,255,255,.65)); }
.invoice-hero-inner { position: relative; display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; padding: clamp(22px, 4vw, 40px); }
.invoice-icon { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; font-size: 36px; background: var(--brand-soft); border: 1px solid var(--line-brand); flex: none; }
.invoice-hero-inner > div:nth-child(2) { flex: 1 1 320px; min-width: 0; }
.invoice-title { font-size: clamp(24px, 3.6vw, 38px); margin-block: 4px 10px; }
.invoice-meta { flex-wrap: wrap; }
.invoice-amount { text-align: end; margin-inline-start: auto; }
.invoice-amount b { display: block; font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; color: var(--brand); }
.invoice-amount span { font-size: 12.5px; }

.invoice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-5); align-items: start; }
.invoice-server { margin-block-start: var(--sp-5); padding: var(--sp-4); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.invoice-server-head { display: flex; align-items: center; gap: 12px; margin-block-end: var(--sp-4); }
.invoice-server-head > div { flex: 1; min-width: 0; }
.invoice-server-head b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-server-head .muted { font-size: 12.5px; }
.invoice-server-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--sp-2); }
.invoice-metric { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); }
.invoice-metric i { color: var(--brand); font-size: 13px; }
.invoice-metric b { font-size: 16px; font-weight: 800; }
.invoice-metric span { font-size: 11.5px; }

.invoice-table { display: flex; flex-direction: column; gap: 2px; margin-block-end: var(--sp-5); }
.invoice-tr { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--sp-3); align-items: center; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); font-size: 14px; }
.invoice-tr b { overflow-wrap: anywhere; text-align: end; }
.invoice-pay .row code { font-size: 13px; }
.pay-lead { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand); font-size: 14px; margin-block-end: var(--sp-3); }
.invoice-actions { display: flex; flex-direction: column; gap: var(--sp-3); margin-block-start: var(--sp-4); }
.invoice-foot { text-align: center; margin-block-start: var(--sp-6); font-size: 13px; }

/* ---- shared page banner (bots list, rules) --------------------------------------- */
.page-banner { position: relative; overflow: hidden; text-align: center; }
.page-banner-bg { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity var(--slow); }
.page-banner.has-banner .page-banner-bg { opacity: .38; }
.page-banner > .container { position: relative; z-index: 1; }
.page-banner .section-sub { margin-inline: auto; }

.flash-bar {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3); flex-wrap: wrap;
  margin: 0 auto; max-width: var(--container); padding: 12px var(--sp-5);
  background: var(--info-soft); border: 1px solid rgba(88, 166, 255, .3); border-radius: var(--radius);
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.flash-bar i { color: var(--info); }
.flash-bar[hidden] { display: none; }

/* ---- rules page ------------------------------------------------------------------ */
.rules-banner { margin-block-end: var(--sp-6); }
.rules-banner-inner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.rules-quick { flex-wrap: wrap; justify-content: center; margin-block-start: var(--sp-4); }
.rule-chip { font-weight: 700; }
.rule-chip:hover { border-color: var(--line-brand); color: var(--brand); }
.rule-block { margin-block-end: var(--sp-6); scroll-margin-block-start: calc(var(--nav-h) + 16px); }
.rule-block h2 { font-size: 19px; margin-block-end: 10px; display: flex; align-items: center; gap: 10px; }
.rule-block h2 .step-num { width: 30px; height: 30px; font-size: 13px; flex: none; }
.rule-block p { color: var(--muted); font-size: 15.5px; line-height: 1.85; white-space: pre-line; }
.rules-extra { justify-content: center; flex-wrap: wrap; margin-block-start: var(--sp-6); }

/* ---- free bots gallery + detail --------------------------------------------------- */
.bots-search { max-width: 340px; }
.bot-framework { font-size: 11.5px; }
.bot-open { margin-block-start: auto; }
.bot-video-flag {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px; z-index: 2;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px;
  background: rgba(6, 7, 10, .8); border: 1px solid var(--line-brand); color: var(--brand); font-size: 12px;
}
.bot-card { position: relative; overflow: hidden; }
.bot-card.mini { padding: var(--sp-4); gap: var(--sp-2); }
.bot-card.mini .bot-cover { height: 96px; margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-1); }
.bot-card.mini .bot-name { font-size: 14px; }
.bot-card.mini:hover { transform: translateY(-4px); }

.bot-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-block-end: var(--sp-5);
  border: 1px solid var(--line); border-radius: var(--radius-3);
  background: radial-gradient(120% 140% at 88% 0%, var(--brand-soft), transparent 55%), linear-gradient(160deg, var(--bg-2), var(--bg-0));
}
.bot-hero-cover { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center; opacity: .42; }
.bot-hero.has-cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(190deg, rgba(4, 5, 8, .55) 0%, rgba(4, 5, 8, .82) 55%, rgba(4, 5, 8, .95) 100%);
}
.bot-hero-body {
  display: flex; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap;
  padding: clamp(24px, 4vw, 46px); min-height: 240px;
}
.bot-hero-desc {
  margin-block-start: 10px; max-width: 62ch; color: var(--dim); font-size: 14.5px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bot-hero .bot-page-title h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.bot-frame { aspect-ratio: 16 / 9; height: auto; border: 0; }
.bot-cover {
  height: 132px; margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) var(--sp-2);
  background-size: cover; background-position: center; background-color: var(--bg-3);
  background-blend-mode: luminosity; border-block-end: 1px solid var(--line);
}
.bot-card .bot-download { flex: none; }
.bot-page-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 24px; background: var(--brand-soft); border: 1px solid var(--line-brand); color: var(--brand); flex: none; }
.bot-page-title { flex: 1 1 260px; min-width: 0; }
.bot-page-title h1 { font-size: clamp(22px, 3.2vw, 32px); margin-block-end: 6px; overflow-wrap: anywhere; }
.bot-page-title .row { flex-wrap: wrap; }
.bot-page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-inline-start: auto; }
.bot-page-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; margin-block-end: var(--sp-5); }
@media (max-width: 960px) { .bot-page-grid { grid-template-columns: 1fr; } }
.bot-media { display: flex; flex-direction: column; gap: var(--sp-3); }
.media-host { border-radius: var(--radius); overflow: hidden; background: #06070a; border: 1px solid var(--line); min-height: 220px; display: grid; place-items: center; }
.bot-player { width: 100%; max-height: 420px; display: block; background: #06070a; }
.bot-no-media { padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--dim); font-size: 14px; }
.bot-no-media i { font-size: 34px; opacity: .5; margin-block-end: var(--sp-3); }
.bot-author { font-size: 13px; }
.bot-specs { display: flex; flex-direction: column; gap: 8px; }
.bot-spec { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; }
.bot-spec i { color: var(--brand); }
.bot-spec b { text-align: end; font-variant-numeric: tabular-nums; }
.bot-about { color: var(--muted); font-size: 15px; line-height: 1.85; white-space: pre-line; }
.bot-source-links { flex-wrap: wrap; margin-block-start: var(--sp-4); }
.bot-source-links a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-pill); background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--info); }
.bot-source-links a:hover { border-color: var(--line-brand); color: var(--brand); }
.bot-file-list { display: flex; flex-direction: column; gap: 2px; }
.file-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-xs); font-size: 13px; font-family: var(--font-mono); }
.file-row:hover { background: var(--bg-2); }
.file-row i { color: var(--dim); }
.file-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- admin ----------------------------------------------------------------------- */
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.admin-stats .stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--sp-4) var(--sp-3); text-align: center; }
.admin-stats .stat > i { font-size: 15px; color: var(--dim); margin-block-end: 2px; }
.admin-stats .stat-value { font-size: clamp(22px, 2.6vw, 28px); }
.admin-stats .tone-brand .stat-value, .admin-stats .tone-brand > i { color: var(--brand); }
.admin-stats .tone-info .stat-value, .admin-stats .tone-info > i { color: var(--info); }
.admin-stats .tone-success .stat-value, .admin-stats .tone-success > i { color: var(--success); }
.admin-stats .tone-warn .stat-value, .admin-stats .tone-warn > i { color: var(--warn); }
.admin-stats .tone-muted .stat-value { color: var(--ink); }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 110px; margin-block-start: var(--sp-3); }
.spark-bar { flex: 1; min-width: 4px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--brand), var(--brand-deep)); opacity: .85; transition: opacity var(--fast); }
.spark-bar:hover { opacity: 1; }
.page-row { font-size: 13.5px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }

.order-card { display: flex; flex-direction: column; gap: 8px; padding: var(--sp-4); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line-brand); }
.order-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.order-line i { width: 16px; color: var(--dim); text-align: center; flex: none; }
.order-foot { margin-block-start: 6px; padding-block-start: var(--sp-3); border-block-start: 1px solid var(--line); }
.btn-success {
  --btn-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 48%),
    linear-gradient(160deg, color-mix(in srgb, var(--success) 72%, white), var(--success));
  --btn-fg: #05261a; --btn-bd: rgba(61, 220, 151, 0.5);
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(5, 70, 45, 0.28),
    0 10px 24px -12px rgba(61, 220, 151, 0.7);
}
.btn-success:hover {
  --btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -2px 5px rgba(5, 70, 45, 0.28),
    0 16px 32px -12px rgba(61, 220, 151, 0.8);
}

.admin-table { display: flex; flex-direction: column; gap: 4px; }
.admin-tr { display: grid; grid-template-columns: 1.1fr 1.4fr .9fr .9fr .9fr; gap: var(--sp-3); align-items: center; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; }
.admin-tr.head { background: transparent; border-color: transparent; color: var(--dim); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
html[lang='ar'] .admin-tr.head { text-transform: none; letter-spacing: 0; }
.admin-tr > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-tr.trash-row { grid-template-columns: 1.5fr 1fr .9fr 1.2fr; }
.admin-tr.backup-row { grid-template-columns: 2fr .9fr .7fr 1.1fr; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--muted); }
.status-pill.status-paid { background: var(--success-soft); border-color: rgba(61, 220, 151, .32); color: var(--success); }
.status-pill.status-pending { background: var(--brand-soft); border-color: var(--line-brand); color: var(--brand); }
.status-pill.status-rejected, .status-pill.status-cancelled { background: var(--danger-soft); border-color: rgba(255, 92, 92, .3); color: var(--danger); }
@media (max-width: 820px) { .admin-tr { grid-template-columns: 1fr 1fr; } .admin-tr.trash-row { grid-template-columns: 1fr 1fr; } .admin-tr.backup-row { grid-template-columns: 1fr 1fr; } .admin-tr.head { display: none; } }

.pkg-editor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--sp-4); }
.pkg-editor { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--bg-2); border: 1px solid var(--line); }
.pkg-editor-head { display: flex; flex-direction: column; gap: 10px; }
.pkg-strip { height: 6px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand), transparent); }
.pkg-editor .pkg-icon { flex: 0 0 62px; text-align: center; }
.pkg-editor .pkg-key { flex: 1 1 90px; }
.pkg-editor .pkg-name { flex: 2 1 130px; }
.pkg-editor .input, .pkg-editor .select { padding-block: 9px; font-size: 13.5px; }
.pkg-editor .input[type='color'] { padding: 4px; height: 40px; }
.pkg-banner { display: flex; flex-direction: column; gap: 10px; }
.pkg-banner .row { flex-wrap: wrap; }
.pkg-banner-url { flex: 1 1 170px; min-width: 0; }

.banner-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-4); }
.banner-card { display: flex; flex-direction: column; gap: 8px; padding: var(--sp-3); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.banner-preview { height: 92px; border-radius: var(--radius-sm); background: var(--bg-3) center/cover no-repeat; border: 1px solid var(--line); }
.banner-preview.tall { height: 150px; }

.editor-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: var(--sp-2); align-items: start; padding: var(--sp-3); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.editor-row.compact { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) auto; align-items: center; }
.editor-row .textarea { resize: vertical; }
.editor-row .input { font-size: 13.5px; padding-block: 9px; }
.er-icon { text-align: center; }

/* ---- admin: bento overview --------------------------------------------------------
   A real bento grid: one grid, one gap, and tiles that span different numbers of
   tracks (the hero is 2x2, traffic 2x1, servers 1x2) while all edges stay aligned. */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); grid-auto-rows: minmax(150px, auto); }
.bento-overview {
  grid-template-areas:
    "hero    hero    live    live"
    "hero    hero    users   orders"
    "servers pages   revenue revenue"
    "servers bots    revenue revenue";
}
.bento-overview > .tile-hero { grid-area: hero; }
.bento-overview > .tile-live { grid-area: live; }
.bento-overview > .tile-users { grid-area: users; }
.bento-overview > .tile-orders { grid-area: orders; }
.bento-overview > .tile-servers { grid-area: servers; }
.bento-overview > .tile-pages { grid-area: pages; }
.bento-overview > .tile-revenue { grid-area: revenue; }
.bento-overview > .tile-bots { grid-area: bots; }
.bento-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.bento-tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: var(--sp-5); border-radius: var(--radius-lg); background: var(--bg-1);
  border: 1px solid var(--line); overflow: hidden;
}
.bento-tile.clickable { cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.bento-tile.clickable:hover { border-color: var(--line-brand); background: var(--bg-2); }
.bento-tile.clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.bento-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bento-head b { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
html[lang='ar'] .bento-head b { text-transform: none; letter-spacing: 0; }
.bento-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--bg-3); border: 1px solid var(--line); color: var(--brand); }
.bento-value { font-size: clamp(28px, 3.4vw, 44px); font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bento-value.sm { font-size: clamp(22px, 2.3vw, 30px); }
.bento-sub { font-size: 13px; color: var(--muted); line-height: 1.55; }
.bento-foot { margin-block-start: auto; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--dim); }
.bento-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; animation: pulse 2s infinite; }
.bento-dot.off { background: var(--dim); animation: none; }

.tile-hero {
  justify-content: space-between; gap: var(--sp-3);
  background: radial-gradient(120% 130% at 0% 0%, rgba(242, 176, 30, 0.16), transparent 58%), var(--bg-1);
  border-color: var(--line-brand);
}
.hero-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); min-width: 0; }
.hero-number { min-width: 0; }
.hero-number b { display: block; font-size: clamp(34px, 4.8vw, 62px); font-weight: 900; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; color: var(--brand); }
.hero-number.discord b { color: var(--info); }
.hero-number span { display: block; margin-block-start: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hero-spark { display: flex; align-items: flex-end; gap: 4px; height: 54px; }
.hero-spark .spark-bar { opacity: .7; }
.hero-spark .spark-bar:last-child { opacity: 1; }

.bento-rows { display: flex; flex-direction: column; gap: 8px; margin-block-start: var(--sp-2); }
.bento-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.bento-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bento-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }

.bento-list { display: flex; flex-direction: column; gap: 4px; margin-block-start: var(--sp-2); overflow: auto; }
.bento-list .page-row { background: var(--bg-2); }

/* ---- admin: revenue card ---------------------------------------------------------- */
/* A wide, calm money card: one oversized tabular number, two small facts, and a real
   seven-day chart. The gradient is a tint of the brand so it works in both themes. */
.tile-revenue {
  --rev-glow: rgba(242, 176, 30, 0.16);
  gap: var(--sp-3);
  border-color: var(--line-brand);
  background:
    radial-gradient(120% 110% at 100% 0%, var(--rev-glow), transparent 58%),
    radial-gradient(90% 80% at 0% 100%, rgba(242, 176, 30, 0.05), transparent 60%),
    var(--bg-1);
}
html[data-theme='light'] .tile-revenue { --rev-glow: rgba(168, 113, 0, 0.11); }
.tile-revenue.clickable:hover {
  border-color: var(--brand);
  background:
    radial-gradient(120% 110% at 100% 0%, var(--rev-glow), transparent 58%),
    radial-gradient(90% 80% at 0% 100%, rgba(242, 176, 30, 0.06), transparent 60%),
    var(--bg-2);
}
.revenue-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rev-badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--success-soft); color: var(--success);
  font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.rev-badge i { font-size: 10px; }
.revenue-main { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px; }
.revenue-amount {
  display: flex; align-items: baseline; gap: 7px; min-width: 0; direction: ltr;
  font-family: var(--font-display); font-size: clamp(32px, 3.6vw, 48px);
  font-weight: 800; line-height: .95; letter-spacing: -0.05em; color: var(--ink);
}
html[lang='ar'] .revenue-amount { font-family: var(--font-ar); letter-spacing: 0; }
.rev-symbol { font-size: .58em; font-weight: 700; color: var(--brand); translate: 0 -.06em; }
.rev-number { font-variant-numeric: tabular-nums; }
.rev-code {
  align-self: flex-start; padding-block-start: 3px;
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 800;
  letter-spacing: .14em; color: var(--dim);
}
.revenue-meta { display: flex; flex-wrap: wrap; gap: 7px; padding-block-end: 3px; }
.rev-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-pill);
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.rev-meta-item b { font-size: 12.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.rev-period { background: var(--brand-soft); border-color: var(--line-brand); color: var(--brand); }
.rev-period i { font-size: 10px; }
.revenue-chart-wrap { position: relative; flex: 1 1 auto; min-height: clamp(136px, 16vw, 205px); margin-block-start: auto; }
.rev-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rev-svg text { font-family: var(--font-ui); font-size: 10.5px; fill: var(--dim); font-variant-numeric: tabular-nums; }
html[lang='ar'] .rev-svg text { font-family: var(--font-ar); }
.rev-grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.rev-grid line.base { stroke: var(--line-strong); }
.rev-area { fill: url(#revAreaFill); }
.rev-stop-a { stop-color: var(--brand); stop-opacity: .26; }
.rev-stop-b { stop-color: var(--brand); stop-opacity: 0; }
.rev-line {
  fill: none; stroke: var(--brand); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 5px 12px var(--brand-glow));
  animation: rev-draw 900ms var(--ease) 40ms forwards;
}
.rev-point { fill: var(--bg-1); stroke: var(--brand); stroke-width: 2; }
.rev-point.last { fill: var(--brand); stroke: var(--bg-1); stroke-width: 2.5; filter: drop-shadow(0 0 8px var(--brand-glow)); }
.rev-guide { stroke: var(--line-brand); stroke-width: 1; stroke-dasharray: 3 4; }
.rev-focus { fill: var(--brand); stroke: var(--bg-1); stroke-width: 2; filter: drop-shadow(0 0 8px var(--brand-glow)); }
.rev-tip {
  position: absolute; z-index: 3; left: 0; top: 0;
  padding: 7px 10px; border-radius: 10px; pointer-events: none;
  background: var(--bg-3); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm); white-space: nowrap;
  font-size: 11px; color: var(--dim);
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 120ms var(--fast), translate 120ms var(--fast);
}
.rev-tip.below { transform: translate(-50%, 12px); }
.rev-tip b { display: block; margin-block-end: 1px; font-family: var(--font-display); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
@keyframes rev-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .rev-line { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .rev-tip { transition: none; }
}

/* ---- admin: user administration -------------------------------------------------- */
.users-toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-block-end: var(--sp-4); }
.users-toolbar .input { max-inline-size: 280px; }
.users-tr { grid-template-columns: minmax(0, 1.6fr) .65fr .75fr 1.05fr .75fr minmax(0, 1.5fr); }
.users-tr > * { min-width: 0; }
.users-tr .u-cell { display: flex; align-items: center; gap: 9px; overflow: hidden; }
.u-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--bg-4); flex: none; }
.u-name { display: flex; flex-direction: column; min-width: 0; }
.u-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-name span { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 800; background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--muted); }
.role-pill.owner { background: var(--brand-soft); border-color: var(--line-brand); color: var(--brand); }
.role-pill.admin { background: rgba(90, 170, 255, .12); border-color: rgba(90, 170, 255, .32); color: var(--info); }
.role-pill.blocked { background: var(--danger-soft); border-color: rgba(255, 92, 92, .32); color: var(--danger); }
@media (max-width: 900px) {
  .users-tr { grid-template-columns: 1fr 1fr; }
  .users-tr.head { display: none; }
  .u-actions { justify-content: flex-start; }
}

/* ---- admin: permission + live-stats modals --------------------------------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.perm-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.perm-option:hover { border-color: var(--line-strong); }
.perm-option.on { border-color: var(--line-brand); background: var(--brand-soft); }
.perm-option input { margin-block-start: 3px; accent-color: var(--brand); flex: none; }
.perm-option b { display: block; font-size: 13.5px; }
.perm-option span { display: block; margin-block-start: 2px; font-size: 11.5px; line-height: 1.5; color: var(--dim); }
.perm-option.locked { opacity: .6; cursor: not-allowed; }
.perm-role-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-block-end: var(--sp-4); }
.perm-role-row .select { max-inline-size: 220px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.live-stat { padding: 14px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.live-stat b { display: block; font-size: 24px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.live-stat span { display: block; margin-block-start: 3px; font-size: 11.5px; color: var(--muted); }
.live-stat.accent-brand b { color: var(--brand); }
.live-stat.accent-info b { color: var(--info); }
.live-stat.accent-success b { color: var(--success); }
.live-note { margin-block-start: var(--sp-4); padding: 12px 14px; border-radius: var(--radius); background: var(--bg-2); border: 1px dashed var(--line-strong); font-size: 12.5px; line-height: 1.75; color: var(--dim); }
.live-note i { color: var(--brand); margin-inline-end: 6px; }

@media (max-width: 1180px) {
  .bento-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "hero    hero"
      "live    live"
      "users   orders"
      "servers pages"
      "revenue revenue"
      "bots    bots";
  }
  .bento-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .bento-overview, .bento-summary { grid-template-columns: 1fr; grid-template-areas: none; grid-auto-rows: auto; }
  .bento-overview > .bento-tile { grid-area: auto; }
  .hero-numbers { grid-template-columns: 1fr; gap: var(--sp-3); }
  .bento-tile { padding: var(--sp-4); }
}

/* ---- panel: file tree rows -------------------------------------------------------- */
.file-tree .file-row {
  position: relative;
  display: grid; grid-template-columns: 20px 20px 20px minmax(0, 1fr) auto; align-items: center;
  gap: 8px; padding: 10px 12px; padding-inline-start: calc(12px + var(--depth, 0) * 24px);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--muted);
  font-size: 15px; font-family: var(--font-mono); transition: background var(--fast), color var(--fast);
  border: 1px solid transparent; margin-bottom: 3px;
}
.file-tree .file-row:hover { background: var(--bg-3); color: var(--ink); border-color: var(--line); }
.file-tree .file-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.file-tree .file-row.selected { background: var(--brand-soft); color: var(--ink); border-color: var(--brand); }
.file-tree .file-row.active { background: var(--brand-soft); color: var(--brand); }
/* the name owns the free space and wraps instead of being ellipsised away */
.file-tree .file-row .name {
  overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere;
  line-height: 1.4; font-weight: 600; letter-spacing: .1px; min-width: 0;
}
.file-tree .file-row .size { font-size: 12px; color: var(--dim); white-space: nowrap; }
.file-tree .file-row i { text-align: center; color: var(--dim); font-size: 15px; }
.file-tree .file-row.selected i, .file-tree .file-row.active i { color: var(--brand); }
.file-tree .file-row .fa-folder, .file-tree .file-row .fa-folder-open { color: var(--brand); font-size: 16px; }
/* action buttons float over the row instead of reserving a column the name needs */
.file-tree .file-actions {
  position: absolute; inset-inline-end: 6px; top: 50%; translate: 0 -50%;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.file-twist { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0; border-radius: 6px; }
.file-twist:hover { background: var(--bg-2); color: var(--ink); }
.file-twist i { font-size: 11px; transition: transform var(--fast); transform: rotate(-90deg); }
.file-twist.open i { transform: rotate(0deg); }
.file-twist.gap { cursor: default; }
.file-twist.gap:hover { background: none; }

/* ---- panel: right-click menu ------------------------------------------------------ */
.ctx-menu {
  position: fixed; z-index: 120; min-width: 210px; padding: 6px;
  background: rgba(17, 20, 27, .97); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .55); backdrop-filter: blur(14px);
  animation: ctxIn 130ms var(--ease) both;
}
@keyframes ctxIn { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; } }
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; text-align: start;
  border-radius: var(--radius-xs); cursor: pointer; transition: background var(--fast), color var(--fast);
}
.ctx-item i { width: 16px; text-align: center; color: var(--dim); font-size: 13px; }
.ctx-item:hover { background: var(--bg-3); color: var(--ink); }
.ctx-item:hover i { color: var(--brand); }
.ctx-item.danger:hover { background: var(--danger-soft); color: #ff8f8f; }
.ctx-item.danger:hover i { color: var(--danger); }
.ctx-sep { display: block; height: 1px; margin: 5px 4px; background: var(--line); }

/* ---- panel: diagnose -------------------------------------------------------------- */
.modal-xl { width: min(1080px, 100%); }
.diag-head-icon { color: var(--brand); font-size: 18px; }
.diag-body { max-height: 72vh; overflow: auto; padding: var(--sp-4) var(--sp-5); }
.diag-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: var(--sp-6) 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin 720ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.diag-summary { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.diag-summary-head { display: flex; align-items: center; gap: 14px; }
.diag-summary-head i { font-size: 26px; }
.diag-summary-head h3 { font-size: 17px; }
.diag-summary.tone-good { border-color: rgba(61, 220, 151, .35); }
.diag-summary.tone-good i { color: var(--success); }
.diag-summary.tone-warn { border-color: rgba(255, 176, 32, .35); }
.diag-summary.tone-warn i { color: var(--warn); }
.diag-summary.tone-bad { border-color: rgba(255, 92, 92, .4); background: linear-gradient(180deg, rgba(255, 92, 92, .08), var(--bg-2)); }
.diag-summary.tone-bad i { color: var(--danger); }
.diag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.diag-chip { display: inline-flex; gap: 7px; align-items: baseline; padding: 6px 11px; border-radius: var(--radius-pill); background: var(--bg-3); border: 1px solid var(--line); font-size: 12px; }
.diag-chip b { color: var(--dim); font-weight: 800; }
.diag-issue { padding: var(--sp-4); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.diag-issue.sev-error { border-color: rgba(255, 92, 92, .35); }
.diag-issue.sev-warn { border-color: rgba(255, 176, 32, .3); }
.diag-issue-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.diag-issue.sev-error .diag-issue-head i { color: var(--danger); }
.diag-issue.sev-warn .diag-issue-head i { color: var(--warn); }
.diag-issue.sev-info .diag-issue-head i { color: var(--info); }
.diag-issue-body { color: var(--muted); font-size: 13.8px; line-height: 1.7; }
.diag-evidence { display: flex; flex-wrap: wrap; gap: 6px; }
.diag-evidence code { font-family: var(--font-mono); font-size: 11.5px; padding: 4px 8px; border-radius: 6px; background: #0a0c11; color: #9fb0c6; border: 1px solid var(--line); }
.diag-hint { padding-block-start: var(--sp-3); border-block-start: 1px solid var(--line); }
.diag-hint-row { display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); font-size: 13.5px; }
.diag-hint-row code { font-family: var(--font-mono); color: var(--brand); font-size: 12.5px; word-break: break-all; }
.diag-raw { border-block-start: 1px solid var(--line); padding-block-start: var(--sp-3); }
.diag-raw summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.diag-raw-list { margin-block-start: 10px; max-height: 220px; overflow: auto; background: #07080b; border-radius: var(--radius-sm); padding: 10px; }
.diag-raw-line { font-size: 11.5px; color: #ff9c9c; white-space: pre-wrap; word-break: break-word; padding: 2px 0; direction: ltr; }

/* ---- panel: bot dashboard iframe --------------------------------------------------- */
.dash-frame-host { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.dash-frame-host iframe { width: 100%; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ---- panel: drag & drop upload ----------------------------------------------------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  backdrop-filter: blur(6px);
  animation: dropFade var(--fast) both;
}
.drop-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: clamp(28px, 5vw, 52px) clamp(34px, 7vw, 76px);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--line-brand);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  box-shadow: var(--shadow-brand);
  animation: dropBreath 2.4s var(--ease) infinite;
}
.drop-card > i { font-size: 52px; color: var(--brand); animation: dropFloat 1.8s var(--ease) infinite; }
.drop-card h3 { font-size: clamp(19px, 2.4vw, 25px); color: var(--ink); }
.drop-hint { color: var(--muted); font-size: 14px; max-width: 46ch; line-height: 1.8; }
.drop-into { display: inline-flex; align-items: center; gap: 8px; margin-block-start: 4px; padding: 7px 14px; border-radius: var(--radius-pill); background: var(--bg-3); border: 1px solid var(--line); color: var(--brand); font-size: 13px; }
.drop-into .mono { color: var(--ink); }
@keyframes dropFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes dropBreath { 0%, 100% { border-color: var(--line-brand) } 50% { border-color: var(--brand) } }
@keyframes dropFloat { 0%, 100% { transform: translateY(-3px) } 50% { transform: translateY(6px) } }

.upload-tray {
  position: fixed; inset-block-end: 0; inset-inline-end: clamp(12px, 3vw, 34px); z-index: 110;
  width: min(420px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-2);
  border: 1px solid var(--line-brand);
  border-block-end: 0;
  box-shadow: var(--shadow-lg);
  animation: trayRise var(--normal) both;
}
.upload-tray-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; }
.upload-tray-head > .row:first-child { min-width: 0; gap: 9px; }
.upload-tray-head i { color: var(--brand); font-size: 16px; }
.upload-tray-head b { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-count { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.upload-tray-bar { height: 4px; margin-inline: 14px; border-radius: var(--radius-pill); background: var(--bg-3); overflow: hidden; }
.upload-tray-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); transition: width var(--fast); }
.upload-list { list-style: none; margin: 0; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 4px; max-height: min(38vh, 320px); overflow: auto; }
.upload-tray.folded .upload-list { display: none; }
.upload-tray.folded { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
@keyframes trayRise { from { transform: translateY(18px); opacity: 0 } to { transform: none; opacity: 1 } }

.up-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--radius-sm); background: var(--bg-3); border: 1px solid transparent; animation: upIn var(--fast) both; }
.up-row:hover { border-color: var(--line); }
@keyframes upIn { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.up-ico { font-size: 14px; color: var(--dim); text-align: center; }
.up-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-name { font-size: 13px; font-family: var(--font-mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { position: relative; height: 6px; border-radius: var(--radius-pill); background: var(--bg-1); overflow: hidden; }
.up-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); transition: width var(--fast); }
.up-pct { position: absolute; inset-block-start: -3px; inset-inline-end: 0; font-size: 10px; }
.up-sub { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-act { width: 26px; height: 26px; font-size: 12px; }
.up-row.up-uploading .up-ico { color: var(--brand); }
.up-row.up-uploading .up-fill { background-image: linear-gradient(115deg, transparent 0 25%, rgba(255, 255, 255, .35) 25% 50%, transparent 50% 75%, rgba(255, 255, 255, .35) 75% 100%); background-size: 220% 100%; animation: upStripe 1.1s linear infinite; }
.up-row.up-done { background: color-mix(in srgb, var(--success) 10%, var(--bg-3)); }
.up-row.up-done .up-ico, .up-row.up-done .up-pct { color: var(--success); }
.up-row.up-done .up-fill { background: var(--success); }
.up-row.up-failed { background: color-mix(in srgb, var(--danger) 10%, var(--bg-3)); border-color: rgba(255, 92, 92, .28); }
.up-row.up-failed .up-ico, .up-row.up-failed .up-pct, .up-row.up-failed .up-sub { color: var(--danger); }
.up-row.up-failed .up-fill { background: var(--danger); }
.up-row.up-queued { opacity: .78; }
.up-row.up-blind .up-fill { width: 30% !important; animation: upBlind 1.3s var(--ease) infinite; }
@keyframes upBlind { from { margin-inline-start: -30% } to { margin-inline-start: 100% } }
@keyframes upStripe { from { background-position: 120% 0 } to { background-position: -120% 0 } }
@media (max-width: 640px) { .upload-tray { inset-inline: 8px; width: auto; } }

/* ---- panel: console clock, file names, upload tray, editor ------------------------- */
.log-line .ts { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.diag-raw-line { direction: ltr; unicode-bidi: isolate; }

/* file names are code, not prose: they must clip at the tail and never mirror in RTL */
.file-tree .file-row .name, .up-name, .editor-file b { direction: ltr; unicode-bidi: isolate; text-align: start; }

.upload-tray { width: min(640px, calc(100vw - 24px)); }
.upload-list { max-height: min(56vh, 520px); gap: 8px; padding: 12px; }
.up-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; padding: 12px 10px; }
.up-row .up-ico { font-size: 18px; }
.up-name { font-size: 15px; font-weight: 600; }
.up-bar { height: 8px; }
.up-pct { inset-block-start: -5px; font-size: 11px; }
.up-sub { font-size: 12px; }

.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.editor-file { display: flex; align-items: center; gap: 9px; min-width: 0; }
.editor-file > i { color: var(--brand); }
.editor-file b { font-size: 14px; color: var(--ink); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-tools { flex-wrap: wrap; gap: 3px; }
.editor-tools .icon-btn.on { background: var(--brand-soft); color: var(--brand); }
.editor-sep { width: 1px; height: 20px; background: var(--line); margin-inline: 5px; }
.editor-status { font-size: 11.5px; color: var(--dim); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.editor-host { height: clamp(380px, 62vh, 760px); min-height: 0; }
.editor-host .CodeMirror { min-height: 0; }
.editor-shell.full { position: fixed; inset: 14px; z-index: 130; padding: var(--sp-3); overflow: auto; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.editor-shell.full .editor-host { height: calc(100vh - 150px); }

.CodeMirror-gutters { border-inline-end: 1px solid var(--line); background: rgba(0, 0, 0, .22); }
.CodeMirror-lint-markers { width: 15px; }
.CodeMirror-lint-tooltip { z-index: 150; }
.CodeMirror-hints, .CodeMirror-dialog { background: var(--bg-2); border: 1px solid var(--line-strong); color: var(--ink); border-radius: var(--radius-sm); font-family: var(--font-mono); }
.CodeMirror-hints { z-index: 140; padding: 4px; list-style: none; }
.CodeMirror-hints li { border-radius: var(--radius-xs); padding: 3px 8px; }
.CodeMirror-hints li.CodeMirror-hint-active { background: var(--brand); color: #fff; }
.CodeMirror-dialog { padding: 8px 10px; }
.CodeMirror-dialog input { background: var(--bg-1); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 4px 8px; }
.cm-tab { background: rgba(255, 255, 255, .06); }

@media (max-width: 700px) {
  .file-tree .file-row { grid-template-columns: 18px 18px 18px minmax(0, 1fr); }
  .file-tree .file-row .size { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- page transition loader ----------------------------------------------------
   A warm aurora veil, a sweeping gold arc and a shimmering wordmark. On exit the
   veil closes into a circle around the mark, so the new page opens from the centre.
   No extra markup is required: the four pseudo-elements are the whole loader. */
html.page-loading body::before {
  content: ''; position: fixed; inset: 0; z-index: 99990; pointer-events: auto;
  clip-path: circle(120% at 50% 50%);
  background:
    radial-gradient(120% 100% at 50% 42%, transparent 40%, rgba(3, 4, 8, 0.62) 100%),
    radial-gradient(22rem 22rem at 50% 50%, rgba(242, 176, 30, 0.13), transparent 70%),
    radial-gradient(46rem 34rem at 18% 12%, rgba(242, 176, 30, 0.20), transparent 62%),
    radial-gradient(40rem 30rem at 84% 78%, rgba(255, 211, 91, 0.12), transparent 62%),
    radial-gradient(52rem 40rem at 62% 118%, rgba(200, 137, 10, 0.18), transparent 66%),
    linear-gradient(180deg, #07080d, #040509);
  background-size: 100% 100%, 100% 100%, 160% 160%, 150% 150%, 170% 170%, 100% 100%;
  animation: loader-aurora 11s ease-in-out infinite alternate;
}
html[data-theme='light'].page-loading body::before {
  background:
    radial-gradient(120% 100% at 50% 42%, transparent 46%, rgba(120, 100, 60, 0.10) 100%),
    radial-gradient(22rem 22rem at 50% 50%, rgba(224, 165, 26, 0.12), transparent 70%),
    radial-gradient(46rem 34rem at 18% 12%, rgba(224, 165, 26, 0.20), transparent 62%),
    radial-gradient(40rem 30rem at 84% 78%, rgba(242, 176, 30, 0.14), transparent 62%),
    radial-gradient(52rem 40rem at 62% 118%, rgba(168, 113, 0, 0.10), transparent 66%),
    linear-gradient(180deg, #fbfaf6, #f3f0e9);
  background-size: 100% 100%, 100% 100%, 160% 160%, 150% 150%, 170% 170%, 100% 100%;
}
/* the arc: a conic sweep masked into a thin ring so it reads as a drawn stroke */
html.page-loading body::after {
  content: ''; position: fixed; top: 50%; left: 50%;
  width: 116px; height: 116px; margin: -58px 0 0 -58px; z-index: 99991; pointer-events: none;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(242, 176, 30, 0.11) 0deg 236deg,
    var(--brand) 296deg,
    var(--brand-bright) 344deg,
    rgba(242, 176, 30, 0.11) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  filter: drop-shadow(0 0 10px var(--brand-glow));
  opacity: 0; transform: scale(0.86);
  animation: loader-arc 1.15s linear infinite, loader-arc-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}
/* the bolt sits inside the ring and breathes */
html.page-loading::before {
  content: ''; position: fixed; top: 50%; left: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 99992; pointer-events: none;
  background: linear-gradient(150deg, var(--brand-bright), var(--brand) 55%, var(--brand-deep));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M13 2 4.2 13.4c-.4.5 0 1.2.6 1.2H10l-1.6 7.1c-.1.6.6.9 1 .4L20 10.7c.4-.5 0-1.2-.6-1.2H14l1.4-6.6c.1-.6-.5-.9-.9-.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M13 2 4.2 13.4c-.4.5 0 1.2.6 1.2H10l-1.6 7.1c-.1.6.6.9 1 .4L20 10.7c.4-.5 0-1.2-.6-1.2H14l1.4-6.6c.1-.6-.5-.9-.9-.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 14px var(--brand-glow));
  opacity: 0; transform: scale(0.7);
  animation: loader-bolt-in 0.34s ease 0.06s forwards, loader-bolt 2.1s ease-in-out 0.5s infinite;
}
/* wordmark with a slow gold sheen */
html.page-loading::after {
  content: 'BOTIFY HOSTING'; position: fixed; top: calc(50% + 92px); left: 50%;
  transform: translateX(-50%); z-index: 99992; pointer-events: none;
  direction: ltr; text-indent: 0.42em; white-space: nowrap;
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 800; letter-spacing: 0.42em;
  color: #f6f8fb;
  background: linear-gradient(100deg, #7f8795 0%, #f6f8fb 34%, var(--brand-bright) 50%, #f6f8fb 66%, #7f8795 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  animation: loader-word-in 0.34s ease 0.1s forwards, loader-sheen 2.6s ease-in-out 0.7s infinite;
}
html[data-theme='light'].page-loading::after {
  background: linear-gradient(100deg, #87909e 0%, #1f2a3a 34%, var(--brand) 50%, #1f2a3a 66%, #87909e 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
}
html.page-ready.page-loading body::before {
  clip-path: circle(0% at 50% 50%); opacity: 0; pointer-events: none;
  transition: clip-path 0.85s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.45s ease 0.45s;
}
html.page-ready.page-loading body::after {
  animation: loader-arc 0.9s linear infinite, loader-arc-out 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
html.page-ready.page-loading::before {
  animation: loader-bolt 2.1s ease-in-out infinite, loader-bolt-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
html.page-ready.page-loading::after {
  animation: loader-word-out 0.35s ease forwards;
}

@keyframes loader-aurora {
  from { background-position: 0 0, 0 0, 0% 0%, 100% 100%, 50% 100%, 0 0; }
  to { background-position: 0 0, 0 0, 55% 40%, 20% 55%, 35% 60%, 0 0; }
}
@keyframes loader-arc { to { rotate: 360deg; } }
@keyframes loader-arc-in {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes loader-arc-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.45); }
}
@keyframes loader-bolt-in {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes loader-bolt { 0%, 100% { scale: 1; } 50% { scale: 1.1; } }
@keyframes loader-bolt-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.7); }
}
@keyframes loader-word-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes loader-word-out {
  from { opacity: 1; transform: translateX(-50%); }
  to { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}
@keyframes loader-sheen {
  0% { background-position: 120% 0; }
  55%, 100% { background-position: -60% 0; }
}


/* ---- soft button light: every button keeps a gentle glow, never a bright one ---- */
.btn { --btn-sheen: rgba(255, 255, 255, 0.14); }
.btn, .icon-btn, .chip-btn, .tab { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 3px rgba(0, 0, 0, 0.2); }
.btn-primary {
  --btn-sheen: rgba(255, 255, 255, 0.2);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 3px rgba(120, 75, 0, 0.22), 0 4px 12px -6px rgba(242, 176, 30, 0.32);
}
.btn-primary:hover { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 3px rgba(120, 75, 0, 0.22), 0 8px 18px -8px rgba(242, 176, 30, 0.38); }
.btn-secondary, .btn-outline, .btn-danger, .btn-discord, .btn-ghost { --btn-sheen: rgba(255, 255, 255, 0.12); }
.btn-secondary { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px -6px rgba(0, 0, 0, 0.45); }
.btn-secondary:hover { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 14px -8px rgba(0, 0, 0, 0.5); }
.btn-outline { --btn-shadow: 0 2px 8px -6px rgba(0, 0, 0, 0.4); }
.btn-outline:hover { --btn-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.45); }
.btn-danger { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 3px 10px -6px rgba(224, 84, 75, 0.35); }
.btn-danger:hover { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 14px -8px rgba(224, 84, 75, 0.4); }
.btn-discord { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 3px 10px -6px rgba(88, 101, 242, 0.35); }
.btn-discord:hover { --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 14px -8px rgba(88, 101, 242, 0.4); }
.btn:hover { transform: translateY(-1px); }

/* ---- create server builder ---- */
.builder { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, var(--bg-2)), var(--bg-2)); }
.builder-head h3 { margin: 0; font-size: 21px; }
.builder-head p { margin: 4px 0 0; font-size: 13px; }
.builder-body { display: grid; gap: 18px; padding: 20px 24px; overflow: auto; }
.builder-step { display: grid; gap: 10px; }
.step-head { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); }
.step-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent); }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rt-card { display: grid; justify-items: center; gap: 8px; padding: 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: var(--text); transition: border-color .15s, background .15s, transform .1s; }
.rt-card b { font-size: 14.5px; }
.rt-card i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.rt-card:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); transform: translateY(-1px); }
.rt-card.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--bg-2)); }
.rt-card.off { opacity: .5; cursor: not-allowed; transform: none; }
.rt-card.off:hover { border-color: var(--line); transform: none; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.spec-field { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.spec-hint { margin: 0; font-size: 12px; }
.lang-badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; line-height: 0; }
.lang-badge svg { width: 34px; height: 34px; display: block; border-radius: 7px; }
.lang-badge--emoji { font-size: 24px; line-height: 1; }
.server-icon .lang-badge { width: 26px; height: 26px; }
.server-icon .lang-badge svg { width: 26px; height: 26px; border-radius: 6px; }
.server-icon .lang-badge--emoji { font-size: 19px; }
.plan-menu { width: 100%; font-size: 15px; font-weight: 700; padding: 14px 16px; border-radius: 14px; }
.price-box { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.price-main { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price-main span { font-size: 12px; color: var(--muted); }
.price-main b { font-size: 22px; color: var(--brand); }
.price-meta { font-size: 12px; color: var(--muted); }
.price-warn { display: none; }
.price-box.short { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: color-mix(in srgb, var(--danger) 10%, var(--bg-2)); }
.price-box.short .price-main b { color: var(--danger); }
.price-box.short .price-warn { display: block; font-size: 12.5px; font-weight: 700; color: var(--danger); }
.builder-foot { position: sticky; inset-block-end: 0; display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; padding: 15px 24px; border-block-start: 1px solid var(--line); background: var(--bg-2); }
.builder-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- celebration ---- */
.created-card { text-align: center; }
.created-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 8px 18px; }
.created-check { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; font-size: 30px; color: #fff; background: linear-gradient(140deg, var(--brand), #37d67a); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 45%, transparent); }
.created-hero h3 { font-size: 24px; margin: 0; }
.created-hero p { margin: 0; font-size: 14px; }
.created-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; text-align: start; }
.created-cell { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.created-cell span { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.created-cell b { font-size: 14.5px; word-break: break-word; align-items: center; }
.created-tip { margin-block: 16px 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); font-size: 13px; color: var(--muted); background: var(--bg-2); }

/* ---- custom cursor: compact arrow, code marks on anything clickable ---- */
:root {
  --cursor-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='20' viewBox='0 0 15 20'%3E%3Cpath d='M1.5 1 1.5 15.2 4.9 12.1 6.9 16.6 9 15.7 7 11.4 11.2 11.2Z' fill='%23f6f7f9' stroke='%23101319' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2;
  --cursor-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='20' viewBox='0 0 22 20'%3E%3Cg fill='none' stroke='%23f2b01e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.4 5.2 2.2 10l4.2 4.8'/%3E%3Cpath d='M15.6 5.2 19.8 10l-4.2 4.8'/%3E%3Cpath d='M12.6 3.6 9.4 16.4' stroke='%23fff' stroke-width='1.8'/%3E%3C/g%3E%3C/svg%3E") 11 10;
}
html, body { cursor: var(--cursor-arrow), auto; }
a, button, summary, select, input[type=checkbox], input[type=radio], label, .btn, .icon-btn, .tab, .chip-btn, .rt-card, .plan-row, .dur-chip, .lvl-chip, .side-link, [role=button], [data-close], .server-card, .pkg-card { cursor: var(--cursor-hand), pointer; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, .cm-content { cursor: text; }
