/* SpecEnvoy Edu — Understanding Cancer — tool styles.
   Scoped to .cx-* / #cx* so it never touches site chrome. Dark-theme native. */

.cx-intro { max-width: 60ch; margin: .2rem auto 1rem; color: var(--muted, #9fb0d0); text-align: center; line-height: 1.55; }

/* ---- full-bleed stage ---------------------------------------------------- */
#cxStage {
  position: relative; width: 100%; height: min(78vh, 780px);
  background: radial-gradient(120% 90% at 50% 15%, #141c33 0%, #0a0e1c 70%);
  overflow: hidden; touch-action: pan-y; user-select: none;
  border-top: 1px solid rgba(120,150,220,.14); border-bottom: 1px solid rgba(120,150,220,.14);
}
#cx3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#cx3d:active { cursor: grabbing; }

/* loading pill */
.cx-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6;
  padding: .5rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: #eaf0ff;
  background: rgba(12,16,30,.72); backdrop-filter: blur(6px); box-shadow: 0 4px 18px rgba(0,0,0,.35);
  pointer-events: none; letter-spacing: .01em; transition: opacity .4s ease;
}
.cx-loading.gone { opacity: 0; }

/* ---- cancer list (left) -------------------------------------------------- */
.cx-list {
  position: absolute; left: 12px; top: 12px; z-index: 5; width: 232px; max-height: calc(100% - 24px);
  overflow-y: auto; padding: .55rem; border-radius: 14px;
  background: rgba(12,17,32,.7); backdrop-filter: blur(9px);
  border: 1px solid rgba(120,150,220,.18); box-shadow: 0 8px 30px rgba(0,0,0,.35);
  -webkit-overflow-scrolling: touch;
}
.cx-reg { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #7f93bd;
  margin: .5rem .35rem .25rem; font-weight: 700; }
.cx-reg:first-child { margin-top: .2rem; }
.cx-item {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  padding: .42rem .55rem; margin: 1px 0; border-radius: 8px; font-size: .9rem; line-height: 1.25;
  color: #dbe4f7; background: transparent; transition: background .15s, color .15s;
}
.cx-item:hover { background: rgba(120,150,220,.14); }
.cx-item.on { background: linear-gradient(90deg, rgba(255,111,122,.24), rgba(120,150,220,.14)); color: #fff; font-weight: 600; }

/* ---- content panel (right) ---------------------------------------------- */
.cx-panel {
  position: absolute; right: 0; top: 0; z-index: 7; width: min(400px, 92%); height: 100%;
  overflow-y: auto; padding: 1.15rem 1.25rem 1.5rem; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(13,18,34,.94), rgba(10,14,26,.97));
  backdrop-filter: blur(10px); border-left: 1px solid rgba(120,150,220,.2);
  transform: translateX(102%); transition: transform .34s cubic-bezier(.4,0,.2,1);
  -webkit-overflow-scrolling: touch;
}
#cxStage.panel-open .cx-panel { transform: translateX(0); }
.cx-close { position: absolute; right: .7rem; top: .7rem; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(150,170,220,.28); background: rgba(20,26,44,.8); color: #cdd8f2; cursor: pointer;
  font-size: .9rem; line-height: 1; }
.cx-close:hover { background: rgba(40,48,76,.9); color: #fff; }
.cx-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #ff8f97; font-weight: 700; margin-bottom: .2rem; }
.cx-title { font-size: 1.5rem; margin: 0 0 .7rem; color: #fff; line-height: 1.15; padding-right: 2rem; }
.cx-systemic { font-size: .85rem; color: #ffd7b0; background: rgba(255,150,90,.1); border: 1px solid rgba(255,150,90,.24);
  border-radius: 9px; padding: .5rem .65rem; margin-bottom: .8rem; line-height: 1.45; }
.cx-sec { margin: 0 0 .9rem; }
.cx-sec h4 { margin: 0 0 .2rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: #8ea3cf; font-weight: 700; }
.cx-sec p { margin: 0; font-size: .95rem; line-height: 1.6; color: #d8e1f5; }
.cx-support { background: rgba(120,150,220,.09); border: 1px solid rgba(120,150,220,.2); border-radius: 10px; padding: .7rem .8rem; }
.cx-support h4 { color: #b8c6ec; }
.cx-support p { color: #eaf0ff; }
.cx-disc { margin-top: 1rem; padding-top: .7rem; border-top: 1px solid rgba(120,150,220,.16);
  font-size: .78rem; line-height: 1.5; color: #8493b5; }

/* ---- controls + legend --------------------------------------------------- */
.cx-controls {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5;
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: center;
  padding: .4rem .6rem; border-radius: 999px; background: rgba(12,17,32,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(120,150,220,.18); max-width: calc(100% - 24px); box-sizing: border-box;
}
.cx-controls label { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: #b8c6ec; }
.cx-controls input[type=range] { width: 84px; min-width: 0; accent-color: #ff6f7a; }
.cx-controls button { border: 1px solid rgba(150,170,220,.28); background: rgba(20,26,44,.7); color: #cdd8f2;
  border-radius: 999px; padding: .3rem .7rem; font-size: .78rem; cursor: pointer; }
.cx-controls button:hover { background: rgba(40,48,76,.9); color: #fff; }
.cx-controls button.on { background: rgba(255,111,122,.24); border-color: rgba(255,111,122,.5); color: #fff; }

.cx-menu { position: absolute; left: 12px; top: 12px; z-index: 8; display: none;
  border: 1px solid rgba(150,170,220,.28); background: rgba(12,17,32,.82); color: #eaf0ff;
  border-radius: 999px; padding: .4rem .8rem; font-size: .85rem; font-weight: 600; cursor: pointer; }

.cx-legend { position: absolute; right: 12px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: .4rem;
  font-size: .76rem; color: #ffd0d4; background: rgba(12,17,32,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,111,122,.3); border-radius: 999px; padding: .3rem .65rem; }
.cx-legend .dot { width: 11px; height: 11px; border-radius: 50%; background: #ff6f7a; box-shadow: 0 0 8px #ff6f7a; }

/* ---- no-WebGL fallback --------------------------------------------------- */
#cxStage.no3d { height: auto; min-height: 0; padding: 1rem 0; }
#cxStage.no3d #cx3d { display: none; }
#cxStage.no3d .cx-list { position: static; width: auto; max-height: none; margin: 0 auto 1rem; max-width: 640px; }
#cxStage.no3d .cx-panel { position: static; width: auto; height: auto; transform: none; max-width: 640px; margin: 0 auto;
  border-left: 0; border: 1px solid rgba(120,150,220,.2); border-radius: 14px; }
#cxStage.no3d .cx-controls, #cxStage.no3d .cx-legend, #cxStage.no3d .cx-menu { display: none; }
.cx-fallnote { max-width: 640px; margin: 0 auto 1rem; text-align: center; color: #9fb0d0; font-size: .9rem; }

/* ================= responsive: phone / small tablet ====================== */
@media (max-width: 900px) {
  #cxStage { height: min(72vh, 640px); }
  .cx-menu { display: inline-block; }
  .cx-list { transform: translateX(-112%); transition: transform .3s ease; top: 56px; }
  #cxStage.list-open .cx-list { transform: translateX(0); }
  .cx-panel { width: 100%; height: 66%; top: auto; bottom: 0; transform: translateY(102%);
    border-left: 0; border-top: 1px solid rgba(120,150,220,.2); border-radius: 16px 16px 0 0; }
  #cxStage.panel-open .cx-panel { transform: translateY(0); }
  .cx-controls { bottom: 8px; gap: .35rem; padding: .35rem .5rem; }
  .cx-controls label { font-size: .72rem; }
}
@media (max-width: 480px) {
  .cx-controls .cx-fade-wrap { display: none; }   /* keep the bar from wrapping on tiny screens */
  .cx-title { font-size: 1.3rem; }
}
