/* ═══════════════════════════════════════════════════
   HL Trade · hl.css — سيولة
   ✅ Hyperliquid Design System — DESIGN.md مطبق بالكامل
   ✅ #0F1A1F خلفية · #50D2C1 شراء · #ED7088 بيع
   ✅ border-radius 8px · font-weight 400 · بدون gradients
════════════════════════════════════════════════════ */

/* ════════════════════
   متغيرات — Dark (الافتراضي)
   المصدر: DESIGN.md §2 Color Palette
════════════════════ */
:root {
  /* ── Android System Bar ── */
  --statusbar-h: max(env(safe-area-inset-top), 0px);
  --navbartop-h: max(env(safe-area-inset-top), 0px);
  color-scheme: dark light;

  /* ── Backgrounds ── */
  --bg-app:        #0F1A1F;   /* Background Darkest */
  --bg-card:       #0F1A1F;   /* same — الفصل عبر border لا لون */
  --bg-elev:       #273035;   /* Background Tertiary */
  --bg-input:      #273035;   /* Button Neutral Gray */
  --bg-panel:      #1A2429;   /* بين bg-app و bg-elev */

  /* ── Borders ── */
  --border:        #273035;   /* Border Default */
  --border-strong: #404452;   /* Background Secondary */

  /* ── Brand Accent (Teal) ── */
  --ac:     #50D2C1;                    /* Primary Action Teal */
  --ac-dim: rgba(80, 210, 193, .12);   /* subtle teal bg */
  --ac-text:#04060C;                    /* dark text on teal button */

  /* ── Bullish / Buy ── */
  --up:     #1FA67D;                   /* Success / Bullish Green */
  --up-dim: rgba(31, 166, 125, .12);

  /* ── Bearish / Sell ── */
  --dn:     #ED7088;                   /* Primary Action Coral */
  --dn-dim: rgba(237, 112, 136, .12);

  /* ── Warning ── */
  --warn:   #F0BE30;

  /* ── TP / SL ── */
  --tp:     #50D2C1;
  --tp-dim: rgba(80, 210, 193, .12);
  --sl:     #ED7088;
  --sl-dim: rgba(237, 112, 136, .12);

  /* ── Text ── DESIGN.md §2 §6 */
  --text-primary:   #F6FEFD;   /* Surface Light — ليس أبيض نقي لتقليل الوهج */
  --text-secondary: #D2DAD7;   /* Text Secondary */
  --text-muted:     #949E9C;   /* Text Tertiary */

  /* ── Shadows — §6 Elevation ── */
  --shadow:    0px 4px 12px rgba(0, 0, 0, .40);  /* Elevated (2) */
  --shadow-sm: 0px 2px  6px rgba(0, 0, 0, .30);  /* Raised (1) */
  --shadow-lg: 0px 8px 24px rgba(0, 0, 0, .60);  /* High (3) */

  /* ── Border Radius — §5 Scale ── */
  --r-xs:   4px;   /* badges, chips */
  --r-sm:   6px;   /* inputs, secondary buttons */
  --r-md:   8px;   /* primary buttons, cards ← المعيار */
  --r-lg:   8px;   /* same — spec: max 8px للمكونات الأساسية */
  --r-xl:   12px;  /* modals, overlays فقط */
  --r-pill: 8px;   /* spec: "Don't apply > 8px to primary components" */

  /* ── Typography ── */
  --font-ui:   -apple-system, BlinkMacSystemFont, 'Cairo', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ════════════════════
   Light Mode
   المصدر: DESIGN.md §1 — dark first, light surfaces للـ success contexts
════════════════════ */
@media (prefers-color-scheme: light) {
  :root {
    --bg-app:        #E4F6F4;   /* Surface Extra Light */
    --bg-card:       #F6FEFD;   /* Surface Light */
    --bg-elev:       #D2DAD7;   /* Border Light كخلفية */
    --bg-input:      #E4F6F4;
    --bg-panel:      #E4F6F4;
    --border:        #D2DAD7;   /* Border Light */
    --border-strong: #949E9C;

    --up:     #1FA67D; --up-dim: rgba(31,166,125,.14);
    --dn:     #ED7088; --dn-dim: rgba(237,112,136,.14);
    --ac:     #1FA67D; --ac-dim: rgba(31,166,125,.14);
    --ac-text:#F6FEFD;
    --tp:     #1FA67D; --tp-dim: rgba(31,166,125,.14);
    --sl:     #ED7088; --sl-dim: rgba(237,112,136,.14);
    --warn:   #9a6400;

    --text-primary:   #04060C;   /* Text Dark Inverse */
    --text-secondary: #273035;
    --text-muted:     #878C8F;   /* Text Alternate Gray */

    --shadow:    0px 2px 8px  rgba(0,0,0,.12);
    --shadow-sm: 0px 1px 4px  rgba(0,0,0,.08);
    --shadow-lg: 0px 4px 16px rgba(0,0,0,.18);
  }
}

/* ════════════════════
   RESET
════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

/* نسمح بالتحديد على القيم المهمة */
.pos-data-value, .price-value, .positions-pnl,
.hist-val, .hist-pnl, .balance-value, .confirm-val,
.tab-price, .nav-address, .pos-pnl, .pos-size,
.price-bid-ask, .price-delta {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  height: 100%;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-ui);
  overflow: hidden;
  /* §3 Body Regular: 14px weight 400 */
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;   /* ← DESIGN.md: 400-weight default */
  color-scheme: dark light;
}

input, button, select { font-family: inherit; font-size: inherit; color: inherit; }

/* §4 Buttons — §8 Touch Targets: 44px min */
button {
  cursor: pointer; border: none; background: none;
  transition: opacity .15s, transform .12s;
}
button:hover  { opacity: .9; }
button:active { transform: scale(.97); opacity: .8; }
button:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* §4 Form Inputs */
input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);   /* 6px per spec */
  padding: 10px 14px;
  outline: none;
  /* §9 Focus: teal border + glow */
  transition: border-color .15s, box-shadow .15s;
  font-weight: 400;
  color: var(--text-primary);
}
input:focus {
  border-color: var(--ac);
  box-shadow: 0px 0px 8px rgba(80, 210, 193, .30);
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ════════════════════
   SCREENS
════════════════════ */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  z-index: 1; background: var(--bg-app);
  overflow: hidden; max-width: 100vw;
  padding-top: var(--statusbar-h);
}
.screen.hidden { display: none !important; }

/* ════════════════════
   LOGIN
════════════════════ */
#loginScreen {
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  /* subtle teal glow — لا gradient ثقيل */
  background: radial-gradient(ellipse 70% 40% at 50% 0%,
    rgba(80,210,193,.08) 0%, transparent 70%);
}
.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  flex-shrink: 0;
}
.login-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--ac);                /* teal solid — no gradient */
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0px 4px 12px rgba(80,210,193,.30);
  flex-shrink: 0;
}
.login-title { font-size: 24px; font-weight: 400; }   /* §3 H1: 24px 400 */
.login-title em { color: var(--ac); font-style: normal; }

/* §4 Card */
.login-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);          /* 8px */
  padding: 20px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);           /* Elevated (2) */
}
.login-header {
  font-size: 12px; font-weight: 400; color: var(--text-muted);
  letter-spacing: .5px; text-transform: uppercase;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.field-label {
  display: block; font-size: 12px; font-weight: 400;
  color: var(--text-secondary); letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 8px;
}
.key-wrapper { position: relative; margin-bottom: 4px; }
.key-input {
  width: 100%; font-family: var(--font-mono); font-size: 13px;
  padding: 10px 40px 10px 12px; direction: ltr;
}
.key-toggle {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--text-muted); padding: 4px;
  background: none; border: none;
}

/* §4 Primary Button — Teal / "Buy" */
.login-btn {
  width: 100%; margin-top: 14px;
  height: 44px;                         /* §8 Touch: 44px */
  padding: 0 16px;
  border-radius: var(--r-md);           /* 8px */
  font-size: 14px; font-weight: 400;
  background: var(--ac);               /* #50D2C1 */
  color: var(--ac-text);               /* #04060C dark text on teal */
  border: none;
  transition: opacity .15s, transform .12s;
}
.login-btn:hover  { opacity: .9; transform: scale(1.02); }
.login-btn:active { opacity: .8; }

.login-note {
  margin-top: 12px; padding: 10px 14px; border-radius: var(--r-md);
  background: rgba(31,166,125,.08);
  border: 1px solid rgba(31,166,125,.25);
  font-size: 12px; color: var(--text-secondary); line-height: 1.8; text-align: center;
}
.login-note strong { color: var(--up); }

/* §4 Ghost / Tertiary Button */
.create-wallet-btn {
  width: 100%; margin-top: 8px;
  height: 44px; padding: 0 12px;
  border-radius: var(--r-md);
  font-size: 12px; font-weight: 400;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  transition: border-color .15s, background .15s;
}
.create-wallet-btn:hover {
  border-color: var(--text-secondary);
  background: rgba(210,218,215,.08);
}

/* ════════════════════
   NAV
════════════════════ */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  height: 48px;                        /* §5 Header: 56px on desktop, 48px mobile */
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0; overflow: hidden; min-width: 0;
  margin-top: 0;
}
.nav-left {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; min-width: 0;
}

.nav-logo-icon {
  font-size: 18px; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(80,210,193,.5));
}
.nav-logo-text {
  font-size: 16px; font-weight: 400;
  color: var(--text-primary);
  white-space: nowrap;
}

/* "مباشر" badge */
.nav-status {
  display: flex; align-items: center; gap: 4px;
  background: rgba(31,166,125,.10);
  border: 1px solid rgba(31,166,125,.30);
  border-radius: var(--r-xs);          /* 4px badge */
  padding: 2px 7px;
  font-size: 11px; font-weight: 400; color: var(--up);
  white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}
.status-dot {
  width: 5px; height: 5px; background: var(--up);
  border-radius: 50%; animation: pulse 2s infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.nav-right {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; min-width: 0; overflow: hidden;
}
.nav-clock {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); white-space: nowrap;
}
@media (max-width: 380px) { .nav-clock { display: none; } }

#btnLock {
  background: none; border: none;
  color: var(--text-muted); font-size: 15px;
  padding: 4px; cursor: pointer;
  transition: color .15s; flex-shrink: 0;
}
#btnLock:hover { color: var(--text-secondary); opacity: 1; }

.nav-address-wrap {
  display: flex; align-items: center; gap: 2px; min-width: 0;
}
.nav-address {
  font-family: var(--font-mono); font-size: 10px; font-weight: 400;
  color: var(--text-muted);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);          /* 4px */
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 80px;
  user-select: text; -webkit-user-select: text;
}
.nav-address:hover { color: var(--text-primary); border-color: var(--border-strong); }

.nav-copy-btn {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-xs); color: var(--text-muted);
  font-size: 11px; padding: 2px 5px; line-height: 1.4;
  cursor: pointer; transition: color .12s, border-color .12s; flex-shrink: 0;
}
.nav-copy-btn:hover { color: var(--ac); border-color: var(--ac); opacity: 1; }

/* ════════════════════
   TABS
════════════════════ */
.tabs {
  display: flex; gap: 4px; padding: 4px 8px;
  background: var(--bg-app); flex-shrink: 0; overflow: hidden;
}
.tab {
  flex: 1; min-width: 0;
  border-radius: var(--r-md);           /* 8px */
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex; flex-direction: column; align-items: stretch;
  overflow: hidden;
  transition: border-color .15s;
  cursor: pointer;
}
.tab:active { transform: scale(.96); }
.tab.active {
  border-color: var(--ac);
  box-shadow: 0px 0px 0px 1px rgba(80,210,193,.25);
  background: var(--bg-panel);
}

.tab-left {
  width: 100%; height: clamp(28px, 6.5vw, 42px);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel);
  padding: clamp(2px, 0.8vw, 5px);
}
.tab-img {
  width: auto; height: 100%; max-width: 100%;
  object-fit: contain; display: block;
}

.tab-right {
  width: 100%; display: flex; align-items: center; justify-content: center;
  padding: 2px 1px 3px; border-top: 1px solid var(--border);
}
.tab-price {
  font-family: var(--font-mono);
  font-size: clamp(8px, 1.6vw, 11px);
  font-weight: 400; color: var(--text-primary);
  line-height: 1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 1px; width: 100%;
}
.tab-price.up { color: var(--up); }
.tab-price.dn { color: var(--dn); }

/* ════════════════════
   MAIN LAYOUT
════════════════════ */
.main {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  gap: 8px; padding: 8px;              /* §5 gap 8px vertical */
}
.main::-webkit-scrollbar { width: 2px; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.col-left, .col-right { display: flex; flex-direction: column; gap: 8px; }

/* Desktop layout */
@media (min-width: 680px) {
  .main {
    flex-direction: row; align-items: flex-start;
    gap: 12px; overflow: hidden; padding: 12px;
  }
  .col-left  { flex: 1.1; min-width: 0; overflow-y: auto; max-height: 100%; }
  .col-right { flex: 1;   min-width: 0; overflow-y: auto; max-height: 100%; }
}

/* ════════════════════
   PRICE CARD
   §4 Card — bg #0F1A1F, border 1px solid #273035, radius 8px
════════════════════ */
.price-card {
  border-radius: var(--r-md);          /* 8px */
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: border-color .3s;
  flex-shrink: 0;
  display: flex; flex-direction: row; align-items: stretch;
  min-height: clamp(76px, 18vw, 100px);
  box-shadow: var(--shadow-sm);
}
/* لا glow — فقط border يتغير لون */
.price-card.up { border-color: rgba(31,166,125,.45); }
.price-card.dn { border-color: rgba(237,112,136,.45); }

.price-img-wrap {
  width: 42%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel); padding: 8px; flex-shrink: 0;
}
.price-img-wrap img {
  width: 80%; max-width: clamp(56px, 12vw, 88px);
  height: auto; object-fit: contain; display: block;
}

.price-data {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 6px; gap: 3px;
  text-align: center; overflow: hidden;
}
.price-asset {
  /* §3 Body Small: 12px 400 */
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  letter-spacing: .5px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.price-value {
  font-family: var(--font-mono);
  /* §3 Display: 32px — نضغط للموبايل */
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 400; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.price-value.up { color: var(--up); }
.price-value.dn { color: var(--dn); }
.price-value.n  { color: var(--text-primary); }

.price-delta {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  white-space: nowrap;
}
.price-delta.up { color: var(--up); }
.price-delta.dn { color: var(--dn); }
.price-delta.n  { color: var(--text-muted); }

.price-session {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; width: 100%; flex-wrap: nowrap;
  background: var(--bg-panel); border-radius: var(--r-xs);
  padding: 3px 6px; margin-top: 2px; overflow: hidden;
}
.price-session.hidden { display: none !important; }

.ps-chg { font-family: var(--font-mono); font-size: 11px; font-weight: 400; }
.ps-chg.up { color: var(--up); }
.ps-chg.dn { color: var(--dn); }
.ps-chg.n  { color: var(--text-muted); }
.ps-h  { font-family: var(--font-mono); font-size: 9px; font-weight: 400; color: var(--up); white-space: nowrap; }
.ps-l  { font-family: var(--font-mono); font-size: 9px; font-weight: 400; color: var(--dn); white-space: nowrap; }
.ps-divider { color: var(--border-strong); font-size: 9px; }

.price-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 3px; overflow: hidden;
}
.price-bid-ask {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-muted); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.price-timer {
  font-size: 9px; color: var(--text-muted);
  font-family: var(--font-mono); font-weight: 400; white-space: nowrap;
}

/* ════════════════════
   TRADE PANEL
════════════════════ */
.trade-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  letter-spacing: .5px; text-transform: uppercase;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.qty-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.qty-preset {
  flex: 1; min-width: 24px; padding: 5px 2px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-muted); font-size: 11px; font-weight: 400;
  text-align: center; font-family: var(--font-mono);
  transition: border-color .12s, color .12s;
}
.qty-preset:active { transform: scale(.92); }
.qty-preset.active { background: var(--ac-dim); border-color: var(--ac); color: var(--ac); opacity: 1; }

.qty-input-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 6px; align-items: stretch;
}
.qty-input {
  width: 100%; font-family: var(--font-mono);
  font-size: clamp(16px, 4.5vw, 20px); font-weight: 400;
  padding: 8px 10px; text-align: center; direction: ltr;
  border-radius: var(--r-sm); background: var(--bg-input);
  border: 1px solid var(--border-strong);
  min-width: 0;
}
.qty-input:focus {
  border-color: var(--ac);
  box-shadow: 0px 0px 8px rgba(80,210,193,.25);
}

/* §4 Primary Button — Teal */
.qty-100 {
  background: var(--ac); color: var(--ac-text);
  border-radius: var(--r-sm); padding: 0 10px;
  font-size: 11px; font-weight: 400; font-family: var(--font-mono);
  white-space: nowrap; flex-shrink: 0; border: none;
}
.qty-unit {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  text-align: center; min-width: 30px;
  display: flex; align-items: center; justify-content: center;
  white-space: nowrap;
}

.trade-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* §4 Primary Button (Teal / "Buy") */
.btn-trade {
  border-radius: var(--r-md);          /* 8px */
  height: 44px;                        /* §8 Touch Target */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: none;
  font-weight: 400;
}
.btn-trade:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-buy  {
  background: var(--ac);              /* #50D2C1 */
  color: var(--ac-text);             /* #04060C */
}
.btn-buy:hover  { opacity: .9; transform: scale(1.02); }
.btn-buy:active { opacity: .8; transform: scale(.97); }

/* §4 Secondary Button (Dark Gray / "Sell") */
.btn-sell {
  background: var(--bg-input);        /* #273035 */
  color: var(--text-primary);         /* white */
  border: 1px solid var(--border-strong);
}
.btn-sell:hover  { background: var(--border-strong); opacity: .95; transform: scale(1.01); }
.btn-sell:active { background: var(--bg-app); opacity: .9; }

.btn-label { font-size: 14px; font-weight: 400; }
.btn-price {
  font-family: var(--font-mono); font-size: 10px;
  font-weight: 400; opacity: .75;
}
.btn-buy  .btn-price { color: var(--ac-text); }
.btn-sell .btn-price { color: var(--text-secondary); }

/* ════════════════════
   POSITIONS
════════════════════ */
.positions-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.positions-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  flex-wrap: nowrap; min-height: 38px; overflow: hidden;
}
.positions-title {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  letter-spacing: .5px; text-transform: uppercase; white-space: nowrap;
}
.positions-count {
  background: var(--ac); color: var(--ac-text);
  border-radius: var(--r-xs);
  padding: 2px 7px; font-size: 11px; font-weight: 400; flex-shrink: 0;
}
.positions-pnl {
  font-family: var(--font-mono); font-size: 14px; font-weight: 400;
  margin-right: auto; white-space: nowrap;
}
.positions-pnl.pos { color: var(--up); }
.positions-pnl.neg { color: var(--dn); }

/* §4 Ghost Button — "إغلاق الكل" */
.btn-close-all {
  background: transparent;
  border: 1px solid var(--dn); color: var(--dn);
  border-radius: var(--r-xs);
  padding: 3px 8px;
  font-size: 11px; font-weight: 400; white-space: nowrap; flex-shrink: 0;
  transition: background .12s;
}
.btn-close-all:hover { background: var(--dn-dim); opacity: 1; }
.btn-close-all.hidden { display: none; }

.positions-empty {
  padding: 24px; text-align: center;
  color: var(--text-muted); font-size: 13px; font-weight: 400;
}

/* كارت الصفقة */
.position-item {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.pos-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.pos-name { font-size: 14px; font-weight: 400; color: var(--text-primary); }
.pos-dir  { font-size: 11px; font-weight: 400; margin-top: 2px; }
.pos-dir.long  { color: var(--up); }
.pos-dir.short { color: var(--dn); }
.pos-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.pos-pnl {
  font-family: var(--font-mono);
  /* §3 H2: 20px */
  font-size: 18px; font-weight: 400; line-height: 1;
}
.pos-pnl.pos { color: var(--up); }
.pos-pnl.neg { color: var(--dn); }
.pos-size { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); font-weight: 400; }

.pos-data-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 4px; background: var(--bg-panel); border-radius: var(--r-xs); padding: 6px;
}
.pos-data-item { display: flex; flex-direction: column; gap: 2px; }
.pos-data-label {
  font-size: 9px; font-weight: 400; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.pos-data-value {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 400; color: var(--text-primary);
}
.pos-funding-val { font-family: var(--font-mono); font-size: 12px; font-weight: 400; }
.pos-funding-val.pos { color: var(--up); }
.pos-funding-val.neg { color: var(--dn); }

.pos-tpsl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tpsl-btn {
  border-radius: var(--r-xs);
  padding: 6px 4px;
  font-size: 11px; font-weight: 400; text-align: center;
  cursor: pointer; border: 1px solid;
  transition: background .1s, opacity .1s;
  line-height: 1.3;
}
.tpsl-btn span.sub { font-size: 9px; display: block; margin-bottom: 2px; font-weight: 400; }
.tpsl-btn span.val { font-family: var(--font-mono); font-size: 11px; font-weight: 400; display: block; }
.tpsl-btn.tp-set   { background: var(--tp-dim); border-color: var(--tp); color: var(--tp); }
.tpsl-btn.tp-unset { background: var(--bg-input); border-color: var(--border); color: var(--text-muted); }
.tpsl-btn.sl-set   { background: var(--sl-dim); border-color: var(--sl); color: var(--sl); }
.tpsl-btn.sl-unset { background: var(--bg-input); border-color: var(--border); color: var(--text-muted); }
.tpsl-btn:hover { opacity: .85; }

.pos-actions-row { display: grid; grid-template-columns: 1fr; }
.btn-pos-close {
  border: 1px solid var(--dn); background: transparent; color: var(--dn);
  border-radius: var(--r-xs); padding: 8px 0;
  font-size: 12px; font-weight: 400; text-align: center;
  transition: background .1s;
}
.btn-pos-close:hover { background: var(--dn-dim); opacity: 1; }

/* ════════════════════
   FOOTER
════════════════════ */
.footer {
  display: flex; gap: 4px;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  background: var(--bg-elev); border-top: 1px solid var(--border);
  flex-shrink: 0; overflow: hidden;
}
.footer-btn {
  flex: 1; min-width: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-muted);
  padding: 5px 2px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 8px; font-weight: 400;
  letter-spacing: .3px; text-transform: uppercase;
  transition: border-color .12s, background .12s;
  overflow: hidden;
}
.footer-btn:active { transform: scale(.94); border-color: var(--ac); background: var(--ac-dim); }
.footer-btn:hover  { border-color: var(--border-strong); opacity: 1; }
.footer-img {
  width: clamp(16px, 4vw, 22px); height: clamp(16px, 4vw, 22px);
  object-fit: contain; display: block; flex-shrink: 0;
}
.footer-lbl {
  font-size: clamp(7px, 1.5vw, 9px); font-weight: 400;
  color: var(--text-muted); line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%; text-align: center;
}
.footer-logout { flex: 0.6; }

/* ════════════════════
   MODALS
   §6 High (3): 0px 8px 24px rgba(0,0,0,.6)
════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .75);
  z-index: 100; display: none;
  align-items: center; justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; animation: fadeIn .15s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
  background: var(--bg-elev);
  border-radius: 0;
  width: 100%; height: 100dvh;
  max-width: 100%; max-height: 100dvh;
  padding: 20px 16px 24px;
  border: none;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
@keyframes popIn { from{opacity:0;transform:scale(.97)} to{opacity:1;transform:scale(1)} }

.modal-handle { display: none; }

.modal-title {
  /* §3 H1: 24px 400 */
  font-size: 20px; font-weight: 400; margin-bottom: 6px;
  text-align: center; color: var(--text-primary);
  flex-shrink: 0;
}
.modal-subtitle {
  font-size: 13px; color: var(--text-secondary); margin-bottom: 14px;
  line-height: 1.5; text-align: center; font-weight: 400;
  flex-shrink: 0;
}

.confirm-details {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px; margin-bottom: 12px; flex: 1;
  display: flex; flex-direction: column; gap: 0;
}
.confirm-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.confirm-row:last-child { border: none; }
.confirm-key  { font-size: 14px; color: var(--text-secondary); font-weight: 400; }
.confirm-val  { font-family: var(--font-mono); font-size: 14px; font-weight: 400; color: var(--text-primary); }
.confirm-val.buy   { color: var(--up); }
.confirm-val.sell  { color: var(--dn); }
.confirm-val.warn  { color: var(--warn); }
.confirm-val.tp    { color: var(--tp); }
.confirm-val.sl    { color: var(--sl); }
.confirm-val.muted { color: var(--text-muted); }
.confirm-val.fee   { color: var(--warn); font-size: 13px; }

.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; flex-shrink: 0; }
.form-group label {
  font-size: 12px; font-weight: 400; color: var(--text-secondary);
  letter-spacing: .5px; text-transform: uppercase;
}
.form-input {
  width: 100%; font-family: var(--font-mono);
  font-size: 20px; font-weight: 400;
  padding: 12px 14px; direction: ltr;
  border-radius: var(--r-sm);
}
.form-note {
  font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--ac-dim);
  border: 1px solid rgba(80,210,193,.20);
  margin-bottom: 10px; font-weight: 400; flex-shrink: 0;
}

.calc-preview {
  font-family: var(--font-mono); font-size: 14px; font-weight: 400;
  color: var(--ac); padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--ac-dim);
  border: 1px solid rgba(80,210,193,.20);
  min-height: 44px; display: flex; align-items: center;
}

.delete-row { margin-top: 10px; flex-shrink: 0; }
.delete-row.hidden { display: none; }
.btn-delete-tpsl {
  border: 1px solid var(--dn); color: var(--dn); background: transparent;
  border-radius: var(--r-md); padding: 12px 16px;
  font-size: 14px; font-weight: 400; width: 100%; text-align: center;
  transition: background .1s;
}
.btn-delete-tpsl:hover { background: var(--dn-dim); opacity: 1; }

.modal-buttons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: auto; padding-top: 14px; flex-shrink: 0;
}
.modal-buttons-center { grid-template-columns: 1fr; }

/* §4 Button styles in modals */
.btn-modal {
  height: 44px; padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 400;
  transition: opacity .15s, transform .12s;
}

/* §4 Ghost Button / Tertiary — Cancel */
.btn-cancel {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
}
.btn-cancel:hover { border-color: var(--text-secondary); opacity: .9; }

.btn-confirm {
  border: none; color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-confirm:active { opacity: .8; transform: scale(.97); }
.btn-confirm:disabled { opacity: .5; pointer-events: none; }

/* §4 Primary → Teal for success */
.btn-success { background: var(--ac); color: var(--ac-text); }
.btn-success:hover { opacity: .9; transform: scale(1.02); }

/* §4 Secondary → coral for danger */
.btn-danger  { background: var(--dn); color: #fff; }
.btn-danger:hover { opacity: .9; transform: scale(1.01); }

/* modal full-screen */
.overlay-fs { align-items: stretch !important; justify-content: stretch !important; padding: 0 !important; }
.modal-fs   { width: 100% !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; border: none !important; }

/* ════════════════════
   ABOUT MODAL
════════════════════ */
.about-body { display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; }
.about-block {
  background: var(--ac-dim);
  border: 1px solid rgba(80,210,193,.18);
  border-radius: var(--r-md); padding: 12px 14px;
  font-size: 13px; line-height: 1.7; color: var(--text-secondary);
}
.about-section { display: flex; flex-direction: column; gap: 6px; }
.about-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-panel); border-radius: var(--r-xs); padding: 10px 12px;
}
.about-icon { font-size: 18px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.about-item div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.about-item strong { font-size: 13px; font-weight: 400; color: var(--text-primary); }
.about-item p { font-size: 12px; font-weight: 400; color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* ════════════════════
   HISTORY
════════════════════ */
.history-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.history-item {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px; display: flex; flex-direction: column; gap: 6px;
}
.history-item:last-child { border-bottom: none; }
.hist-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.hist-asset { font-weight: 400; font-size: 15px; display: flex; align-items: center; gap: 5px; color: var(--text-primary); }
.hist-type {
  font-size: 11px; font-weight: 400; padding: 2px 8px;
  border-radius: var(--r-xs);
}
.hist-type.buy  { background: rgba(31,166,125,.12); color: var(--up); }
.hist-type.sell { background: rgba(237,112,136,.12); color: var(--dn); }
.hist-pnl { font-family: var(--font-mono); font-size: 16px; font-weight: 400; }
.hist-pnl.pos  { color: var(--up); }
.hist-pnl.neg  { color: var(--dn); }
.hist-pnl.zero { color: var(--text-muted); }
.hist-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; background: var(--bg-panel);
  border-radius: var(--r-md); padding: 8px 10px;
}
.hist-cell { display: flex; flex-direction: column; gap: 2px; }
.hist-lbl { font-size: 9px; color: var(--text-muted); font-weight: 400; text-transform: uppercase; letter-spacing: .5px; }
.hist-val { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--text-primary); }

/* ════════════════════
   BALANCE
════════════════════ */
.balance-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.balance-item {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; overflow: hidden;
}
.balance-label { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.balance-value { font-family: var(--font-mono); font-size: 18px; font-weight: 400; white-space: nowrap; }
.balance-value.green { color: var(--up); }
.balance-value.red   { color: var(--dn); }
.balance-value.blue  { color: var(--ac); }
.balance-value.warn  { color: var(--warn); }
.balance-auto-note   { text-align: center; font-size: 11px; color: var(--text-muted); padding-bottom: 4px; font-weight: 400; }
.balance-loading     { text-align: center; padding: 20px; color: var(--text-muted); font-size: 14px; font-weight: 400; }

/* ════════════════════
   LOGOUT
════════════════════ */
.logout-content { text-align: center; padding: 10px 0 8px; }
.logout-icon    { font-size: 40px; margin-bottom: 10px; }
.logout-text    { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; font-weight: 400; }

/* ════════════════════
   WITHDRAW
════════════════════ */
.withdraw-fee-warn {
  background: var(--dn-dim);
  border: 1px solid var(--dn);
  border-radius: var(--r-md); color: var(--dn);
  font-size: 14px; font-weight: 400;
  padding: 12px 14px; margin-bottom: 14px;
  line-height: 1.7; text-align: center; flex-shrink: 0;
}
.withdraw-fee-warn strong { font-weight: 400; font-size: 15px; }
.withdraw-preview {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px; margin-bottom: 12px;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.withdraw-preview.hidden { display: none; }
.wp-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 400;
}
.wp-row:last-of-type { border: none; }
.wp-val { font-family: var(--font-mono); font-size: 14px; font-weight: 400; }
.wp-val.red   { color: var(--dn); }
.wp-val.green { color: var(--up); }

/* ════════════════════
   TP/SL Breakdown
════════════════════ */
.tpsl-breakdown { display: flex; flex-direction: column; gap: 0; font-size: 13px; font-weight: 400; }
.tb-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.tb-row:last-child { border: none; }
.tb-net span:first-child { color: var(--text-primary); font-weight: 400; }
.tb-mono { font-family: var(--font-mono); font-size: 14px; font-weight: 400; }
.tb-mono.pos  { color: var(--up); }
.tb-mono.neg  { color: var(--dn); }
.tb-mono.warn { color: var(--warn); }

/* ════════════════════
   TOAST
   §6 High (3) — فوق كل شيء
════════════════════ */
#toast {
  position: fixed; bottom: 74px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 8px 18px;
  font-size: 12px; font-weight: 400; z-index: 250;
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  pointer-events: none; white-space: nowrap; max-width: 92vw;
  text-align: center; box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok   { border-color: var(--up); color: var(--up); background: rgba(31,166,125,.08); }
#toast.err  { border-color: var(--dn); color: var(--dn); background: rgba(237,112,136,.08); }
#toast.info { border-color: var(--ac); color: var(--ac); }

/* ════════════════════
   LOADER
════════════════════ */
#loader {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 26, 31, .88);
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
#loader.active { display: flex; animation: fadeIn .12s; }
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--ac);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }
.loader-text { font-size: 13px; color: var(--text-secondary); font-weight: 400; }

/* ════════════════════
   إشعارات TP/SL — بانر علوي بارز
════════════════════ */
#notifBanner {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  padding-top: calc(14px + var(--statusbar-h));
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  transform: translateY(-110%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
}
#notifBanner.show {
  transform: translateY(0);
  pointer-events: auto;
}
#notifBanner.notif-tp {
  background: linear-gradient(135deg, #1FA67D, #156f53);
  color: #fff;
}
#notifBanner.notif-sl {
  background: linear-gradient(135deg, #ED7088, #b5334a);
  color: #fff;
}
#notifBanner.notif-close {
  background: linear-gradient(135deg, var(--ac), #1a7f6a);
  color: #fff;
}
.notif-icon { font-size: 22px; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 15px; font-weight: 800; }
.notif-desc  { font-size: 12px; font-weight: 400; opacity: .9; }
.notif-dismiss {
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  border-radius: 50%; width: 28px; height: 28px;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* دعم Light Mode للإشعارات */
@media (prefers-color-scheme: light) {
  #notifBanner.notif-tp  { background: linear-gradient(135deg, #1FA67D, #27b88a); color: #fff; }
  #notifBanner.notif-sl  { background: linear-gradient(135deg, #ED7088, #f08090); color: #fff; }
  #notifBanner.notif-close { background: linear-gradient(135deg, #1FA67D, #27b88a); color: #fff; }
}

/* ════════════════════
   شريط حالة أندرويد — خلفية تمتد خلف شريط النظام
════════════════════ */
#loginScreen::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--statusbar-h);
  background: var(--bg-app);
  z-index: 0;
}
#appScreen::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--statusbar-h);
  background: var(--bg-elev);
  z-index: 2;
}

/* ════════════════════
   PIN / LOCK SCREEN
════════════════════ */
.lock-screen {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px; color: var(--text-primary);
}
.lock-header { text-align: center; margin-bottom: 36px; }
.lock-icon   { font-size: 40px; margin-bottom: 8px; }
.lock-title  { font-size: 20px; font-weight: 400; margin-bottom: 4px; }
.lock-subtitle { font-size: 13px; color: var(--text-muted); }

.pin-dots { display: flex; gap: 18px; margin-bottom: 44px; }
.dot {
  width: 14px; height: 14px;
  border: 1px solid var(--border-strong); border-radius: 50%; transition: all .15s;
}
.dot.filled {
  background: var(--ac); border-color: var(--ac);
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(80,210,193,.4);
}

.pin-dots.shake { animation: shake .4s; }
@keyframes shake {
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-8px)}
  50%{transform:translateX(8px)}
  75%{transform:translateX(-8px)}
}

.numpad {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 16px; width: 100%; max-width: 260px; margin-bottom: 36px;
}
.num-btn {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 20px; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  transition: background .12s;
}
.num-btn:active { background: var(--border-strong); opacity: 1; }
.num-empty { background: transparent !important; border: none !important; pointer-events: none; }
.num-del   { background: transparent !important; border: none !important; font-size: 18px; }

.lock-footer {
  display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%;
}
.lock-logout-btn  { color: var(--dn); font-size: 12px; text-decoration: underline; font-weight: 400; }
.lock-cancel-btn  { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.lock-cancel-btn.hidden { display: none; }

/* ════════════════════
   CHART SCREEN
════════════════════ */
.chart-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; background: var(--bg-app);
}
.chart-screen.hidden { display: none !important; }

/* ════════════════════
   GPU
════════════════════ */
.tab, .price-card, .position-item, .btn-trade,
.modal-overlay, .positions-card, .footer-btn {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}
canvas { image-rendering: crisp-edges; image-rendering: pixelated; }
.price-value, .pos-pnl, .tab-price { contain: layout style paint; }

/* ════════════════════
   HIDDEN UTILITY
════════════════════ */
.hidden { display: none !important; }

/* ════════════════════
   DESKTOP
   §5 Header: 56px · §8 Breakpoints
════════════════════ */
@media (min-width: 640px) {
  .nav { height: 56px; padding: 0 16px; }
  .footer { padding: 7px 8px 9px; gap: 6px; }
  .footer-btn { padding: 7px 4px 8px; }
  .modal {
    max-width: 480px; max-height: 88dvh;
    border-radius: var(--r-xl);        /* 12px modals only */
    border: 1px solid var(--border);
    margin: auto; height: auto;
    box-shadow: var(--shadow-lg);
  }
  .modal-overlay { padding: 20px; background: rgba(0,0,0,.7); }
  .overlay-fs .modal { max-width: 100%; max-height: 100dvh; border-radius: 0; margin: 0; height: 100dvh; border: none; }
  .nav-address { max-width: 120px; }
  .price-value { font-size: 28px; }
  .btn-trade   { height: 48px; }
}

@media (min-width: 900px) {
  .nav { padding: 0 20px; }
  .nav-logo-text { font-size: 18px; }
  .tabs { padding: 5px 10px; gap: 5px; }
  .tab-price { font-size: clamp(10px, 1.4vw, 12px); }
  .main { padding: 12px 16px 8px; }
}

/* ════════════════════
   شريط التاريخ والوقت
════════════════════ */
.datetime-bar {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  cursor: pointer; flex-shrink: 0;
  transition: background .12s; user-select: none;
}
.datetime-bar:hover  { background: var(--bg-elev); }
.datetime-bar:active { opacity: .8; }

.dt-clock {
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 400;
  color: var(--text-secondary); direction: rtl; white-space: nowrap;
}
.dt-hint { font-size: 12px; opacity: .45; flex-shrink: 0; }

/* ════════════════════
   جدول الأشهر
════════════════════ */
.months-panel {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 8px; flex-shrink: 0; overflow: hidden;
  animation: slideDown .15s ease;
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}
.months-panel.hidden { display: none; }

.months-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 4px;
}
@media (min-width: 480px) {
  .months-grid { grid-template-columns: repeat(6,1fr); }
}

.month-item {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 5px 4px; text-align: center;
}
.m-num  { font-family: var(--font-mono); font-size: 14px; font-weight: 400; color: var(--ac); line-height: 1; }
.m-name { font-size: 11px; font-weight: 400; color: var(--text-primary); }
.m-en   { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); font-weight: 400; }

/* ════════════════════
   NAV Logo Button
════════════════════ */
.nav-logo-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  padding: 4px 6px; border-radius: var(--r-xs);
  transition: background .12s; flex-shrink: 0;
}
.nav-logo-btn:hover  { background: var(--ac-dim); opacity: 1; }
.nav-logo-btn:active { opacity: .7; }
