/* GlobalVet Soft Tissue Surgery Academy — surgical tools stylesheet (original).
   Inherits the established academy system: dark panels, cream text, copper actions, Fraunces
   headings and Source Sans 3 body. Scoped to .gst-* so the main port keeps full ownership of its
   own pages. Layout is mobile-first: every input is full-width with a 16px base size (no iOS
   zoom), option text is written short enough for a 390 px viewport, and the grid goes two-column
   only from 640 px. Body units are never text-transformed. Print rules show ONLY the active tool
   (the mount tags its root with .gst-tool-active) and the checklist prints black on white. */

/* ── base ─────────────────────────────────────────────────────────────── */
.gst-tool {
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 14px 40px;
  color: #F3EEDD;
  background: transparent;
  font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.gst-tool *,
.gst-tool *::before,
.gst-tool *::after { box-sizing: border-box; }

.gst-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #F3EEDD;
}
.gst-lede {
  color: #8A94A0;
  margin: 0 0 16px;
  font-size: 0.95rem;
}

/* ── form ─────────────────────────────────────────────────────────────── */
.gst-form { margin-bottom: 14px; }
.gst-grid { display: grid; grid-template-columns: 1fr; gap: 10px 14px; }
@media (min-width: 640px) {
  .gst-grid { grid-template-columns: 1fr 1fr; }
}

.gst-field {
  display: block;
  margin: 0 0 10px;
}
.gst-field > span {
  display: block;
  font-size: 0.82rem;
  color: #8A94A0;
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}
.gst-field input[type="text"],
.gst-field input[type="number"],
.gst-field input[type="time"],
.gst-field input[type="datetime-local"],
.gst-field select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;             /* 16px prevents iOS zoom; units keep their case */
  font-family: inherit;
  color: #F3EEDD;
  background: #0E1620;
  border: 1px solid #2A3947;
  border-radius: 6px;
}
.gst-field input:focus,
.gst-field select:focus {
  outline: 2px solid #C4A574;
  outline-offset: 1px;
  border-color: #C4A574;
}
.gst-field select option {
  background: #0E1620;
  color: #F3EEDD;
}

.gst-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.92rem;
}
.gst-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #C4A574;
}

/* ── output ───────────────────────────────────────────────────────────── */
.gst-output { margin-top: 4px; }
.gst-card {
  background: #0E1620;
  border: 1px solid #2A3947;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.gst-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: #C4A574;
  font-weight: 600;
}
.gst-card p { margin: 0 0 8px; }
.gst-card p:last-child { margin-bottom: 0; }
.gst-card ul, .gst-card ol { margin: 4px 0 4px 20px; padding: 0; }
.gst-card li { margin: 0 0 6px; }
.gst-why { color: #8A94A0; font-size: 0.88rem; }

.gst-callout {
  border-left: 4px solid #C4A574;
  background: rgba(196, 165, 116, 0.08);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.92rem;
}
.gst-callout.warn { border-left-color: #F2B84B; background: rgba(242, 184, 75, 0.08); }
.gst-callout.bad  { border-left-color: #F26D6D; background: rgba(242, 109, 109, 0.08); }
.gst-callout.ok   { border-left-color: #4CC38A; background: rgba(76, 195, 138, 0.08); }
.gst-callout p { margin: 0 0 6px; }
.gst-callout p:last-child { margin-bottom: 0; }

.gst-alarms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
}
.gst-alarms li {
  background: #16222E;
  border: 1px solid #2A3947;
  color: #5FD3F3;
  border-radius: 6px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}

.gst-src {
  color: #8A94A0;
  font-size: 0.8rem;
  margin: 10px 0 0;
}
.gst-src ul { margin: 4px 0 0 18px; padding: 0; }
.gst-src li { margin: 0 0 4px; }
.gst-footer { border-top: 1px solid #2A3947; padding-top: 8px; margin-top: 14px; }
.gst-region { color: #F2B84B; }

/* ── actions ──────────────────────────────────────────────────────────── */
.gst-actions { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.gst-btn {
  display: inline-block;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #0E1620;
  background: #C4A574;
  border: 1px solid #C4A574;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.gst-btn:hover, .gst-btn:focus { background: #D4B98A; border-color: #D4B98A; }

/* ── checklist ────────────────────────────────────────────────────────── */
.gst-chk-set {
  border: 1px solid #2A3947;
  border-radius: 8px;
  padding: 10px 12px 6px;
  margin: 0 0 12px;
}
.gst-chk-set legend {
  font-family: "Fraunces", Georgia, serif;
  color: #C4A574;
  font-size: 0.95rem;
  padding: 0 6px;
}
.gst-checklist.gst-print-sheet h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  margin: 0 0 10px;
}
.gst-chk-meta { border: 1px solid #2A3947; border-radius: 8px; margin: 0 0 12px; overflow: hidden; }
.gst-chk-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  border-bottom: 1px solid #2A3947;
}
.gst-chk-row:last-child { border-bottom: 0; }
.gst-chk-lbl {
  background: #101A26;
  color: #8A94A0;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.gst-chk-val { padding: 6px 10px; font-size: 0.92rem; overflow-wrap: anywhere; }
.gst-chk-phase { margin: 0 0 12px; }
.gst-chk-phase h3 { font-size: 0.95rem; color: #C4A574; margin: 0 0 6px; font-family: "Fraunces", Georgia, serif; }
.gst-chk-item { padding: 4px 2px; border-bottom: 1px dashed #2A3947; font-size: 0.92rem; }
.gst-chk-item:last-child { border-bottom: 0; }
.gst-chk-note { color: #8A94A0; font-size: 0.8rem; margin: 8px 0 0; }

/* ── charts (SVG) ─────────────────────────────────────────────────────── */
.gst-output svg {
  display: block;
  width: 100%;
  height: auto;
  background: #0E1620;
  border: 1px solid #2A3947;
  border-radius: 8px;
  margin: 0 0 12px;
}
.gst-entries { list-style: none; margin: 0; padding: 0; }
.gst-entries li {
  padding: 5px 0;
  border-bottom: 1px dashed #2A3947;
  font-size: 0.88rem;
}

/* ── print: ONLY the active tool, nav hidden ──────────────────────────── */
@media print {
  body * { visibility: hidden; }
  .gst-tool-active, .gst-tool-active * { visibility: visible; }
  .gst-tool-active {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #101820;
  }
  .gst-tool-active .gst-title { color: #101820; }
  .gst-tool-active[data-testid="tool-checklist"] > .gst-title,
  .gst-tool-active .gst-chk-set,
  .gst-tool-active [data-testid="chk-output"] > .gst-callout { display: none; }
  .gst-tool-active[data-testid="tool-checklist"] { font-size: 12px; line-height: 1.35; }
  .gst-tool-active .gst-checklist .gst-chk-item { padding: 4px 0; }
  .gst-tool-active .gst-checklist .gst-chk-phase h3 { margin: 12px 0 5px; }
  .gst-tool-active .gst-checklist .gst-chk-row { padding: 2px 0; }

  .gst-tool-active .gst-lede,
  .gst-tool-active .gst-form,
  .gst-tool-active .gst-actions,
  .gst-tool-active .gst-src,
  .gst-tool-active .gst-callout.warn[data-testid="chk-privacy"] { display: none; }
  .gst-tool-active .gst-card {
    background: #ffffff;
    border-color: #9aa4ae;
    color: #101820;
  }
  .gst-tool-active .gst-card h3 { color: #101820; }
  .gst-tool-active .gst-chk-meta,
  .gst-tool-active .gst-chk-set { border-color: #9aa4ae; }
  .gst-tool-active .gst-chk-row { border-color: #9aa4ae; }
  .gst-tool-active .gst-chk-lbl { background: #f0f2f4; color: #101820; }
  .gst-tool-active .gst-chk-item { border-color: #9aa4ae; color: #101820; }
  .gst-tool-active .gst-chk-note { color: #101820; }
  .gst-tool-active .gst-checklist.gst-print-sheet h2 { font-size: 1.4rem; }
  .gst-tool-active .gst-chk-phase h3 { color: #101820; }
  .gst-tool-active .gst-output svg { border-color: #9aa4ae; }
  @page { margin: 14mm; }
}

/* ── motion ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gst-tool *, .gst-tool *::before, .gst-tool *::after {
    transition: none !important;
    animation: none !important;
  }
}
