@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');
/*
 * vitik-ui.css — ONE theme for the whole web panel (ViTiK, Earthlink, SAS4),
 * the app's own identity (god-vitik/lib/theme/app_colors.dart): midnight
 * dark, clean light, one accent per mode. config.php injects it LAST in
 * every page's <head>, so:
 *   1. the tokens below win over each page's own copy (same selectors, later);
 *   2. the old variable names every page already uses (--bg-color, --card-bg,
 *      --wa-*, …) are aliases of the new ones — 41 pages recolour at once;
 *   3. the shared pieces (header, card, field, window) get one look.
 * Dark is the default; light = body.light-mode (as every page sets it).
 *
 * Layers (z-index): header 100 · bottom bar 200 · windows 1000+ · toast top.
 * Breakpoints: phone ≤ 600 · tablet 601–1023 · desktop ≥ 1024.
 */

/* ── 1. Tokens ─────────────────────────────────────────────────────────── */
:root,
body:not(.light-mode) {
  color-scheme: dark;
  --v-bg0: #0A0B0F;
  --v-bg1: #11131A;
  --v-bg2: #181B23;
  --v-surface: #1B1E27;
  --v-card: #1E2129;
  --v-raised: #272A33;
  --v-pressed: #323641;
  --v-border: rgba(255, 255, 255, 0.12);
  --v-border-strong: rgba(255, 255, 255, 0.20);
  --v-primary: #3D9EFF;
  --v-primary-deep: #1976D2;
  --v-primary-bright: #7AB9FF;
  --v-primary-rgb: 61, 158, 255;
  --v-on-primary: #ffffff;
  --v-green: #34D399;
  --v-green-deep: #10B981;
  --v-green-rgb: 52, 211, 153;
  --v-amber: #FBBF24;
  --v-amber-rgb: 251, 191, 36;
  --v-red: #F87171;
  --v-red-rgb: 248, 113, 113;
  --v-violet: #A78BFA;
  --v-violet-rgb: 167, 139, 250;
  --v-cyan: #22D3EE;
  --v-text: #EEF0F4;
  --v-text-2: #A1A1AA;
  --v-text-3: #8A8A94;
  --v-header-bg: rgba(17, 19, 26, 0.78);
  --v-scrim: rgba(4, 5, 9, 0.66);
  --v-track: rgba(255, 255, 255, 0.07);
  --v-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.40);
  --v-shadow-2: 0 6px 16px rgba(0, 0, 0, 0.34);
  --v-shadow-3: 0 14px 34px rgba(0, 0, 0, 0.46);
  --v-shadow-4: 0 28px 60px rgba(0, 0, 0, 0.60);
  --v-page-bg:
    radial-gradient(1100px 520px at 88% -8%, rgba(61, 158, 255, 0.10), transparent 62%),
    radial-gradient(820px 460px at -6% 4%, rgba(139, 92, 246, 0.07), transparent 58%),
    linear-gradient(180deg, #0A0B0F 0%, #11131A 100%);
}
body.light-mode {
  color-scheme: light;
  --v-bg0: #F6F7FA;
  --v-bg1: #EDEFF3;
  --v-bg2: #E2E4EA;
  --v-surface: #FFFFFF;
  --v-card: #FFFFFF;
  --v-raised: #FAFBFD;
  --v-pressed: #EFF1F5;
  --v-border: #E2E4EA;
  --v-border-strong: #C9CCD3;
  --v-primary: #7C4DEB;
  --v-primary-deep: #6D28D9;
  --v-primary-bright: #A78BFA;
  --v-primary-rgb: 124, 77, 235;
  --v-on-primary: #ffffff;
  --v-green: #15803D;
  --v-green-deep: #166534;
  --v-green-rgb: 21, 128, 61;
  --v-amber: #B45309;
  --v-amber-rgb: 180, 83, 9;
  --v-red: #DC2626;
  --v-red-rgb: 220, 38, 38;
  --v-violet: #7C3AED;
  --v-violet-rgb: 124, 58, 237;
  --v-cyan: #0E7490;
  --v-text: #18181B;
  --v-text-2: #52525B;
  --v-text-3: #6B6B76;
  --v-header-bg: rgba(255, 255, 255, 0.86);
  --v-scrim: rgba(24, 24, 27, 0.42);
  --v-track: rgba(24, 24, 27, 0.06);
  --v-shadow-1: 0 1px 2px rgba(24, 24, 27, 0.06);
  --v-shadow-2: 0 6px 16px rgba(24, 24, 27, 0.08);
  --v-shadow-3: 0 14px 34px rgba(24, 24, 27, 0.12);
  --v-shadow-4: 0 28px 60px rgba(24, 24, 27, 0.18);
  --v-page-bg:
    radial-gradient(1100px 520px at 88% -8%, rgba(124, 77, 235, 0.08), transparent 62%),
    linear-gradient(180deg, #F6F7FA 0%, #EDEFF3 100%);
}

/* Shape, type and motion — the same in both modes. */
:root {
  --v-font: 'Tajawal', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --v-r-sm: 10px;
  --v-r: 14px;
  --v-r-lg: 18px;
  --v-r-xl: 24px;
  --v-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --v-dur: 220ms;
  --v-z-header: 100;
  --v-z-nav: 200;
  --v-z-window: 1000;
  --v-safe-b: env(safe-area-inset-bottom, 0px);
  --v-safe-t: env(safe-area-inset-top, 0px);
}

/* The names the pages already use → the tokens above. */
:root,
body:not(.light-mode),
body.light-mode {
  --bg-color: var(--v-bg0);
  --bg: var(--v-bg0);
  --page-bg: var(--v-page-bg);
  --card-bg: var(--v-card);
  --card-bg-elevated: var(--v-raised);
  --input-bg: var(--v-raised);
  --header-bg: var(--v-header-bg);
  --text-light: var(--v-text);
  --text-main: var(--v-text);
  --text: var(--v-text);
  --text-dark-fade: var(--v-text-2);
  --text-secondary: var(--v-text-2);
  --muted: var(--v-text-2);
  --border-color: var(--v-border);
  --border-strong: var(--v-border-strong);
  --accent-blue: var(--v-primary);
  --accent-primary: var(--v-primary);
  --blue: var(--v-primary);
  --accent-blue-rgb: var(--v-primary-rgb);
  --accent-green: var(--v-green);
  --accent-success: var(--v-green);
  --green: var(--v-green);
  --accent-green-rgb: var(--v-green-rgb);
  --red-alert: var(--v-red);
  --red: var(--v-red);
  --red-alert-rgb: var(--v-red-rgb);
  --amber: var(--v-amber);
  --color-warning: var(--v-amber);
  --color-warning-soft: rgba(var(--v-amber-rgb), 0.16);
  --purple: var(--v-violet);
  --purple-accent: var(--v-violet);
  --purple-accent-rgb: var(--v-violet-rgb);
  --cyan: var(--v-cyan);
  --track: var(--v-track);
  --total-active-bg: rgba(var(--v-primary-rgb), 0.12);
  --total-active-border: var(--v-primary);
  --shadow-1: var(--v-shadow-1);
  --shadow-2: var(--v-shadow-2);
  --shadow-3: var(--v-shadow-3);
  --shadow-4: var(--v-shadow-4);
  --shadow: var(--v-shadow-2);
  --shadow-dark: rgba(0, 0, 0, 0.30);
  --button-hover-shadow: var(--v-shadow-3);
  --card-hover-shadow: var(--v-shadow-3);
  --font-family: var(--v-font);
  --font-family-ar: var(--v-font);
  --font-family-en: var(--v-font);
  /* the account pages' own set (web-account.css) */
  --wa-bg0: var(--v-bg0);
  --wa-glass: var(--v-card);
  --wa-card: var(--v-surface);
  --wa-border: var(--v-border);
  --wa-text: var(--v-text);
  --wa-muted: var(--v-text-2);
  --wa-blue: var(--v-primary);
  --wa-green: var(--v-green);
  --wa-amber: var(--v-amber);
  --wa-red: var(--v-red);
  --wa-purple: var(--v-violet);
}

/* ── 2. Base ───────────────────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #0A0B0F;
  overflow-x: clip;
  scroll-padding-top: 84px;
}
html:has(body.light-mode) { background: #F6F7FA; }

body:not(.light-mode),
body.light-mode {
  background: var(--v-page-bg);
  color: var(--v-text);
  font-family: var(--v-font);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
body, button, input, select, textarea { font-family: var(--v-font); }

::selection { background: rgba(var(--v-primary-rgb), 0.32); }

:focus-visible {
  outline: 2px solid var(--v-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

* { scrollbar-width: thin; scrollbar-color: var(--v-pressed) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--v-pressed); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Latin runs (usernames, IPs, numbers) keep their order inside Arabic text. */
.vui-ltr, bdi.v { direction: ltr; unicode-bidi: isolate; }

/* ── 3. The shared pieces, one look ────────────────────────────────────── */

/* 3.1 Header: the three families the pages use. */
.header-section,
.topbar,
.wa-topbar,
.elw-top {
  background: var(--v-header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--v-border);
  box-shadow: var(--v-shadow-2);
  z-index: var(--v-z-header);
}
.topbar,
.elw-top {
  position: sticky;
  top: 8px;
  width: min(1200px, calc(100% - 16px));
  margin: 8px auto 0;
  border-radius: var(--v-r-lg);
  box-sizing: border-box;
}
.wa-topbar {
  position: sticky;
  top: 8px;
  padding: 8px 10px;
  border-radius: var(--v-r-lg);
}
.topbar h1, .wa-topbar h1, .elw-top h1 { color: var(--v-text); letter-spacing: 0; }
.topbar h1 i, .elw-top h1 i { color: var(--v-primary); }
.header-title {
  background: linear-gradient(135deg, var(--v-primary-bright) 0%, var(--v-primary) 55%, var(--v-green) 130%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Round, even, finger-sized controls in every header. */
.header-control-item,
.topbar a.back,
.wa-back,
.elw-top .elw-icon-btn {
  min-width: 40px;
  min-height: 40px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--v-text);
  transition: background-color var(--v-dur) var(--v-ease), color var(--v-dur) var(--v-ease), border-color var(--v-dur) var(--v-ease);
}
.topbar a.back, .wa-back { border: 1px solid var(--v-border); background: var(--v-track); }
.header-control-item:hover,
.topbar a.back:hover,
.wa-back:hover { background: rgba(var(--v-primary-rgb), 0.14); color: var(--v-primary); }

/* 3.2 Cards. */
.card, .wa-card, .s4w-card, .elw-card {
  background: var(--v-card);
  border: 1px solid var(--v-border);
  border-radius: var(--v-r-lg);
  box-shadow: var(--v-shadow-1);
}

/* 3.3 Fields. */
input[type="text"], input[type="search"], input[type="number"], input[type="tel"], input[type="email"],
input[type="password"], input[type="url"], input[type="date"], input[type="time"], input[type="datetime-local"],
input:not([type]), select, textarea {
  background-color: var(--v-raised);
  color: var(--v-text);
  border-color: var(--v-border);
  accent-color: var(--v-primary);
}
input::placeholder, textarea::placeholder { color: var(--v-text-3); opacity: 1; }
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, input[type="tel"]:focus,
input[type="email"]:focus, input[type="password"]:focus, input[type="url"]:focus, input:not([type]):focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--v-primary);
  box-shadow: 0 0 0 3px rgba(var(--v-primary-rgb), 0.22);
}
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--v-primary); }
select option { background: var(--v-surface); color: var(--v-text); }

/* 3.4 Windows (every old window family + the new one). The window manager
   in vitik-common.js marks an open one .vui-ov.vui-on and its box .vui-win. */
.vui-ov.vui-on {
  background: var(--v-scrim) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overscroll-behavior: contain;
}
.vui-win {
  background: var(--v-surface) !important;
  color: var(--v-text);
  border: 1px solid var(--v-border) !important;
  box-shadow: var(--v-shadow-4) !important;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
.vui-win:not(.vui-full) { border-radius: var(--v-r-xl) !important; }
html.vui-lock, html.vui-lock body { overflow: hidden !important; }
html.vui-lock body { padding-inline-end: var(--vui-sbw, 0px); }
/* The bottom bar steps aside while a window is open (a sheet owns the bottom). */
html.vui-lock .dl-bottom-nav, html.vui-lock .elw-tabs, html.vui-lock .s4w-tabs { visibility: hidden; }

@keyframes vui-pop { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes vui-rise { from { opacity: 0.4; translate: 0 100%; } to { opacity: 1; translate: 0 0; } }
@keyframes vui-fade { from { opacity: 0; } to { opacity: 1; } }

/* On a phone a window is a sheet from the bottom, as in the app. */
@media (max-width: 600px) {
  /* The sheet is pinned to the bottom itself; the overlay is left exactly
     as the page made it (its display, size and position are the page's). */
  .vui-ov.vui-sheet > .vui-win {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: var(--vui-kb, 0px) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: none !important;
    border-radius: 22px 22px 0 0 !important;
    border-bottom: none !important;
    max-height: calc(var(--vui-vvh, 100dvh) - 44px - var(--v-safe-t));
    padding-bottom: calc(18px + var(--v-safe-b)) !important;
  }
  .vui-ov.vui-sheet > .vui-win::before {
    content: '';
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 4px;
    background: var(--v-border-strong);
    margin: -4px auto 12px;
  }
}

/* The page's own dialog (VitikUI.confirm) and toast in the same look. */
.vui-dialog { background: var(--v-surface) !important; color: var(--v-text) !important; border: 1px solid var(--v-border); border-radius: var(--v-r-xl) !important; }
.vui-dialog .vui-ok { background: linear-gradient(135deg, var(--v-primary), var(--v-primary-deep)) !important; }
.vui-dialog.danger .vui-ok { background: linear-gradient(135deg, #F87171, #DC2626) !important; }
.vui-dialog button { min-height: 44px; }
.vui-toast { border-radius: 14px !important; font-family: var(--v-font); }

/* 3.5 Phone sizes: nothing wider than the screen, fields that do not zoom. */
@media (max-width: 600px) {
  input[type="text"], input[type="search"], input[type="number"], input[type="tel"], input[type="email"],
  input[type="password"], input[type="url"], input:not([type]), select, textarea { font-size: 16px; }
  .header-section, .topbar, .elw-top { width: calc(100% - 12px); top: 6px; margin-top: 6px; border-radius: 16px; }
}

/* 3.55 Buttons: one shape, one primary, in every system. */
.confirm-btn, .cancel-btn, .s4w-btn, .elw-btn, .wa-btn, .modal-button, .btn {
  border-radius: 12px;
  font-family: var(--v-font);
  font-weight: 800;
  cursor: pointer;
  transition: filter var(--v-dur) var(--v-ease), background-color var(--v-dur) var(--v-ease), box-shadow var(--v-dur) var(--v-ease);
}
.confirm-btn, .s4w-btn.primary, .elw-btn.primary, .wa-btn.primary, .btn.primary {
  background: linear-gradient(135deg, var(--v-primary) 0%, var(--v-primary-deep) 100%);
  color: var(--v-on-primary);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(var(--v-primary-rgb), 0.28);
}
.cancel-btn, .s4w-btn.ghost, .elw-btn.ghost, .wa-btn.ghost {
  background: var(--v-raised);
  color: var(--v-text);
  border: 1px solid var(--v-border);
  box-shadow: none;
}
.s4w-btn.ok, .elw-btn.ok, .btn.ok { background: linear-gradient(135deg, var(--v-green) 0%, var(--v-green-deep) 100%); color: #06231a; }
body.light-mode .s4w-btn.ok, body.light-mode .elw-btn.ok, body.light-mode .btn.ok { color: #fff; }
.s4w-btn.danger, .elw-btn.danger, .btn.no {
  background: rgba(var(--v-red-rgb), 0.14);
  color: var(--v-red);
  border: 1px solid rgba(var(--v-red-rgb), 0.38);
}
.confirm-btn:hover, .s4w-btn:hover, .elw-btn:hover, .wa-btn:hover { filter: brightness(1.07); }
.confirm-btn:disabled, .cancel-btn:disabled, .s4w-btn:disabled, .elw-btn:disabled, .wa-btn:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }

/* 3.56 The tab bar of every system (ViTiK .dl-bottom-nav, Earthlink
   .elw-tabs, SAS4 .s4w-tabs): a floating bar at the bottom of a phone or
   tablet, a row of pills under the header on a desktop. */
.dl-bottom-nav a, .elw-tab, .s4w-tab {
  color: var(--v-text-2);
  border: 0;
  background: none;
  font-family: var(--v-font);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border-radius: 14px;
  transition: color var(--v-dur) var(--v-ease), background-color var(--v-dur) var(--v-ease);
}
.dl-bottom-nav a.on, .elw-tab.on, .s4w-tab.on {
  color: var(--v-primary);
  background: rgba(var(--v-primary-rgb), 0.14);
  border-color: transparent;
  font-weight: 800;
}
@media (max-width: 1023px) {
  .dl-bottom-nav, .elw-tabs, .s4w-tabs {
    display: flex;
    position: fixed;
    top: auto;
    bottom: calc(8px + var(--v-safe-b));
    left: 8px;
    right: 8px;
    inset-inline: 8px;
    width: auto;
    max-width: 560px;
    margin: 0 auto;
    padding: 6px;
    gap: 4px;
    z-index: var(--v-z-nav);
    border-radius: 20px;
    background: var(--v-header-bg);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
    border: 1px solid var(--v-border);
    box-shadow: var(--v-shadow-3);
    box-sizing: border-box;
  }
  .dl-bottom-nav a, .elw-tab, .s4w-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    font-size: 11.5px;
    line-height: 1.2;
  }
  .dl-bottom-nav a span, .elw-tab span, .s4w-tab span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dl-bottom-nav i, .elw-tab i, .s4w-tab i { font-size: 18px; }
  body.has-bottom-nav, body:has(> .dl-bottom-nav) { padding-bottom: calc(86px + var(--v-safe-b)); }
  /* floating action buttons sit above the bar */
  body:has(> .dl-bottom-nav) .fab, body:has(> .dl-bottom-nav) .floating-add-btn, body:has(> .dl-bottom-nav) .add-device-fab,
  body:has(> .dl-bottom-nav) [class*="fab"]:not(i):not(svg) { bottom: calc(88px + var(--v-safe-b)); }
  .elw-app, .s4w-wrap { padding-bottom: calc(96px + var(--v-safe-b)); }
  body.elw-out .elw-tabs { display: none; }
}
@media (min-width: 1024px) {
  .dl-bottom-nav { display: none; }
  .elw-tabs, .s4w-tabs {
    position: sticky;
    top: 76px;
    z-index: 90;
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
    background: var(--v-header-bg);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
    border: 1px solid var(--v-border);
  }
  .elw-tab, .s4w-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    font-size: 14px;
  }
}

/* 3.57 Earthlink and SAS4 sit in the same shell as ViTiK. */
.elw-top { width: 100%; margin: 8px 0 0; padding: 8px 10px; }
.elw-icon {
  background: var(--v-track);
  border: 1px solid var(--v-border);
  color: var(--v-text);
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
}
.elw-top-bal { background: rgba(var(--v-green-rgb), 0.14); color: var(--v-green); }
.s4w-modal, .elw-modal, .sysx-modal, .dm-modal, .sf-modal { background: var(--v-surface); border: 1px solid var(--v-border); }

/* 3.6 Phone header: back · title · a few controls · «⋮» for the rest
   (vitik-ui.js moves what does not fit). */
@media (max-width: 600px) {
  .header-section {
    display: flex !important;
    align-items: center;
    gap: 4px;
    padding: 6px 8px !important;
  }
  .header-section .header-title {
    flex: 1 1 0;
    min-width: 0;
    max-width: none !important;
    justify-self: auto;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.02rem !important;
  }
  .header-section .header-control-group { gap: 2px !important; flex: 0 0 auto; min-width: 0 !important; }
  .header-section .header-control-item { font-size: 1.05rem !important; padding: 0 !important; }
}
.vui-more-pop {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 6px;
  min-width: 210px;
  padding: 6px;
  border-radius: 16px;
  background: var(--v-surface);
  border: 1px solid var(--v-border);
  box-shadow: var(--v-shadow-3);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: vui-pop 180ms var(--v-ease);
}
.vui-more-pop[hidden] { display: none; }
.vui-more-pop .vui-more-item {
  display: flex !important;
  justify-content: flex-start !important;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px !important;
  border-radius: 12px;
  font-size: 1rem !important;
  text-decoration: none;
  color: var(--v-text);
  box-sizing: border-box;
}
.vui-more-label { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* 3.7 A floor for what people read and tap: no text under 12px (a few
   labels were 8–10px on phones), no link shorter than a finger. */
.expires-date, .expires-time, .user-cell-profile, .debt-summary-mobile span, .currency-label,
.stat-box label, .plan-chip, .dm-via, .metric-unit, .device-version, span.src, .debt-chip,
.remaining-time-value, .user-cell-debt { font-size: 12px !important; }
.remaining-time-label { font-size: 11.5px !important; letter-spacing: 0; }
/* the larger text may take a second line instead of being cut by its cell */
.remaining-time-value { white-space: normal !important; overflow-wrap: anywhere; line-height: 1.25 !important; }
.expires-date, .expires-time { white-space: normal; overflow-wrap: anywhere; }
.username-link, .ip-link { display: inline-block; padding-block: 7px; margin-block: -4px; }
.st-i, .sys-star, .s4w-eye, .wa-preview-link { min-width: 36px; min-height: 36px; }
input[type="checkbox"], input[type="radio"] { min-width: 18px; min-height: 18px; }

/* 3.8 Narrow-screen fixes found by the overlap sweep (320–600px). */
@media (max-width: 600px) {
  /* Debt card: the name gets the row's width, and when the chip and the
     buttons do not fit one line the buttons drop to the next one by
     themselves (they used to squeeze the name into a 50px column, or sit on
     the chip). */
  .debt-card-header { display: flex !important; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; }
  .debt-card-header .debtor-info { order: 1; flex: 1 1 0; min-width: 0; }
  .debt-card-header .total-debt-display { order: 2; flex: 0 0 auto; }
  .debt-card-header::after { content: ''; order: 3; flex: 0 0 100%; height: 0; }
  .debt-card-header .debt-summary-mobile { order: 4; flex: 0 1 auto; min-width: 0; }
  .debt-card-header .debt-card-actions { order: 5; flex: 0 0 auto; margin-inline-start: auto; }
  .debt-card-header .debt-chips { order: 6; flex: 0 0 100%; }
  /* Managers: a subscription line wraps instead of running out of its card. */
  .sub-row { grid-template-columns: minmax(0, 1fr) auto !important; }
  .sub-row .sub-name { min-width: 0; }
  .sub-row .sub-left { grid-column: 2; grid-row: 1; white-space: normal !important; text-align: end; }
  .sub-row .sub-end { grid-column: 1 / -1; grid-row: 2; white-space: normal !important; }
  /* Managers: the name keeps a full line; the card's buttons go under it
     (four buttons used to squeeze the name into a 69px column). */
  .admin-header { flex-wrap: wrap; row-gap: 10px; }
  .admin-header > div:first-child { flex: 1 1 100%; min-width: 0; }
  .admin-header .admin-header-actions { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; }
}
.plan-chip { white-space: nowrap; }
  .debt-card-header .debt-card-actions { grid-column: 1 / -1 !important; grid-row: 3; justify-self: stretch; justify-content: space-between; }
  .debt-card-header .debt-chips { grid-row: 4; }
}
/* A long e-mail or username breaks inside its box on every size. */
.email-cell { max-width: 100%; min-width: 0; }
.email-text, .detail-value, .system-stat-value { overflow-wrap: anywhere; min-width: 0; }

/* 3.9 The ⚙ options menu: one look on every page (web_options_menu.php). */
.account-popover {
  width: min(300px, calc(100vw - 20px)) !important;
  max-height: min(78dvh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px !important;
  border-radius: 18px !important;
  background: var(--v-surface) !important;
  border: 1px solid var(--v-border) !important;
  box-shadow: var(--v-shadow-4) !important;
  box-sizing: border-box;
  direction: inherit;
  text-align: start;
}
html[lang="ar"] .account-popover { direction: rtl; }
html[lang="en"] .account-popover { direction: ltr; }
.account-popover .popover-acct-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--v-border); margin-bottom: 4px; }
.account-popover .pah-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--v-primary), var(--v-violet)); }
.account-popover .pah-text { display: flex; flex-direction: column; min-width: 0; }
.account-popover .pah-name { font-weight: 800; font-size: 14.5px; color: var(--v-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover .pah-role { font-size: 12px; color: var(--v-text-2); }
.account-popover .popover-section-label { font-size: 11.5px; font-weight: 800; color: var(--v-text-3); padding: 8px 10px 2px; letter-spacing: 0; }
.account-popover .popover-section { padding: 2px 0 !important; border: 0 !important; }
.account-popover .popover-section + .popover-section-label { border-top: 1px solid var(--v-border); margin-top: 4px; padding-top: 10px; }
.account-popover .popover-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 10px !important;
  border-radius: 12px !important;
  color: var(--v-text) !important;
  font-size: 14px !important;
  font-weight: 600;
  text-decoration: none;
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
}
.account-popover .popover-item i { width: 20px; text-align: center; font-size: 15px; flex: 0 0 20px; color: var(--v-text-2); }
.account-popover .popover-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover .popover-item:hover { background: rgba(var(--v-primary-rgb), 0.10) !important; color: var(--v-text) !important; }
.account-popover .popover-item.is-current { background: rgba(var(--v-primary-rgb), 0.14) !important; color: var(--v-primary) !important; font-weight: 800; }
.account-popover .popover-item.danger-item, .account-popover .popover-item.danger-item i { color: var(--v-red) !important; }
.account-popover .popover-version { text-align: center; font-size: 11px; color: var(--v-text-3); padding: 6px 0 2px; }
.account-popover .popover-section:last-child { border-top: 1px solid var(--v-border) !important; margin-top: 4px; padding-top: 6px !important; }

/* ── 4. Motion off for those who ask ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Dashboard: the router's uptime, short (web_uptime_short). */
.system-stat .uptime-short { font-size: 13px !important; font-weight: 800; white-space: nowrap; letter-spacing: 0; unicode-bidi: plaintext; }

/* Whatever a page or the collector rules hide stays hidden, even where a
   rule above sets a display with !important (the specificity is raised on
   purpose so it outranks them). */
[data-vcw-hidden][data-vcw-hidden][data-vcw-hidden],
a[href][aria-hidden="true"][style*="display: none"] { display: none !important; }


/* ── 5. Smooth on phones and between pages ──────────────────────────────
   (the user, 2026-11-13: «اجعل التنقل والتصفح سموث أكثر»)
   • A fixed page background repainted the whole screen on every scroll
     step on phones: it no longer is fixed (the gradient sits at the top).
   • Live blur behind the header / window backdrop is the most expensive
     thing a phone draws while scrolling: on phones they are solid instead.
   • Going from page to page fades instead of flashing white (browsers
     that support cross-document view transitions; others are unchanged). */
@media (max-width: 1023px), (pointer: coarse) {
  .header-section, .topbar, .wa-topbar, .elw-top, .elw-tabs, .s4w-tabs, .vui-ov.vui-on {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .header-section, .topbar, .wa-topbar, .elw-top { background: color-mix(in srgb, var(--v-bg1) 96%, transparent) !important; }
  body.light-mode .header-section, body.light-mode .topbar, body.light-mode .wa-topbar, body.light-mode .elw-top { background: rgba(255, 255, 255, 0.97) !important; }
  .elw-tabs, .s4w-tabs { background: var(--v-surface) !important; }
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--v-ease); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
