/* © 2026 Bella Bardabareket — Risk Exposure Builder styles.
   Namespaced .rx-* so it never collides with the atlas. Inherits the
   SIA dark-glass / cyan vocabulary. RTL-aware via [dir]. */

:root {
  --rx-cyan: #22d3ee;
  --rx-cyan-soft: #67e8f9;
  --rx-ink: #e6edf5;
  --rx-ink-2: #98a3b3;
  --rx-ink-3: #5a6473;
  --rx-panel: rgba(11, 16, 24, 0.94);
  --rx-line: rgba(255, 255, 255, 0.09);
  --rx-line-cyan: rgba(34, 211, 238, 0.32);
}

/* ---------------- trigger FAB ---------------- */
.rx-fab {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 38px; padding: 0 16px;
  background: linear-gradient(180deg, rgba(244,63,94,0.20), rgba(244,63,94,0.10));
  border: 1px solid rgba(244,63,94,0.55);
  border-radius: 7px;
  color: #fecdd3;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: filter .15s, box-shadow .18s, transform .12s;
}
.rx-fab:hover { filter: brightness(1.12); box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 24px rgba(244,63,94,.4); transform: translateY(-1px); }
.rx-fab:active { transform: scale(.97); }
.rx-fab-glyph { width: 15px; height: 15px; flex-shrink: 0; }
html[lang="he"] .rx-fab { font-family: "Assistant", sans-serif; letter-spacing: .02em; font-size: 12.5px; font-weight: 700; }

/* ---------------- shared atoms ---------------- */
.rx-eyebrow {
  font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--rx-cyan-soft);
}
.rx-h1 { font-family: "Heebo","Assistant",sans-serif; font-weight: 800; letter-spacing: -.01em; color: #f5f8fc; margin: 0; }
.rx-mono { font-family: "JetBrains Mono", monospace; }
html[lang="he"] .rx-num { font-family: "JetBrains Mono", monospace; } /* keep numerals mono in HE too */

.rx-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(ellipse at 50% 30%, rgba(8,12,20,.55), rgba(3,5,11,.86));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: rx-fade .25s ease both;
}
@keyframes rx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.rx-close {
  width: 30px; height: 30px; border-radius: 6px; flex-shrink: 0;
  background: rgba(255,255,255,.05); border: 1px solid var(--rx-line);
  color: var(--rx-ink-2); font-size: 16px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.rx-close:hover { background: rgba(244,63,94,.14); color: #fecdd3; border-color: rgba(244,63,94,.45); }

/* ---------------- layout switch ---------------- */
.rx-modes { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(5,8,14,.7); border: 1px solid var(--rx-line); }
.rx-mode { appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rx-ink-3); padding: 5px 9px; border-radius: 6px; transition: color .15s, background .15s; }
.rx-mode.on { color: #04121a; background: var(--rx-cyan); font-weight: 700; }
.rx-mode:not(.on):hover { color: var(--rx-ink); }

/* ---------------- gauge ---------------- */
.rx-gauge { display: flex; align-items: center; gap: 16px; }
.rx-gauge-ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.rx-gauge-ring svg { transform: rotate(-90deg); display: block; }
.rx-gauge-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rx-gauge-num { font-family: "JetBrains Mono", monospace; font-size: 30px; font-weight: 600; color: #f5f8fc; line-height: 1; }
.rx-gauge-max { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--rx-ink-3); margin-top: 2px; }
.rx-tierpill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  font-family: "Heebo","Assistant",sans-serif; font-weight: 700; font-size: 13px; }
.rx-tierdot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------------- holdings editor ---------------- */
.rx-hold { display: flex; flex-direction: column; gap: 8px; }
.rx-hold-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 11px; background: rgba(255,255,255,.025); border: 1px solid var(--rx-line); border-radius: 8px; transition: border-color .15s, background .15s; }
.rx-hold-row:hover { border-color: var(--rx-line-cyan); }
.rx-hold-flag { font-size: 17px; line-height: 1; }
.rx-hold-name { font-family: "Heebo","Assistant",sans-serif; font-weight: 600; font-size: 13.5px; color: var(--rx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-hold-meta { font-size: 11px; color: var(--rx-ink-3); }
.rx-w-wrap { display: flex; align-items: center; gap: 8px; }
.rx-w-range { width: 96px; accent-color: var(--rx-cyan); cursor: pointer; }
.rx-w-num { width: 42px; background: rgba(5,8,14,.7); border: 1px solid var(--rx-line); border-radius: 5px; color: var(--rx-ink);
  font-family: "JetBrains Mono", monospace; font-size: 12px; text-align: center; padding: 4px 2px; }
.rx-w-num:focus { outline: none; border-color: var(--rx-line-cyan); }
.rx-hold-score { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 600; min-width: 28px; text-align: center; }
.rx-x { appearance: none; border: 0; background: transparent; color: var(--rx-ink-3); cursor: pointer; font-size: 15px; padding: 2px 4px; border-radius: 4px; }
.rx-x:hover { color: #fecdd3; background: rgba(244,63,94,.12); }

.rx-add { position: relative; }
.rx-add-input { width: 100%; box-sizing: border-box; padding: 10px 12px; background: rgba(5,8,14,.7);
  border: 1px solid var(--rx-line); border-radius: 8px; color: var(--rx-ink); font-size: 13px;
  font-family: "Heebo","Assistant",sans-serif; }
.rx-add-input::placeholder { color: var(--rx-ink-3); }
.rx-add-input:focus { outline: none; border-color: var(--rx-line-cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.1); }
.rx-add-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 230px; overflow-y: auto;
  background: var(--rx-panel); border: 1px solid var(--rx-line-cyan); border-radius: 8px; box-shadow: 0 18px 46px rgba(0,0,0,.6); }
.rx-add-opt { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--rx-ink); }
.rx-add-opt:hover, .rx-add-opt.active { background: rgba(34,211,238,.12); }
.rx-add-opt .rx-hold-meta { margin-inline-start: auto; }

/* ---------------- dimension bars ---------------- */
.rx-dims { display: flex; flex-direction: column; gap: 9px; }
.rx-dim { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; }
.rx-dim-ic { font-family: "JetBrains Mono", monospace; font-size: 13px; text-align: center; }
.rx-dim-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rx-dim-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rx-dim-name { font-family: "Heebo","Assistant",sans-serif; font-weight: 600; font-size: 12.5px; color: var(--rx-ink); }
.rx-dim-sub { font-size: 10.5px; color: var(--rx-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.rx-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.rx-dim-val { font-family: "JetBrains Mono", monospace; font-size: 12.5px; font-weight: 600; min-width: 26px; text-align: end; }

/* ---------------- alerts ---------------- */
.rx-alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid; align-items: flex-start;
  animation: rx-rise .3s ease both; }
.rx-alert.info   { background: rgba(34,211,238,.07);  border-color: rgba(34,211,238,.28); }
.rx-alert.warn   { background: rgba(251,191,36,.08);  border-color: rgba(251,191,36,.34); }
.rx-alert.danger { background: rgba(244,63,94,.09);   border-color: rgba(244,63,94,.4); }
.rx-alert-ic { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.rx-alert.info .rx-alert-ic { color: var(--rx-cyan-soft); }
.rx-alert.warn .rx-alert-ic { color: #fcd34d; }
.rx-alert.danger .rx-alert-ic { color: #fb7185; }
.rx-alert-t { font-family: "Heebo","Assistant",sans-serif; font-weight: 700; font-size: 12.5px; color: #f5f8fc; margin: 0 0 2px; }
.rx-alert-x { font-size: 12px; line-height: 1.45; color: var(--rx-ink-2); margin: 0; }

/* ---------------- recommendations ---------------- */
.rx-rec { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rx-line); }
.rx-rec:last-child { border-bottom: 0; }
.rx-rec-ic { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 700; }
.rx-rec-x { font-size: 12.5px; line-height: 1.5; color: var(--rx-ink); }

/* ---------------- AI briefing ---------------- */
.rx-ai-btn { display: inline-flex; align-items: center; gap: 9px; width: 100%; justify-content: center;
  padding: 11px 14px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(180deg, rgba(34,211,238,.18), rgba(34,211,238,.08));
  border: 1px solid var(--rx-line-cyan); color: #cefcff;
  font-family: "Heebo","Assistant",sans-serif; font-weight: 700; font-size: 13px; transition: filter .15s, box-shadow .15s; }
.rx-ai-btn:hover { filter: brightness(1.1); box-shadow: 0 0 22px rgba(34,211,238,.22); }
.rx-ai-btn[disabled] { opacity: .6; cursor: progress; }
.rx-ai-out { font-family: "Assistant","Heebo",sans-serif; font-size: 13.5px; line-height: 1.62; color: #dbe6f1; white-space: pre-wrap;
  padding: 13px 15px; border-radius: 8px; background: rgba(34,211,238,.05); border: 1px solid rgba(34,211,238,.18);
  border-inline-start: 3px solid var(--rx-cyan); animation: rx-rise .3s ease both; }
.rx-ai-sig { margin-top: 8px; font-family: "JetBrains Mono", monospace; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--rx-ink-3); }
.rx-spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--rx-cyan); border-radius: 50%; animation: rx-spin .7s linear infinite; }
@keyframes rx-spin { to { transform: rotate(360deg); } }

.rx-empty { text-align: center; color: var(--rx-ink-3); font-size: 13px; padding: 26px 14px; line-height: 1.6; }

/* headline stat + dashboard gateway */
.rx-headline { display: flex; align-items: baseline; gap: 11px; padding: 12px 14px; border-radius: 10px; border: 1px solid; animation: rx-rise .3s ease both; }
.rx-headline-num { font-family: "JetBrains Mono", monospace; font-size: 34px; font-weight: 600; line-height: .9; }
.rx-headline-lb { font-size: 12px; color: var(--rx-ink-2); line-height: 1.4; }
.rx-dash-cta { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--rx-line);
  color: var(--rx-ink); font-family: "Heebo","Assistant",sans-serif; font-weight: 700; font-size: 12.5px; transition: border-color .15s, background .15s, color .15s; }
.rx-dash-cta:hover { border-color: var(--rx-line-cyan); background: rgba(34,211,238,.08); color: #cefcff; }
.rx-back { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--rx-line); color: var(--rx-ink-2);
  font-family: "Heebo","Assistant",sans-serif; font-weight: 600; font-size: 12.5px; transition: border-color .15s, background .15s, color .15s; }
.rx-back:hover { border-color: var(--rx-line-cyan); background: rgba(34,211,238,.08); color: #cefcff; }
html[dir="rtl"] .rx-back svg { transform: scaleX(-1); }
.rx-export { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(180deg, rgba(34,211,238,.2), rgba(34,211,238,.1)); border: 1px solid var(--rx-line-cyan); color: #cefcff;
  font-family: "Heebo","Assistant",sans-serif; font-weight: 700; font-size: 12.5px; white-space: nowrap; transition: filter .15s, box-shadow .15s; }
.rx-export:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(34,211,238,.25); }
.rx-clear { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; cursor: pointer;
  background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.32); color: #fda4af;
  font-family: "Heebo","Assistant",sans-serif; font-weight: 600; font-size: 11.5px; transition: background .15s, border-color .15s, color .15s; }
.rx-clear:hover { background: rgba(244,63,94,.18); border-color: rgba(244,63,94,.5); color: #fecdd3; }

/* section label */
.rx-sect { display: flex; align-items: center; gap: 9px; margin: 2px 0 2px; }
.rx-sect-line { flex: 1; height: 1px; background: var(--rx-line); }

/* =====================================================================
   VARIATION 1 — SIDE DRAWER
   ===================================================================== */
.rx-side { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 392px; max-width: 92vw; z-index: 61;
  background: var(--rx-panel); border-inline-start: 1px solid var(--rx-line-cyan);
  box-shadow: -24px 0 70px rgba(0,0,0,.55); display: flex; flex-direction: column;
  animation: rx-slide-in .32s cubic-bezier(.2,.7,.2,1) both; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
@keyframes rx-slide-in { from { transform: translateX(var(--rx-slide, 100%)); } to { transform: none; } }
html[dir="rtl"] .rx-side { --rx-slide: -100%; }
.rx-side-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--rx-line); display: flex; flex-direction: column; gap: 12px; }
.rx-side-titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rx-side-title .rx-h1 { font-size: 19px; }
.rx-side-body { flex: 1; overflow-y: auto; padding: 14px 18px 26px; display: flex; flex-direction: column; gap: 18px; }
.rx-side-body::-webkit-scrollbar { width: 8px; }
.rx-side-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* =====================================================================
   VARIATION 2 — FULL DASHBOARD
   ===================================================================== */
.rx-dash { position: fixed; inset: 0; z-index: 61; display: flex; flex-direction: column;
  background: linear-gradient(160deg, #080c14 0%, #05070d 100%); animation: rx-fade .25s ease both; }
.rx-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 26px; border-bottom: 1px solid var(--rx-line); flex-wrap: wrap; }
.rx-dash-head .rx-h1 { font-size: 23px; }
.rx-dash-grid { flex: 1; overflow: hidden; display: grid; grid-template-columns: 340px 1fr 340px; gap: 0; min-height: 0; }
.rx-dash-col { overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.rx-dash-col + .rx-dash-col { border-inline-start: 1px solid var(--rx-line); }
.rx-dash-col::-webkit-scrollbar { width: 8px; }
.rx-dash-col::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* risk matrix */
.rx-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.rx-matrix th { font-family: "JetBrains Mono", monospace; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rx-ink-3); font-weight: 500; padding: 8px 6px; text-align: center; position: sticky; top: 0;
  background: #080c14; z-index: 2; white-space: nowrap; }
.rx-matrix th.rx-mx-country { text-align: start; }
.rx-matrix td { padding: 5px 6px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.05); }
.rx-mx-country { text-align: start; white-space: nowrap; }
.rx-mx-cname { display: inline-flex; align-items: center; gap: 8px; font-family: "Heebo","Assistant",sans-serif; font-weight: 600; font-size: 13px; color: var(--rx-ink); }
.rx-mx-w { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--rx-ink-3); }
.rx-cell { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 26px; border-radius: 5px;
  font-family: "JetBrains Mono", monospace; font-size: 11.5px; font-weight: 600; color: #04121a; }
.rx-cell.na { background: rgba(255,255,255,.05) !important; color: var(--rx-ink-3); }
.rx-mx-overall { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 14px; }
.rx-matrix tr-hover { background: rgba(255,255,255,.02); }
.rx-matrix tbody tr:hover td { background: rgba(34,211,238,.04); }

.rx-legend-tiers { display: flex; flex-wrap: wrap; gap: 12px; }
.rx-legend-tier { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--rx-ink-2); }
.rx-legend-sw { width: 12px; height: 12px; border-radius: 3px; }

/* =====================================================================
   VARIATION 3 — GLOBE OVERLAY CARD
   ===================================================================== */
.rx-globe-card { position: fixed; left: 76px; bottom: 112px; z-index: 40; width: 330px; max-width: calc(100vw - 100px);
  background: var(--rx-panel); border: 1px solid var(--rx-line-cyan); border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 0 50px rgba(34,211,238,.06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow: hidden;
  animation: rx-rise .32s cubic-bezier(.2,.7,.2,1) both; }
.rx-globe-head { padding: 13px 15px; border-bottom: 1px solid var(--rx-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rx-globe-body { padding: 13px 15px; display: flex; flex-direction: column; gap: 14px; max-height: min(64vh, 540px); overflow-y: auto; }
.rx-globe-body::-webkit-scrollbar { width: 7px; }
.rx-globe-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.rx-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--rx-line); cursor: pointer; font-size: 12px; color: var(--rx-ink);
  font-family: "Heebo","Assistant",sans-serif; transition: border-color .15s; }
.rx-chip:hover { border-color: var(--rx-line-cyan); }
.rx-chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.rx-chip-score { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--rx-ink-3); }

/* mini heat strip used in side + globe variations */
.rx-heatstrip { display: flex; height: 10px; border-radius: 5px; overflow: hidden; border: 1px solid var(--rx-line); }
.rx-heatseg { height: 100%; }

@media (max-width: 1080px) { .rx-dash-grid { grid-template-columns: 300px 1fr; } .rx-dash-col.rx-dash-right { display: none; } }
@media (max-width: 720px) {
  .rx-dash-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rx-dash-col.rx-dash-left { max-height: 40vh; }
  .rx-side { width: 100vw; }
}
