/* Bundled Arabic font (Cairo variable, Arabic subset only): Arabic UI text renders even on
   systems with no Arabic font installed. ~30KB, precached by the service worker. */
@font-face {
  font-family: 'Gannova Arabic';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
:root, [data-theme="dark"] {
  --bg:#0a0e1a; --bg2:#101728; --card:#121a2e; --border:#253050;
  --text:#e8eaf0; --muted:#97a1b5; --gold:#e3c15d; --green:#3ecf8e; --red:#f0616d;
  --input:#0d1424;
}
[data-theme="light"] {
  --bg:#f4f6fb; --bg2:#ffffff; --card:#ffffff; --border:#dde3f0;
  --text:#1a2333; --muted:#5b6679; --gold:#b8912e; --green:#0f9d63; --red:#d33a46;
  --input:#f0f3fa;
}
* { margin:0; padding:0; box-sizing:border-box; }
button, input, select, textarea { font-family:inherit; }
body { font-family:'Noto Sans Arabic','Gannova Arabic','Segoe UI',Tahoma,sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }
.topbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 18px;
  background:var(--bg2); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:10; }
.brand { font-size:24px; font-weight:800; color:var(--gold); }
.brand-word { font-size:19px; letter-spacing:5px; font-weight:800; background:linear-gradient(120deg,#f2d98c,#e3c15d 45%,#a87f22); -webkit-background-clip:text; background-clip:text; color:transparent; }
.topbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.sources-chip { font-size:11px; color:var(--muted); border:1px solid var(--border); border-radius:20px; padding:4px 12px; }
.pro-chip { font-size:11px; color:var(--muted); border:1px dashed var(--border); border-radius:20px; padding:4px 12px; opacity:.65; }
.toggle-btn { background:var(--card); color:var(--gold); border:1px solid var(--border); border-radius:8px;
  padding:6px 12px; cursor:pointer; font-size:13px; font-weight:700; }
.tabs { display:flex; gap:6px; padding:12px 18px 0; }
.tab { background:none; border:none; color:var(--muted); font-size:15px; font-weight:700; padding:8px 18px;
  cursor:pointer; border-bottom:2px solid transparent; font-family:inherit; }
.tab.active { color:var(--gold); border-bottom-color:var(--gold); }
main { padding:16px 18px 60px; max-width:1400px; margin:0 auto; }
.tab-pane { display:none; } .tab-pane.active { display:block; }
.dash-controls { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.chips { display:flex; gap:8px; flex-wrap:wrap; }
.chip { background:var(--card); border:1px solid var(--border); color:var(--muted); border-radius:20px;
  padding:6px 16px; cursor:pointer; font-size:13px; font-weight:700; }
.chip.active { color:#0a0e1a; background:var(--gold); border-color:var(--gold); }
.tf-select { background:var(--card); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:6px 10px; font-family:inherit; }
.dash-grid { display:grid; grid-template-columns:2.4fr 1fr; gap:14px; }
@media (max-width:900px) { .dash-grid { grid-template-columns:1fr; } }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; }
.card h3 { color:var(--gold); font-size:16px; margin-bottom:12px; }
.ticker-row { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; }
.ticker-price { font-size:26px; font-weight:800; }
.ticker-change { font-size:13px; font-weight:700; }
.ticker-change.up { color:var(--green); } .ticker-change.down { color:var(--red); }
.ticker-symbol { font-size:14px; color:var(--muted); font-weight:700; }
.chart { width:100%; height:420px; }
.data-note { font-size:11px; color:var(--muted); margin-top:8px; }
.base-row { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
.base-row label { font-size:12px; color:var(--muted); white-space:nowrap; }
input, select { background:var(--input); color:var(--text); border:1px solid var(--border); border-radius:8px;
  padding:8px 10px; font-size:13px; font-family:inherit; width:100%; }
.base-row input { width:auto; flex:1; min-width:0; }
.mini-btn { background:var(--card); color:var(--gold); border:1px solid var(--gold); border-radius:8px; padding:8px 12px; cursor:pointer; font-size:12px; font-weight:700; white-space:nowrap; }
.levels-list { display:flex; flex-direction:column; gap:4px; max-height:330px; overflow-y:auto; }
.level-row { display:flex; justify-content:space-between; padding:6px 10px; border-radius:8px; font-size:13px; background:var(--bg2); }
.level-row .ang { color:var(--muted); font-size:11px; }
.level-row.res { border-right:3px solid var(--red); }
.level-row.sup { border-right:3px solid var(--green); }
.level-row.cur { border:1px solid var(--gold); font-weight:800; }
.check-row { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); margin-top:10px; }
.check-row input { width:auto; }
.calc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:14px; }
.calc-body { display:flex; flex-direction:column; gap:8px; }
.calc-body label { font-size:12px; color:var(--muted); }
.go-btn { background:var(--gold); color:#0a0e1a; border:none; border-radius:8px; padding:10px; font-size:14px; font-weight:800; cursor:pointer; font-family:inherit; }
.result { font-size:13px; }
.result table { width:100%; border-collapse:collapse; }
.result td, .result th { padding:5px 8px; border-bottom:1px solid var(--border); text-align:right; font-size:12.5px; }
.result th { color:var(--gold); }
#taWatch table, #taStudy table { width:100%; border-collapse:collapse; table-layout:auto; }
#taWatch td, #taWatch th, #taStudy td, #taStudy th { padding:6px 10px; border-bottom:1px solid var(--border); text-align:right; font-size:12.5px; vertical-align:top; }
#taWatch th, #taStudy th { color:var(--gold); font-weight:700; line-height:1.35; }
#taWatch td:nth-child(1), #taWatch th:nth-child(1), #taWatch td:nth-child(2), #taWatch th:nth-child(2) { white-space:nowrap; }
#taWatch td .src { white-space:nowrap; }
.bt-ledger { margin-top:10px; }
.bt-ledger summary { cursor:pointer; color:var(--gold); font-size:13px; font-weight:700; }
.bt-ledger-scroll { max-height:260px; overflow:auto; margin-top:6px; border:1px solid var(--border); border-radius:8px; padding:0 6px; }
.result .hi { color:var(--gold); font-weight:800; }
.result .up { color:var(--green); } .result .dn { color:var(--red); }
.sq144-grid { display:grid; grid-template-columns:repeat(12,1fr); gap:2px; direction:ltr; }
.sq144-cell { font-size:9px; text-align:center; padding:2px 0; background:var(--bg2); border-radius:3px; color:var(--muted); }
.sq144-cell.hit { background:var(--gold); color:#0a0e1a; font-weight:800; }
.sq144-cell.cardinal { background:#3a2f10; color:var(--gold); }
.statusbar { position:static; background:var(--bg2); border-top:1px solid var(--border);
  padding:10px 18px; font-size:11px; color:var(--muted); display:flex; gap:10px 22px; flex-wrap:wrap; align-items:center; }
.statusbar b { color:var(--text); font-weight:600; }
#statusTxt{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.status-sep{color:var(--gold);font-weight:700}

@media (max-width:600px){
  .pro-chip{ display:none; } .sources-chip{ font-size:10px; }
  .tabs{ flex-wrap:wrap; padding:10px 12px 0; row-gap:6px; }
  .tab{ padding:8px 12px; font-size:14px; flex:0 0 auto; }
  .result{ overflow-x:auto; }
  .result td, .result th{ padding:4px 5px; font-size:11.5px; }
  #taWatch td, #taWatch th, #taStudy td, #taStudy th{ padding:4px 6px; font-size:11.5px; }
}
html, body { overflow-x:hidden; }

.brief-card { margin-bottom:14px; }
.brief-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; }
.brief-head h3 { margin:0; }
.brief-date { font-size:12px; color:var(--muted); }
.brief-astro { font-size:12px; color:var(--muted); padding:6px 0 10px; border-bottom:1px solid var(--border); }
.brief-astro b { color:var(--gold); font-weight:700; }
.brief-symbols { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; margin-top:12px; }
.brief-sym { background:var(--bg2); border:1px solid var(--border); border-radius:10px; padding:10px 12px; }
.brief-sym .nm { font-size:12px; color:var(--muted); }
.brief-sym .pr { font-size:16px; font-weight:800; margin:2px 0; }
.brief-sym .gr { font-size:12px; font-weight:800; color:var(--gold); }
.brief-sym .lv { font-size:11px; color:var(--muted); }
.scan-note { font-size:12px; color:var(--muted); margin-bottom:10px; }

.bt-controls { display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.bt-controls select { width:auto; }
.bt-controls .go-btn { width:auto; padding:8px 22px; }
.bt-bars { display:flex; flex-direction:column; gap:10px; margin:14px 0; }
.bt-bar-row { display:grid; grid-template-columns:110px 1fr 70px; align-items:center; gap:10px; font-size:13px; }
.bt-bar { height:18px; border-radius:5px; min-width:2px; }
.bt-disclaimer { font-size:11px; color:var(--muted); margin-top:10px; border-top:1px solid var(--border); padding-top:8px; }

/* Welcome / profile modal */
.modal-backdrop { position:fixed; inset:0; background:rgba(4,6,12,.72); display:flex; align-items:center; justify-content:center; z-index:60; padding:16px; }
.modal-card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:26px 24px; max-width:380px; width:100%; text-align:center; box-shadow:0 14px 44px rgba(0,0,0,.45); }
.modal-card h3 { color:var(--gold); font-size:19px; margin:0 0 8px; }
.modal-card p { color:var(--muted); font-size:13px; margin:0 0 16px; line-height:1.7; }
.modal-card input { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:8px; color:var(--text); padding:11px 12px; font-size:15px; font-family:inherit; margin-bottom:14px; text-align:center; box-sizing:border-box; }
.modal-card input:focus { outline:none; border-color:var(--gold); }
.modal-actions { display:flex; gap:10px; justify-content:center; }
.modal-actions .go-btn { min-width:130px; }
.modal-err { color:var(--red); font-size:12px; min-height:16px; margin-bottom:12px; }

/* Support section */
.support-head h3{margin:0 0 6px}
.support-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-top:14px;align-items:stretch}
.support-card{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;height:100%}
.sup-coin-head{display:flex;align-items:flex-start;gap:10px;min-height:100px}
.sup-coin-head h4{margin:0;font-size:17px}
.sup-badge{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700}
.sup-badge.usdt{background:rgba(38,161,123,.15);color:#26a17b}
.sup-badge.btc{background:rgba(247,147,26,.15);color:#f7931a}
.sup-net{font-size:12px;opacity:.7}
.sup-qr{background:#fff;border-radius:12px;padding:10px;width:190px;height:190px;display:flex;align-items:center;justify-content:center;flex:none}
.sup-qr svg{width:170px;height:170px}
.sup-qr img{width:170px;height:170px;border-radius:8px;object-fit:cover;display:block}
.sup-qr-empty{background:rgba(128,128,128,.10);border:1px dashed rgba(128,128,128,.4)}
.sup-warn{margin-top:4px;font-size:11.5px;color:#e0a83c;line-height:1.5;max-width:230px}
.sup-soon{opacity:.6;font-size:13px;padding:0 12px}
.sup-addr{font-family:ui-monospace,monospace;font-size:12.5px;word-break:break-all;background:rgba(128,128,128,.15);padding:8px 10px;border-radius:8px;max-width:100%;min-height:54px;display:flex;align-items:center;justify-content:center}
.sup-copy{margin-top:auto}
.sup-copy[disabled]{opacity:.45;cursor:not-allowed}

/* analysis layers */
.layers-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; margin-top:10px; }
.layer-row{ display:flex; justify-content:space-between; align-items:center; gap:10px; background:var(--bg2); border:1px solid var(--border); border-radius:8px; padding:8px 10px; }
.layer-row .ly-w input{ width:56px; background:var(--bg); color:var(--text); border:1px solid var(--border); border-radius:6px; padding:4px 6px; font-family:inherit; }
.layer-row .ly-w{ font-size:12px; color:var(--muted); display:flex; align-items:center; gap:6px; }
.layers-score{ margin-top:12px; }
.ly-total{ font-size:15px; margin-bottom:8px; }
.ly-total b{ color:var(--gold); }
.ly-chip{ display:inline-block; background:var(--bg2); border:1px solid var(--border); border-radius:20px; padding:3px 10px; font-size:12px; margin:2px; color:var(--muted); }
.ly-chip.up b{ color:var(--green); } .ly-chip.dn b{ color:var(--red); }
.brief-sym .sc{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.brief-sym .sc b{ font-weight:800; }

/* mobile overflow guard: grid items must be allowed to shrink (RTL overflow hid the price column) */
.dash-grid > *, .calc-grid > *, .layers-grid > *, .support-grid > * { min-width:0; }
.card { min-width:0; }
#chart { max-width:100%; overflow:hidden; }

/* light-mode brand contrast */
[data-theme=light] .brand-word { background:linear-gradient(120deg,#8a6410,#6d4e08 45%,#4d3704); -webkit-background-clip:text; background-clip:text; }

/* ETH donate badge */
.sup-badge.eth{background:rgba(98,126,234,.15);color:#627eea;font-size:23px}

/* Support tab: FAQ + form */
.faq-box details{border:1px solid var(--border);border-radius:10px;padding:10px 14px;margin:8px 0;background:var(--bg2)}
.faq-box summary{cursor:pointer;font-weight:600;color:var(--gold);font-size:14px}
.faq-box details p{margin:8px 0 2px;font-size:13.5px;line-height:1.7;color:var(--text)}
.help-form{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.help-form .hf-row{display:flex;gap:10px;flex-wrap:wrap}
.help-form .hf-row input{flex:1;min-width:180px}
.help-form input,.help-form select,.help-form textarea{background:var(--bg2);border:1px solid var(--border);border-radius:10px;color:var(--text);padding:10px 12px;font-size:14px;font-family:inherit}
.help-form textarea{resize:vertical}
.help-form input:focus,.help-form select:focus,.help-form textarea:focus{outline:none;border-color:var(--gold)}
.hf-dev{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);cursor:pointer}
.hf-status{font-size:13px;min-height:18px}
.hf-status.hf-ok{color:var(--green)}
.hf-status.hf-err{color:var(--red)}

/* Footer: privacy link + newsletter */
.foot-right{margin-inline-start:auto;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
#privacyLink{color:var(--gold);text-decoration:none;font-weight:600}
#privacyLink:hover{text-decoration:underline}
.news-wrap{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:min(100%,300px)}
.news-title{font-weight:600;color:var(--text);align-self:flex-start;padding-top:8px}
.news-form{display:flex;gap:6px;flex:1}
.news-form input{background:var(--bg);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:5px 10px;font-size:12px;width:170px;max-width:100%}
.news-form .go-btn{padding:5px 12px;font-size:12px;white-space:nowrap}
.news-soon{font-size:10.5px;color:var(--muted);flex-basis:100%}
@media (max-width:900px){ .foot-right{margin-inline-start:0;flex-basis:100%} .news-wrap{flex-basis:100%} .news-soon{max-width:none} }

/* Privacy overlay page */
.priv-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:200;display:flex;justify-content:center;overflow-y:auto;padding:30px 14px}
.priv-overlay[hidden]{display:none}
.priv-page{background:var(--bg);border:1px solid var(--border);border-radius:16px;max-width:760px;width:100%;padding:22px 26px;height:fit-content}
.priv-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.priv-head h3{color:var(--gold);margin:0}
.priv-page h4{color:var(--gold);margin:16px 0 4px;font-size:14.5px}
.priv-page p{font-size:13.5px;line-height:1.8;color:var(--text);margin:0}

/* Footer links + newsletter consent/honeypot */
.foot-links{display:flex;gap:12px;flex-wrap:wrap}
.foot-links a{color:var(--gold);text-decoration:none;font-weight:600}
.foot-links a:hover{text-decoration:underline}
.news-form fieldset{border:0;margin:0;padding:0;display:flex;gap:6px;align-items:center;flex-wrap:wrap;flex:1}
.news-form fieldset:disabled{opacity:.55}
.news-consent{display:inline-flex;align-items:center;gap:8px;font-size:11px;color:var(--muted);cursor:pointer;flex-basis:100%;order:3;max-width:none;padding-top:2px;justify-content:flex-start;text-align:start}
.hp-field{position:absolute!important;left:-9999px!important;width:1px;height:1px;opacity:0;pointer-events:none}

/* Dashboard: how to read the score */
.score-help-card{padding:12px 18px}
.score-help-card h4{color:var(--gold);margin:0 0 6px;font-size:14px}
.score-help-list{margin:0;padding-inline-start:18px;font-size:12.5px;line-height:1.7;color:var(--muted)}
#statusTxt{display:flex;gap:14px;flex-wrap:wrap}
.bt-weak{color:var(--red);font-size:11px;border:1px solid var(--red);border-radius:4px;padding:0 4px;margin-inline-start:4px;white-space:nowrap;}
input[type=checkbox]{width:auto!important;min-width:0!important;flex:none!important;margin:0}
#langToggle,#themeToggle{font-family:'Noto Sans Arabic','Segoe UI Symbol',Tahoma,sans-serif}

.news-wrap[hidden]{display:none}

/* v21: workspaces, plans, since-visit */
.ws-block{margin-top:12px;border-top:1px solid var(--border);padding-top:10px}
.ws-block h4{margin:0 0 8px;font-size:14px}
.ws-note{font-size:12px;opacity:.8;margin:6px 0}
.ws-empty{font-size:12px;opacity:.6;padding:6px 0}
.ws-row,.pl-row{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding:7px 0;border-top:1px solid var(--border)}
.ws-meta{display:flex;flex-direction:column;gap:2px;min-width:0}
.ws-meta span{font-size:12px;opacity:.75}
.ws-actions{display:flex;gap:6px;flex-shrink:0}
.ws-drift{color:var(--gold);font-weight:600}
.pl-form{margin-bottom:6px}
.pl-err{color:#e05a5a;font-size:12px;min-height:14px;margin:2px 0}
.pl-nums{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;font-size:12px;justify-content:flex-end}
.pl-live{opacity:.8}
.brief-since{margin-top:8px;border-top:1px dashed var(--border);padding-top:8px}
.brief-since:empty{display:none}
.sv-title{font-size:13px;font-weight:700;margin-bottom:4px}
.sv-row{font-size:12px;padding:2px 0}
.sv-note{font-size:12px;opacity:.7}
.sv-tag{display:inline-block;font-size:11px;padding:1px 6px;border:1px solid var(--border);border-radius:8px;opacity:.85}
[hidden]{display:none!important}

.alert-row{display:flex;justify-content:space-between;align-items:center;padding:4px 0;font-size:12.5px;border-bottom:1px dashed var(--border);}
.alert-row:last-child{border-bottom:none;}
.chart-card.loading{opacity:.45;transition:opacity .15s;}
.chart-card{transition:opacity .15s;}

/* v43: same gold G mark as notifications, kept readable on mobile. */
.brand{display:flex;align-items:center;gap:10px;flex-shrink:0;}
.brand-mark{display:block;width:40px;height:40px;object-fit:contain;border-radius:50%;flex-shrink:0;}
@media(max-width:600px){.brand{gap:8px;}.brand-mark{width:32px;height:32px;}}

/* Approved octagon G + serif lockup. Keep artwork geometry intact. */
.brand-lockup{display:block;width:200px;height:48px;object-fit:contain;direction:ltr;}
@media(max-width:600px){.brand-lockup{width:170px;height:41px;}}
