:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --canvas:#11151b; --surface:#191f28; --raised:#232b35; --well:#141920;
  --ink:#eef1f4; --muted:#b1bbc8; --line:#37414e; --gold:#efc575;
  --blue:#94baff; --green:#71d9ab; --red:#ffa0a4; --orange:#f3ad82;
  --cyan:#80d5df; --violet:#cab1f2; --pink:#f5aacb; --slate:#aeb9cc;
  --shadow:0 6px 18px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.06);
  --veil:rgba(6,10,17,.65); --highlight:rgba(255,255,255,.06);
}
:root[data-theme="light"] {
  color-scheme:light;
  --canvas:#f3f4f6; --surface:#fff; --raised:#edf0f4; --well:#f7f8fa;
  --ink:#1a2230; --muted:#49586b; --line:#c5cdd6; --gold:#805600;
  --blue:#284f95; --green:#146544; --red:#962f42; --orange:#873e15;
  --cyan:#126574; --violet:#65448d; --pink:#90375c; --slate:#455369;
  --shadow:0 5px 16px rgba(38,49,64,.08),inset 0 1px 0 rgba(255,255,255,.9);
  --veil:rgba(25,31,43,.40); --highlight:rgba(255,255,255,.8);
}
html[data-theme] {background:var(--canvas);color:var(--ink);accent-color:var(--gold)}
html[data-theme] body {background:var(--canvas);color:var(--ink)}
html[data-theme] body,html[data-theme] body * {font-family:'Cairo',sans-serif}
html[data-theme] :where(h1,h2,h3,h4) {font-weight:700;letter-spacing:normal;text-shadow:none}
html[data-theme] h1 {line-height:1.4}
html[data-theme] :focus-visible {outline:2px solid var(--gold);outline-offset:3px}
html[data-theme] ::placeholder {color:var(--muted);opacity:1}
html[data-theme] dialog::backdrop {background:var(--veil)}
html[data-theme] :is(.box,.b,.card,.panel,.main,.server-card,.subscriber-card,.fup-level-card,.fup-setting-box) {
  border-radius:12px;box-shadow:var(--shadow);transition:transform .18s ease,box-shadow .18s ease,background-color .18s ease;
}
@media (hover:hover) {
  html[data-theme] :is(article.card,.cards>.card,.server-card,.subscriber-stat,.fup-level-card):hover {transform:translateY(-3px)}
  html[data-theme] :where(a,button):not(:disabled):hover {filter:brightness(1.08)}
  html[data-theme] tbody tr:hover {background:var(--raised)}
}
html[data-theme] :is(button,a,input,select,textarea) {transition:background-color .18s,color .18s,border-color .18s,box-shadow .18s}
html.theme-changing *,html.theme-changing *::before,html.theme-changing *::after {transition:color .18s,background-color .18s,border-color .18s,box-shadow .18s}
.ax-theme-bar {display:flex;align-items:center;justify-content:flex-end;max-width:1280px;margin:0 auto;padding:8px 16px;box-sizing:border-box}
html[data-theme] .ax-theme-toggle {
  all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;
  direction:ltr;gap:2px;padding:3px;background:var(--well);color:var(--muted);border:1px solid var(--line);
  border-radius:24px;cursor:pointer;line-height:1;
}
.ax-theme-toggle svg {box-sizing:content-box;width:16px;height:16px;padding:6px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
[data-theme="dark"] .ax-moon,[data-theme="light"] .ax-sun {color:var(--gold);background:var(--raised);border-radius:50%;filter:drop-shadow(0 0 3px color-mix(in srgb,var(--gold) 28%,transparent))}
html[data-theme] .ax-theme-toggle:focus-visible {outline:2px solid var(--gold)}
@media(prefers-reduced-motion:reduce) {
  html[data-theme] *,html[data-theme] *::after,html[data-theme] *::before {animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
:where(html[data-theme]) a {color:var(--blue)}
html[data-theme] :is(.fup-page section,.fup-cards article) {border-radius:12px;box-shadow:var(--shadow)}
@media(hover:hover) and (prefers-reduced-motion:no-preference) {
  html[data-theme] .fup-cards article {transition:transform .18s ease}
  html[data-theme] .fup-cards article:hover {transform:translateY(-3px)}
}

/* Keep native scrolling and pinch zoom available on the desktop-sized mobile viewport. */
html,body {touch-action:pan-x pan-y pinch-zoom}
html:has(dialog:modal,.edit-overlay:not([hidden]),.ax-safe-overlay:not([hidden]),.v3-overlay.open) {
  box-sizing:border-box;padding-left:var(--ax-scroll-left,0px);padding-right:var(--ax-scroll-right,0px);
}
html:has(dialog:modal,.edit-overlay:not([hidden]),.ax-safe-overlay:not([hidden]),.v3-overlay.open),
body:has(dialog:modal,.edit-overlay:not([hidden]),.ax-safe-overlay:not([hidden]),.v3-overlay.open) {
  overflow:hidden;
  overscroll-behavior:none;
}
dialog:modal,.edit-overlay:not([hidden]),.ax-safe-overlay:not([hidden]) {overscroll-behavior:contain}
.edit-overlay:not([hidden]),.ax-safe-overlay:not([hidden]) {overflow:auto}
.ax-theme-bar,[data-theme-slot] {gap:9px;align-items:center;direction:ltr}
.ax-theme-bar {justify-content:flex-start}
html[data-theme] .ax-home {
  box-sizing:border-box;display:inline-grid;place-items:center;width:38px;height:38px;
  margin:0;padding:0;border:1px solid var(--line);border-radius:9px;background:var(--surface);
  color:var(--ink);text-decoration:none;line-height:1;
}
.ax-home svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.ax-message {max-width:min(430px,90vw);width:max-content;min-width:min(300px,85vw);max-height:85dvh;
  box-sizing:border-box;padding:22px;background:var(--surface);color:var(--ink);border:1px solid var(--line);
  border-radius:12px;box-shadow:var(--shadow);overflow:auto}
.ax-message form {display:grid;gap:16px;width:auto;margin:0;padding:0;background:transparent}
.ax-message p {margin:0;font-size:16px;font-weight:600;line-height:1.65;color:var(--ink)}
.ax-message input {box-sizing:border-box;width:100%;margin:0;border:1px solid var(--line);border-radius:8px;padding:9px 12px;background:var(--well);color:var(--ink);font:inherit}
.ax-message form > div {display:flex;gap:8px}
html[data-theme] .ax-message button {font:inherit;font-weight:600;width:auto;min-width:70px;margin:0;padding:6px 16px;background:var(--raised);color:var(--ink);border:1px solid var(--line);border-radius:8px;cursor:pointer}
html[data-theme] .ax-message [type="submit"] {color:var(--canvas);background:var(--gold);border-color:var(--gold)}
.ax-message.ax-confirm, .ax-confirm {
  --ax-confirm-accent:var(--gold);
  --ax-confirm-button-text:var(--canvas);
  box-sizing:border-box;width:min(320px,calc(100vw - 24px));min-width:0;max-width:none;
  max-height:90dvh;padding:20px;margin:auto;border:1px solid var(--line);border-radius:16px;
  background:var(--surface);color:var(--ink);box-shadow:var(--shadow);text-align:center;overflow:auto;
  font:inherit;overflow-wrap:anywhere;
}
.ax-confirm::backdrop {background:var(--veil)}
.ax-confirm.ax-confirm--danger {--ax-confirm-accent:#b9263d;--ax-confirm-button-text:#fff}
.ax-confirm.ax-confirm--handheld {
  position:fixed;inset:auto;left:var(--ax-confirm-x);top:var(--ax-confirm-y);margin:0;
  width:var(--ax-confirm-width);max-height:var(--ax-confirm-height);
  transform:translate(-50%,-50%) scale(var(--ax-confirm-scale));
}
.ax-confirm > form, .ax-confirm.ax-message > form {
  display:grid;justify-items:center;gap:10px;padding:0;margin:0;text-align:center;
}
.ax-confirm-icon {
  display:grid;place-items:center;width:42px;height:42px;margin-inline:auto;border-radius:50%;
  background:color-mix(in srgb,var(--ax-confirm-accent) 18%,var(--surface));color:var(--ax-confirm-accent);
  font:700 24px/1 'Cairo',sans-serif;
}
.ax-confirm .ax-confirm-title {margin:0;color:var(--ink);font:700 17px/1.55 'Cairo',sans-serif;text-align:center}
.ax-confirm .ax-confirm-detail {
  margin:0;color:var(--muted);font:400 13px/1.6 'Cairo',sans-serif;text-align:center;white-space:pre-line;
}
.ax-confirm .ax-confirm-actions, .ax-confirm.ax-message form > .ax-confirm-actions {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;margin-top:4px;
}
html[data-theme] .ax-confirm .ax-confirm-actions button {
  box-sizing:border-box;width:100%;min-width:0;min-height:42px;margin:0;padding:6px;
  background:var(--raised);color:var(--ink);border:1px solid var(--line);border-radius:8px;
  font:700 14px/1.45 'Cairo',sans-serif;cursor:pointer;
}
html[data-theme] .ax-confirm .ax-confirm-actions .ax-confirm-accept {
  color:var(--ax-confirm-button-text);background:var(--ax-confirm-accent);border-color:var(--ax-confirm-accent);
}
.ax-eagle {position:relative;display:block;overflow:hidden;isolation:isolate;border-radius:6px}
.ax-eagle img {display:block}
.ax-eagle::after {content:"";position:absolute;inset:-15% 0;pointer-events:none;transform:translateX(-145%) skewX(-18deg);
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--gold) 17%,transparent),transparent);animation:ax-sheen 9s ease-in-out infinite}
@keyframes ax-sheen {0%,75% {transform:translateX(-145%) skewX(-18deg)} 93%,100% {transform:translateX(145%) skewX(-18deg)}}
.ax-login-eagle {width:170px;max-width:100%;margin:0 auto 10px}
.ax-login-eagle img.logo {width:100%;margin:0}
@media (prefers-reduced-motion:reduce) {.ax-eagle::after {display:none}}
@media(hover:hover) {
  html[data-theme] :is(.ax-home,.ax-tool,.ax-theme-toggle,.ax-message button,.btn,.subscriber-action,.server-refresh):hover {
    border-color:var(--gold);box-shadow:0 2px 10px color-mix(in srgb,var(--gold) 13%,transparent);
  }
  html[data-theme] :is(.card,.box,.server-card,.subscriber-card,.fup-level-card):hover {
    box-shadow:var(--shadow),0 0 12px color-mix(in srgb,var(--gold) 8%,transparent);
  }
}

:root, :root[data-theme="dark"] {--switch-on:#16854e;--switch-off:#515d70;--switch-border:#a3adba}
:root[data-theme="light"] {--switch-on:#167347;--switch-off:#667182;--switch-border:#4e5b6a}
.ax-theme-bar {position:sticky;top:0;z-index:35;background:var(--canvas)}
.phone .ax-theme-bar {background:var(--surface)}
body > .ax-theme-bar {
    width:max-content;max-width:100%;margin-left:max(0px,calc((100% - 1280px)/2));margin-right:auto;
    margin-bottom:8px;border-radius:0 0 10px 10px;
}
html:has(.ax-theme-bar) {scroll-padding-top:68px}

.ax-save-context {position:relative}
.ax-save-feedback {position:absolute;top:0;left:0;z-index:2;box-sizing:border-box;width:max-content;max-width:none;
    margin:0;padding:0;border:0;background:transparent;color:var(--green);font:600 12px/1.4 Cairo,sans-serif;
    direction:rtl;white-space:nowrap;pointer-events:none;transform:translateY(-50%);
    animation:ax-save-fade 1.7s linear both}
@keyframes ax-save-fade {0%,88% {opacity:1} 100% {opacity:0}}
@media(prefers-reduced-motion:reduce) {html[data-theme] .ax-save-feedback {animation:none!important}}
html.ax-save-arrival::view-transition-old(root) {animation:ax-save-depart 1.7s linear both;mix-blend-mode:normal}
html.ax-save-arrival::view-transition-new(root) {animation:ax-save-arrive 1.7s linear both;mix-blend-mode:normal}
html.ax-save-arrival::view-transition-old(ax-saved) {animation:ax-save-fade 1.7s linear both}
@keyframes ax-save-arrive {0%,99% {opacity:0} 100% {opacity:1}}
@keyframes ax-save-depart {0%,99% {opacity:1} 100% {opacity:0}}

html.ax-snapshot-viewport,html.ax-snapshot-viewport body {overflow-x:clip}

.ax-return-from-edit .subscriber-message {display:none}
