/* additions for the 3D app (style.css carries the mockup's base) */
[hidden] { display: none !important; }
/* hidden views keep their layout for the crossfade, so stop their controls catching clicks */
.view:not(.on), .view:not(.on) * { pointer-events: none !important; }
.tabs button { padding: 5px 13px; }
#host3d { position: absolute; inset: 0; touch-action: none; }
#host3d canvas { display: block; cursor: grab; }
#host3d canvas:active { cursor: grabbing; }
.hud.bot { flex-wrap: wrap; }
.spin { width: 9px !important; height: 9px !important; border-radius: 50%; border: 1.5px solid var(--green); border-right-color: transparent; background: none !important; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 4px 9px; border-radius: 8px; background: rgba(8,12,10,.82); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; backdrop-filter: blur(8px); }
.mk { all: unset; position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.mk::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--red)); box-shadow: 0 0 0 2px rgba(0,0,0,.35); transition: transform 160ms var(--ease-out); }
.mk::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px solid var(--c, var(--red)); animation: ring 2s var(--ease-out) infinite; }
.mk.joint { --c: var(--cart); } .mk.joint::after { animation: none; opacity: .6; }
.mk:active::before { transform: scale(.85); }
.mk:focus-visible { outline: 2px solid var(--green); }
.mk span { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 11.5px; white-space: nowrap; padding: 2px 7px; border-radius: 6px; background: rgba(8,12,10,.78); opacity: 0; transition: opacity 150ms ease; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .mk:hover span { opacity: 1; } }
.mk.sel span { opacity: 1; }
.groupH { color: var(--faint); font-size: 11px; margin: 10px 4px 6px; }
.conds .cond small { display: block; }
.row .end .sw { margin-left: auto; }
.info h1 { font-size: 21px; }
.info-foot small, .groupH, .vtag, .mk span { font-size: 12px; }
/* panel text swaps on every click: keep it quick and quiet */
.info-body { animation: fade 140ms ease-out; }
@keyframes fade { from { opacity: 0; } }
.stage-load { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity 300ms ease-out; }
.stage-load.done { opacity: 0; }
.stage-load div { display: grid; justify-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.stage-load .bar2 { width: 160px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.stage-load .bar2 i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--green); animation: slide 1.1s var(--ease-io) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .stage-load .bar2 i { animation: none; width: 100%; opacity: .5; } }
/* study page */
.study { position: fixed; inset: 52px 0 0; padding: 0 12px 12px; background: var(--bg); display: grid; grid-template-columns: 280px 1fr; gap: 12px; z-index: 20; animation: in 240ms var(--ease-out); }
.study[hidden] { display: none; }
.study-nav { padding: 14px 10px; overflow: auto; }
.study-nav input { all: unset; box-sizing: border-box; width: 100%; height: 32px; padding: 0 10px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 12.5px; margin-bottom: 8px; caret-color: var(--green); }
.study-nav input:focus { border-color: rgba(70,176,114,.5); }
.study-page { overflow: auto; padding: 32px 40px 48px; }
.study-page .wrap { max-width: 860px; }
.study-page h1 { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
.study-page .latin { color: var(--muted); font-style: italic; margin-top: 4px; font-size: 15px; }
.study-page h2 { font-size: 15px; font-weight: 600; margin: 32px 0 10px; letter-spacing: -.01em; }
.study-page p { color: #cdd8d1; font-size: 14.5px; line-height: 1.65; max-width: 70ch; margin-bottom: 10px; }
.study-page .facts div { grid-template-columns: 200px 1fr; font-size: 13.5px; padding: 10px 14px; }
.study-page .clin { font-size: 13.5px; padding: 12px 14px; }
.study-page .toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 4px; }
.study-page .toc a { color: var(--muted); font-size: 12px; text-decoration: none; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.05); }
.study-page .toc a:hover { color: var(--text); }
.study-page .src { color: var(--faint); font-size: 12px; margin-top: 36px; max-width: 70ch; }
.study-page .actions { display: flex; gap: 8px; margin-top: 18px; }
@media (max-width: 860px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .vishead { flex-wrap: wrap; } .vishead .chip { order: 3; white-space: normal; }
  .tabs { max-width: 100%; overflow-x: auto; }
  .hud.top .chip#hint { display: none; }
  .study { inset: auto; position: fixed; top: 0; left: 0; right: 0; bottom: 0; grid-template-columns: 1fr; grid-template-rows: 40vh 1fr; padding: 10px; background: var(--bg); }
  .study-page { padding: 20px; }
  .study-page .facts div { grid-template-columns: 1fr; gap: 2px; }
}
