/* v2 improved responsive + wider desktop + mobile menu */
:root{
  --bg:#0b1220;
  --text:#eaf1ff;
  --muted:#a9b7d0;
  --line:rgba(255,255,255,.09);
  --brand:#3b82f6;
  --good:#22c55e;
  --bad:#ef4444;
  --shadow: 0 18px 40px rgba(0,0,0,.28);
  --shadow-soft: 0 10px 22px rgba(0,0,0,.18);
  --radius:18px;
}
.light{
  --bg:#f6f8fc;
  --text:#0b1220;
  --muted:#52607a;
  --line:rgba(11,18,32,.11);
  --shadow: 0 18px 40px rgba(10,20,40,.10);
  --shadow-soft: 0 10px 22px rgba(10,20,40,.08);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1200px 700px at 80% -20%, rgba(59,130,246,.35), transparent 55%),
    radial-gradient(1000px 600px at 10% 0%, rgba(34,197,94,.20), transparent 60%),
    var(--bg);
  color:var(--text);
}
a{color:inherit; text-decoration:none}
.container{max-width:1320px; margin:0 auto; padding:22px}
@media (min-width:1400px){.container{max-width:1420px}}
@media (max-width:980px){.container{padding:14px}}

.header{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,0));
}
.light .header{background: linear-gradient(180deg, rgba(246,248,252,.75), rgba(246,248,252,0))}

.topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0 10px}

.brand{display:flex; align-items:center; gap:10px; font-weight:800}
.logo{
  width:44px; height:44px; border-radius:16px;
  background: linear-gradient(135deg, var(--brand), rgba(59,130,246,.35));
  box-shadow: var(--shadow-soft);
  position:relative;
}
.logo:after{content:""; position:absolute; inset:11px; border-radius:11px; border:2px solid rgba(255,255,255,.35)}
.brand .name{font-size:18px; line-height:1; font-weight:1000}
.small{font-size:13px; color:var(--muted); font-weight:700}

.nav{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.nav a{
  padding:9px 12px; border-radius:999px; border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-weight:900;
  transition:.2s;
}
.nav a:hover{transform: translateY(-1px); color:var(--text); border-color: rgba(59,130,246,.35)}
.nav a.active{color:var(--text); border-color: rgba(59,130,246,.45); background: rgba(59,130,246,.10)}

.actions{display:flex; align-items:center; gap:10px}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:10px 14px;
  border-radius:14px;
  font-weight:1000;
  cursor:pointer;
  transition:.2s;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(59,130,246,.4)}
.btn.primary{
  background: linear-gradient(135deg, var(--brand), rgba(59,130,246,.65));
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 14px 30px rgba(59,130,246,.22);
}
.btn.ghost{padding:10px 12px}
.menu-btn{display:none}

.hero{
  margin-top:14px;
  border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}
.hero:before{
  content:""; position:absolute; inset:-2px;
  background: radial-gradient(600px 260px at 18% 10%, rgba(59,130,246,.18), transparent 60%),
              radial-gradient(560px 220px at 78% 0%, rgba(34,197,94,.14), transparent 60%);
  pointer-events:none;
}
/* ================== HERO (Top Section) ================== */

.hero.simple{
  padding:48px 0;
}

.hero-inner{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:28px;
  align-items:flex-start;
}

/* النص */
.hero h1{
  font-size:32px;
  line-height:1.3;
  margin:0 0 8px;
}

.hero .muted{
  color:var(--muted);
  font-size:15px;
  max-width:520px;
}

/* الأزرار */
.hero-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}

/* Pills */
.pill-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  background:rgba(37,99,235,.08);
  color:var(--text);
  border:1px solid var(--line);
}

/* محول العملات */
.hero-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
}

.card-title{
  font-weight:700;
  font-size:15px;
  margin-bottom:10px;
}

/* ================== Mini Rates Embed ================== */
#miniRates{
  margin-top:10px;
}

/* ================== Responsive ================== */
@media (max-width:992px){
  .hero-inner{
    grid-template-columns:1fr;
  }

  .hero h1{
    font-size:26px;
  }

  .hero-card{
    margin-top:10px;
  }
}

@media (max-width:576px){
  .hero.simple{
    padding:32px 0;
  }

  .hero h1{
    font-size:22px;
  }

  .pill{
    font-size:11px;
  }
}

.hero-inner{
  position:relative;
  padding:24px;
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:18px;
  align-items:stretch;
}
.hero h1{margin:0; font-size:36px; line-height:1.15; letter-spacing:.2px}
.hero p{margin:10px 0 0; color: var(--muted); font-weight:650; font-size:15px}
.hero-meta{display:flex; gap:10px; flex-wrap:wrap; margin-top:14px}

.pill{
  padding:8px 12px; border-radius:999px; border:1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--muted); font-weight:1000;
  display:flex; gap:8px; align-items:center;
}
.dot{width:8px; height:8px; border-radius:999px; background: var(--good); box-shadow: 0 0 0 4px rgba(34,197,94,.18)}

.hero-card{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow-soft);
  padding:16px;
  display:flex; flex-direction:column; justify-content:space-between; gap:12px;
}
.hero-card .title{display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:1000}
.badge{padding:8px 10px; border-radius:999px; border:1px solid var(--line); background: rgba(255,255,255,.03); font-weight:1000}

.search{
  display:flex; gap:10px; align-items:center;
  border:1px solid var(--line); background: rgba(255,255,255,.03);
  padding:10px 12px; border-radius:16px;
}
.search input{
  width:100%; border:none; outline:none; background:transparent;
  color:var(--text); font-family:inherit; font-weight:1000; font-size:14px;
}
.search input::placeholder{color: rgba(169,183,208,.75)}

.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  padding:8px 10px; border-radius:999px;
  background: rgba(59,130,246,.12); border:1px solid rgba(59,130,246,.25);
  color: var(--text); font-weight:1100; cursor:pointer; user-select:none;
}
.chip.secondary{background: rgba(255,255,255,.03); border-color: var(--line); color: var(--muted); font-weight:1000}

.ticker{
  margin-top:14px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  overflow:hidden;
  box-shadow: var(--shadow-soft);
}
.ticker-row{display:flex; gap:14px; padding:10px 12px; white-space:nowrap; overflow:auto hidden; scrollbar-width:thin}
.quote{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:16px; border:1px solid var(--line);
  background: rgba(0,0,0,.08); min-width: 220px;
}
.sym{font-weight:1100; letter-spacing:.3px}
.price{font-weight:1100; margin-inline-start:auto}
.chg{font-weight:1100}
.up{color: var(--good)}
.down{color: var(--bad)}

.grid{margin-top:14px; display:grid; grid-template-columns: 1.35fr .65fr; gap:14px; align-items:start}
.panel{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-hd{padding:14px 14px 10px; display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--line)}
.panel-hd h2{margin:0; font-size:18px; font-weight:1100}
.panel-hd .right{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.select{border:1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); border-radius:12px; padding:8px 10px; font-weight:1100; font-family:inherit; outline:none}

table{width:100%; border-collapse:separate; border-spacing:0}
thead th{
  text-align:right; font-size:13px; color: var(--muted);
  padding:12px 14px; border-bottom:1px solid var(--line);
  font-weight:1100; background: rgba(255,255,255,.02);
}
[dir="ltr"] thead th{text-align:left}
tbody td{padding:12px 14px; border-bottom:1px solid var(--line); font-weight:1000}
tbody tr:hover{background: rgba(59,130,246,.06)}

.tag{
  display:inline-flex; align-items:center; gap:8px; padding:6px 10px;
  border-radius:999px; border:1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--muted);
  font-weight:1100; font-size:12px;
}
.tag .dot{width:7px; height:7px; box-shadow:none}

.side{display:grid; gap:14px}
.card{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding:14px;
}
.card h3{margin:0 0 6px; font-size:16px; font-weight:1100}
.stat{display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px dashed var(--line); gap:10px}
.stat:last-child{border-bottom:none}
.stat .k{color:var(--muted); font-weight:1100}
.stat .v{font-weight:1100}

.news{display:grid; gap:10px; margin-top:10px}
.news a{
  display:block; border:1px solid var(--line); background: rgba(0,0,0,.06);
  border-radius:16px; padding:12px; transition:.2s;
}
.news a:hover{transform: translateY(-1px); border-color: rgba(59,130,246,.35)}
.news .t{font-weight:1100}
.news .d{color:var(--muted); font-weight:900; font-size:13px; margin-top:2px}

.footer{margin-top:18px; padding:18px 0 26px; color: var(--muted); font-weight:1000; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; border-top:1px solid var(--line)}
.muted{color:var(--muted)}
.stack{display:grid; gap:14px; margin-top:14px}

.form{display:grid; gap:10px}
.field{display:grid; gap:6px}
.field label{font-weight:1100}
.field input,.field textarea{
  border:1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text);
  border-radius:16px; padding:12px 12px; font-family:inherit; font-weight:1000; outline:none;
}
.field textarea{min-height:120px; resize:vertical}

.kpis{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
.kpi{border:1px solid var(--line); background: rgba(255,255,255,.03); border-radius: var(--radius); padding:14px}
.kpi .n{font-size:22px; font-weight:1200}
.kpi .l{color:var(--muted); font-weight:1000}

.breadcrumb{margin-top:14px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; color:var(--muted); font-weight:1000}
.breadcrumb a{color:var(--muted)}
.breadcrumb a:hover{color:var(--text)}

/* Mobile menu */
@media (max-width: 980px){
  .hero-inner{grid-template-columns: 1fr; padding:18px}
  .grid{grid-template-columns: 1fr}
  .kpis{grid-template-columns:1fr}
  .menu-btn{display:inline-flex}
  .nav{display:none}
  .nav.mobile-open{
    display:flex;
    position:fixed;
    inset:70px 14px auto 14px;
    background: rgba(15,27,51,.95);
    border:1px solid var(--line);
    border-radius:18px;
    padding:12px;
    gap:10px;
    flex-direction:column;
    box-shadow: var(--shadow);
    z-index:60;
  }
  .light .nav.mobile-open{background: rgba(255,255,255,.95)}
}

/* ================== Investing Embeds (Global) ================== */
.investing-widget { padding: 14px; }
.investing-widget .panel-hd { margin-bottom: 12px; }

.card-title{
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  opacity: .9;
}

/* Heights per type */
.embed--mini{ height: 74px; }
.embed--card{ height: 460px; }
.embed--chart{ height: 420px; }
.embed--fx{ height: 240px; }
.embed--table{ height: auto; }

.embed-foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
}
.embed-foot a{
  color: var(--primary);
  text-decoration:none;
  font-weight:700;
}
.embed-foot a:hover{ text-decoration:underline; }

@media (max-width: 992px){
  .embed--table{ height: 860px; }
  .embed--card{ height: 520px; }
}
@media (max-width: 576px){
  .embed{ border-radius: 14px; }
  .embed--mini{ height: 92px; }
  .embed--chart{ height: 520px; }
  .embed--table{ height: 980px; }
}
.footer{
  margin-top:28px;
  border-top:1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.footer-inner{
  padding:18px 0;
  display:flex;
  justify-content:space-between;
  gap:18px;
}
.foot-brand{display:flex; gap:10px; align-items:flex-start}
.foot-links{display:flex; gap:22px}
.foot-links .col{display:flex; flex-direction:column; gap:8px; min-width:170px}
.foot-links .title{font-weight:900}
.foot-links a{color:var(--muted); text-decoration:none}
.foot-links a:hover{color:var(--text)}
.foot-bottom{
  padding:14px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
@media (max-width:980px){
  .footer-inner{flex-direction:column}
  .foot-links{flex-wrap:wrap}
}
/* ================== ROOT & RESET ================== */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#2563eb;
  --up:#16a34a;
  --down:#dc2626;
}

body.dark{
  --bg:#0b1220;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:#1f2937;
  --primary:#60a5fa;
  --up:#22c55e;
  --down:#ef4444;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"Cairo",system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}

/* offset for sticky header when using anchors */
:target{scroll-margin-top:96px}

/* ================== LAYOUT ================== */
.container{max-width:1200px;margin:auto;padding:0 16px}
.section{padding:28px 0}
.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
}
.panel-hd{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
}
.panel-hd h2{margin:0;font-size:18px}
.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
.dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--primary);
}

/* ================== HEADER / NAV ================== */
.header{
  position:sticky;top:0;z-index:50;
  background:var(--card);
  border-bottom:1px solid var(--line);
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:64px;
}
.nav{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}
.nav a{
  font-size:14px;
  color:var(--muted);
}
.nav a:hover{color:var(--text)}

.actions{display:flex;gap:8px}
.btn{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}

/* ================== HERO ================== */
.hero.simple{padding:32px 0}
.hero h1{margin:0 0 8px;font-size:28px}
.hero p{margin:0;color:var(--muted)}
.hero-card{
  margin-top:18px;
  padding:16px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  width:260px;

  margin-inline-start: 200px;
  margin-inline-end: auto;
}


/* ================== EMBEDS (Investing Widgets) ================== */
.embed{
  width:100%;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}
.embed iframe{
  width:100%!important;
  height:100%;
  border:0;
  display:block;
}

/* ---- Widget Types (Desktop) ---- */
.embed--mini{min-height:auto;}
.embed--card{min-height: auto;}
.embed--chart{min-height:auto;}
.embed--table{min-height:auto;}
.embed--fxrates{min-height:auto;}

/* ---- Tablet ---- */
@media (max-width:992px){
  :target{scroll-margin-top:auto;}
  .embed--mini{min-height:auto;}
  .embed--card{min-height:auto;}
  .embed--chart{min-height:auto;}
  .embed--table{min-height:auto;}
  .embed--fxrates{min-height:auto;}
}

/* ---- Mobile ---- */
@media (max-width:auto;){
  .embed{border-radius:auto;}
  .embed--mini{min-height:auto;}
  .embed--card{min-height:auto;}
  .embed--chart{min-height:auto;}
  .embed--table{min-height:auto;}
  .embed--fxrates{min-height:auto;}

  .nav{display:none} /* لو عندك menu زر */
}

/* ================== FOOTER ================== */
footer{
  margin-top:40px;
  padding:24px 0;
  border-top:1px solid var(--line);
  background:var(--card);
}
.foot-links{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
}
.foot-links .title{
  font-weight:700;
  margin-bottom:6px;
}
.foot-links a{
  display:block;
  font-size:14px;
  color:var(--muted);
  margin:4px 0;
}
.foot-links a:hover{color:var(--text)}
.footer-note{
  margin-top:16px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

/* ================== RTL / LTR tweaks ================== */
html[dir="ltr"] body{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
/* ================== FOOTER (Enhanced) ================== */
.footer{
  margin-top:48px;
  background: linear-gradient(180deg, rgba(37,99,235,.06), transparent);
  border-top:1px solid var(--line);
  padding:28px 0 0;
}

.footer-inner{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:24px;
  align-items:start;
  padding-bottom:18px;
}

/* Brand block */
.foot-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo.small{
  width:42px;
  height:42px;
  border-radius:14px;
  background:
    radial-gradient(circle at 30% 30%, rgba(37,99,235,.45), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(96,165,250,.30), transparent 55%),
    linear-gradient(135deg, rgba(37,99,235,.25), rgba(37,99,235,.08));
  border:1px solid var(--line);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* Typography helpers */
.footer .small{font-size:13px;line-height:1.7}
.footer .muted{color:var(--muted)}

/* Links columns */
.foot-links{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:18px;
}

.foot-links .col{
  background: rgba(255,255,255,.55);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px 14px 10px;
}

body.dark .foot-links .col{
  background: rgba(15,23,42,.55);
}

.foot-links .title{
  font-weight:800;
  font-size:14px;
  margin-bottom:10px;
  display:flex;
  align-items:center;
  gap:8px;
}

.foot-links .title::before{
  content:"";
  width:10px;height:10px;border-radius:50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Footer links */
.foot-links a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border-radius:12px;
  color:var(--muted);
  font-size:14px;
  transition: .15s ease;
}

.foot-links a::after{
  content:"↗";
  font-size:12px;
  opacity:.5;
}

.foot-links a:hover{
  color:var(--text);
  background: rgba(37,99,235,.08);
  transform: translateY(-1px);
}

/* bottom bar */
.foot-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0 18px;
  border-top:1px dashed var(--line);
}

/* badge */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--line);
  background: rgba(37,99,235,.10);
  color: var(--text);
}

.badge::before{
  content:"";
  width:8px;height:8px;border-radius:50%;
  background: var(--primary);
}

/* Responsive */
@media (max-width: 992px){
  .footer-inner{
    grid-template-columns: 1fr;
  }
  .foot-links{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px){
  .footer{padding-top:22px}
  .foot-bottom{
    flex-direction:column;
    align-items:flex-start;
  }
}


TABLE.main {
    width: -webkit-fill-available;
}

.investing-widget iframe {
    width: 100%;
    height: 400px;
    border: none;
}


/* ================== FX THEME BUTTON (IMAGES) ================== */
.fx-theme-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  font: inherit;
  font-weight: 900;
  line-height:1;
  transition: .2s ease;
}
.fx-theme-pill:hover{transform: translateY(-1px); border-color: rgba(59,130,246,.35)}

.fx-theme-img{
  width:18px;
  height:18px;
  display:block;
}

/* show the correct icon */
body.light .fx-img-moon{display:block}
body.light .fx-img-sun{display:none}
body.dark  .fx-img-moon{display:none}
body.dark  .fx-img-sun{display:block}

.fx-theme-text{
  font-size:13px;
  font-weight:900;
  color: var(--muted);
}

/* ================== HEADER MOBILE FIXES ================== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.actions{
  display:flex;
  align-items:center;
  gap:8px;
}

@media (max-width: 820px){
  .nav{display:none}
  .topbar{gap:8px}
  .actions{margin-inline-start:auto}
  .fx-theme-text{display:none}
}

@media (max-width: 420px){
  .logo{width:38px;height:38px;border-radius:14px}
  .btn{padding:8px 10px}
  .fx-theme-pill{padding:8px 10px}
}


/* ================== FX THEME BUTTON (IMAGES) ================== */
.fx-theme-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  font: inherit;
  font-weight: 900;
  line-height:1;
  transition: .2s ease;
}
.fx-theme-pill:hover{
  transform: translateY(-1px);
  border-color: rgba(59,130,246,.35);
}
.fx-theme-img{
  width:18px;
  height:18px;
  display:block;
  object-fit:contain;
}
body.light .fx-img-moon{display:block}
body.light .fx-img-sun{display:none}
body.dark  .fx-img-moon{display:none}
body.dark  .fx-img-sun{display:block}

.fx-theme-text{
  font-size:13px;
  color: var(--muted);
  font-weight: 900;
}

/* ================== MOBILE HEADER FIX ================== */
.header .topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.header .brand{display:flex; align-items:center; gap:10px}
.header .actions{
  display:flex;
  align-items:center;
  gap:8px;
}

/* Put controls together on small screens */
@media (max-width: 600px){
  .header .topbar{
    gap:8px;
  }
  .header .brand strong{font-size:14px}
  .header .small{font-size:12px}
  .fx-theme-text{display:none} /* keep icons only */
  .nav{display:none} /* if you don't have mobile menu yet */
}
