/* ===== LMS tokens (inlined from shared/styles/lms-preview.css) ===== */
:root {
  --lms-fg-default: #1c2024;
  --lms-fg-muted:   #60646c;
  --lms-bg-page:    #f5f6f8;
  --lms-bg-card:    #ffffff;
  --lms-bg-subtle:  #f9f9fb;
  --lms-border:        #e8e8ec;
  --lms-border-subtle: #f0f0f3;
  --lms-brand:        #003e75;
  --lms-brand-hover:  #005a9e;
  --lms-accent:       #d21437;
  --lms-error-solid:   #e5484d;
  --lms-error-text:    #ce2c31;
  --lms-success-solid: #30a46c;
  --lms-success-text:  #218358;
  --lms-warning-solid: #a16207;
  --lms-warning-text:  #854d0e;
  --lms-font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system,
                   BlinkMacSystemFont, "Segoe UI", sans-serif;
  --lms-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular,
                   "SF Mono", Menlo, Consolas, monospace;
  --lms-space-1:  4px; --lms-space-2:  8px; --lms-space-3: 12px;
  --lms-space-4: 16px; --lms-space-5: 20px; --lms-space-6: 24px;
  --lms-space-8: 32px; --lms-space-12: 48px;
  --lms-radius: 8px;
  --lms-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ===== Page canvas + base ===== */
html, body {
  margin: 0; padding: 0;
  background: var(--lms-bg-page);
  color: var(--lms-fg-default);
  font-family: var(--lms-font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
code, pre, kbd, samp { font-family: var(--lms-font-mono); }

/* ===== Slide chrome ===== */
.lms-slide {
  max-width: 720px;
  margin: 32px auto;
  padding: 32px;
  background: var(--lms-bg-card);
  border: 1px solid var(--lms-border);
  border-radius: var(--lms-radius);
  box-shadow: var(--lms-shadow);
}
.lms-slide--wide { max-width: 1100px; }

.lms-slide h2 {
  font-size: 24px; font-weight: 600; line-height: 2rem;
  margin: 0 0 16px; color: var(--lms-fg-default);
}
.lms-slide h3 {
  font-size: 20px; font-weight: 600; line-height: 1.875rem;
  margin: 0 0 12px; color: var(--lms-fg-default);
}
.lms-slide p {
  font-size: 16px; line-height: 1.5rem;
  margin: 0 0 24px; color: var(--lms-fg-default);
}

/* ===== Interaction layout ===== */
.wrap {
  width: 100%;
}

.scene-card {
  background: var(--lms-bg-subtle);
  border: 1px solid var(--lms-border);
  border-radius: var(--lms-radius);
  padding: var(--lms-space-2);
  min-width: 0;
  position: relative;
  aspect-ratio: 997 / 808;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
svg.scene {
  width: 100%; height: 100%;
  display: block;
  border-radius: 6px;
  background: var(--lms-bg-card);
}
.coord-readout {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(28, 32, 36, 0.78);
  color: #ffffff;
  font-family: var(--lms-font-mono);
  font-size: 12px; font-weight: 500;
  padding: 4px 8px; border-radius: 4px;
  pointer-events: none; z-index: 10;
  letter-spacing: 0.3px;
}

/* ===== Pins + hotspots on the SVG ===== */
.hot { cursor: pointer; }
.pin { cursor: pointer; transition: opacity .15s; }
.pin circle.bg { fill: var(--lms-bg-card); stroke: var(--lms-brand); stroke-width: 3; }
.pin.explored circle.bg { fill: var(--lms-brand); stroke: var(--lms-bg-card); stroke-width: 3; }
.pin.active circle.bg { fill: var(--lms-brand-hover); stroke: var(--lms-bg-card); stroke-width: 3; }
.pin text { font-family: var(--lms-font-body); font-weight: 600; font-size: 12px; fill: var(--lms-brand); }
.pin.explored text, .pin.active text { fill: var(--lms-bg-card); }
.pin.pulse circle.bg { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { stroke-width: 3; } 50% { stroke-width: 5; } }

/* ===== On-diagram popup ===== */
.popup {
  position: absolute;
  z-index: 20;
  width: 290px;
  max-width: calc(100% - 16px);
  background: var(--lms-bg-card);
  border: 1px solid var(--lms-border);
  border-top: 4px solid var(--lms-brand);
  border-radius: var(--lms-radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  padding: 14px 16px 16px;
  overflow: hidden;
  /* animate in/out */
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  transform-origin: top left;
  transition: opacity .28s ease, transform .28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.popup.popup--show { opacity: 1; transform: translateY(0) scale(1); }
.popup[hidden] { display: none; }
.popup-close {
  position: absolute; top: 6px; right: 8px;
  border: none; background: none;
  font-size: 22px; line-height: 1;
  color: var(--lms-fg-muted);
  cursor: pointer; padding: 2px 6px;
}
.popup-close:hover { color: var(--lms-fg-default); }
.popup-head { display: flex; align-items: center; gap: 8px; margin: 0 18px 8px 0; }
.popup-num {
  flex: none;
  width: 24px; height: 24px; line-height: 24px;
  border-radius: 50%;
  background: var(--lms-brand);
  color: var(--lms-bg-card);
  font-size: 13px; font-weight: 600;
  text-align: center;
}
.popup-title { font-size: 15px; font-weight: 600; color: var(--lms-fg-default); }
.popup-exp { font-size: 13px; line-height: 1.45; color: var(--lms-fg-muted); }

/* ===== Progress row (below diagram) ===== */
.progress-row {
  display: flex;
  align-items: center;
  gap: var(--lms-space-4);
  margin-bottom: var(--lms-space-4);
}
.scorebar {
  flex: 1;
  height: 6px;
  background: var(--lms-bg-subtle);
  border: 1px solid var(--lms-border-subtle);
  border-radius: 3px;
  overflow: hidden;
}
.scorefill { height: 100%; width: 0%; background: var(--lms-brand); transition: width .3s; }
.scoretext { flex: none; font-size: 13px; font-weight: 600; color: var(--lms-fg-default); }

.done-msg {
  display: none;
  background: var(--lms-brand);
  color: var(--lms-bg-card);
  border-radius: var(--lms-radius);
  padding: 12px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
}
.done-msg b { color: #f5d97a; }

.btn {
  border: 1px solid var(--lms-border);
  background: var(--lms-bg-card);
  color: var(--lms-fg-default);
  border-radius: var(--lms-radius);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  flex: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--lms-bg-subtle); border-color: var(--lms-fg-muted); }
