/* =====================================================================
   Per-Peptide Reconstitution & Dose Calculator
   Shared styles. Used by every peptide page that includes the .ppc widget.
   Color tokens come from styles.css.
   ===================================================================== */

.ppc {
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.75rem 1.5rem;
  margin: 2rem 0;
}
.ppc h2 { margin-top: 0; margin-bottom: 1rem; }

/* Top warning banner */
.ppc-warn {
  background: #fff7e6;
  border-left: 4px solid var(--orange);
  padding: 0.85rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.55;
}
.ppc-warn strong { color: #8a5a00; }

/* Quick-reference card grid */
.ppc-ref {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.ppc-ref-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.ppc-ref-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.ppc-ref-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.ppc-ref-value .ppc-unit {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}
.ppc-ref-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* Calculator form */
.ppc-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}
.ppc-row + .ppc-row { margin-top: 1.1rem; }
.ppc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.ppc-vials {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ppc-vial {
  flex: 1;
  min-width: 90px;
  max-width: 180px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ppc-vial:hover {
  border-color: var(--blue-accent);
  background: var(--blue-soft);
}
.ppc-vial.selected {
  border-color: var(--blue-accent);
  background: var(--blue-soft);
  color: var(--blue-dark);
  box-shadow: 0 0 0 3px var(--blue-accent-focus);
}

.ppc-row-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.ppc-input-wrap { position: relative; }
.ppc-input-wrap input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--navy);
  background: #fff;
}
.ppc-input-wrap input:focus {
  outline: none;
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px var(--blue-accent-focus);
}
.ppc-suffix {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
}
.ppc-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.45;
}
.ppc-warn-inline {
  margin-top: 0.5rem;
  background: #fff5f5;
  border-left: 3px solid var(--red);
  color: #7a1f28;
  padding: 0.55rem 0.75rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.78rem;
  line-height: 1.5;
}
.ppc-warn-inline strong { color: var(--red); }
.ppc-input-wrap input.over-max {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

/* Output */
.ppc-output {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  background: var(--blue-soft);
  border: 1px solid #c9dded;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.ppc-out-item { text-align: left; }
.ppc-out-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-dark);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.ppc-out-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.ppc-out-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.45;
}

/* ============== Insulin syringe visual ============== */
.ppc-syringe {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem 1rem;
  margin-bottom: 1.25rem;
}
.ppc-syringe-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.ppc-syringe-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.ppc-syringe-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.ppc-syringe-meta strong {
  color: var(--navy);
  font-weight: 600;
}
.ppc-syringe-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 130px;
}

/* SVG sub-element styles */
.syr-needle      { stroke: #888; stroke-width: 1.5; }
.syr-hub         { fill: #777; }
.syr-barrel      { fill: #fff; stroke: var(--gray-300); stroke-width: 1.5; }
.syr-fill        { fill: var(--blue-accent); opacity: 0.45; transition: width 0.15s ease, x 0.15s ease; }
.syr-fill-stripe { fill: var(--blue-accent); opacity: 0.85; transition: x 0.15s ease; }
.syr-plunger     { fill: var(--gray-700); transition: x 0.15s ease; }
.syr-plunger-rod { stroke: var(--gray-500); stroke-width: 2.5; transition: x1 0.15s ease; }
.syr-thumb       { fill: var(--gray-700); }
.syr-tick-major  { stroke: var(--gray-500); stroke-width: 1.2; }
.syr-tick-minor  { stroke: var(--gray-300); stroke-width: 1; }
.syr-tick-label  { fill: var(--text-muted); font-size: 9px; font-family: var(--font-sans); text-anchor: middle; }
.syr-indicator-line { stroke: var(--red); stroke-width: 1.5; transition: x1 0.15s ease, x2 0.15s ease; }
.syr-indicator-text { fill: var(--red); font-size: 11px; font-weight: 700; font-family: var(--font-sans); text-anchor: middle; transition: x 0.15s ease; }

.ppc-syringe-overflow {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #7a1f28;
  background: #fff5f5;
  border-left: 3px solid var(--red);
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}
.ppc-syringe-overflow strong { color: var(--red); }

/* Guidance + disclaimer */
.ppc-guidance {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.ppc-guidance h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--navy);
}
.ppc-guidance p {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.ppc-guidance p:last-child { margin-bottom: 0; }
.ppc-guidance strong { color: var(--green-dark); }

.ppc-disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0.75rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 700px) {
  .ppc { padding: 1.25rem 1rem 1rem; }
  .ppc-ref { grid-template-columns: 1fr 1fr; }
  .ppc-row-inputs { grid-template-columns: 1fr; }
  .ppc-output { grid-template-columns: 1fr; gap: 0.85rem; }
}
