/* Diagram Labels — calm labeling drills for the science courses.
   Slate Emerald: no timers, no gamification. The pin dot scales with the
   image box (percent positioning + relative sizing), so nothing depends
   on hover or a fixed viewport. */

.diagram-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 4px;
}

.diagram-figure {
  margin: 18px 0 6px;
}

.diagram-image-wrap {
  position: relative;
  width: 100%;
  border: 1px solid var(--rycal-slate-200, var(--border-subtle));
  border-radius: 14px;
  overflow: hidden;
  background: var(--rycal-slate-50, #f8fafc);
}

.diagram-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Numbered pin dot. Positioned by percentage of the image box so it
   tracks the structure at any image size; its own size is a fraction of
   the box width with pixel clamps so it stays tappable on phones and
   proportionate on desktop. */
.diagram-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 8%;
  min-width: 30px;
  max-width: 46px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #245C45;
  color: #f4faf6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(14px, 3.2vw, 20px);
  box-shadow: 0 0 0 3px rgba(244, 250, 246, 0.9), 0 2px 8px rgba(15, 40, 28, 0.35);
  pointer-events: none;
}

.diagram-attribution {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--rycal-slate-500, #64748b);
}

.diagram-attribution a {
  color: var(--rycal-slate-500, #64748b);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.diagram-prompt-label {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rycal-slate-500, #64748b);
}

.diagram-prompt {
  margin: 6px 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--rycal-slate-700, #334155);
}

/* When there is no pin, the clue prompt is the whole question — it gets
   the prominent treatment. */
.diagram-clue {
  margin: 6px 0 18px;
  font-size: 21px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--rycal-slate-900, #0f172a);
}

.diagram-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 18px;
  line-height: 1.4;
  padding: 14px 16px;
  border: 1px solid var(--rycal-slate-300, #cbd5e1);
  border-radius: 12px;
  background:var(--bg-surface);
  color: var(--rycal-slate-900, #0f172a);
}

.diagram-input:focus {
  outline: 2px solid #245C45;
  outline-offset: 1px;
  border-color: #245C45;
}

.diagram-input:disabled {
  background: var(--rycal-slate-50, #f8fafc);
  color: var(--rycal-slate-500, #64748b);
}

.diagram-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.diagram-continue {
  margin-top: 14px;
}

.diagram-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rycal-slate-200, var(--border-subtle));
  font-size: 14px;
  line-height: 1.65;
}

.diagram-results {
  text-align: center;
  padding: 34px 12px;
}

.diagram-result-big {
  font-size: 24px;
  font-weight: 800;
  color: var(--rycal-slate-900, #0f172a);
}

.diagram-result-sub {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--rycal-slate-500, #64748b);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.diagram-result-actions {
  justify-content: center;
  margin-top: 22px;
}

.diagram-exit-confirm {
  padding: 30px 12px;
  text-align: center;
}

.diagram-exit-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--rycal-slate-900, #0f172a);
}

.diagram-exit-sub {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--rycal-slate-500, #64748b);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.diagram-exit-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .diagram-clue {
    font-size: 19px;
  }

  .diagram-input {
    font-size: 17px;
    padding: 13px 14px;
  }
}
