:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --gray: #64748b;
  --primary: #2563eb;
  --header: #f1f5f9;
  --itm: #dbeafe;
  --otm: #f8fafc;
  --green-bar: #ecfdf5;
  --green-text: #0f766e;
  --delta-bg: #e8e4d9;
  --chip: #f1f5f9;
  --sidebar: #ffffff;
}
html[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --gray: #94a3b8;
  --primary: #3b82f6;
  --header: #1e293b;
  --itm: #1e3a5f;
  --otm: #0b1526;
  --green-bar: #134e4a;
  --green-text: #5eead4;
  --delta-bg: #2f3a4a;
  --chip: #334155;
  --sidebar: #1e293b;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100%;
}
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; min-width: 1100px; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 16px;
}


.brand h1 { margin: 0; font-size: 16px; color: var(--text); font-weight: 700; }
.brand p { margin: 0; font-size: 11px; color: var(--gray); }


.brand-title h1 {
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}





.sidebar .meta {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--gray); text-align: center;
}
.main { padding: 20px; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.top h2 { margin: 0; font-size: 22px; text-align: center; flex: 1; color: var(--text); }
.top .sub { color: var(--gray); font-size: 12px; text-align: center; }
.tickers { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.tcard {
  width: 150px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
  display: flex; gap: 10px; align-items: center; color: var(--text);
}
.tcard.active { border: 2px solid var(--primary); }
.dot {
  width: 28px; height: 28px; border-radius: 50%; color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
}
.tcard b { display: block; font-size: 13px; color: var(--text); }
.tcard span { font-size: 10px; color: var(--gray); }
.controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: center; margin-bottom: 16px;
}
.select, .chip-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
label { font-size: 13px; font-weight: 700; color: var(--text); }
select {
  height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); padding: 0 10px;
}
.chip {
  min-width: 44px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--chip); color: var(--text); font-weight: 700; cursor: pointer;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn {
  height: 36px; border-radius: 8px; border: none; padding: 0 12px;
  font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-teal { background: #0f766e; color: #fff; }
.delta-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  font-weight: 700; cursor: pointer; background: var(--chip); color: var(--text);
}
.delta-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.table-scroll { overflow: auto; max-width: 100%; }
.table-title {
  text-align: center;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.close-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--header);
  color: var(--gray);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
}
table.oi { border-collapse: collapse; margin: 0 auto; font-size: 11px; color: var(--text); }
table.oi th, table.oi td {
  min-width: 72px; height: 34px; text-align: center; border: 1px solid var(--border); padding: 2px 4px;
}
table.oi th { background: var(--header); font-weight: 700; color: var(--text); }
table.oi th .subh { font-weight: 500; color: var(--gray); font-size: 10px; }
table.oi .strike { min-width: 64px; font-weight: 700; }
table.oi .itm { background: var(--itm); color: var(--text); }
table.oi .otm { background: var(--otm); color: var(--text); }
table.oi .green { background: var(--green-bar); color: var(--green-text); font-weight: 700; }
table.oi th.delta,
table.oi td.delta {
  background: var(--delta-bg) !important;
  color: var(--text) !important;
  border-color: var(--delta-bg) !important;
}
/* عمود النمو G — لون الماكرو RGB(216,231,231) */
table.oi th.growth,
table.oi td.growth {
  background: #d8e7e7 !important;
  color: #0f172a !important;
  border-color: #c5d6d6 !important;
  font-weight: 700;
}
html[data-theme="dark"] table.oi th.growth,
html[data-theme="dark"] table.oi td.growth {
  background: #2a3f40 !important;
  color: #e2e8f0 !important;
  border-color: #3d5556 !important;
}
.growth-btn.active {
  background: #0f766e !important;
  color: #fff !important;
  border-color: #0f766e !important;
}
.status { font-size: 12px; color: var(--gray); text-align: center; margin-top: 10px; }
.status.ok { color: #16a34a; }
.status.err { color: #dc2626; }
html[data-theme="dark"] .status.ok { color: #4ade80; }
html[data-theme="dark"] .status.err { color: #f87171; }
.theme-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.switch {
  width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1;
  position: relative; cursor: pointer; border: none; padding: 0;
}
html[data-theme="dark"] .switch { background: #475569; }
.switch.on { background: var(--primary); }
.switch i {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s; display: block;
}
.switch.on i { left: 21px; }

/* alternating rows — clear in light and dark */
table.oi tbody tr.zebra td.itm { filter: brightness(0.96); }
table.oi tbody tr.zebra td.otm { filter: brightness(0.97); }
html[data-theme="dark"] table.oi tbody tr.zebra td.itm {
  background: #172a45;
  filter: none;
}
html[data-theme="dark"] table.oi tbody tr.zebra td.otm {
  background: #111c2e;
  filter: none;
}
html[data-theme="light"] table.oi tbody tr.zebra td.itm {
  background: #cfe0f8;
  filter: none;
}
html[data-theme="light"] table.oi tbody tr.zebra td.otm {
  background: #eef2f7;
  filter: none;
}
/* subtle separator line between strikes */
table.oi tbody tr td {
  border-bottom-color: var(--border);
}
html[data-theme="dark"] table.oi tbody tr td {
  border-bottom: 1px solid #2a3a52;
}
html[data-theme="dark"] table.oi th {
  border-bottom: 1px solid #475569;
}




/* أعلى رقم في عمود Call/Put */
table.oi td.max-oi {
  background: #c7d2fe !important;
  color: #1e1b4b !important;
  font-weight: 700;
}
html[data-theme="dark"] table.oi td.max-oi {
  background: #3730a3 !important;
  color: #e0e7ff !important;
  font-weight: 700;
}





/* توقيع By Gee — يتلوّن مع الثيم */
.brand-sign-wrap {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-sign-svg {
  height: 22px;
  width: auto;
  display: block;
}
html[data-theme="light"] .brand-sign-wrap {
  color: #1e3a5f; /* كحلي هادئ على خلفية فاتحة */
}
html[data-theme="dark"] .brand-sign-wrap {
  color: #e8eef8; /* أبيض سكري مائل للأزرق على الليلي */
}


.brand-sign-img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
  opacity: 0.95;
}
.theme-row { display: none !important; }



/* Excel button — gradient + glow */
.btn-excel {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0 16px !important;
  height: 36px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 0 0 1px rgba(45,212,191,0.25), 0 4px 14px rgba(13,148,136,0.35) !important;
}
.btn-excel:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.4), 0 6px 18px rgba(13,148,136,0.45) !important;
}
.btn-map {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-map:hover { filter: brightness(1.08); }

.map-modal {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.map-modal.hidden { display: none; }
.map-panel {
  width: min(1100px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 16px 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.map-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 12px;
}
.map-head h3 { margin: 0; font-size: 18px; color: #f1f5f9; }
.map-sub { margin: 4px 0 0; font-size: 12px; color: #94a3b8; }
.map-body { display: grid; gap: 14px; }
.map-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px) {
  .map-grid { grid-template-columns: 200px 1fr 200px; }
}
.map-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 12px;
}
.map-card h4 {
  margin: 0 0 10px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: .02em;
}
.map-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 6px 0;
  border-bottom: 1px solid #1f2937;
  color: #e2e8f0;
}
.map-row:last-child { border-bottom: none; }
.map-row .tag-sup { color: #5eead4; }
.map-row .tag-res { color: #c4b5fd; }
.map-chart-wrap {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 10px;
  min-height: 200px;
}
.map-chart-wrap svg { width: 100%; height: auto; display: block; }
.map-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: #94a3b8; margin-top: 8px;
}
.map-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 4px; }


.map-simple { display: grid; gap: 10px; }
.map-price {
  text-align: center;
  padding: 14px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
}
.map-price .n {
  font-size: 28px;
  font-weight: 700;
  color: #e2e8f0;
}
.map-price .l { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.map-band {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
}
.map-band .name {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}
.map-band .cell {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0b1220;
}
.map-band .cell b { display: block; font-size: 15px; margin-bottom: 2px; }
.map-band .cell.sup b { color: #5eead4; }
.map-band .cell.res b { color: #c4b5fd; }
.map-band .cell span { color: #94a3b8; font-size: 11px; }
.map-hint {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 4px;
}






















/* ========== Brand (stable) — restored layout ========== */
.brand {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
.logo {
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  display: grid !important;
  place-items: center !important;
  font-family: "Montserrat", system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  flex: 0 0 auto !important;
  line-height: 1 !important;
}
.brand-divider {
  width: 1px !important;
  flex: 0 0 auto !important;
  display: block !important;
  align-self: center !important;
}
.brand-divider-light {
  height: 28px !important;
  background: rgba(248, 250, 252, 0.35) !important;
}
.brand-left {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
}
.brand-oi {
  font-family: "Montserrat", system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  color: #f8fafc !important;
  line-height: 1.1 !important;
}
.brand-sub {
  font-size: 10px !important;
  color: #94a3b8 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}
.brand-sign {
  font-family: "Montserrat", system-ui, sans-serif !important;
  font-weight: 500 !important;
  font-size: 8px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #6B8CFF !important;
  white-space: nowrap !important;
  border: none !important;
  margin-left: 6px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ===== Levels Map H1 ===== */
.map-h1 { direction: ltr; }
.map-h1 .price-card {
  text-align: center;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.map-h1 .price-card b {
  font-size: 30px;
  font-weight: 700;
  color: #f8fafc;
  display: block;
}
.map-h1 .price-card p {
  margin-top: 6px;
  font-size: 13px;
  color: #94a3b8;
}
.map-h1 .grid-wrap {
  display: grid;
  grid-template-columns: 1fr 168px;
  gap: 12px;
}
.map-h1 .stage {
  position: relative;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 14px;
  min-height: 400px;
  overflow: hidden;
}
.map-h1 .stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(#1e293b 1px, transparent 1px),
                    linear-gradient(90deg, #1e293b 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.4;
  pointer-events: none;
}
.map-h1 .track {
  position: absolute;
  left: 50%; top: 24px; bottom: 24px;
  width: 1.5px;
  background: #334155;
  transform: translateX(-50%);
  z-index: 1;
}
.map-h1 .level {
  position: absolute;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 0;
}
/* قمم يسار خط السعر */
.map-h1 .level.res {
  flex-direction: row-reverse;
  transform: translate(-100%, 50%);
}
/* قيعان يمين خط السعر */
.map-h1 .level.sup {
  flex-direction: row;
  transform: translate(0%, 50%);
}
.map-h1 .level.dual {
  flex-direction: row;
  transform: translate(0%, 50%);
}
.map-h1 .level .line {
  height: 1px;
  width: 140px;
  flex-shrink: 0;
}
.map-h1 .level.res .line { background: #a78bfa; }
.map-h1 .level.sup .line { background: #2dd4bf; }
.map-h1 .level.dual .line {
  height: 1.5px;
  width: 140px;
  background: linear-gradient(90deg, #2dd4bf, #94a3b8, #a78bfa);
}
.map-h1 .level .end {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-h1 .level.res .end { background: #a78bfa; box-shadow: 0 0 6px rgba(167,139,250,.55); }
.map-h1 .level.sup .end { background: #2dd4bf; box-shadow: 0 0 6px rgba(45,212,191,.55); }
.map-h1 .level.dual .end { background: #94a3b8; box-shadow: 0 0 6px rgba(148,163,184,.5); }
.map-h1 .level .num {
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  white-space: nowrap;
}
.map-h1 .level.res .num { color: #c4b5fd; }
.map-h1 .level.sup .num { color: #5eead4; }
.map-h1 .level.dual .num { color: #e2e8f0; }
.map-h1 .px {
  position: absolute;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, 50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #22d3ee;
  border: 2.5px solid #f8fafc;
  box-shadow: 0 0 0 4px rgba(34,211,238,.22), 0 0 20px #22d3ee;
}
.map-h1 .px span {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; font-weight: 700;
  color: #f8fafc;
  background: #0f172a;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid #334155;
  white-space: nowrap;
}
.map-h1 .cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  direction: rtl;
}
.map-h1 .card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 10px 12px;
}
.map-h1 .card .t {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
  font-weight: 600;
}
.map-h1 .card .r {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin: 3px 0;
}
.map-h1 .card .res { color: #c4b5fd; }
.map-h1 .card .sup { color: #5eead4; }
@media (max-width: 700px) {
  .map-h1 .grid-wrap { grid-template-columns: 1fr; }
  .map-h1 .cards { flex-direction: row; flex-wrap: wrap; }
  .map-h1 .card { flex: 1 1 120px; }
}





/* level change arrows */
.lvl-arrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-inline-start: 4px;
  vertical-align: middle;
}
.lvl-arrow.up { color: #34d399; }
.lvl-arrow.down { color: #f87171; }
.lvl-arrow.flat { color: #64748b; }

/* TradingView-style price axis INSIDE the chart */
.map-h1 .stage {
  touch-action: none;
  overflow: hidden;
  padding-right: 52px; /* room for axis */
}
.map-h1 .price-axis {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 52px;
  z-index: 8;
  cursor: ns-resize;
  background: linear-gradient(90deg, transparent 0%, rgba(15,23,42,0.55) 30%, rgba(15,23,42,0.92) 100%);
  border-left: 1px solid #334155;
  user-select: none;
}
.map-h1 .price-axis:hover {
  background: linear-gradient(90deg, transparent 0%, rgba(15,23,42,0.4) 20%, rgba(30,41,59,0.95) 100%);
  border-left-color: #38bdf8;
}
.map-h1 .axis-tick {
  position: absolute;
  right: 0;
  left: 0;
  height: 0;
  border-top: 1px solid rgba(51,65,85,0.85);
  pointer-events: none;
}
.map-h1 .axis-tick span {
  position: absolute;
  right: 6px;
  top: -8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.map-h1 .axis-grip {
  position: absolute;
  top: 50%;
  right: 2px;
  width: 4px;
  height: 36px;
  margin-top: -18px;
  border-radius: 3px;
  background: #475569;
  opacity: 0.7;
}
.map-h1 .price-axis:hover .axis-grip {
  background: #38bdf8;
  opacity: 1;
}
.map-h1 .zoom-badge {
  position: absolute;
  top: 8px;
  right: 60px;
  z-index: 9;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15,23,42,0.85);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 2px 8px;
  pointer-events: none;
  direction: ltr;
}

/* modal body: avoid page-like scroll; chart handles scale */
.map-h1 .stage {
  min-height: 420px;
  height: 420px;
}


/* Map modal: no outer scrollbar — chart zooms instead */
.map-modal {
  overflow: hidden !important;
}
.map-modal .map-panel {
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.map-modal .map-body,
#mapBody {
  overflow: hidden !important;
  max-height: none !important;
  flex: 1;
}
.map-h1 {
  height: 100%;
}
.map-h1 .grid-wrap {
  min-height: 0;
}
.map-h1 .stage {
  min-height: 380px;
  height: min(58vh, 460px) !important;
  overflow: hidden;
  padding-right: 56px;
  touch-action: none;
}
.map-h1 .price-axis {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 56px;
  z-index: 20;
  cursor: ns-resize !important;
  touch-action: none;
  background: linear-gradient(90deg, transparent 0%, rgba(15,23,42,0.5) 25%, rgba(15,23,42,0.95) 100%);
  border-left: 1px solid #475569;
  user-select: none;
}
.map-h1 .price-axis:hover,
.map-h1 .price-axis:active {
  border-left-color: #38bdf8;
  background: linear-gradient(90deg, transparent 0%, rgba(15,23,42,0.35) 20%, rgba(30,41,59,0.98) 100%);
}
.map-h1 .axis-tick {
  position: absolute;
  right: 0; left: 0;
  height: 0;
  border-top: 1px solid rgba(71,85,105,0.9);
  pointer-events: none;
}
.map-h1 .axis-tick span {
  position: absolute;
  right: 6px;
  top: -8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.map-h1 .axis-grip {
  position: absolute;
  top: 50%;
  right: 3px;
  width: 5px;
  height: 48px;
  margin-top: -24px;
  border-radius: 4px;
  background: #64748b;
}
.map-h1 .price-axis:hover .axis-grip {
  background: #38bdf8;
}
.map-h1 .zoom-badge {
  position: absolute;
  top: 8px;
  right: 64px;
  z-index: 21;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(15,23,42,0.9);
  border: 1px solid #38bdf8;
  border-radius: 8px;
  padding: 3px 10px;
  pointer-events: none;
  direction: ltr;
}


/* شبكة المؤشرات: 5 بطاقات + STOCKS تحت IWM (العمود 3) */
.tickers-wrap {
  display: grid;
  grid-template-columns: repeat(5, 150px);
  gap: 10px 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.tickers-wrap .tickers {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 150px);
  gap: 10px;
  margin: 0;
  justify-content: center;
}
.stocks-row {
  grid-column: 3;
  width: 150px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
}
.stocks-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gray);
  text-align: left;
  flex: 0 0 auto;
  white-space: nowrap;
}
.stocks-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}
.stocks-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.price-card .close-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.lvl-arrow { font-weight: 700; margin-inline-start: 4px; }
.lvl-arrow.up { color: #34d399; }
.lvl-arrow.down { color: #f87171; }
.lvl-arrow.flat { color: #64748b; }


.map-range-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.map-range-chip {
  min-width: 44px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text, #e2e8f0);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.map-range-chip.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}
.map-range-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--gray, #94a3b8);
  font-weight: 500;
  line-height: 1.35;
  max-width: 280px;
}


.stocks-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 8px;
}
.stocks-inline .stocks-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gray);
}
.stocks-inline .stocks-select {
  min-width: 110px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.map-range-intro {
  margin: 8px auto 6px;
  font-size: 11px;
  color: var(--gray);
  text-align: center;
  line-height: 1.45;
  max-width: 360px;
}
#mapSub:empty { display: none !important; }



.export-panel {
  max-width: 640px;
  width: min(640px, 94vw);
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.25);
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
  overflow: hidden;
  background: var(--card);
}
.export-panel .map-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.export-panel .map-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.export-panel .map-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--gray);
}
.export-body { padding: 16px 18px 20px; }
.exp-export-block { margin-bottom: 14px; }
.exp-export-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; gap: 8px;
}
.exp-export-head b { font-size: 13px; color: var(--text); }
.exp-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15,23,42,.35);
}
html[data-theme="light"] .exp-checks { background: #f8fafc; }
.exp-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text); cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .12s;
}
.exp-check:hover { background: rgba(37,99,235,.12); }
.exp-check input { accent-color: var(--primary); }
.exp-export-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 0; font-size: 12px; color: var(--gray);
}
.exp-export-row > span {
  min-width: 52px; font-weight: 700; color: var(--text); font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.exp-export-row .chip {
  border: 1px solid var(--border); background: transparent;
  color: var(--text); border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .12s;
}
.exp-export-row .chip:hover { border-color: var(--primary); }
.exp-export-row .chip.on {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.exp-export-note {
  font-size: 11px; color: var(--gray); margin: 6px 0 14px;
  line-height: 1.5; opacity: .9;
}
.exp-export-actions { display: flex; gap: 10px; align-items: center; }
.exp-export-actions .btn-teal {
  border-radius: 12px; padding: 10px 18px; font-weight: 700;
}
.exp-status {
  margin-top: 12px; font-size: 13px; font-weight: 600;
  color: #4ade80; min-height: 1.2em;
}
.btn-sm {
  padding: 6px 12px; font-size: 11px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  cursor: pointer;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.map-range-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: .85;
  color: var(--gray);
}



.exp-footer {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding-top: 12px;
  padding-bottom: 4px;
  border-top: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.export-body {
  max-height: min(70vh, 560px);
  overflow: auto;
}
.export-panel .map-head {
  background: transparent !important;
}
.btn-feedback {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}
.btn-feedback:hover {
  border-color: var(--primary);
  background: rgba(37,99,235,.1);
}
.feedback-panel { max-width: 420px; width: min(420px, 94vw); }
.feedback-form {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 4px 12px;
}
.feedback-form label {
  font-size: 12px; font-weight: 600; color: var(--text);
}
.feedback-form .opt { font-weight: 400; color: var(--gray); font-size: 11px; }
.feedback-form input,
.feedback-form textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,.4);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.feedback-form input:focus,
.feedback-form textarea:focus {
  outline: 2px solid rgba(37,99,235,.45);
  border-color: var(--primary);
}
.map-range-sub {
  direction: rtl;
  unicode-bidi: isolate;
}

/* ===== Reports ===== */
.btn-reports {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff !important;
  border: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}
.btn-reports:hover { filter: brightness(1.08); }
.reports-panel {
  width: min(1100px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reports-body {
  overflow-y: auto !important;
  overflow-x: hidden;
  max-height: calc(92vh - 72px);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
.rep-grid { direction: ltr; }
.rep-table { direction: ltr; }
.rep-insight-soft {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.rep-insight-soft h4 { color: var(--text) !important; text-align: center; }
.rep-insight-soft .score-line {
  text-align: center !important;
  font-weight: 500 !important;
  color: var(--text) !important;
}
.rep-insight-soft .muted { text-align: center; }
html[data-theme="dark"] .rep-insight-soft {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.rep-controls {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.rep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 800px) {
  .rep-grid { grid-template-columns: 1fr; }
}
.rep-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.rep-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.rep-card h4 .tag {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.tag-delta { background: #e4e4d2; color: #3f3f2e; }
.tag-growth { background: #d8e7e7; color: #1e3a3a; }
.tag-trough { background: #ede9fe; color: #5b21b6; }
.tag-peak { background: #ccfbf1; color: #0f766e; }
html[data-theme="dark"] .tag-delta { background: #3f3f2e; color: #e4e4d2; }
html[data-theme="dark"] .tag-growth { background: #1e3a3a; color: #a7f3f3; }
html[data-theme="dark"] .tag-trough { background: #2e1065; color: #ddd6fe; }
html[data-theme="dark"] .tag-peak { background: #134e4a; color: #99f6e4; }
.rep-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.rep-table th, .rep-table td {
  padding: 6px 8px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.rep-table th {
  font-size: 11px; color: var(--gray); font-weight: 600;
}
.rep-table tr:last-child td { border-bottom: none; }
.rep-insight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
  border: 1px solid #312e81;
  border-radius: 12px;
  padding: 14px 16px;
  color: #e0e7ff;
}
.rep-insight h4 { color: #c7d2fe; margin: 0 0 8px; font-size: 14px; }
.rep-insight .score-line {
  font-size: 15px; font-weight: 700; margin: 6px 0;
}
.rep-insight .muted { color: #94a3b8; font-size: 12px; margin-top: 6px; }
.rep-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; margin-left: 6px;
}
.rep-badge.high { background: #065f46; color: #a7f3d0; }
.rep-badge.mid { background: #92400e; color: #fde68a; }
.rep-badge.low { background: #374151; color: #d1d5db; }
.rep-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px; flex-wrap: wrap;
}

.rep-input-row { align-items: center; gap: 10px; }
.rep-input {
  width: 72px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.rep-result { margin-top: 8px; padding-top: 4px; }
.rep-reasons { text-align: right !important; font-size: 11px; color: var(--gray); }
.rep-top-row td { background: rgba(99, 102, 241, 0.12) !important; font-weight: 600; }
.rep-score-card h4 { margin-bottom: 10px; }
.rep-insight .score-line {
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
  margin: 0 0 8px;
}
