/* =====================================================================
   Dose Lab — widget-specific styles
   ===================================================================== */

/* ---------- Notation detector ---------- */
.cl-notation-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 880px) { .cl-notation-wrap { grid-template-columns: 1fr; } }

.cl-notation-input {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--nr-border);
  border-radius: var(--nr-radius);
  padding: 1rem;
  min-height: 180px;
}
.cl-notation-input textarea {
  width: 100%;
  border: 0;
  font-family: var(--nr-font-mono);
  font-size: 1rem;
  line-height: 1.7;
  background: transparent;
  resize: vertical;
  min-height: 140px;
  outline: none;
  color: var(--nr-text);
}
.cl-notation-highlights {
  font-family: var(--nr-font-mono);
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--nr-text);
}
.cl-notation-highlights .cl-flagged {
  background: #FBE8E8;
  color: #7B1F1F;
  padding: 1px 4px;
  border-radius: 4px;
  border-bottom: 2px dotted var(--nr-danger);
  cursor: help;
  font-weight: 700;
}
.cl-notation-highlights .cl-flagged--warn {
  background: #FFF3D6;
  color: #7A4A0F;
  border-bottom-color: var(--nr-warn);
}

.cl-notation-findings {
  margin-top: 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.cl-finding {
  border-left: 3px solid var(--nr-danger);
  background: #FBE8E8;
  padding: 0.7rem 0.9rem;
  border-radius: var(--nr-radius-sm);
  font-size: 0.88rem;
  color: #7B1F1F;
}
.cl-finding strong { color: #5B1414; }
.cl-finding--warn { border-color: var(--nr-warn); background: #FFF6E5; color: #7A4A0F; }
.cl-finding--warn strong { color: #5C3408; }
.cl-finding-fix {
  display: block;
  margin-top: 0.35rem;
  color: var(--nr-text-soft);
  font-size: 0.84rem;
}

.cl-notation-empty {
  color: var(--nr-text-muted);
  font-style: italic;
  text-align: center;
  padding: 2rem 1rem;
}

/* ---------- Decimal slider (kg→g→mg→mcg visualization) ---------- */
.cl-decimal-wrap {
  background: linear-gradient(180deg, #F4FAFD 0%, #fff 100%);
  border: 1px solid var(--nr-border-soft);
  border-radius: var(--nr-radius);
  padding: 1.5rem;
  margin-top: 1.25rem;
}
.cl-decimal-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}
.cl-decimal-stop {
  text-align: center;
  padding: 0.85rem 0.5rem;
  background: #fff;
  border: 2px solid var(--nr-border);
  border-radius: var(--nr-radius);
  cursor: pointer;
  transition: all 0.18s ease;
}
.cl-decimal-stop.is-active {
  border-color: var(--nr-teal);
  background: var(--nr-sky);
  box-shadow: var(--nr-shadow);
}
.cl-decimal-stop .cl-unit-label {
  font-family: var(--nr-font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--nr-navy);
  display: block;
}
.cl-decimal-stop .cl-unit-name {
  font-size: 0.75rem;
  color: var(--nr-text-muted);
  display: block;
  margin-top: 0.15rem;
}
.cl-decimal-value {
  text-align: center;
  font-family: var(--nr-font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--nr-navy);
  letter-spacing: 0.05em;
  margin: 1rem 0;
  position: relative;
  min-height: 3rem;
}
.cl-decimal-value .cl-dec-point {
  display: inline-block;
  color: var(--nr-danger);
  transition: transform 0.45s cubic-bezier(0.34, 1.5, 0.64, 1);
  font-weight: 900;
}
.cl-decimal-callout {
  background: var(--nr-sky);
  border-radius: var(--nr-radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--nr-navy);
  margin-top: 0.5rem;
}
.cl-decimal-warn {
  background: #FBE8E8;
  color: #7B1F1F;
  padding: 0.85rem 1rem;
  border-radius: var(--nr-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ---------- LASA matching game ---------- */
.cl-lasa-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 720px) { .cl-lasa-wrap { grid-template-columns: 1fr; } }

.cl-lasa-column {
  background: var(--nr-bg);
  border: 1px solid var(--nr-border);
  border-radius: var(--nr-radius);
  padding: 1rem;
  min-height: 320px;
}
.cl-lasa-column h4 {
  font-family: var(--nr-font-display);
  font-weight: 700;
  color: var(--nr-navy);
  font-size: 0.95rem;
  margin: 0 0 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.cl-lasa-drug {
  background: #fff;
  border: 1.5px solid var(--nr-border);
  border-radius: var(--nr-radius-sm);
  padding: 0.7rem 0.9rem;
  font-family: var(--nr-font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--nr-navy);
  margin-bottom: 0.5rem;
  cursor: grab;
  transition: all 0.18s ease;
  user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.cl-lasa-drug:hover {
  border-color: var(--nr-teal);
  box-shadow: var(--nr-shadow-sm);
  transform: translateX(2px);
}
.cl-lasa-drug.is-dragging { opacity: 0.4; }
.cl-lasa-drug.is-selected {
  border-color: var(--nr-teal);
  background: var(--nr-sky);
  box-shadow: 0 0 0 3px rgba(45, 156, 156, 0.18);
}
.cl-lasa-drug.is-matched {
  background: #E8F5EE;
  border-color: #B7D9C4;
  color: #0F5132;
  cursor: default;
}
.cl-lasa-drug.is-wrong {
  animation: cl-shake 0.4s ease;
  border-color: var(--nr-danger);
  background: #FBE8E8;
  color: #7B1F1F;
}
@keyframes cl-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.cl-lasa-drug .cl-lasa-cat {
  font-size: 0.72rem;
  color: var(--nr-text-muted);
  font-weight: 500;
  font-family: var(--nr-font-body);
}
.cl-lasa-score {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--nr-sky);
  border-radius: var(--nr-radius-sm);
  font-weight: 600;
}
.cl-lasa-reveal {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid var(--nr-border);
  border-radius: var(--nr-radius);
  padding: 1rem;
  display: none;
}
.cl-lasa-reveal.is-visible { display: block; animation: cl-step-in 0.35s ease forwards; }
.cl-lasa-reveal h5 {
  font-family: var(--nr-font-display);
  font-weight: 700;
  color: var(--nr-navy);
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.cl-lasa-reveal p { margin: 0.3rem 0; font-size: 0.9rem; color: var(--nr-text-soft); }
.cl-lasa-reveal .cl-lasa-risk { color: #7B1F1F; font-weight: 600; }
.cl-lasa-reveal .cl-lasa-case { font-style: italic; color: var(--nr-text-muted); font-size: 0.85rem; }

/* ---------- Reconstitution visualizer ---------- */
.cl-recon-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (max-width: 720px) { .cl-recon-wrap { grid-template-columns: 1fr; } }

.cl-vial-stage {
  background: linear-gradient(180deg, #F4FAFD 0%, #E6F0F4 100%);
  border-radius: var(--nr-radius);
  padding: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
}

.cl-vial-svg { width: 200px; height: 280px; }

.cl-recon-controls .cl-field { margin-bottom: 0.85rem; }

.cl-recon-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--nr-border);
  border-radius: var(--nr-radius);
}
.cl-recon-result-row {
  display: flex; justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--nr-border-soft);
  font-family: var(--nr-font-mono);
  font-size: 0.9rem;
}
.cl-recon-result-row:last-child { border-bottom: 0; }
.cl-recon-result-row .cl-rec-label { color: var(--nr-text-soft); font-family: var(--nr-font-body); }
.cl-recon-result-row .cl-rec-value { font-weight: 700; color: var(--nr-navy); }
.cl-recon-result-row.is-key { background: #FFF6E5; padding: 0.55rem 0.65rem; margin: 0.3rem -0.65rem; border-radius: 6px; }
.cl-recon-result-row.is-key .cl-rec-value { color: #7A4A0F; }
.cl-recon-trap {
  margin-top: 0.85rem;
  background: #FBE8E8;
  color: #7B1F1F;
  padding: 0.85rem;
  border-radius: var(--nr-radius-sm);
  font-size: 0.88rem;
}
.cl-recon-trap strong { display: block; margin-bottom: 0.25rem; }
