/* ============================================================
   Risk Module — styles specific to the toxicological calculator
   Semantic accent variables (not in general.css)
   ============================================================ */
:root {
  --safe: oklch(0.60 0.11 152);
  --safe-bg: oklch(0.95 0.03 152);
  --caution: oklch(0.66 0.12 70);
  --caution-bg: oklch(0.95 0.035 75);
  --neutral: #8C8B8A;
  --neutral-bg: #EFEEED;
}

/* ---------- module wrapper ---------- */
.risk-module { margin-top: 44px; }

/* ---------- form grid ---------- */
.rx-form {
  background: var(--orange-light);
  border-radius: 14px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 44px;
  margin-top: 18px;
}
.rx-field { margin-bottom: 14px; }
.rx-flab {
  display: block;
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--orange-dark);
  margin-bottom: 8px;
}
.rx-input, .rx-ro {
  width: 100%;
  background: #fff;
  border: 1.5px solid #f0ddd6;
  border-radius: 10px;
  padding: 11px 13px;
  font-family: 'Public Sans', sans-serif;
  font-size: 14px;
  color: var(--grey-dark);
}
.rx-input:focus { outline: none; border-color: var(--orange-main); }
.rx-ro {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  min-height: 44px;
}
.rx-ro.over { color: var(--orange-dark); }
.rx-selw { position: relative; }
select.rx-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
}
.rx-selw .xp-caret {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange-dark);
  pointer-events: none;
}
.rx-meta {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--grey-dark);
  margin: 11px 0;
}
.rx-meta b { font-weight: 700; }
.rx-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--grey-dark);
  cursor: pointer;
}
.rx-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange-main);
  cursor: pointer;
}
.rx-sed {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--grey-dark);
  margin-top: 8px;
}
.rx-sed b { font-weight: 700; }

/* ---------- summary band ---------- */
.rx-band {
  background: var(--orange-light);
  border-radius: 14px;
  padding: 18px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 14px;
  align-items: baseline;
}
.rx-band .l {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--grey-dark);
}
.rx-band .vv {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--grey-dark);
  margin-left: 4px;
}

/* ---------- conclusion ---------- */
.rx-concl {
  font-size: 13.5px;
  color: var(--grey-medium);
  line-height: 1.6;
  margin-top: 18px;
  background: var(--grey-light);
  border-radius: 12px;
  padding: 16px 20px;
}
.rx-concl b { color: var(--grey-dark); font-weight: 700; }

/* ---------- log scale (xp2) ---------- */
.xp2-frame { margin-top: 8px; }
.xp2-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 30px;
}
.xp2-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--grey-medium);
}
.xp2-leg .swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  flex-shrink: 0;
}

.xp2-axis-wrap { padding: 64px 8px 8px; position: relative; }
.xp2-track {
  position: relative;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--safe-bg) 0%, var(--safe-bg) 40%, var(--caution-bg) 64%, var(--orange-light) 100%);
}
.xp2-danger-zone {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  border-radius: 0 8px 8px 0;
  background: repeating-linear-gradient(45deg, var(--orange-light), var(--orange-light) 6px, #ffe0d7 6px, #ffe0d7 12px);
  border-left: 2px dashed var(--orange-dark);
}
.xp2-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.xp2-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
}
.xp2-dot.you { border: 5px solid var(--safe); }
.xp2-dot.ifra { border: 4px dashed var(--caution); width: 18px; height: 18px; }
.xp2-flag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 12px);
  white-space: nowrap;
  text-align: center;
}
.xp2-flag::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  width: 1.5px; height: 12px;
  background: currentColor;
  opacity: 0.35;
}
.xp2-flag .lab {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.xp2-flag .val {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--grey-medium);
  margin-top: 1px;
}
.xp2-flag.you { color: var(--safe); }
.xp2-flag.ifra { color: var(--caution); bottom: calc(100% + 34px); }
.xp2-tick {
  position: absolute;
  top: -10px; bottom: -10px;
  width: 2px;
  background: var(--grey-dark);
  z-index: 2;
}
.xp2-tick.thresh { background: var(--caution); }
.xp2-tick.noael { background: var(--orange-dark); }
.xp2-tick-lab {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
  font-size: 10.5px;
}
.xp2-tick-lab .l { font-family: 'Funnel Display', sans-serif; font-weight: 700; }
.xp2-tick.thresh .xp2-tick-lab { color: var(--caution); }
.xp2-tick.noael .xp2-tick-lab { color: var(--orange-dark); }
.xp2-scale {
  display: flex;
  justify-content: space-between;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #a8a4a1;
  margin-top: 16px;
}

/* ---------- readout cards ---------- */
.xp2-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 34px;
}
.xp2-card { border-radius: 12px; padding: 16px 18px; }
.xp2-card.you { background: var(--safe-bg); }
.xp2-card.gap { background: var(--grey-light); border: 1px solid #ece9e7; }
.xp2-card .lab {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-medium);
  margin-bottom: 7px;
}
.xp2-card.you .lab { color: var(--safe); }
.xp2-card .big {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--grey-dark);
}
.xp2-card.you .big { color: var(--safe); }
.xp2-card .note {
  font-size: 12px;
  color: var(--grey-medium);
  margin-top: 6px;
  line-height: 1.5;
}

/* ---------- verdict pill ---------- */
.xp-verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 15px;
  border-radius: 22px;
}
.xp-verdict-pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.xp-v-safe { background: var(--safe-bg); color: var(--safe); }
.xp-v-safe .dot { background: var(--safe); }
.xp-v-caution { background: var(--caution-bg); color: var(--caution); }
.xp-v-caution .dot { background: var(--caution); }
.xp-v-danger { background: var(--orange-light); color: var(--orange-dark); }
.xp-v-danger .dot { background: var(--orange-dark); }

/* ---------- tooltip ---------- */
.term {
  border-bottom: 1.5px dotted var(--orange-main);
  cursor: help;
  position: relative;
}
.term .tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 270px;
  background: var(--grey-dark);
  color: #efece9;
  font-family: 'Public Sans', sans-serif;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  opacity: 0;
  visibility: hidden;
  transition: .18s ease;
  z-index: 30;
  text-align: left;
  pointer-events: none;
}
.term .tip b { color: #fff; font-weight: 600; }
.term .tip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--grey-dark);
}
.term:hover .tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.term .tip .tip-acr {
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700;
  color: var(--orange-main);
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .rx-form, .rx-band { grid-template-columns: 1fr; }
  .xp2-readout { grid-template-columns: 1fr; }
}
