/* The map keeps its physical row pitch even when only two rows are in view. */
.clinic-study {
  --book-paper: #f5f2e7;
  --thread-copper: #efaf80;
  --thread-open: #eed4ae;
  --thread-sage: #a9b9a5;
  --inset: clamp(14px, 2.05vw, 28px);
  min-width: 0;
  overflow: clip;
  border-top: 1px solid #a9b2a2;
  background: var(--book-paper);
}
.clinic-study [hidden] {display: none !important;}
.clinic-question {padding: 20px var(--inset) 14px;}
.clinic-source {
  margin: 0 0 5px;
  color: #75482e;
  font: 650 .79rem/1.45 var(--mono);
  letter-spacing: .055em;
  text-transform: uppercase;
}
.clinic-question h3 {
  margin: 0;
  font: 400 clamp(1.65rem, 2.5vw, 2.35rem)/1.08 var(--serif);
  letter-spacing: -.045em;
  color: var(--forest);
}
.clinic-question .clinic-setup {
  margin: 8px 0 0;
  color: var(--muted);
  font: 400 1rem/1.48 var(--sans);
}
.clinic-board {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  height: 182px;
  overflow: hidden;
  background-color: #1c372b;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, #edf3d90d 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 3px, #0d211a40 3px 4px),
    radial-gradient(ellipse at 48% 30%, #314e3c, transparent 85%);
  box-shadow: inset 0 2px 4px #0b211b66, inset 0 -2px 4px #0b211b4d;
}
.clinic-board[data-rows="3"] {height: 272px;}
.clinic-wires {
  pointer-events: none;
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  height: 272px;
  overflow: visible;
}
.clinic-wires path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.cord-shadow {stroke: #10251d; stroke-width: 6.5; opacity: .8;}
.cord-core {stroke: var(--thread-copper); stroke-width: 3.6;}
.cord-twist {stroke: #ad6848; stroke-width: 1.8; stroke-dasharray: 1.6 4.6;}
.clinic-wires [data-state="open"] .cord-core {
  stroke: var(--thread-open);
  stroke-width: 2.2;
  stroke-dasharray: 5 6;
}
.clinic-wires [data-state="open"] .cord-shadow,
.clinic-wires [data-state="open"] .cord-twist {display: none;}
.clinic-wires [data-state="same"] .cord-core {stroke: var(--thread-sage); stroke-width: 2.4;}
.clinic-wires [data-state="same"] .cord-twist {stroke: #465e49; stroke-dasharray: .1 6; stroke-width: 1.7;}
.clinic-pin {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  width: min(37%, 9.1rem);
  min-height: 48px;
  padding: 6px 7px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  border: 1px solid #dca878;
  border-radius: 5px;
  background: #fbf0db;
  color: #233a2d;
  box-shadow: 0 2px 0 #101f18a6, 0 3px 8px #12261d70;
  font-family: var(--sans);
  text-align: center;
  cursor: pointer;
}
.clinic-pin strong {
  font-size: .98rem;
  line-height: 1.16;
  font-weight: 680;
  overflow-wrap: anywhere;
}
.clinic-pin small {
  font-size: .79rem;
  line-height: 1.22;
  color: #654027;
  overflow-wrap: anywhere;
}
.clinic-pin[data-state="open"] {
  border: 1.5px dashed #d8ba93;
  background: #284234;
  color: #fff6e5;
}
.clinic-pin[data-state="open"] small {color: #eddbbd;}
.clinic-pin[data-state="same"] {
  border-color: #a5b6a4;
  background: #d9e3d3;
  color: #283b2d;
}
.clinic-pin[data-state="same"] small {color: #455944;}
.clinic-pin[aria-pressed="true"] {
  outline: 2px solid #f4bc92;
  outline-offset: 3px;
}
.clinic-pin:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  z-index: 2;
}
@media (hover: hover) {
  .clinic-pin:hover {box-shadow: 0 0 0 2px #e5cdae, 0 3px 7px #10251d80;}
}
@container (max-width: 340px) {
  .clinic-pin {padding-inline: 4px;}
  .clinic-pin strong {font-size: .9rem;}
}
.clinic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 0;
  padding: 10px var(--inset);
  border-bottom: 1px solid #c6cbbd;
  color: #435747;
  font: 500 .82rem/1.4 var(--sans);
}
.clinic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.clinic-legend span::before {
  content: '';
  width: 18px;
  border-top: 3px solid #9d5233;
}
.clinic-legend span[data-state="open"]::before {
  border-top: 2px dashed #7c623e;
}
.clinic-legend span[data-state="same"]::before {
  border-top: 2px solid #667a62;
  border-right: 2px solid #667a62;
  height: 6px;
}
.clinic-reading {padding: 17px var(--inset) 3px;}
.clinic-reading article {min-width: 0;}
.clinic-reading h4 {
  margin: 3px 0 5px;
  font: 400 1.4rem/1.17 var(--serif);
  color: var(--forest);
  letter-spacing: -.025em;
}
.clinic-reading p:not(.clinic-source) {
  margin: 4px 0 7px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}
.clinic-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 9px var(--inset) 17px;
}
.clinic-next, .clinic-reset {
  min-height: 44px;
  max-width: 100%;
  font: 650 .95rem/1.25 var(--sans);
  cursor: pointer;
}
.clinic-next {
  padding: 9px 14px;
  border: 1px solid var(--forest);
  border-radius: 4px;
  background: var(--forest);
  color: var(--light);
}
.clinic-next:hover {background: #345a45;}
.clinic-reset {
  padding: 9px 3px;
  border: 0;
  background: transparent;
  color: #4d604f;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.other-settings {
  padding: 0 var(--inset, 18px);
  border-top: 1px solid #bac5b4;
  background: #e9eddf;
}
.other-settings summary {
  min-height: 44px;
  padding-block: 11px;
  font: 650 .94rem/1.45 var(--sans);
  color: var(--forest);
  cursor: pointer;
}
.other-settings[open] {padding-bottom: 12px;}
.other-settings summary::marker {color: var(--clay);}

.clinic-pin:first-of-type {touch-action: pan-y; user-select: none; cursor: grab;}
.clinic-pin:first-of-type:active {cursor: grabbing;}
@media (prefers-reduced-motion: no-preference) {
  .clinic-pin:first-of-type {transform: translate(calc(-50% + var(--tug, 0px)), -50%);}
}

.clinic-decisions {list-style: none; padding: 0; margin: 8px 0;}
.clinic-decisions li {margin: 5px 0; font-size: 1rem; line-height: 1.45;}
.clinic-decisions b {display: inline; color: var(--forest); margin-right: .3em;}
