/* ===================== ROOT / THEME ===================== */
:root {
  --bg-0: #05070d;
  --bg-1: #0b0f1a;
  --bg-2: #121828;
  --bg-3: #1a2136;
  --border: #232c45;
  --text-0: #e8ecf7;
  --text-1: #9aa5c4;
  --text-2: #667089;
  --gold: #ffd54a;
  --gold-2: #ffb300;
  --green: #16e08b;
  --green-2: #0ea968;
  --red: #ff4757;
  --red-2: #d63447;
  --orange: #ff9f43;
  --blue: #4aa3ff;
  --purple: #a06bff;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
  --radius: 14px;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: radial-gradient(circle at 20% 0%, #0e1424 0%, var(--bg-0) 55%);
  color: var(--text-0);
  min-height: 100vh;
  direction: rtl;
}
body.ltr-force { direction: ltr; }
a { color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===================== FLASH BORDER (Emergency) ===================== */
@keyframes flash-red {
  0%, 100% { box-shadow: inset 0 0 0px 0px rgba(255,71,87,0); }
  50% { box-shadow: inset 0 0 60px 12px rgba(255,71,87,.85); }
}
@keyframes flash-green {
  0%, 100% { box-shadow: inset 0 0 0px 0px rgba(22,224,139,0); }
  50% { box-shadow: inset 0 0 60px 12px rgba(22,224,139,.85); }
}
body.flash-border-buy::before,
body.flash-border-sell::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9990;
}
body.flash-border-buy::before { animation: flash-green .6s infinite; }
body.flash-border-sell::before { animation: flash-red .6s infinite; }

/* ===================== LOGIN PAGE ===================== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card .logo { font-size: 46px; margin-bottom: 6px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-card p.sub { color: var(--text-1); font-size: 13px; margin-bottom: 26px; }
.login-card input {
  width: 100%; padding: 13px 14px; margin-bottom: 14px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-0); font-size: 14px; outline: none; transition: .2s;
}
.login-card input:focus { border-color: var(--blue); }
.login-card button {
  width: 100%; padding: 13px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #14100a; font-weight: 800; font-size: 15px; margin-top: 6px;
  transition: transform .15s;
}
.login-card button:hover { transform: translateY(-2px); }
.login-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-hint { color: var(--text-2); font-size: 11px; margin-top: 18px; line-height: 1.7; }

/* ===================== TOP BAR ===================== */
.topbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: rgba(11,15,26,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-2); }
.brand .dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse-dot 1.4s infinite; }
.brand .dot.off { background: var(--red); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }
.topbar .spacer { flex: 1; }
.pill {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-1);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-3); color: var(--text-0); cursor: pointer; font-size: 13px; font-weight: 700;
  transition: .15s;
}
.btn:hover { border-color: var(--blue); background: var(--bg-2); }
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #14100a; border: none; }
.btn.danger { background: linear-gradient(135deg, var(--red), var(--red-2)); color: #fff; border: none; }
.btn.small { padding: 6px 10px; font-size: 12px; }

/* ===================== LAYOUT ===================== */
.layout { padding: 18px 22px 60px; max-width: 1700px; margin: 0 auto; }
.grid-top {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-card .label { font-size: 11px; color: var(--text-1); margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 800; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.gold { color: var(--gold); }

/* Symbol tabs */
.symbol-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.symbol-tab {
  padding: 8px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border);
  cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-1); position: relative;
}
.symbol-tab.active { color: var(--text-0); border-color: var(--blue); background: var(--bg-3); }
.symbol-tab .badge {
  position: absolute; top: -6px; left: -6px; width: 10px; height: 10px; border-radius: 50%;
}
.symbol-tab .badge.gold { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.symbol-tab .badge.buy { background: var(--green); }
.symbol-tab .badge.sell { background: var(--red); }

/* ===================== SIGNAL CARDS GRID ===================== */
.signals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px,1fr)); gap: 16px; margin-bottom: 24px; }
.signal-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  transition: transform .15s, border-color .2s;
}
.signal-card:hover { transform: translateY(-3px); }
.signal-card.zone-gold { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,213,74,.25); }
.signal-card.zone-excellent { border-color: var(--green); }
.signal-card.zone-good { border-color: var(--blue); }
.signal-card.zone-medium { border-color: var(--orange); }
.signal-card.zone-weak { border-color: var(--text-2); opacity: .8; }
@keyframes card-pulse {
  0%,100% { box-shadow: 0 0 0 rgba(255,213,74,0); }
  50% { box-shadow: 0 0 30px rgba(255,213,74,.55); }
}
.signal-card.pulsing { animation: card-pulse 1s infinite; }

.signal-card .sc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.signal-card .sc-sym { font-weight: 800; font-size: 15px; }
.signal-card .sc-price { font-size: 13px; color: var(--text-1); font-variant-numeric: tabular-nums; }
.zone-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
}
.zone-tag.gold { background: rgba(255,213,74,.15); color: var(--gold); }
.zone-tag.excellent { background: rgba(22,224,139,.15); color: var(--green); }
.zone-tag.good { background: rgba(74,163,255,.15); color: var(--blue); }
.zone-tag.medium { background: rgba(255,159,67,.15); color: var(--orange); }
.zone-tag.weak { background: rgba(102,112,137,.15); color: var(--text-2); }

.direction-badge { font-size: 12px; font-weight: 900; padding: 4px 10px; border-radius: 8px; }
.direction-badge.buy { background: rgba(22,224,139,.18); color: var(--green); }
.direction-badge.sell { background: rgba(255,71,87,.18); color: var(--red); }

.confidence-bar-wrap { background: var(--bg-3); height: 8px; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.confidence-bar { height: 100%; border-radius: 6px; transition: width .3s; }
.sc-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-1); margin: 4px 0; }
.sc-row b { color: var(--text-0); }
.sc-spike { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; display:flex; align-items:center; gap:6px;}
.sc-spike.buy { background: rgba(22,224,139,.12); color: var(--green); }
.sc-spike.sell { background: rgba(255,71,87,.12); color: var(--red); }
.sc-mtf { display: flex; gap: 6px; margin-top: 10px; }
.mtf-chip { flex: 1; text-align: center; padding: 5px 0; border-radius: 8px; font-size: 11px; font-weight: 800; background: var(--bg-3); color: var(--text-2); }
.mtf-chip.buy { background: rgba(22,224,139,.15); color: var(--green); }
.mtf-chip.sell { background: rgba(255,71,87,.15); color: var(--red); }

/* ===================== PER-PAIR HIGH-ACCURACY COUNTDOWN TIMER ===================== */
/* Shows time remaining until the pair's next M1 candle close (next signal
   evaluation/lock point). Ticks every animation frame (see app.js tickCountdowns)
   for smooth, drift-free display; turns red + pulses in the final 5 seconds. */
.countdown-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800;
  color: var(--text-1); background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 9px; font-variant-numeric: tabular-nums;
  transition: color .2s, border-color .2s, background .2s;
}
.countdown-badge.countdown-hot {
  color: #fff; background: rgba(255,71,87,.25); border-color: var(--red);
  animation: countdown-pulse .5s infinite;
}
@keyframes countdown-pulse {
  0%,100% { box-shadow: 0 0 0 rgba(255,71,87,0); }
  50% { box-shadow: 0 0 10px rgba(255,71,87,.75); }
}
.countdown-track { background: var(--bg-3); height: 4px; border-radius: 4px; overflow: hidden; margin: 8px 0 2px; }
.countdown-fill {
  height: 100%; width: 100%; background: linear-gradient(90deg, var(--blue), var(--purple));
  transition: width .1s linear, background .2s;
}
.countdown-fill.countdown-hot { background: linear-gradient(90deg, var(--red), var(--red-2)); }

/* ===================== INDICATOR BOX ===================== */
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 16px; font-weight: 800; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }
.indicator-box {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.indicator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 12px; }
.ind-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer;
  transition: border-color .15s;
}
.ind-card:hover { border-color: var(--blue); }
.ind-card .ind-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ind-card .ind-name { font-size: 12px; font-weight: 800; color: var(--text-1); }
.ind-card .ind-dot { width: 9px; height: 9px; border-radius: 50%; }
.ind-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.ind-dot.orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.ind-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.ind-card .ind-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ind-card .ind-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.ind-card canvas { width: 100%; height: 34px; margin-top: 6px; }

/* ===================== SETTINGS / MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,6,12,.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(165deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow);
}
.modal-box h2 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.modal-close { float: left; cursor: pointer; font-size: 20px; color: var(--text-1); }
.tabs-row { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.tab-btn { padding: 7px 14px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--border); cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-1); }
.tab-btn.active { color: var(--text-0); border-color: var(--gold); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.field-row { margin-bottom: 14px; }
.field-row label { display: block; font-size: 12px; color: var(--text-1); margin-bottom: 6px; font-weight: 700; }
.field-row input[type=text], .field-row input[type=password], .field-row input[type=number], .field-row select {
  width: 100%; padding: 10px 12px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; color: var(--text-0); font-size: 13px;
}
.field-row input[type=range] { width: 100%; }
.field-inline { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.field-inline label { font-size: 13px; font-weight: 600; color: var(--text-0); }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--bg-3); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--text-2); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: rgba(22,224,139,.25); border-color: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); background: var(--green); }
.symbol-check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 8px; }
.symbol-check { display: flex; align-items: center; gap: 8px; background: var(--bg-3); padding: 8px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--border); }
.save-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ===================== EMERGENCY FULLSCREEN POPUP ===================== */
.emergency-overlay {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(5,3,3,.92); animation: emergency-bg 1s infinite;
}
.emergency-overlay.hidden { display: none; }
@keyframes emergency-bg {
  0%,100% { background: rgba(30,3,3,.92); }
  50% { background: rgba(5,3,3,.96); }
}
.emergency-box {
  max-width: 560px; width: 92%; text-align: center; padding: 40px 30px;
  background: linear-gradient(165deg,#1c0d0d,#0d0606);
  border: 3px solid var(--red); border-radius: 24px;
  box-shadow: 0 0 80px rgba(255,71,87,.6);
  animation: shake 0.4s infinite;
}
.emergency-box.buy { border-color: var(--green); box-shadow: 0 0 80px rgba(22,224,139,.6); background: linear-gradient(165deg,#0d1c14,#060d09); }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-2px,1px); }
  50% { transform: translate(2px,-1px); }
  75% { transform: translate(-1px,-2px); }
}
.emergency-box .siren { font-size: 60px; margin-bottom: 10px; }
.emergency-box h1 { font-size: 26px; margin: 6px 0; color: #fff; letter-spacing: 1px; }
.emergency-box .sym-big { font-size: 34px; font-weight: 900; color: var(--gold); margin: 10px 0; }
.emergency-box .direction { font-size: 22px; font-weight: 900; margin-bottom: 14px; }
.emergency-box .direction.buy { color: var(--green); }
.emergency-box .direction.sell { color: var(--red); }
.emergency-box .details { text-align: right; background: rgba(255,255,255,.05); border-radius: 12px; padding: 14px 18px; margin: 16px 0; font-size: 13px; line-height: 2; }
.emergency-box .details b { color: #fff; }
.emergency-box button {
  margin-top: 10px; padding: 14px 30px; font-size: 15px; font-weight: 900; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #14100a; cursor: pointer;
}

/* ===================== SUDDEN ONE-SHOT SCREEN FLASH ===================== */
/* Fired once per alert, in the same frame the popup appears, to make the
   message feel abrupt/unexpected — a bright instantaneous flash that decays
   fast (~0.45s) and is then removed from the DOM entirely (see alerts.js
   _suddenFlash). Distinct from the repeating siren-style flash-border classes
   used for the whole alert duration. */
.sudden-flash {
  position: fixed; inset: 0; z-index: 8500; pointer-events: none; opacity: 0;
}
.sudden-flash.buy { background: radial-gradient(circle, rgba(22,224,139,.55), transparent 70%); }
.sudden-flash.sell { background: radial-gradient(circle, rgba(255,71,87,.55), transparent 70%); }
.sudden-flash.go { animation: sudden-flash-decay .45s ease-out forwards; }
@keyframes sudden-flash-decay {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===================== CENTER-SCREEN SIGNAL POPUPS (all levels) ===================== */
#signalPopupRoot {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 8000; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none; width: 100%; max-width: 380px;
}
.signal-popup {
  pointer-events: auto;
  width: 100%; background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--border); border-radius: 16px; padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
}
/* SUDDEN delivery: the popup SNAPS onto the screen abruptly — an oversized,
   instantaneous pop-in with a sharp overshoot — rather than a gentle fade/scale-in.
   This mirrors the abrupt, unexpected nature of a Boom/Crash spike itself. */
.signal-popup.sudden-pop { animation: sp-sudden-in .32s cubic-bezier(.2,1.6,.4,1); }
@keyframes sp-sudden-in {
  0%   { opacity: 0; transform: scale(2.2); }
  8%   { opacity: 1; transform: scale(1.35); }
  35%  { transform: scale(.92); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.signal-popup.buy { border-color: var(--green); box-shadow: 0 0 30px rgba(22,224,139,.35); }
.signal-popup.sell { border-color: var(--red); box-shadow: 0 0 30px rgba(255,71,87,.35); }
.signal-popup.lvl-3 { border-width: 3px; animation: sp-in .25s ease-out, sp-shake .5s infinite; }
.signal-popup.lvl-3.buy { box-shadow: 0 0 46px rgba(22,224,139,.6); }
.signal-popup.lvl-3.sell { box-shadow: 0 0 46px rgba(255,71,87,.6); }
@keyframes sp-shake { 0%,100%{transform:translate(0,0);} 25%{transform:translate(-1.5px,1px);} 75%{transform:translate(1.5px,-1px);} }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sp-zone { font-size: 11px; font-weight: 800; color: var(--gold); }
.sp-close { cursor: pointer; color: var(--text-2); font-size: 14px; }
.sp-sym { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.sp-dir { font-size: 15px; font-weight: 900; margin-bottom: 10px; }
.sp-dir.buy { color: var(--green); }
.sp-dir.sell { color: var(--red); }
.sp-confidence-wrap { background: var(--bg-3); height: 7px; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.sp-confidence-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.sp-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-1); margin: 3px 0; }
.sp-row b { color: var(--text-0); }
.sp-ghost { margin-top: 8px; font-size: 11px; color: var(--purple); font-weight: 700; }
.sp-strategies { margin-top: 8px; font-size: 10px; color: var(--text-2); line-height: 1.6; }

/* Live high-accuracy auto-close countdown embedded INSIDE the sudden popup itself */
.sp-countdown-row { display:flex; justify-content:space-between; align-items:center; margin-top:10px; font-size:10px; color:var(--text-2); font-variant-numeric:tabular-nums; }
.sp-countdown-text { font-weight:800; color:var(--text-1); }
.sp-countdown-track { background:var(--bg-3); height:3px; border-radius:3px; overflow:hidden; margin-top:4px; }
.sp-countdown-fill { height:100%; width:100%; background:linear-gradient(90deg,var(--blue),var(--purple)); }
.signal-popup.lvl-3 .sp-countdown-fill { background:linear-gradient(90deg,var(--red),var(--gold)); }

@media (max-width: 500px) {
  #signalPopupRoot { max-width: 92%; }
}

/* ===================== ALERT LOG PANEL ===================== */
.alert-log-box {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  max-height: 480px; overflow-y: auto;
}
.alert-log-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.alert-log-toolbar select {
  background: var(--bg-3); color: var(--text-0); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px;
}
.log-entry {
  display: grid; grid-template-columns: 90px 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-3); margin-bottom: 8px; font-size: 12px;
  border-right: 3px solid var(--text-2);
}
.log-entry.buy { border-right-color: var(--green); }
.log-entry.sell { border-right-color: var(--red); }
.log-entry.lvl-3 { background: rgba(255,213,74,.08); }
.log-entry .log-time { color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.log-entry .log-main { display: flex; flex-direction: column; gap: 2px; }
.log-entry .log-sym { font-weight: 800; }
.log-entry .log-meta { color: var(--text-1); font-size: 11px; }
.log-entry .log-conf { font-weight: 800; font-variant-numeric: tabular-nums; }
.log-entry .log-level { font-size: 16px; }
.alert-log-empty { text-align: center; color: var(--text-2); font-size: 12px; padding: 30px 0; }

/* toast */
.toast-wrap { position: fixed; bottom: 20px; left: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: 13px; box-shadow: var(--shadow); animation: toast-in .2s; }
@keyframes toast-in { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform: translateY(0);} }

.footer-note { text-align: center; color: var(--text-2); font-size: 11px; margin-top: 40px; line-height: 1.8; }
@media (max-width: 640px) {
  .topbar { padding: 10px 12px; }
  .layout { padding: 12px; }
}

/* ===================== FLOATING CIRCULAR RESET BUTTON ===================== */
/* زر دائري عائم ثابت أسفل يسار الشاشة (فوق التوستات) لإعادة ضبط الصفحة والمؤشرات
   بالكامل بضغطة واحدة — يدور أيقونته باستمرار بلطف لتمييزه كأداة "تحديث/ضبط". */
.fab-reset {
  position: fixed; bottom: 20px; right: 20px; z-index: 5000;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: transform .15s ease, box-shadow .15s ease;
}
.fab-reset:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.fab-reset:active { transform: scale(.94); }
.fab-reset .fab-reset-icon { display: inline-block; animation: fab-reset-spin 6s linear infinite; }
.fab-reset.spinning .fab-reset-icon { animation-duration: .5s; }
@keyframes fab-reset-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .fab-reset { bottom: 16px; right: 16px; width: 48px; height: 48px; font-size: 20px; }
}
