/* SMRbot dashboard: the servers' /dashboard and the owner's /owner, in the light look of the new site.
   A cream page, near-white cards with soft warm shadows, a cream side list with the mark and line icons, teal text,
   coral and yellow accents, and the teal arches scene in the overview's welcome banner.
   Tokens come from brand.css (--lt-* --teal-* --cream-* --coral-* --yellow-* --sh-* --r-*); this file loads after it.
   Like the rest of SMRbot, the motion plays even when the device asks for less motion (the owner wants it).

   Contents: tokens · base · boot and sign-in · shell (side list, top bar, phone drawer) · page head · cards and stats ·
   pills, lists, tables · forms, switches, buttons, tabs, save bar · notices, code, toasts · pickers and chips ·
   feature cards, module header · designer, previews, charts · permissions · plans · owner reports · overview pages */

/* ===================================================================================================================
   Tokens: the names the page code already uses (--line --ink --muted --accent --ok …), now on light surfaces
   =================================================================================================================== */
:root {
  color-scheme: light;
  --bg: var(--lt-page); --panel: var(--lt-card); --panel-2: var(--lt-card-2);
  --line: var(--lt-line); --line-2: var(--lt-line-2);
  --ink: var(--lt-text); --ink-2: var(--lt-text-2); --muted: var(--lt-muted);
  --accent: var(--coral-500); --accent-ink: #0A2426;
  --ok: var(--teal-600); --warn: var(--yellow-text); --bad: var(--coral-text); --info: var(--teal-500);
  --r: 20px; --rail-w: 286px; --tb-h: 70px; --focus: var(--teal-600);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--lt-page); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body.dash {
  color: var(--ink); font: 15px/1.7 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 620px at 0% -8%, rgb(255 203 87 / .13), transparent 62%),
    radial-gradient(900px 640px at 105% 108%, rgb(255 122 86 / .08), transparent 60%),
    var(--lt-page);
  background-attachment: fixed;
}
#boot, #login, #app, .toasts { position: relative; z-index: 1; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; color: var(--teal-800); }
h1 { font: 800 32px/1.35 var(--f-display); }
h2 { font: 800 19px/1.45 var(--f-display); }
h3 { font: 700 15.5px/1.5 var(--f-display); }
p { margin: 0; }
code { font-family: var(--f-latin); }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-family: var(--f-latin); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-body); font-variant-numeric: tabular-nums; font-size: 13px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: rgb(255 203 87 / .55); color: var(--teal-900); }
.tb-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 8px; pointer-events: none; }
/* the icon wrappers the overview pages draw (art.js icon() inside a span) */
.ic-w { display: inline-flex; flex: none; line-height: 0; }
.ic-w .ic { width: 1.15em; height: 1.15em; }

/* ===================================================================================================================
   Loading screen: the mark draws itself
   =================================================================================================================== */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.boot-in { display: grid; justify-items: center; gap: 18px; color: var(--muted); font-weight: 600; }
.boot-mark { height: 64px; }
.boot-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: boot-draw 1.6s var(--ease-out) infinite alternate; }
.boot-mark path:nth-of-type(2) { animation-delay: .16s; } .boot-mark path:nth-of-type(3) { animation-delay: .32s; }
.boot-t { animation: boot-fade 1.6s ease-in-out infinite alternate; }
@keyframes boot-draw { 0% { stroke-dashoffset: 1; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes boot-fade { from { opacity: .55; } to { opacity: 1; } }

/* ===================================================================================================================
   Sign in: a wide card, the form at the start, the teal scene with the medallion at the end
   =================================================================================================================== */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: clamp(16px, 4vw, 40px) 16px; }
.login-shell {
  width: min(1060px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); overflow: hidden; isolation: isolate;
  background: var(--lt-card); border: 1px solid var(--lt-line); border-radius: 34px; box-shadow: var(--sh-lg), inset 0 1px 0 #fff;
  animation: lg-in 1s var(--ease-out) both;
}
.login-card { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; padding: clamp(28px, 5vw, 64px); }
.login-card > * { animation: lg-rise .9s var(--ease-out) both; }
.login-card > :nth-child(2) { animation-delay: .08s; } .login-card > :nth-child(3) { animation-delay: .16s; }
.login-card > :nth-child(4) { animation-delay: .22s; } .login-card > :nth-child(5) { animation-delay: .28s; } .login-card > :nth-child(6) { animation-delay: .34s; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--teal-800); border-radius: 12px; }
.login-brand .logo-mark { height: 34px; }
.login-brand b { font: 800 26px/1 var(--f-latin); }
.login-card h1 { font: 800 clamp(28px, 3.2vw, 38px)/1.3 var(--f-display); }
.login-card .muted { max-width: 44ch; font-size: 16px; line-height: 1.85; }
.login-card .error {
  align-self: stretch; background: var(--coral-50); color: var(--coral-800); border: 1px solid var(--coral-200); border-radius: 14px;
  padding: 12px 16px; font-size: 14px; line-height: 1.8;
}
.login-card .error code { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 8px; background: #fff; color: var(--teal-800); font-size: 13px; }
.lbtn {
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 12px 30px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  background: var(--grad-coral); color: #0A2426; font: 800 16.5px/1.2 var(--f-body);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), var(--sh-coral); transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.lbtn .ic { width: 24px; height: 24px; transition: transform .5s var(--ease-spring); }
.lbtn::after {
  content: ""; position: absolute; inset-block: -30%; inset-inline-start: 0; width: 42%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .55), transparent); transform: translateX(150%) skewX(-20deg);
}
.lbtn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 20px 36px -14px rgb(240 98 61 / .8); }
.lbtn:hover::after { transition: transform .9s var(--ease-out); transform: translateX(-360%) skewX(-20deg); }
.lbtn:hover .ic { transform: rotate(-8deg) scale(1.08); }
.login-more { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14.5px; }
.login-more a { color: var(--teal-700); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid rgb(46 110 114 / .25); padding-bottom: 2px; transition: color .25s, border-color .25s; }
.login-more a:hover { color: var(--coral-text); border-color: var(--coral-400); }
.login-art { position: relative; min-height: 600px; overflow: hidden; isolation: isolate; --scene-floor: var(--lt-card); --scene-maxw: 100cqw; }
.login-art .scene--home .sc-gate { width: min(84cqw, 440px); inset-inline: 0; margin-inline: auto; }
.login-mark {
  position: absolute; z-index: 2; top: 8%; left: 50%; width: min(220px, 46%); translate: -50% 0;
  filter: drop-shadow(0 26px 40px rgb(4 20 22 / .5)); animation: lg-float 7s ease-in-out infinite;
}
@keyframes lg-in { from { opacity: 0; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lg-rise { from { opacity: 0; transform: translateY(16px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes lg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; border-radius: 28px; }
  .login-art { order: -1; min-height: 300px; }
  .login-art .sc-gate { display: none; }
  .login-mark { top: 12%; width: 150px; }
  .login-card { align-items: stretch; text-align: start; }
  .lbtn { width: 100%; }
}
@media (max-width: 420px) { .login-card { padding: 26px 20px 30px; } .login-art { min-height: 250px; } .login-mark { width: 128px; } }
/* the ring's words are Arabic (mark.js): in English the ring keeps its ticks and gold rings only */
html[lang="en"] .login-mark :is(.mk-words-top, .mk-words-bottom) { display: none; }

/* ===================================================================================================================
   Shell: the cream side list (start side), the slim top bar, one content column
   =================================================================================================================== */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 14px; z-index: 40; height: calc(100vh - 28px); height: calc(100dvh - 28px); margin: 14px; margin-inline-end: 0;
  display: flex; flex-direction: column; overflow: hidden; isolation: isolate; border-radius: 28px;
  background: linear-gradient(180deg, #FFFCF6 0%, #FBF4E8 55%, #F8EEDD 100%);
  border: 1px solid var(--lt-line); box-shadow: var(--sh-md), inset 0 1px 0 #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 22px 14px; text-decoration: none; color: var(--teal-800); border-radius: 18px; flex: none; }
.brand .logo-mark { height: 30px; transition: transform .6s var(--ease-spring); }
.brand:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }
.brand-t { display: grid; line-height: 1.1; }
.brand-t b { font: 800 23px/1.05 var(--f-latin); letter-spacing: .01em; }
.brand-t small { font: 600 12px/1.5 var(--f-body); color: var(--muted); margin-top: 3px; }
.owner .brand-t small { color: var(--coral-text); }

/* the server card: teal, the Discord glyph in a coral circle, the server's name (or the list of servers) */
.srv {
  flex: none; display: flex; align-items: center; gap: 12px; margin: 0 14px 12px; padding: 11px 14px; border-radius: 18px;
  color: var(--cream-100); color-scheme: dark; --focus: var(--yellow-500); position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 120% at 100% 0%, rgb(63 135 138 / .55), transparent 60%), var(--grad-teal);
  box-shadow: 0 14px 26px -16px rgb(12 43 45 / .8), inset 0 1px 0 rgb(243 231 211 / .12);
}
.srv::after { content: ""; position: absolute; inset: auto -10% -60% 30%; height: 90%; z-index: -1; background: radial-gradient(closest-side, rgb(255 122 86 / .35), transparent); pointer-events: none; }
.srv-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--grad-coral); color: #0A2426; box-shadow: 0 6px 14px -6px rgb(240 98 61 / .8); }
.srv-ic .ic { width: 22px; height: 22px; }
.owner .srv-ic { background: var(--grad-gold); color: var(--teal-900); }
.srv-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.srv-l { font: 600 11.5px/1.4 var(--f-body); color: var(--dk-muted); }
.srv-n { font: 800 15px/1.35 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.35em; }
.srv:has(.guild-pick:not([hidden])) :is(.srv-l, .srv-n) { display: none; }
.guild-pick { display: grid; gap: 3px; }
.guild-pick label { font: 600 11.5px/1.4 var(--f-body); color: var(--dk-muted) !important; }
.guild-pick select {
  min-height: 30px; padding: 0 0 0 26px; padding-inline-end: 26px; padding-inline-start: 0; border: 0; border-radius: 8px; box-shadow: none;
  background-color: transparent; color: var(--cream-100); font: 800 15px/1.35 var(--f-display); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFDB7E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-position: left 2px center; background-size: 16px;
}
.guild-pick select:hover { border: 0; }
/* focused (Tab or a click to open it), it stays on the teal card: no white box, the yellow ring clear of the label */
.guild-pick select:focus { background-color: transparent; border: 0; box-shadow: none; outline: none; }
.guild-pick select:focus-visible { outline: 2px solid var(--yellow-500); outline-offset: 2px; }
.guild-pick select option { background: #fff; color: var(--teal-800); }

/* the list of pages: groups, line icons, the active page in a coral pill */
.nav {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 22px;
  scrollbar-width: thin; scrollbar-color: rgb(21 61 64 / .18) transparent;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent);
}
.nav .group { font: 800 11.5px/1.5 var(--f-display); color: var(--teal-600); padding: 16px 12px 6px; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.nav .group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(270deg, rgb(21 61 64 / .12), transparent); }
.nav a {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 5px 8px; margin-block: 1px;
  border-radius: 14px; text-decoration: none; color: var(--ink-2); font: 600 14.5px/1.35 var(--f-body);
  transition: color .3s, background-color .3s, transform .35s var(--ease-out);
}
.nav a .ico {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--teal-600);
  background: rgb(21 61 64 / .045); transition: background-color .3s, color .3s, transform .5s var(--ease-spring);
}
.nav a .ico .ic { width: 19px; height: 19px; }
.nav a .lbl { flex: 1; min-width: 0; }
.nav a:hover { background: rgb(21 61 64 / .05); color: var(--teal-800); }
.nav a:hover .ico { transform: translateY(-1px) rotate(-6deg); background: rgb(255 122 86 / .14); color: var(--coral-700); }
.nav a:active { transform: scale(.98); }
.nav a[aria-current="page"] { color: #0A2426; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 14px; background: var(--grad-coral);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .38), 0 12px 24px -14px rgb(240 98 61 / .85);
  animation: nav-pill .55s var(--ease-out) both;
}
.nav a[aria-current="page"] .ico { background: rgb(255 253 248 / .32); color: #0A2426; }
.nav a[aria-current="page"]:hover .ico { transform: none; }
@keyframes nav-pill { from { opacity: 0; transform: scaleX(.86); } to { opacity: 1; transform: none; } }
.nav a .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 3px rgb(63 135 138 / .16); margin-inline: auto 6px; flex: none; }
.nav a[aria-current="page"] .dot { background: #0A2426; box-shadow: 0 0 0 3px rgb(255 255 255 / .35); }
.nav a .lock { margin-inline: auto 4px; flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: var(--yellow-text); background: var(--yellow-100); }
.nav a .lock .ic { width: 14px; height: 14px; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
/* the link between the owner's dashboard and the servers' dashboard */
.nav a.nav-switch {
  margin: 4px 0 6px; padding-inline-end: 12px; color: #5C3D00;
  background: linear-gradient(135deg, #FFF4D6, #FFE3A0); box-shadow: inset 0 0 0 1px rgb(217 143 31 / .28), 0 8px 18px -12px rgb(217 143 31 / .7);
}
.nav a.nav-switch .ico { background: rgb(255 255 255 / .55); color: var(--yellow-800); }
.nav a.nav-switch .go { flex: none; display: grid; color: var(--yellow-800); transition: transform .45s var(--ease-spring); }
.nav a.nav-switch .go .ic { width: 18px; height: 18px; }
.nav a.nav-switch:hover { background: linear-gradient(135deg, #FFF0C4, #FFD979); color: #4A3100; }
.nav a.nav-switch:hover .go { transform: translateX(-4px); }
.nav a.nav-switch:hover .ico { background: rgb(255 255 255 / .7); color: var(--yellow-800); }

/* the foot of the side list: waves, then two links on teal */
.rail-foot { flex: none; position: relative; margin-top: auto; }
.rail-waves { position: relative; height: 44px; overflow: hidden; --foot-bg: var(--teal-800); pointer-events: none; }
.rail-waves .sf-wave { position: absolute; bottom: -1px; left: -60px; width: calc(100% + 120px); height: 100%; animation: sc-sway var(--d, 18s) ease-in-out var(--dl, 0s) infinite alternate; will-change: transform; }
.rail-waves .sf-f2 { height: 80%; } .rail-waves .sf-f3 { height: 56%; }
.rail-links { display: flex; gap: 8px; padding: 2px 12px 10px; background: var(--teal-800); color-scheme: dark; --focus: var(--yellow-500); }
.rail-links a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 6px 10px; border-radius: 12px;
  color: var(--cream-100); text-decoration: none; font: 700 13px/1.2 var(--f-body); background: rgb(243 231 211 / .08);
  box-shadow: inset 0 0 0 1px rgb(243 231 211 / .1); transition: background-color .3s, transform .35s var(--ease-out);
}
.rail-links a .ic { width: 16px; height: 16px; color: var(--yellow-500); }
.rail-links a:hover { background: rgb(243 231 211 / .16); transform: translateY(-1px); }
/* the developer's credit under the two links, as at the foot of the site */
.rail-credit { margin: 0; display: flex; justify-content: center; padding: 0 12px 12px; background: var(--teal-800); }
.rail-dev {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); white-space: nowrap;
  background: rgb(243 231 211 / .06); box-shadow: inset 0 0 0 1px rgb(243 231 211 / .12); color: rgb(243 231 211 / .78); font: 600 12px/1.2 var(--f-body);
}
a.rail-dev { text-decoration: none; cursor: pointer; transition: background-color .35s, box-shadow .35s; }
a.rail-dev:hover { background: rgb(243 231 211 / .1); box-shadow: inset 0 0 0 1px rgb(255 203 87 / .4); }
a.rail-dev:focus-visible { outline: 2px solid var(--yellow-500); outline-offset: 3px; }
.rail-dev .ic { width: 14px; height: 14px; color: var(--yellow-500); }
.rail-dev-name {
  font: 800 13px/1 var(--f-latin); letter-spacing: .02em; direction: ltr; unicode-bidi: isolate;
  background: linear-gradient(90deg, var(--coral-400), var(--yellow-500) 45%, #FFF1CC 55%, var(--yellow-500) 65%, var(--coral-400));
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rail-shine 7s ease-in-out infinite;
}
@keyframes rail-shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* the content column and its slim top bar */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--tb-h); display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 2.6vw, 34px); transition: background-color .4s var(--ease-soft), box-shadow .4s var(--ease-soft);
}
.topbar.scrolled { background: rgb(247 238 223 / .82); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 10px 30px -22px rgb(21 61 64 / .45), inset 0 -1px 0 var(--lt-line); }
.crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crumb-root { font-weight: 600; white-space: nowrap; }
.crumb-sep { color: var(--cream-600); }
.crumb-sep .ic { width: 16px; height: 16px; }
.mbar-title { font: 800 15px/1.3 var(--f-display); color: var(--teal-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-end { display: flex; align-items: center; gap: 10px; flex: none; }
.tb-btn {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 14px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--lt-line); background: var(--lt-card); color: var(--teal-700); box-shadow: var(--sh-xs);
  transition: transform .35s var(--ease-out), box-shadow .35s, color .3s, background-color .3s;
}
.tb-btn .ic { width: 20px; height: 20px; }
.tb-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); color: var(--coral-text); }
#logout:hover { background: var(--coral-50); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 14px; border-radius: 999px; background: var(--lt-card); border: 1px solid var(--lt-line); box-shadow: var(--sh-xs); min-width: 0; }
[dir="rtl"] .me { padding: 4px 4px 4px 14px; }
.me img { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--cream-300); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--yellow-500); }
.me .who { display: grid; line-height: 1.25; min-width: 0; }
.me .who b { font: 700 13.5px/1.3 var(--f-body); color: var(--teal-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.me .who span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.burger { display: none; }

.main { padding: 6px clamp(16px, 2.6vw, 34px) 96px; min-width: 0; flex: 1; }
.page { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* a page settles in when it opens: each block rises in turn */
.page.enter > * { animation: settle .7s var(--ease-out) both; }
.page.enter > :nth-child(2) { animation-delay: .07s; }
.page.enter > :nth-child(3) { animation-delay: .14s; }
.page.enter > :nth-child(n + 4) { animation-delay: .2s; }
.page.enter .page-head::after { animation: draw 1.1s .1s var(--ease-out) both; }
.page.enter .form > * { animation: settle .7s var(--ease-out) both; }
.page.enter .form > :nth-child(2) { animation-delay: .06s; } .page.enter .form > :nth-child(3) { animation-delay: .12s; }
.page.enter .form > :nth-child(4) { animation-delay: .18s; } .page.enter .form > :nth-child(n + 5) { animation-delay: .24s; }
.page.enter .form .form > * { animation: none; }
@keyframes settle { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } }

/* phones and small tablets: the top bar gets ☰ and the side list slides in from the start side, under the bar */
@media (max-width: 1180px) { :root { --rail-w: 266px; } .me .who { display: none; } [dir="rtl"] .me { padding: 3px; } }
@media (max-width: 860px) {
  :root { --tb-h: calc(64px + env(safe-area-inset-top, 0px)); }
  .app { grid-template-columns: 1fr; }
  .topbar { padding: env(safe-area-inset-top, 0px) 14px 0; gap: 10px; background: rgb(247 238 223 / .88); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: inset 0 -1px 0 var(--lt-line); }
  .crumb-root, .crumb-sep { display: none; }
  .mbar-title { font-size: 17px; }
  .burger {
    flex: none; width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; padding: 0; cursor: pointer;
    border: 1px solid var(--lt-line); border-radius: 14px; background: var(--lt-card); box-shadow: var(--sh-xs);
  }
  .burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--teal-800); transition: transform .35s var(--ease-out), opacity .2s; }
  .app.drawer-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .app.drawer-open .burger span:nth-child(2) { opacity: 0; }
  .app.drawer-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .rail {
    position: fixed; z-index: 40; top: var(--tb-h); bottom: 0; inset-inline-start: 0; width: min(318px, 88vw); height: auto; margin: 0;
    border-radius: 0; border-start-end-radius: 26px; border-end-end-radius: 26px; border: 0;
    box-shadow: -26px 0 60px -24px rgb(12 43 45 / .45); transform: translateX(104%); visibility: hidden;
    transition: transform .5s var(--ease-out), visibility 0s .5s;
  }
  [dir="ltr"] .rail { transform: translateX(-104%); }
  .rail-credit { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .app.drawer-open .rail { transform: none; visibility: visible; transition: transform .5s var(--ease-out); }
  .scrim { display: block; position: fixed; inset: var(--tb-h) 0 0; z-index: 35; background: rgb(12 43 45 / .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .4s; }
  .app.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .main { padding-top: 18px; }
}
@media (max-width: 420px) { .tb-end > a.tb-btn { display: none; } .tb-btn { width: 40px; height: 40px; } }
.scrim { display: none; }
html.no-scroll { overflow: hidden; }

/* ===================================================================================================================
   Page head: the group as a coral eyebrow, the title, a line that draws itself in coral and yellow
   =================================================================================================================== */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 4px 0 20px; position: relative; }
.page-head::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(270deg, var(--coral-500), var(--yellow-500) 22%, rgb(21 61 64 / .10) 46%, transparent); transform-origin: right; }
.page-head h1 { font: 800 clamp(26px, 3vw, 34px)/1.3 var(--f-display); }
.page-head p { max-width: 72ch; margin-top: 6px; font-size: 15.5px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  background: var(--coral-50); color: var(--coral-800); font: 700 12.5px/1.4 var(--f-body); box-shadow: inset 0 0 0 1px rgb(255 122 86 / .2);
}
.plan-now .eyebrow, .lock-card .eyebrow { margin-bottom: 2px; }

/* ===================================================================================================================
   Cards and stats
   =================================================================================================================== */
.card {
  position: relative; background: var(--lt-card); border: 1px solid var(--lt-line); border-radius: var(--r); padding: clamp(18px, 2vw, 24px);
  display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--sh-sm), inset 0 1px 0 rgb(255 255 255 / .9);
}
.card > h2:first-child, .card > div:first-child > h2:first-child { display: flex; align-items: center; gap: 10px; }
/* a section title in a card leads with a short coral-to-yellow bar */
.card > h2:first-child::before, .card > div:first-child:not(.card-h) > h2:first-child::before { content: ""; width: 5px; height: 1.05em; border-radius: 4px; flex: none; background: linear-gradient(180deg, var(--yellow-500), var(--coral-500)); }
.plan-now > h2:first-child::before, .lock-card > h2:first-child::before { display: none; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .n { font: 800 28px/1.2 var(--f-latin); font-variant-numeric: tabular-nums; color: var(--teal-800); overflow-wrap: anywhere; }
.stat .l { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.stat .sub { color: var(--muted); font-size: 12.5px; }
/* a stat card gets a short coloured bar, in turn coral, yellow, teal */
.card > .stat::before { content: ""; width: 30px; height: 5px; border-radius: 5px; margin-bottom: 8px; background: var(--grad-coral); }
.stats > .card:nth-child(3n + 2) > .stat::before { background: var(--grad-gold); }
.stats > .card:nth-child(3n) > .stat::before { background: linear-gradient(90deg, var(--teal-500), var(--teal-700)); }
.card.status { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(270deg, var(--yellow-50), var(--lt-card)); }
.card.status .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* ===================================================================================================================
   Pills, lists, tables
   =================================================================================================================== */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1.5 var(--f-body); padding: 3px 11px; border-radius: 99px; white-space: nowrap; background: var(--cream-300); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--teal-100); color: var(--teal-700); }
.pill.bad { background: var(--coral-100); color: var(--coral-800); }
.pill.warn { background: var(--yellow-100); color: var(--yellow-text); }
.pill.info { background: var(--teal-50); color: var(--teal-700); box-shadow: inset 0 0 0 1px var(--teal-200); }
.pill.muted { background: rgb(21 61 64 / .06); color: var(--muted); }
.pill .ic { width: 13px; height: 13px; }
.pill.lockp::before { display: none; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .grow > * { overflow: hidden; text-overflow: ellipsis; }
.item b { color: var(--teal-800); }
.item img.av { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--cream-300); box-shadow: 0 0 0 2px #fff, var(--sh-xs); }
.item .sub, .sub { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }

.table-wrap { overflow-x: auto; border-radius: 14px; scrollbar-width: thin; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: start; color: var(--muted); font: 700 12.5px/1.4 var(--f-body); padding: 10px 12px; background: var(--lt-card-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th:first-child { border-start-start-radius: 12px; } th:last-child { border-start-end-radius: 12px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .25s; }
tbody tr:hover { background: rgb(243 231 211 / .38); }
td.num { font-family: var(--f-latin); font-variant-numeric: tabular-nums; }
td code { background: var(--lt-sunk); padding: 2px 8px; border-radius: 8px; color: var(--teal-800); white-space: nowrap; }

/* ===================================================================================================================
   Forms
   =================================================================================================================== */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > .label { font: 700 14px/1.5 var(--f-body); color: var(--teal-800); }
.field .hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > .field { flex: 1 1 160px; }
.row.fields { align-items: start; }
.row.fields > .toggle { flex: 1 1 160px; }
.subhead { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.subhead h3 { font: 800 16px/1.45 var(--f-display); color: var(--teal-800); display: flex; align-items: center; gap: 8px; }
.subhead h3::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--grad-coral); transform: rotate(45deg); flex: none; }
input[type=text], input[type=number], input[type=search], input[type=url], input[type=email], input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 14px; border-radius: 13px; border: 1px solid var(--line-2); color: var(--ink);
  background-color: #FFFEFB; box-shadow: inset 0 1px 2px rgb(21 61 64 / .05);
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
input::placeholder, textarea::placeholder { color: rgb(79 101 103 / .72); }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E6E72' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 16px;
}
[dir="ltr"] select { background-position: right 14px center; }
select option { background: #FFFEFB; color: var(--teal-800); }
input:hover, select:hover, textarea:hover { border-color: rgb(21 61 64 / .3); }
textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-600); box-shadow: 0 0 0 4px rgb(46 110 114 / .16), inset 0 1px 2px rgb(21 61 64 / .04); background-color: #fff; }
input:disabled, select:disabled, textarea:disabled { background-color: var(--lt-sunk); color: var(--muted); cursor: not-allowed; }
input[type=color] { width: 52px; height: 44px; padding: 4px; border-radius: 13px; border: 1px solid var(--line-2); background: #FFFEFB; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } input[type=color]::-webkit-color-swatch { border: 0; border-radius: 9px; }
/* sliders: a thin cream track, a coral knob with a white ring (no dark track from the browser) */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; padding: 0; background: transparent; cursor: pointer; accent-color: var(--coral-500); }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--cream-500); box-shadow: inset 0 1px 2px rgb(21 61 64 / .12); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--cream-500); box-shadow: inset 0 1px 2px rgb(21 61 64 / .12); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--grad-coral); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; border: 3px solid #fff;
  background: var(--coral-500); box-shadow: 0 2px 6px rgb(21 61 64 / .32); transition: transform .3s var(--ease-spring);
}
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 3px solid #fff; background: var(--coral-500); box-shadow: 0 2px 6px rgb(21 61 64 / .32); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type=range]:focus { background: transparent; box-shadow: none; border: 0; }
input[type=range]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
input[type=range]:disabled { opacity: .5; cursor: not-allowed; background: transparent; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--teal-600); cursor: pointer; flex: none; }
input[type=file] { font-size: 13.5px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  margin-inline-end: 12px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer;
  background: linear-gradient(180deg, #FFFDF8, #F4E8D5); color: var(--teal-800); font: 700 13px/1.2 var(--f-body);
}

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }
.toggle .txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.toggle .txt label { font-weight: 700; color: var(--teal-800); }
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
/* off: an outlined track with a small teal-grey knob; on: a filled teal track, the knob white with a yellow ring */
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #F3ECE0; box-shadow: inset 0 0 0 2px #6E8C8A; transition: background .35s var(--ease-out), box-shadow .35s var(--ease-out); pointer-events: none; }
.switch span::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #6E8C8A;
  transform: scale(.66); transition: transform .45s var(--ease-spring), background-color .3s, box-shadow .3s;
}
.switch input:checked + span { background: var(--grad-teal); box-shadow: inset 0 1px 2px rgb(0 0 0 / .2), 0 6px 14px -8px rgb(12 43 45 / .7); }
.switch input:checked + span::after { transform: translateX(-22px); background: #FFFDF8; box-shadow: 0 2px 6px rgb(0 0 0 / .3), inset 0 0 0 5px var(--yellow-500); }
[dir="ltr"] .switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch:hover input:not(:checked) + span::after { transform: scale(.78); }
.switch input:disabled + span { opacity: .5; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.rows .r { display: flex; gap: 8px; align-items: center; }
.rows .r > * { flex: 1; min-width: 0; }
.rows .r > .x { flex: none; }

/* buttons: cream by default, coral for the main action, a band of light sweeps across on hover */
.btn {
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 20px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, #FFFDF8, #F6ECDC); color: var(--teal-800); font: 700 14.5px/1.2 var(--f-body);
  box-shadow: inset 0 1px 0 #fff, var(--sh-xs);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .3s, background-color .3s, color .3s;
}
.btn::after {
  content: ""; position: absolute; inset-block: -30%; inset-inline-start: 0; width: 42%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .6), transparent); transform: translateX(150%) skewX(-20deg);
}
[dir="ltr"] .btn::after { transform: translateX(-150%) skewX(-20deg); }
.btn:hover { transform: translateY(-2px); border-color: rgb(21 61 64 / .28); box-shadow: inset 0 1px 0 #fff, var(--sh-sm); }
.btn:hover::after { transition: transform .9s var(--ease-out); transform: translateX(-360%) skewX(-20deg); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .12s; }
.btn.primary {
  background: var(--grad-coral); color: #0A2426; border-color: transparent; font-weight: 800;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .38), 0 10px 22px -12px rgb(240 98 61 / .8);
}
.btn.primary:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 16px 30px -12px rgb(240 98 61 / .85); }
.btn.danger { color: var(--coral-800); border-color: var(--coral-200); background: linear-gradient(180deg, #FFFBF8, var(--coral-50)); }
.btn.danger:hover { background: var(--coral-100); border-color: var(--coral-300); }
.btn.small { min-height: 34px; padding: 5px 15px; font-size: 13px; }
.btn.x { min-height: 44px; width: 44px; padding: 0; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }
.btn:focus-visible, .nav a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* tabs: a sunk cream track, the chosen tab a raised white chip */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 5px; border-radius: 16px; background: var(--lt-sunk); box-shadow: inset 0 1px 2px rgb(21 61 64 / .08); align-self: flex-start; max-width: 100%; }
.tabs button { background: none; border: 0; padding: 8px 16px; min-height: 38px; color: var(--muted); cursor: pointer; border-radius: 12px; font: 700 14px/1.3 var(--f-body); transition: color .3s, background-color .3s, box-shadow .3s; }
.tabs button:hover { color: var(--teal-800); background: rgb(255 255 255 / .5); }
.tabs button[aria-selected="true"] { color: var(--teal-800); background: #fff; box-shadow: var(--sh-sm); }
.tabs button:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }

.savebar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: rgb(255 251 244 / .9); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line-2); border-radius: 22px; padding: 10px 12px 10px 16px; box-shadow: var(--sh-lg);
}
[dir="rtl"] .savebar { padding: 10px 16px 10px 12px; }

/* ===================================================================================================================
   Notices, code, toasts
   =================================================================================================================== */
.notice {
  position: relative; border-radius: 16px; padding: 13px 16px; padding-inline-start: 18px; font-size: 14.5px; line-height: 1.8;
  border: 1px solid var(--teal-200); background: var(--teal-50); color: var(--ink);
}
.notice::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 4px; border-radius: 4px; background: var(--teal-500); }
.notice a { color: var(--teal-700); font-weight: 700; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.notice a:hover { color: var(--coral-text); }
.notice.warn { border-color: var(--yellow-200); background: var(--yellow-50); }
.notice.warn::before { background: var(--yellow-600); }
.notice.warn a { color: var(--yellow-text); text-decoration-color: var(--yellow-600); }
.notice.warn a:hover { color: var(--coral-text); text-decoration-color: currentColor; }
.notice.bad { border-color: var(--coral-200); background: var(--coral-50); color: var(--coral-800); }
.notice.bad::before { background: var(--coral-500); }
.notice.bad a { color: var(--coral-800); }

.key { display: flex; gap: 8px; align-items: center; }
.key code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--lt-sunk); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 13px; direction: ltr; text-align: left; color: var(--teal-800); font-size: 13.5px;
}
pre.env, pre.result {
  margin: 0; background: var(--teal-900); color: var(--cream-200); border: 0; border-radius: 16px; padding: 14px 16px;
  overflow: auto; font: 13px/1.75 var(--f-body); box-shadow: inset 0 1px 0 rgb(243 231 211 / .06);
}
pre.env { direction: ltr; text-align: left; }
pre.result { white-space: pre-wrap; max-height: 520px; }

.toasts { position: fixed; inset-inline-end: max(16px, env(safe-area-inset-left)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; z-index: 60; max-width: min(400px, calc(100vw - 32px)); }
.toast {
  position: relative; overflow: hidden; background: var(--grad-teal); color: var(--cream-100); padding: 12px 18px; border-radius: 16px;
  font-size: 14.5px; font-weight: 600; line-height: 1.6; box-shadow: 0 22px 40px -18px rgb(12 43 45 / .75), inset 0 1px 0 rgb(243 231 211 / .12);
  border-inline-start: 5px solid var(--yellow-500); animation: toast .55s var(--ease-spring);
}
.toast.bad { border-inline-start-color: var(--coral-500); }
.toast.ok { border-inline-start-color: var(--teal-300); }
@keyframes toast { from { opacity: 0; transform: translateY(18px) scale(.94); } }

/* ===================================================================================================================
   Pickers (channels and roles as chips)
   =================================================================================================================== */
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--lt-card-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 3px 4px; padding-inline-start: 12px; font-size: 13px; font-weight: 600; max-width: 100%; color: var(--teal-800); }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.bad { border-color: var(--coral-300); background: var(--coral-50); color: var(--coral-800); }
.chip button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; display: grid; place-items: center; transition: background-color .2s, color .2s; }
.chip button:hover { background: var(--coral-100); color: var(--coral-800); }
.chips select { width: auto; min-width: 140px; flex: 1 1 140px; min-height: 36px; padding-block: 4px; border-radius: 99px; font-size: 13.5px; }

/* ===================================================================================================================
   Feature cards (overview), module header (a feature's on/off)
   =================================================================================================================== */
.module { display: flex; align-items: center; gap: 14px; }
.module .ico { font-size: 26px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; flex: none; background: linear-gradient(160deg, var(--yellow-100), var(--coral-100)); box-shadow: inset 0 1px 0 #fff, var(--sh-xs); }
.module .txt { flex: 1; min-width: 0; }
.feature-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.feature {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--lt-card-2);
  text-decoration: none; min-width: 0; box-shadow: inset 0 1px 0 #fff;
  transition: border-color .3s, background-color .3s, box-shadow .45s var(--ease-out), transform .45s var(--ease-out);
}
.feature .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feature:hover { border-color: var(--line-2); background: #fff; transform: translateY(-4px); box-shadow: var(--sh-md); }
.feature .ico { font-size: 22px; flex: none; }
.feature .t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.feature .t b { font: 800 15px/1.4 var(--f-display); color: var(--teal-800); }
.feature .t span { color: var(--muted); font-size: 13px; line-height: 1.65; }

/* ===================================================================================================================
   The welcome-card designer, Discord-like previews, card looks
   =================================================================================================================== */
.designer { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 1000px) { .designer { grid-template-columns: 1fr; } }
.designer canvas {
  width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line-2); touch-action: none; cursor: grab; box-shadow: var(--sh-sm);
  background: repeating-conic-gradient(#EFE3CF 0 25%, #F9F1E4 0 50%) 0 0 / 20px 20px;
}
.designer canvas.dragging { cursor: grabbing; }
.designer .controls { display: flex; flex-direction: column; gap: 12px; }
.designer .layer { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--lt-card-2); transition: border-color .3s, box-shadow .3s; }
.designer .layer.sel { border-color: var(--coral-400); box-shadow: 0 0 0 3px rgb(255 122 86 / .16); background: #fff; }
.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; align-items: end; }
.mini .field > label, .mini .field > .label { font-size: 12.5px; }

/* the Discord-like preview keeps Discord's own dark look, framed */
.dc { background: #313338; color: #DBDEE1; border-radius: 16px; padding: 16px; font: 14px/1.45 var(--f-body); direction: auto; box-shadow: var(--sh-md); }
.dc .msg { white-space: pre-wrap; margin-bottom: 6px; }
.dc .emb { border-inline-start: 4px solid #FFCB57; background: #2B2D31; border-radius: 4px; padding: 10px 14px; display: grid; gap: 6px; max-width: 520px; }
.dc .emb .au { font-size: 13px; font-weight: 600; } .dc .emb .ti { font-weight: 700; color: #fff; } .dc .emb .de { white-space: pre-wrap; }
.dc .emb .fs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .dc .emb .fs .f { grid-column: 1 / -1; } .dc .emb .fs .f.in { grid-column: auto; }
.dc .emb .fs b { display: block; font-size: 13px; color: #fff; }
.dc .emb img.im { max-width: 100%; border-radius: 4px; } .dc .emb .fo { font-size: 12px; color: #B5BAC1; }
.dc .btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; } .dc .btns span { background: #4E5058; color: #fff; padding: 5px 14px; border-radius: 4px; font-size: 13px; }

/* the card looks picker */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 6px; }
.theme {
  display: flex; flex-direction: column; gap: 7px; align-items: stretch; padding: 10px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--lt-card-2); color: var(--teal-800); cursor: pointer; font: 700 13.5px/1.4 var(--f-body); text-align: start;
  transition: border-color .3s, transform .4s var(--ease-out), box-shadow .4s var(--ease-out), background-color .3s;
}
.theme:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--sh-sm); background: #fff; }
.theme:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme.on { border-color: var(--coral-400); background: #fff; box-shadow: 0 0 0 3px rgb(255 122 86 / .18), var(--sh-sm); }
.theme .sw { display: flex; gap: 4px; height: 48px; border-radius: 11px; border: 3px solid; padding: 6px; align-items: flex-end; box-shadow: inset 0 1px 0 rgb(255 255 255 / .25); }
.theme .sw i { flex: 1; height: 100%; border-radius: 6px; }
.theme small { color: var(--muted); font-size: 12px; font-weight: 500; }
.theme-preview { display: block; width: 100%; max-width: 560px; height: auto; margin-top: 12px; border-radius: 18px; box-shadow: var(--sh-md); }

.cardlist { display: flex; flex-direction: column; gap: 12px; }
.cardlist-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--lt-card-2); }

/* the activity chart (servers' pages) */
.chart { width: 100%; height: 180px; }
.chart rect.bar { fill: var(--coral-500); } .chart rect.bar2 { fill: var(--teal-500); opacity: .8; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--f-latin); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }

/* ===================================================================================================================
   Permissions
   =================================================================================================================== */
.tiers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.tier { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--lt-card-2); }
.tier .tag { align-self: flex-start; font: 800 13px/1.5 var(--f-latin); background: var(--grad-gold); color: var(--ink-900); border-radius: 8px; padding: 1px 9px; }
.tree { display: flex; flex-direction: column; }
.tree .node { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.tree .node.child { padding-inline-start: 24px; position: relative; }
.tree .node.child::before { content: ""; position: absolute; inset-inline-start: 8px; top: 0; bottom: 50%; width: 10px; border-inline-start: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); border-end-start-radius: 6px; }
.tree .node .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .node.cat .name { font-weight: 800; color: var(--teal-800); }
.tree .node select { width: auto; flex: 0 1 230px; min-height: 36px; padding-block: 4px; }
.tree .node.child select:has(option[value="inherit"]:checked) { color: var(--muted); }
@media (max-width: 560px) { .tree .node { flex-wrap: wrap; } .tree .node select { flex: 1 1 100%; } }
.preview { background: var(--lt-card-2); border: 1px solid var(--line); border-inline-start: 4px solid var(--coral-500); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.preview ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; }
/* an empty preview (no title, no rules yet) says what will show there instead of a bare box */
.preview:empty::before, .preview > :is(ol, ul):empty::before { content: "تظهر المعاينة هنا عند كتابة المحتوى."; color: var(--muted); font-size: 14px; }
.preview > :is(ol, ul):empty { padding-inline-start: 0; list-style: none; }

.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgb(21 61 64 / .14); border-top-color: var(--coral-500); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 22px 0; font-weight: 600; }

/* ===================================================================================================================
   Plans: the plan now (a teal card with the plan's name in gold), the code box, the three plans
   =================================================================================================================== */
.nav a .lock { font-size: 12px; }
.t1 { --tier: var(--teal-500); --tier-ink: var(--teal-700); --tier-bg: var(--teal-100); }
.t2 { --tier: var(--coral-500); --tier-ink: var(--coral-800); --tier-bg: var(--coral-100); }
.t3 { --tier: var(--yellow-600); --tier-ink: var(--yellow-text); --tier-bg: var(--yellow-100); }
.lock-card { align-items: flex-start; padding: clamp(24px, 3vw, 34px); background: radial-gradient(600px 260px at 100% 0%, var(--tier-bg), transparent 70%), var(--lt-card); border-color: color-mix(in srgb, var(--tier) 35%, transparent); }
.lock-badge { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 28px; background: var(--tier-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier) 40%, transparent), var(--sh-sm); animation: badge-bob 4s ease-in-out infinite; }
@keyframes badge-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
.lock-intro { font-weight: 800; color: var(--tier-ink, var(--coral-text)); }
.lock-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.lock-list li { border-radius: 99px; padding: 5px 14px; font-size: 13px; font-weight: 600; background: var(--lt-card-2); border: 1px solid var(--line); color: var(--teal-800); }
.plan-now {
  gap: 8px; overflow: hidden; isolation: isolate; border: 0; color: var(--cream-100); color-scheme: dark; --focus: var(--yellow-500);
  background: radial-gradient(120% 90% at 100% 0%, rgb(63 135 138 / .5), transparent 55%), var(--grad-teal); box-shadow: var(--sh-teal);
  padding: clamp(24px, 3vw, 34px);
}
.plan-now::after { content: ""; position: absolute; inset: auto 0 0; height: 60%; z-index: -1; pointer-events: none; background: radial-gradient(70% 80% at 10% 120%, rgb(255 122 86 / .45), transparent 70%), radial-gradient(60% 70% at 92% 128%, rgb(255 203 87 / .38), transparent 70%); }
.plan-now .eyebrow { background: rgb(255 203 87 / .14); color: var(--yellow-300); box-shadow: inset 0 0 0 1px rgb(255 203 87 / .28); align-self: flex-start; }
.plan-now .muted { color: var(--dk-muted); }
.plan-now .plan-name {
  font: 800 clamp(34px, 4.4vw, 48px)/1.2 var(--f-display); color: var(--yellow-500);
  background: linear-gradient(135deg, #FFF1C2, #FFCB57 50%, #F2AE3A); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.redeem { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.redeem .field { flex: 1 1 280px; }
.code-input { font: 800 18px/1 var(--f-latin) !important; letter-spacing: .1em; text-align: center; text-transform: uppercase; min-height: 50px !important; }
.plan-cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
.plan-col {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px;
  background: var(--lt-card-2); transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.plan-col::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--tier); }
.plan-col:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.plan-col.current { background: #fff; border-color: color-mix(in srgb, var(--tier) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tier) 20%, transparent), var(--sh-md); }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-top h3 { font: 800 22px/1.3 var(--f-display); color: var(--tier-ink); }
.plan-price { font-weight: 800; color: var(--teal-800); font-size: 15px; }
.plan-col ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.plan-col li { display: flex; flex-direction: column; gap: 1px; padding-inline-start: 16px; position: relative; }
.plan-col li::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--tier); }
.plan-col li b { font-weight: 700; font-size: 14px; color: var(--teal-800); }
.plan-col li span { color: var(--muted); font-size: 13px; line-height: 1.65; }
.made:empty { display: none; }

/* ===================================================================================================================
   The owner's reports: line charts, ranked bars, meters (the chart colours are drawn for dark; fixed here for light)
   =================================================================================================================== */
.viz-wrap { display: flex; flex-direction: column; gap: 10px; }
.viz-box { position: relative; }
.viz { width: 100%; height: auto; display: block; direction: ltr; overflow: visible; }
.viz line[stroke="rgb(253 246 238 / .08)"] { stroke: rgb(21 61 64 / .1); }
.viz line[stroke="rgb(253 246 238 / .35)"] { stroke: rgb(21 61 64 / .35); stroke-dasharray: 3 3; }
.viz circle[stroke="#0E3739"] { stroke: #FFFBF4; }
.viz path[stroke="#c98500"] { stroke: var(--yellow-700); stroke-width: 2.5; }
.viz path[stroke="#3987e5"] { stroke: var(--teal-500); stroke-width: 2.5; }
.viz-axis { fill: var(--muted); font-size: 11px; font-family: var(--f-latin); }
/* the series colours come inline from the page code (amber, blue, green, red); here they become the identity's */
[style*="background:#c98500"] { background: var(--grad-gold) !important; }
[style*="background:#3987e5"] { background: linear-gradient(90deg, var(--teal-500), var(--teal-700)) !important; }
[style*="background:#199e70"] { background: linear-gradient(90deg, var(--teal-400), var(--teal-600)) !important; }
[style*="background:#e66767"] { background: var(--grad-coral) !important; }
.viz rect[fill="#c98500"] { fill: var(--yellow-600); } .viz rect[fill="#3987e5"] { fill: var(--teal-500); }
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.viz-legend .sw, .viz-tip .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.viz-tip { position: absolute; top: 4px; width: 170px; padding: 9px 12px; border-radius: 12px; background: var(--teal-800); color: var(--cream-100); font-size: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--sh-md); }
.viz-tip[hidden] { display: none; }
.viz-table summary { cursor: pointer; color: var(--teal-700); font-size: 13px; font-weight: 700; width: fit-content; border-radius: 8px; }
.viz-table summary:hover { color: var(--coral-text); }
.viz-table .table-wrap { max-height: 260px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 6px; background: rgb(21 61 64 / .07); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; transform-origin: right; animation: grow-x 1s var(--ease-out) both; }
.bar-value { color: var(--muted); font-family: var(--f-latin); font-variant-numeric: tabular-nums; }
.meter { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.meter-track { height: 9px; border-radius: 5px; background: rgb(21 61 64 / .07); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 5px; transform-origin: right; animation: grow-x 1s var(--ease-out) both; }
@keyframes grow-x { from { transform: scaleX(0); } }
ul.steps { margin: 6px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 600px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; } }

/* the owner's content page */
.design-preview { max-width: 180px; max-height: 180px; border-radius: 16px; background: repeating-conic-gradient(#EFE3CF 0 25%, #FBF5EA 0 50%) 50% / 16px 16px; box-shadow: var(--sh-sm); }
.design-thumb { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: var(--lt-sunk); }
.small-input { width: 110px; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 18px; color: var(--ink); font-weight: 600; cursor: pointer; }
.sim-grid > .field { flex: 1 1 190px; }

/* the owner's servers (older table markup, still styled) */
tr.pick { cursor: pointer; }
tr.pick:hover { background: var(--yellow-50); }

/* ===================================================================================================================
   The overview pages (servers' «نظرة عامة» and the owner's «لوحة المالك»)
   =================================================================================================================== */
/* the welcome banner: teal sky, the arches scene at the end side, the text in the start half */
.welcome {
  --wb-pad: clamp(24px, 3.4vw, 40px);
  position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; min-height: 236px; padding: var(--wb-pad);
  display: flex; align-items: center; color: var(--cream-100); color-scheme: dark; --focus: var(--yellow-500); --scene-floor: #1B4A4D;
  box-shadow: var(--sh-teal); container-type: inline-size;
}
.welcome > .scene { z-index: 0; }
.wb-body { position: relative; z-index: 2; max-width: min(56%, 560px); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
/* the gate (and the owner's trophy) never reaches the text: it takes at most the room the text column leaves free.
   Inside the scene 100cqw is the banner's width; the text column is min(56% of the padded width, 560px). */
.welcome .scene--banner .sc-gate { max-width: calc(97.5cqw - min((100cqw - 2 * var(--wb-pad)) * .56, 560px) - var(--wb-pad) - 24px); }
/* phones: a small gate stands in the band of waves under the chips, at the end side */
@container (max-width: 640px) {
  .welcome .scene--banner .sc-gate { display: block; opacity: 1; height: 104px; width: auto; max-width: 48cqw; inset-inline-end: 5cqw; bottom: 9%; }
}
.wb-eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px; background: rgb(255 203 87 / .14); color: var(--yellow-300); font: 700 12.5px/1.3 var(--f-body); box-shadow: inset 0 0 0 1px rgb(255 203 87 / .28); }
.wb-eyebrow .ic { width: 15px; height: 15px; color: var(--yellow-500); }
.welcome h1 { color: var(--cream-50); font: 800 clamp(26px, 3.4vw, 38px)/1.3 var(--f-display); text-shadow: 0 2px 18px rgb(6 24 26 / .45); }
.wb-sub { color: var(--dk-muted); font-size: 15.5px; line-height: 1.8; }
.wb-sub bdi { color: var(--cream-100); font-weight: 700; }
.wb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wb-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 13px; border-radius: 999px; font: 700 12.5px/1.3 var(--f-body);
  color: var(--cream-100); background: rgb(8 31 33 / .42); box-shadow: inset 0 0 0 1px rgb(243 231 211 / .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  text-decoration: none; white-space: nowrap; transition: background-color .3s, transform .35s var(--ease-out);
}
.wb-chip .ic { width: 15px; height: 15px; color: var(--yellow-500); }
a.wb-chip:hover { background: rgb(8 31 33 / .62); transform: translateY(-2px); }
.wb-chip.on .wb-dot, .wb-chip.off .wb-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #7ED3A6; flex: none; }
.wb-chip.on .wb-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #7ED3A6; animation: live-ring 1.9s var(--ease-out) infinite; }
.wb-chip.off .wb-dot { background: var(--coral-400); }
.welcome .actions { margin-top: 6px; }
@keyframes live-ring { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(3); opacity: 0; } }
/* narrow banners: the text takes the whole width and the small gate stands under it. The question is asked of .ov
   (the banner's own width, like the scene's), not of the banner's padded inside, so text and gate switch together. */
@container ov (max-width: 640px) {
  .wb-body { max-width: 100%; }
  .welcome h1 { font-size: 26px; }
  .welcome { border-radius: 22px; min-height: 0; padding-bottom: 128px; }
}

/* stat cards with illustrated tiles; the numbers count up */
.ov { container: ov / inline-size; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* five cards: one row on wide pages; three and two on medium ones; two columns on phones (an odd last one spans) */
@container (min-width: 560px) {
  .kpis { gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpis > .kpi, .kpis > .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpis > .kpi:nth-child(4):nth-last-child(2), .kpis > .kpi:nth-child(5):last-child, .kpis:has(> .kpi:nth-child(4):last-child) > .kpi { grid-column: span 3; }
}
@container (min-width: 1000px) {
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpis:has(> .kpi:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis > .kpi, .kpis > .kpi:last-child:nth-child(odd), .kpis > .kpi:nth-child(4):nth-last-child(2), .kpis > .kpi:nth-child(5):last-child, .kpis:has(> .kpi:nth-child(4):last-child) > .kpi { grid-column: auto; }
}
.kpi {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; container-type: inline-size; border-radius: 20px; min-width: 0;
  background: var(--lt-card); border: 1px solid var(--line); box-shadow: var(--sh-sm), inset 0 1px 0 #fff;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.kpi:hover { transform: translateY(-4px); box-shadow: var(--sh-md), inset 0 1px 0 #fff; }
.kpi-art { flex: none; line-height: 0; }
.kpi-art .tile { width: 50px; }
.kpi-t { display: grid; min-width: 0; gap: 2px; }
.kpi-l { font: 600 12.5px/1.4 var(--f-body); color: var(--muted); }
.kpi-n { font: 800 clamp(18px, 12.5cqi, 26px)/1.15 var(--f-latin); color: var(--teal-800); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-note { margin-top: -6px; font-size: 13.5px; }
.kpi-note b { color: var(--teal-800); font-family: var(--f-latin); }

/* the two-column rows of the overview */
.ov-row { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: stretch; }
.ov-row.even { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
/* side by side, the two cards keep one height: the channels' bars spread over it */
.ov-row.even > .card .bar-list { flex: 1; justify-content: space-evenly; gap: 14px; }
.ov .bar-value { min-width: 6.6em; } /* the tracks line up from row to row */
@media (max-width: 1060px) { .ov-row { grid-template-columns: 1fr; } }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.card-h > div { display: grid; gap: 3px; min-width: 0; }
.card-h h2 { display: flex; align-items: center; gap: 10px; }
.card-h h2 .ic-w { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--coral-50); color: var(--coral-600); }
.card-h h2 .ic-w .ic { width: 19px; height: 19px; }
.card-h .muted { font-size: 13.5px; }
.count { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 9px; border-radius: 99px; background: var(--teal-100); color: var(--teal-800); font: 800 13px/1 var(--f-latin); }

/* «نشاط السيرفر»: bars for the messages, a line for the voice minutes; they rise and draw in */
.ov-totals { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ov-total { padding: 10px 12px; border-radius: 14px; background: var(--lt-card-2); border: 1px solid var(--line); display: grid; gap: 1px; min-width: 0; }
.ov-total b { font: 800 19px/1.3 var(--f-latin); color: var(--teal-800); font-variant-numeric: tabular-nums; }
.ov-total span { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ov-total span i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
@media (max-width: 560px) { .ov-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ovc-box { min-height: 200px; direction: ltr; }
.ovc { width: 100%; height: auto; display: block; direction: ltr; overflow: visible; }
.ovc .g { stroke: rgb(21 61 64 / .09); stroke-width: 1; }
.ovc .ax { fill: var(--muted); font: 600 11px var(--f-latin); }
.ovc .ax-v { fill: var(--teal-600); }
.ovc .b { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-up .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms + 150ms); transition: opacity .25s, filter .25s; }
.ovc:hover .b { opacity: .5; }
.ovc .b:hover { opacity: 1; filter: brightness(1.06) saturate(1.1); }
.ovc .v { fill: none; stroke: var(--teal-600); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: line-draw 1.8s .5s var(--ease-out) forwards; }
.ovc .va { opacity: 0; animation: fade-in 1s 1.2s var(--ease-out) forwards; }
/* redrawn for a new width: no second rise */
.ovc.still .b { animation: none; }
.ovc.still .va { animation: none; opacity: 1; }
.ovc.still .v { animation: none; stroke-dashoffset: 0; }
/* the chart, the ring and the channel bars hold their first frame until they come into view (app.js playOnView) */
.ov .ov-wait :is(.b, .v, .va, .on, .lk, .bar-fill) { animation-play-state: paused; }
@keyframes bar-up { from { transform: scaleY(0); } }
@keyframes line-draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* «الميزات المفعّلة»: a ring that fills, its legend under it */
.ring-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding-block: 6px; }
.ring { position: relative; width: 178px; aspect-ratio: 1; flex: none; filter: drop-shadow(0 14px 22px rgb(21 61 64 / .12)); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .tr { fill: none; stroke: var(--cream-300); stroke-width: 14; }
.ring .on { fill: none; stroke: url(#ring-grad); stroke-width: 14; stroke-linecap: round; animation: ring-in 1.6s .3s var(--ease-out) both; }
.ring .lk { fill: none; stroke: var(--yellow-500); stroke-width: 14; stroke-linecap: round; animation: ring-in 1.6s .5s var(--ease-out) both; }
@keyframes ring-in { from { stroke-dasharray: 0 100; } }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.2; }
.ring-c b { font: 800 40px/1 var(--f-latin); color: var(--teal-800); }
.ring-c span { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.ring-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ring-legend li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--lt-card-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ring-legend li i { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.ring-legend li b { font: 800 14px/1 var(--f-latin); color: var(--teal-800); }
.ring-card .actions { justify-content: center; }

/* «إجراءات سريعة»: tiles that lift */
.qa-card { container-type: inline-size; }
.qa-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (min-width: 860px) { .qa-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@container (max-width: 520px) { .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.qa {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 124px; padding: 16px 10px 14px;
  border-radius: 18px; text-decoration: none; text-align: center; color: var(--teal-800); font: 700 14px/1.35 var(--f-body);
  background: var(--lt-card-2); border: 1px solid var(--line); box-shadow: inset 0 1px 0 #fff;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), background-color .3s, border-color .3s;
}
.qa .tile { width: 52px; }
.qa:hover { transform: translateY(-5px); background: #fff; border-color: var(--line-2); box-shadow: var(--sh-md); }
.qa .qa-lock { position: absolute; top: 8px; inset-inline-end: 8px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: var(--yellow-text); background: var(--yellow-100); }
.qa .qa-lock .ic { width: 13px; height: 13px; }

/* features: a line icon in a coloured box */
.feature .fi { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--teal-700); background: var(--teal-100); transition: transform .5s var(--ease-spring); }
.feature .fi .ic { width: 21px; height: 21px; }
.feature.on .fi { background: var(--grad-teal); color: var(--yellow-300); }
.feature.locked .fi { background: var(--yellow-100); color: var(--yellow-800); }
.feature:hover .fi { transform: rotate(-6deg) scale(1.06); }

/* the latest events: a lettered bubble per member */
.ev-av { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 15px/1 var(--f-display); color: var(--teal-800); background: linear-gradient(160deg, var(--yellow-100), var(--coral-100)); box-shadow: inset 0 0 0 1px rgb(255 122 86 / .2); }
.item:nth-child(3n + 2) .ev-av { background: linear-gradient(160deg, var(--teal-50), var(--teal-200)); }
.item:nth-child(3n) .ev-av { background: linear-gradient(160deg, var(--cream-200), var(--cream-400)); }
.item .when { flex: none; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* owner: the attention notes (a line icon at the start) */
.notice.ni { display: flex; align-items: flex-start; gap: 12px; }
.ni-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--teal-600); box-shadow: var(--sh-xs); margin-top: 1px; }
.notice.warn .ni-ic { color: var(--yellow-800); }
.ni-ic .ic { width: 18px; height: 18px; }
.ni-t { flex: 1; min-width: 0; }

/* owner: the servers. A row opens the plan editor right under it */
.sv-list { display: flex; flex-direction: column; gap: 10px; }
.sv-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; text-align: start;
  border-radius: 18px; border: 1px solid var(--line); background: var(--lt-card-2); color: var(--ink); font: inherit; box-shadow: inset 0 1px 0 #fff;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), background-color .3s, border-color .3s;
}
button.sv-row { cursor: pointer; }
button.sv-row:hover { transform: translateY(-3px); background: #fff; border-color: var(--line-2); box-shadow: var(--sh-md); }
button.sv-row.on { background: #fff; border-color: var(--coral-300); box-shadow: 0 0 0 3px rgb(255 122 86 / .15), var(--sh-sm); }
.sv-av { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font: 800 19px/1 var(--f-display); color: var(--cream-100); background: var(--grad-teal); box-shadow: 0 8px 16px -10px rgb(12 43 45 / .8); }
.sv-row:nth-child(4n + 2) .sv-av { background: var(--grad-coral); color: #0A2426; }
.sv-row:nth-child(4n + 3) .sv-av { background: var(--grad-gold); color: var(--teal-900); }
.sv-t { display: grid; min-width: 0; gap: 1px; }
.sv-t b { font: 800 15.5px/1.4 var(--f-display); color: var(--teal-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-t small { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sv-t small .ic { width: 14px; height: 14px; }
.sv-plan { display: grid; justify-items: end; gap: 2px; text-align: end; }
.sv-plan b { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 99px; font: 800 12.5px/1.5 var(--f-body); background: var(--tier-bg); color: var(--tier-ink); white-space: nowrap; }
.sv-plan small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sv-go { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px 7px 8px; border-radius: 99px; font: 700 13px/1.2 var(--f-body); color: var(--teal-700); background: var(--teal-100); transition: background-color .3s, color .3s; }
[dir="rtl"] .sv-go { padding: 7px 12px 7px 8px; }
.sv-go .ic { width: 16px; height: 16px; transition: transform .45s var(--ease-spring); }
button.sv-row:hover .sv-go, button.sv-row.on .sv-go { background: var(--grad-coral); color: #0A2426; }
button.sv-row:hover .sv-go .ic { transform: translateX(-3px); }
@media (max-width: 640px) {
  .sv-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 8px; }
  .sv-plan { grid-column: 2 / -1; grid-row: 2; justify-items: start; text-align: start; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .sv-go { grid-column: 3; grid-row: 1; }
}
/* the plan editor opens with a slide */
.plan-edit { margin: 2px 0 6px; border-inline-start-color: var(--coral-500); background: #fff; box-shadow: var(--sh-md); animation: edit-open .55s var(--ease-out) both; }
.plan-edit > b { font: 800 16px/1.4 var(--f-display); color: var(--teal-800); }
.plan-edit label.row { font-weight: 600; color: var(--ink-2); flex-wrap: nowrap; align-items: flex-start !important; cursor: pointer; line-height: 1.6; }
.plan-edit label.row input { margin-top: 3px; }
@keyframes edit-open { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }

/* the overview's phone layout */
@media (max-width: 640px) {
  .page { gap: 18px; }
  .kpis { gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpi-art .tile { width: 44px; }
  .kpis > .kpi:last-child:nth-child(odd) { flex-direction: row; align-items: center; }
  .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .qa { min-height: 112px; }
  .card { border-radius: 18px; }
  .page-head h1 { font-size: 26px; }
  .savebar { bottom: 10px; padding: 8px 10px; gap: 8px; border-radius: 18px; }
  [dir="rtl"] .savebar { padding: 8px 10px; }
  .savebar .btn { min-height: 38px; padding: 6px 14px; font-size: 13.5px; }
  .savebar .actions { gap: 6px; }
}
/* phones: a bar made only of buttons (the permissions page) puts its buttons in rows that fill the bar, so none is cut
   off at the edge */
@media (max-width: 480px) {
  .savebar:not(:has(> :not(.actions))) { justify-content: flex-start; }
  .savebar:not(:has(> :not(.actions))) > .actions { flex: 1 1 100%; flex-wrap: wrap; }
  .savebar:not(:has(> :not(.actions))) > .actions > .btn { flex: 1 1 auto; }
  .savebar:not(:has(> :not(.actions))) > .actions:first-child:not(:only-child) { order: 2; } /* the save buttons show first */
}

/* ===================================================================================================================
   Server setup: the layouts gallery (cards with a dark Discord strip, badges and filters) and the live Discord preview
   beside it (under it on phones). The preview keeps Discord's own dark colours inside the light dashboard.
   =================================================================================================================== */
.su-grid {
  display: grid; gap: 18px; align-items: start;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 372px); grid-template-areas: "pick sim" "opts sim";
}
.su-pick { grid-area: pick; } .su-opts { grid-area: opts; }
.su-pick-h { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; }
.su-pick-h > div { display: grid; gap: 4px; }
.su-pick-h h2 { display: flex; align-items: center; gap: 10px; }
.su-pick-h h2::before { content: ""; width: 5px; height: 1.05em; border-radius: 4px; flex: none; background: linear-gradient(180deg, var(--yellow-500), var(--coral-500)); }
.su-sim { grid-area: sim; position: sticky; top: calc(var(--tb-h) + 14px); display: grid; gap: 12px; min-width: 0; }

/* filters: language and kind of server, as chips */
.lay-filters { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--lt-card-2); border: 1px solid var(--lt-line); }
.lay-fg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.lay-fl { flex: none; min-width: 84px; font: 700 12.5px/1.4 var(--f-body); color: var(--muted); }
.lay-chips { flex: 1 1 320px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lay-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 12px; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid var(--lt-line-2); background: var(--lt-card); color: var(--teal-800); font: 700 13px/1.2 var(--f-body); white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease-out);
}
.lay-chip small { font: 700 11px/1 var(--f-latin); color: var(--muted); padding: 3px 6px; border-radius: var(--r-pill); background: var(--lt-card-2); transition: inherit; }
.lay-chip:hover { border-color: var(--teal-400); transform: translateY(-1px); }
.lay-chip[aria-pressed="true"] { background: var(--teal-800); border-color: var(--teal-800); color: var(--cream-100); }
.lay-chip[aria-pressed="true"] small { background: rgb(255 255 255 / .14); color: var(--yellow-300); }
.lay-status { font: 600 12.5px/1.5 var(--f-body); color: var(--muted); }

/* the gallery scrolls inside its card on wide screens */
.lay-grid {
  position: relative; display: grid; gap: 12px; align-content: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr));
  max-height: min(660px, calc(100vh - var(--tb-h) - 230px)); min-height: 280px; overflow-y: auto; padding: 4px 4px 22px; margin: -4px;
  scrollbar-width: thin; scrollbar-color: rgb(21 61 64 / .22) transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent);
}
.lay-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; cursor: pointer; isolation: isolate;
  border-radius: 16px; background: var(--lt-card); border: 1px solid var(--lt-line-2); box-shadow: var(--sh-xs);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .3s;
}
.lay-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: rgb(21 61 64 / .26); }
.lay-card.on { border-color: var(--coral-500); box-shadow: 0 0 0 3px rgb(255 122 86 / .22), var(--sh-md); }
.lay-card:has(.lay-radio:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.lay-radio { position: absolute; top: 12px; inset-inline-start: 12px; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
/* the card's strip: a few rooms in the layout's own names, in Discord's dark */
.lay-look {
  display: grid; gap: 2px; padding: 10px 10px 10px 8px; direction: ltr; text-align: left; background: #2B2D31; color: #949BA4;
  font: 500 13.5px/1.35 var(--f-body); border-bottom: 1px solid rgb(0 0 0 / .2);
}
.lay-look > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lay-look > span > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lay-lc { padding: 0 2px; gap: 2px !important; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.lay-lr { height: 27px; padding: 0 6px; border-radius: 4px; }
.lay-lr.on { background: rgb(78 80 88 / .6); color: #F2F3F5; }
.lay-lr .dsim-ic, .lay-lr .dsim-ic svg { width: 18px; height: 18px; }
.lay-card.on .lay-look { background: #313338; }
.lay-body { display: grid; gap: 7px; padding: 11px 14px 14px; align-content: start; }
.lay-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.lay-name { font: 800 16.5px/1.35 var(--f-display); color: var(--teal-800); }
.lay-en { font: 600 12px/1.3 var(--f-latin); color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.lay-desc { font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.lay-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lay-tag {
  --tg: var(--teal-700); --tb: var(--teal-50);
  display: inline-flex; align-items: center; padding: 1px 9px; border-radius: var(--r-pill); font: 700 11.5px/1.7 var(--f-body);
  color: var(--tg); background: var(--tb); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tg) 22%, transparent);
}
.lay-tag.lang { --tg: var(--ink-2); --tb: var(--lt-card-2); }
.lay-tag.k-voice, .lay-tag.k-gaming { --tg: var(--coral-800); --tb: var(--coral-50); }
.lay-tag.k-study, .lay-tag.k-friends, .lay-tag.k-roleplay { --tg: var(--yellow-text); --tb: var(--yellow-50); }
.lay-tag.k-creative { --tg: #8A2F5B; --tb: #FCEEF4; }
.lay-tag.k-official { --tg: var(--cream-100); --tb: var(--teal-800); }
.lay-tick {
  /* on the strip's empty right end: the dark Discord strip is left to right in both languages */
  position: absolute; top: 8px; right: 8px; left: auto; z-index: 1; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--grad-coral); color: #0A2426; box-shadow: 0 0 0 3px #2B2D31, 0 6px 14px -4px rgb(240 98 61 / .8);
  opacity: 0; transform: scale(.4) rotate(-30deg); transition: opacity .25s, transform .45s var(--ease-spring);
}
.lay-tick .ic { width: 15px; height: 15px; }
.lay-card.on .lay-tick { opacity: 1; transform: none; }
.lay-none { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; padding: 30px 12px; color: var(--muted); text-align: center; }

/* the live preview's caption and counts */
.su-sim-cap { display: grid; gap: 4px; }
.su-live { display: inline-flex; align-items: center; gap: 8px; font: 700 12.5px/1.4 var(--f-body); color: var(--coral-text); }
.su-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--coral-500); }
.su-live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--coral-500); animation: su-ping 1.8s ease-out infinite; }
@keyframes su-ping { from { transform: scale(1); opacity: .7; } to { transform: scale(2.8); opacity: 0; } }
.su-sim-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.su-sim-name { font: 800 21px/1.35 var(--f-display); color: var(--teal-800); flex: 0 1 auto !important; }
.su-sim-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.su-stat { display: grid; justify-items: center; gap: 1px; padding: 8px 6px; border-radius: 14px; background: var(--lt-card); border: 1px solid var(--lt-line); box-shadow: var(--sh-xs); text-align: center; }
.su-stat b { display: inline-block; font: 800 19px/1.25 var(--f-latin); color: var(--teal-800); }
.su-stat span { font: 600 11.5px/1.4 var(--f-body); color: var(--muted); }
.su-sim-legend { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.su-sim-legend .ic-w svg { width: 15px; height: 15px; color: var(--teal-600); }

/* the Discord window */
.dsim {
  --ds-rail: #1E1F22; --ds-bg: #2B2D31; --ds-me: #232428; --ds-text: #949BA4; --ds-hi: #DBDEE1; --ds-white: #F2F3F5; --ds-ic: #80848E;
  display: grid; grid-template-columns: 62px minmax(0, 1fr); min-width: 0; overflow: hidden; border-radius: 18px; background: var(--ds-rail);
  color: var(--ds-text); color-scheme: dark; --focus: var(--yellow-500); direction: ltr; text-align: left; font: 500 15px/1.25 var(--f-body);
  box-shadow: 0 30px 50px -28px rgb(12 43 45 / .6), 0 0 0 1px rgb(21 61 64 / .16);
}
.dsim-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.dsim-g {
  position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #313338;
  color: var(--ds-hi); font: 800 18px/1 var(--f-display); transition: border-radius .3s;
}
.dsim-g.on { border-radius: 15px; background: var(--grad-coral); color: #0A2426; }
.dsim-g.on::before { content: ""; position: absolute; left: -9px; top: 4px; width: 4px; height: 36px; border-radius: 0 4px 4px 0; background: var(--ds-white); }
.dsim-g.add { color: #23A55A; font: 400 26px/1 var(--f-latin); }
.dsim-g:nth-child(3) { background: linear-gradient(135deg, #3F878A, #153D40); }
.dsim-g:nth-child(4) { background: linear-gradient(135deg, #FFDB7E, #D98F1F); }
.dsim-sep { width: 30px; height: 2px; border-radius: 1px; background: #35363C; }
.dsim-side { display: flex; flex-direction: column; min-width: 0; background: var(--ds-bg); border-top-left-radius: 10px; }
.dsim-head {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px 0 16px; flex: none;
  color: var(--ds-white); font: 700 15.5px/1.2 var(--f-display); box-shadow: 0 1px 0 rgb(4 4 5 / .22), 0 2px 0 rgb(4 4 5 / .05);
}
.dsim-svn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsim-hc svg { width: 18px; height: 18px; display: block; }
.dsim-scroll {
  overflow-y: auto; max-height: clamp(300px, calc(100vh - var(--tb-h) - 330px), 640px); padding: 0 8px 14px 8px;
  scrollbar-width: thin; scrollbar-color: #1A1B1E transparent;
}
.dsim-list { padding-top: 2px; }
.dsim-cat { overflow: hidden; }
.dsim-ch {
  display: flex; align-items: center; gap: 2px; width: 100%; padding: 18px 6px 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--ds-text); font: 700 12px/1.3 var(--f-body); letter-spacing: .02em; text-transform: uppercase; text-align: left;
  transition: color .15s;
}
.dsim-ch:hover { color: var(--ds-hi); }
.dsim-ch:focus-visible { outline-offset: -2px; border-radius: 4px; }
.dsim-cv { flex: none; display: grid; place-items: center; width: 14px; }
.dsim-cv svg { width: 12px; height: 12px; transition: transform .35s var(--ease-out); }
.dsim-cat.shut .dsim-ch .dsim-cv svg { transform: rotate(-90deg); }
.dsim-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .4s var(--ease-out); }
.dsim-cat.shut .dsim-body { grid-template-rows: 0fr; }
.dsim-in { min-height: 0; overflow: hidden; }
.dsim-n { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.dsim-t { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsim-row {
  display: flex; align-items: center; gap: 6px; height: 34px; margin-top: 2px; padding: 0 8px; border-radius: 5px; overflow: hidden;
  color: var(--ds-text); transition: background-color .15s, color .15s;
}
.dsim-row .dsim-t { line-height: 20px; }
.dsim-row:hover { background: rgb(78 80 88 / .3); color: var(--ds-hi); }
.dsim-row.sel { background: rgb(78 80 88 / .6); color: var(--ds-white); }
.dsim-ic { flex: none; display: grid; place-items: center; width: 20px; height: 20px; color: var(--ds-ic); }
.dsim-ic svg { width: 20px; height: 20px; display: block; }
.dsim-row.sel .dsim-ic, .dsim-row:hover .dsim-ic { color: var(--ds-hi); }
.dsim-row.k-gap { height: 22px; }
.dsim-row.k-gap:hover { background: none; }
.dsim-row.k-gap .dsim-ic svg { width: 16px; height: 16px; }
.dsim-more { display: inline-block; padding: 0 8px; border-radius: var(--r-pill); background: var(--ds-rail); color: var(--ds-hi); font: 700 11.5px/18px var(--f-latin); }
.dsim-row.k-create .dsim-ic { color: #23A55A; }
.dsim-row.lock, .dsim-cat.lock > .dsim-ch { opacity: .42; }
.dsim-end { flex: none; display: flex; align-items: center; gap: 4px; }
.dsim-lk svg { width: 14px; height: 14px; display: block; }
.dsim-me { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px; flex: none; background: var(--ds-me); }
.dsim-av {
  position: relative; width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--grad-teal); color: var(--cream-100); font: 800 14px/1 var(--f-display);
}
.dsim-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.dsim-av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #23A55A; box-shadow: 0 0 0 3px var(--ds-me); }
.dsim-mn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ds-white); font: 700 14px/1.2 var(--f-body); }
.dsim-tools { flex: none; display: flex; color: #B5BAC1; }
.dsim-tools > span { width: 30px; height: 32px; display: grid; place-items: center; border-radius: 4px; }
.dsim-tools svg { width: 19px; height: 19px; display: block; }

/* narrower screens: the preview goes under the gallery (and keeps a Discord-like width) */
@media (max-width: 980px) {
  .su-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pick" "sim" "opts"; }
  .su-sim { position: static; width: min(100%, 460px); justify-self: center; }
  .dsim-scroll { max-height: 520px; }
}
/* phones: the gallery is one row of cards that slides sideways, the filters scroll sideways too */
@media (max-width: 640px) {
  .lay-filters { padding: 10px 12px; }
  .lay-fg { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; }
  .lay-chips { flex: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -2px -12px; padding: 2px 12px; }
  .lay-chips::-webkit-scrollbar { display: none; }
  .lay-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(80%, 290px); max-height: none; min-height: 0;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 4px 4px 12px; -webkit-mask-image: none; mask-image: none;
  }
  .lay-card { scroll-snap-align: center; }
  .lay-card:hover { transform: none; }
  .lay-none { grid-column: auto; width: min(80vw, 290px); }
  .su-sim { width: 100%; }
  .dsim { grid-template-columns: 54px minmax(0, 1fr); }
  .dsim-g { width: 40px; height: 40px; }
  .dsim-g.on::before { left: -7px; height: 32px; }
  .dsim-scroll { max-height: 460px; }
}
.su-tagrow > .field { flex: 0 1 340px; }

/* =====================================================================================================================
   The AR | EN switch (top bar and sign-in), and the dashboards read left to right in English
   =================================================================================================================== */
.lang-sw {
  display: inline-flex; align-items: center; flex: none; gap: 2px; padding: 3px; border-radius: 999px; direction: ltr;
  background: var(--lt-card); border: 1px solid var(--lt-line); box-shadow: var(--sh-xs);
}
.lang-sw a {
  display: inline-grid; place-items: center; min-width: 36px; height: 30px; padding: 0 9px; border-radius: 999px;
  color: var(--teal-700); text-decoration: none; font: 800 12.5px/1 var(--f-latin); letter-spacing: .06em;
  transition: background-color .3s, color .3s, box-shadow .3s, transform .3s var(--ease-out);
}
.lang-sw a:hover { background: var(--teal-100); color: var(--teal-800); }
.lang-sw a:active { transform: scale(.94); }
.lang-sw a[aria-current="true"] { background: var(--teal-800); color: var(--cream-100); box-shadow: 0 6px 14px -8px rgb(12 43 45 / .6); }
.lang-sw a:focus-visible { outline: 3px solid var(--yellow-500); outline-offset: 2px; }
.login-card { position: relative; }
.login-card > .lang-sw { position: absolute; top: clamp(16px, 2.6vw, 28px); inset-inline-end: clamp(16px, 2.6vw, 28px); }
/* phones: the top bar's switch shows only the other language (one tap away) */
@media (max-width: 640px) {
  .tb-end .lang-sw a[aria-current="true"] { display: none; }
  .tb-end .lang-sw a { min-width: 40px; height: 34px; }
}
/* leaving for the other language: the page fades out */
html.lang-leave body { opacity: 0; transition: opacity .18s ease; }

/* left to right: what the Arabic page places by its physical right goes to the left */
[dir="ltr"] .crumb-sep .ic, [dir="ltr"] .nav a.nav-switch .go .ic, [dir="ltr"] .sv-go .ic { scale: -1 1; }
[dir="ltr"] .nav a.nav-switch:hover .go { transform: translateX(4px); }
[dir="ltr"] button.sv-row:hover .sv-go .ic { transform: translateX(3px); }
[dir="ltr"] .guild-pick select { background-position: right 2px center; }
[dir="ltr"] .page-head::after { background: linear-gradient(90deg, var(--coral-500), var(--yellow-500) 22%, rgb(21 61 64 / .10) 46%, transparent); transform-origin: left; }
[dir="ltr"] .lbtn::after { transform: translateX(-150%) skewX(-20deg); }
[dir="ltr"] .lbtn:hover::after, [dir="ltr"] .btn:hover::after { transform: translateX(360%) skewX(-20deg); }
[dir="ltr"] .bar-fill, [dir="ltr"] .meter-fill { transform-origin: left; }
@media (max-width: 860px) { [dir="ltr"] .rail { box-shadow: 26px 0 60px -24px rgb(12 43 45 / .45); } }
/* English reads a little tighter than Arabic */
html[lang="en"] .dash { line-height: 1.6; }
