/* anatomy.css — the 3D anatomy viewer (tools/build-anatomy.mjs): on the anatomy pages and in the "Anatomy" part of the robot pages */
/* The stage: the model in the middle, a callout card for each part on both sides, each tied to its part by a leader line.
   On a phone: the model, then the cards as a row you swipe. */
.anat { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; margin: 1rem 0 1.4rem; }
#anatView { position: relative; width: 100%; height: 460px; border-radius: 14px; overflow: hidden; touch-action: none; border: 1px solid var(--border); box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.55); }
#anatView canvas { position: absolute; inset: 0; display: block; cursor: grab; } #anatView canvas:active { cursor: grabbing; }
.antag { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 700 11px var(--mono); cursor: pointer; padding: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, #fff) 28%, transparent), 0 2px 8px rgba(0,0,0,.5); }
.antag.on, .antag.lit { transform: translate(-50%, -50%) scale(1.3); }
#anatView .antag:not(.on):not(.lit) { width: 11px; height: 11px; min-width: 0; font-size: 0; border-width: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.45); }   /* just a small dot until you point at the joint */
.ancards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 10px; } .ancards::-webkit-scrollbar { display: none; }
.ancard { position: relative; z-index: 1; flex: 0 0 min(82%, 290px); scroll-snap-align: start; align-self: start; border: 1px solid var(--border); border-left: 5px solid var(--c); border-radius: 12px; padding: 0.55rem 0.8rem 0.6rem; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.6); transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.ancard.on, .ancard.lit { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 14px 28px -18px var(--c); }
.anhead { display: flex; align-items: center; gap: 0.6rem; width: 100%; background: none; border: 0; color: var(--text); text-align: left; padding: 0; cursor: pointer; font-size: 0.95rem; }
.anhead:hover, .anhead:focus, .anhead:active { background: none; color: var(--text); }
.ann { background: var(--c); flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; color: #fff; display: grid; place-items: center; font: 700 0.72rem var(--mono); }
.ancard p { margin: 0.35rem 0 0.2rem; font-size: 0.84rem; line-height: 1.4; color: var(--muted); max-width: none; }
.ansl { display: grid; grid-template-columns: 1fr 3.4rem; gap: 0.5rem; align-items: center; } .ansl input { width: 100%; accent-color: var(--c); } .ansl output { font: 0.8rem var(--mono); text-align: right; color: var(--muted); }
.anout { position: absolute; left: 10px; bottom: 8px; right: 110px; white-space: pre-line; font: 12px var(--mono); color: #cfd8e3; pointer-events: none; text-shadow: 0 1px 3px #000; }
.ansl3 { grid-template-columns: 7.5rem 1fr 4.2rem; } .ansl3 span { font: 0.8rem var(--mono); } .ancmdt { font-size: 1rem; }
#anCmd { flex: none; }
.andef { margin: 0.6rem 0 1rem; padding: 0.7rem 1rem 0.75rem; border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); max-width: 62rem; }
.andef b { display: block; font: 600 0.72rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.25rem; } .andef p { margin: 0; max-width: none; }
.anframe { position: absolute; transform: translate(-50%, -50%); font: 700 13px var(--mono); pointer-events: none; text-shadow: 0 0 3px #000, 0 1px 4px #000; } .anframe sub { font-size: 9px; }
.angizmo { position: absolute; right: 10px; bottom: 10px; width: 88px; height: 88px; pointer-events: none; } .angizmo .bg { fill: rgba(20, 22, 26, 0.55); stroke: rgba(255, 255, 255, 0.15); } .angizmo text { fill: #fff; font: 700 10px var(--mono); text-anchor: middle; }
.anviews { position: absolute; left: 10px; top: 10px; z-index: 3; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(18, 20, 28, 0.62); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.08); }
.anviews button, .anfull { display: grid; place-items: center; gap: 2px; min-width: 44px; min-height: 0; padding: 4px 6px 3px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.04); color: #c9d2de; font: 600 10px var(--sans, inherit); cursor: pointer; }
.anviews button svg, .anfull svg { width: 15px; height: 15px; } .anviews button:hover, .anfull:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.anviews button.on { color: #fff; border-color: #8b7bff; background: linear-gradient(160deg, #6d5dfc, #3b4fd8); box-shadow: 0 0 0 1px rgba(139, 123, 255, 0.5), 0 6px 18px -6px rgba(109, 93, 252, 0.8); }
.anfull { position: absolute; right: 10px; top: 10px; z-index: 3; min-width: 0; width: 32px; height: 32px; padding: 0; background: rgba(18, 20, 28, 0.62); backdrop-filter: blur(8px); }
#anatView:fullscreen { width: 100vw; height: 100vh; border-radius: 0; border: 0; }
#anatView.light .anviews, #anatView.light .anfull { background: rgba(255, 255, 255, 0.78); border-color: rgba(20, 30, 50, 0.12); }
#anatView.light .anviews button, #anatView.light .anfull { color: #3a4556; background: rgba(20, 30, 50, 0.04); border-color: rgba(20, 30, 50, 0.08); }
#anatView.light .anviews button:hover, #anatView.light .anfull:hover { color: #111; background: rgba(20, 30, 50, 0.1); }
#anatView.light .anviews button.on { color: #fff; border-color: #6d5dfc; background: linear-gradient(160deg, #6d5dfc, #3b4fd8); }
#anatView.light .anout { color: #1d2633; text-shadow: 0 1px 2px #fff; }
#anatView.light .anframe { text-shadow: 0 0 3px #fff, 0 1px 3px #fff; }
#anatView.light .angizmo .bg { fill: rgba(255, 255, 255, 0.72); stroke: rgba(20, 30, 50, 0.15); }
@media (max-width: 600px) { .anviews button { min-width: 0; padding: 6px; } .anviews button span { display: none; } }
.anatbox .toolbar { justify-content: center; }
#anatView .anviews button, #anatView .anfull { font-size: 11px; line-height: 1.1; font-weight: 600; min-height: 0; }
.anatbox .toolbar button.on { background: var(--btn); border-color: var(--btn); color: #fff; }
.ancall { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; display: none; }
.ancall path { fill: none; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0.75; transition: opacity 0.2s ease, stroke-width 0.2s ease; } .ancall path.lit { stroke-width: 2.6; stroke-dasharray: none; opacity: 1; }
@media (min-width: 1000px) {
  .anat { grid-template-columns: 210px minmax(0, 1fr) 210px; column-gap: 14px; row-gap: 10px; align-items: center; }
  #anatView { grid-column: 2; grid-row: 1 / span var(--rows, 3); align-self: stretch; height: auto; min-height: clamp(520px, calc(100vh - 220px), 680px); }
  .ancards { display: contents; }
  .ancard { align-self: center; }
  .ancard[data-side="left"] { grid-column: 1; border-left: 1px solid var(--border); border-right: 5px solid var(--c); } .ancard[data-side="left"].on, .ancard[data-side="left"].lit { border-color: var(--c); }
  .ancard[data-side="right"] { grid-column: 3; }
  #anCmd { grid-column: 2; grid-row: calc(var(--rows, 3) + 1); align-self: start; }
  .ancard:not(.info):not(.on) p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .ancall { display: block; }
}

/* the loupe (magnifying glass) and the zoom buttons, under the full-screen button */
.anloupe { right: 48px; }
#anatView .anloupe.on { color: #fff; border-color: #8b7bff; background: linear-gradient(160deg, #6d5dfc, #3b4fd8); }
.anzoom { position: absolute; right: 10px; top: 48px; z-index: 3; display: grid; gap: 4px; }
.anzoom .anfull { position: static; }
#anatView.loupe canvas { cursor: crosshair; }
.anlens { display: none; position: absolute; z-index: 2; pointer-events: none; border: 3px solid #fff; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 10px 30px -6px rgba(0, 0, 0, 0.6); }
.anlens span { position: absolute; right: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(18, 20, 28, 0.75); color: #fff; font: 700 11px var(--sans, inherit); }
#anatView.light .anlens { border-color: #6d5dfc; }
.anlenshint { display: none; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 140px); padding: 5px 12px; border-radius: 10px; background: rgba(18, 20, 28, 0.75); color: #fff; font: 600 12px var(--sans, inherit); text-align: center; pointer-events: none; }
@media (max-width: 600px) { .anlenshint { bottom: auto; top: 54px; max-width: calc(100% - 70px); } }
