.oa-tha { color: var(--ink); }
.oa-tha .oa-tha-hero { padding-block: clamp(28px, 4vw, 54px); }
.oa-tha .oa-tha-hero h1 { max-width: 900px; margin: 8px 0 12px; font-size: clamp(32px, 5vw, 56px); line-height: 1.08; }
.oa-tha .oa-tha-hero .tool-lede { max-width: 850px; }
.oa-tha .oa-tha-workspace { margin-block: 18px 36px; padding: 0 16px; box-sizing: border-box; }
.oa-tha .oa-tha-workspace-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.oa-tha .oa-tha-workspace-head h2 { margin: 5px 0 0; font-size: clamp(19px, 3vw, 27px); }
.oa-tha .oa-tha-reset, .oa-tha .oa-tha-compare button { min-height: 44px; cursor: pointer; font: 700 12px/1.3 var(--sans); }
.oa-tha .oa-tha-reset { padding: 8px 14px; color: var(--blue-dark); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.oa-tha .oa-tha-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.oa-tha .oa-tha-panel, .oa-tha .oa-tha-visuals { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.oa-tha .oa-tha-panel { padding: 16px; }
.oa-tha .oa-tha-setting { padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.oa-tha .oa-tha-setting:first-child { padding-top: 0; }
.oa-tha .oa-tha-setting label { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; color: var(--ink); font-size: 12px; }
.oa-tha .oa-tha-setting label output { color: var(--blue-dark); font: 600 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.oa-tha .oa-tha-setting input { display: block; width: 100%; height: 34px; margin: 8px 0 2px; accent-color: var(--blue); }
.oa-tha .oa-tha-setting p, .oa-tha .oa-tha-compare p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.oa-tha .oa-tha-result { margin-top: 15px; padding: 14px; background: var(--wash); border: 1px solid #d3e0f5; border-radius: var(--radius-sm); }
.oa-tha .oa-tha-result > span { display: block; font-size: 11px; font-weight: 750; }
.oa-tha .oa-tha-result strong { display: block; margin-top: 5px; color: var(--blue-dark); font: 700 clamp(28px, 5vw, 39px)/1.1 var(--mono); }
.oa-tha .oa-tha-result p { margin: 7px 0 0; font-size: 11px; line-height: 1.5; }
.oa-tha .oa-tha-definitions { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 11px; }
.oa-tha .oa-tha-definitions caption { padding-bottom: 6px; color: var(--ink); font-weight: 750; text-align: left; }
.oa-tha .oa-tha-definitions th, .oa-tha .oa-tha-definitions td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.oa-tha .oa-tha-definitions th:first-child { text-align: left; }
.oa-tha .oa-tha-definitions thead th { color: var(--muted); font-weight: 600; }
.oa-tha .oa-tha-definitions td { color: var(--blue-dark); font: 600 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.oa-tha .oa-tha-range { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 11px; }
.oa-tha .oa-tha-range caption { padding-bottom: 6px; color: var(--ink); font-weight: 750; text-align: left; }
.oa-tha .oa-tha-range th, .oa-tha .oa-tha-range td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.oa-tha .oa-tha-range thead th { color: var(--muted); font-weight: 600; }
.oa-tha .oa-tha-range td { color: var(--blue-dark); font: 600 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.oa-tha .oa-tha-range-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.oa-tha .oa-tha-render-status { margin: 0; padding: 10px 12px; color: var(--ink); background: var(--surface-subtle); border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0; font-size: 12px; line-height: 1.5; }
.oa-tha .oa-tha-render-status[hidden] { display: none; }
.oa-tha .oa-tha-projections figcaption span { display: block; color: #aec4d4; font-size: 10px; font-weight: 500; }
.oa-tha .oa-tha-result .oa-tha-weighted { color: var(--ink); }
.oa-tha .oa-tha-result .oa-tha-weighted b { display: inline; margin: 0; color: var(--blue-dark); font: 700 13px/1.4 var(--mono); }
.oa-tha .oa-tha-fwbar[hidden] { display: none; }
.oa-tha .oa-tha-fwpanes[hidden] { display: none; }
.oa-tha .oa-tha-change { min-height: 58px; margin: 14px 0; padding: 11px 12px; color: var(--ink); background: var(--surface-subtle); border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0; font-size: 12px; line-height: 1.5; }
.oa-tha .oa-tha-motion { margin-bottom: 14px; padding-top: 4px; }
.oa-tha .oa-tha-motion h3 { margin: 0 0 4px; font-size: 14px; }
.oa-tha .oa-tha-motion > p { margin: 2px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.oa-tha .oa-tha-motion-presets { display: grid; gap: 8px; margin-top: 10px; }
.oa-tha .oa-tha-motion-presets button { min-height: 44px; padding: 8px 10px; color: var(--ink); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); font: 700 12px/1.3 var(--sans); text-align: left; cursor: pointer; }
.oa-tha .oa-tha-motion-presets button span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.oa-tha .oa-tha-motion > .oa-tha-contact { margin: 12px 0 6px; padding: 11px 12px; color: var(--ink); background: var(--surface-subtle); border-left: 3px solid var(--line); border-radius: 0 8px 8px 0; font-size: 12px; line-height: 1.5; }
.oa-tha .oa-tha-motion > .oa-tha-contact:not([data-contact="none"])[data-contact] { border-left-color: #d9483b; }
.oa-tha .oa-tha-key-contact { background: #ff5c4d; }
.oa-tha .oa-tha-compare { padding-top: 4px; }
.oa-tha .oa-tha-compare h3 { margin: 0; font-size: 14px; }
.oa-tha .oa-tha-compare-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.oa-tha .oa-tha-compare button { display: grid; align-content: center; gap: 4px; padding: 10px 8px; color: var(--ink); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: left; }
.oa-tha .oa-tha-compare button span { color: var(--muted); font-size: 10px; font-weight: 500; }
.oa-tha .oa-tha-compare button.is-active { color: var(--blue-dark); background: var(--wash); border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.oa-tha .oa-tha-visuals { display: grid; gap: 10px; padding: 12px; }
.oa-tha .oa-tha-model, .oa-tha .oa-tha-projections figure { min-width: 0; margin: 0; overflow: hidden; background: #0c1b27; border: 1px solid #263d50; border-radius: 12px; }
.oa-tha .oa-tha-model figcaption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding: 12px 13px 6px; color: #eff7ff; font-size: 12px; }
.oa-tha .oa-tha-model figcaption span { color: #aec4d4; font-size: 10px; }
.oa-tha .oa-tha-model canvas { display: block; width: 100%; height: clamp(260px, 67vw, 410px); touch-action: none; cursor: grab; }
.oa-tha .oa-tha-model canvas:active { cursor: grabbing; }
.oa-tha .oa-tha-arc-words { padding: 0 12px 10px; color: #b5ccda; font-size: 11px; }
.oa-tha .oa-tha-arc-words summary { min-height: 32px; display: flex; align-items: center; color: #dce9f2; font-weight: 650; cursor: pointer; }
.oa-tha .oa-tha-projections { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; min-width: 0; }
.oa-tha .oa-tha-projections figcaption { padding: 10px 12px 0; color: #dceaf5; font-size: 11px; font-weight: 700; }
.oa-tha .oa-tha-projections canvas { display: block; width: 100%; height: clamp(172px, 44vw, 255px); }
.oa-tha .oa-tha-key { display: flex; flex-wrap: wrap; gap: 8px 17px; margin: 1px 3px 5px; color: var(--muted); font-size: 10px; }
.oa-tha .oa-tha-key span { display: inline-flex; align-items: center; gap: 7px; }
.oa-tha .oa-tha-key i { display: inline-block; width: 16px; height: 4px; border-radius: 3px; }
.oa-tha .oa-tha-key-cup { background: #ff66c4; }
.oa-tha .oa-tha-key-stem { background: #83f3e7; }
.oa-tha .oa-tha-more { margin-top: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.oa-tha .oa-tha-more summary { min-height: 44px; padding: 13px 15px; color: var(--blue-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.oa-tha .oa-tha-more > div { padding: 0 16px 12px; }
.oa-tha .oa-tha-more p { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.oa-tha button:focus-visible, .oa-tha input:focus-visible, .oa-tha canvas:focus-visible, .oa-tha summary:focus-visible, .oa-tha a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (min-width: 960px) and (min-height: 560px) {
  .oa-tha .oa-tha-layout { grid-template-columns: minmax(290px, 330px) minmax(0,1fr); align-items: start; }
  .oa-tha .oa-tha-panel { position: sticky; top: 78px; max-height: calc(100vh - 94px); overflow-y: auto; overscroll-behavior: contain; }
  .oa-tha .oa-tha-model canvas { height: clamp(300px, 35vw, 470px); }
  .oa-tha .oa-tha-projections canvas { height: clamp(165px, 19vw, 255px); }
}
@media (min-width: 1250px) and (min-height: 560px) {
  .oa-tha .oa-tha-layout { grid-template-columns: minmax(330px, 360px) minmax(0,1fr); }
}
@media (max-width: 360px) {
  .oa-tha .oa-tha-projections { grid-template-columns: 1fr; }
  .oa-tha .oa-tha-projections canvas { height: 175px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .oa-tha .oa-tha-model canvas { height: 240px; }
  .oa-tha .oa-tha-projections canvas { height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .oa-tha * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---- Guided tour: non-modal card operating the module's real controls. ---- */
.oa-tha .oa-tha-tour { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 520px; margin-inline: auto; z-index: 1100; padding: 14px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.oa-tha .oa-tha-tour[hidden] { display: none; }
.oa-tha .oa-tha-tour-count { margin: 0; color: var(--muted); font-size: 11px; }
.oa-tha .oa-tha-tour h3 { margin: 2px 0 6px; font-size: 15px; font-weight: 700; }
.oa-tha .oa-tha-tour p[data-tour-text] { margin: 0; font-size: 13px; line-height: 1.5; }
.oa-tha .oa-tha-tour-actions { display: flex; gap: 8px; margin-top: 10px; }
.oa-tha .oa-tha-tour-actions button { min-height: 44px; padding: 8px 14px; color: var(--blue-dark); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font: 700 12px/1.3 var(--sans); cursor: pointer; }
.oa-tha .oa-tha-tour-actions button[data-tour-next] { color: #fff; background: var(--blue); border-color: var(--blue); }
.oa-tha .oa-tha-tour-actions button:disabled { opacity: 0.5; }
.oa-tha .oa-tha-tour h3:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---- Focused workspace: phone portrait, or any viewport too short for model and controls to coexist.
   With JavaScript the stacked layout is replaced by one entry action in Start here; entering makes
   .oa-tha-layout a full-screen view with the model above a scrollable controls surface. ---- */
html.oa-tha-fw-lock, html.oa-tha-fw-lock body { overflow: hidden; }
@media (max-width: 599px), (max-width: 950px) and (max-height: 520px) {
  .oa-tha { --enter-action: inline-flex; }
  .oa-tha .oa-tha-js:not(.is-fw-open) .oa-tha-layout,
  .oa-tha .oa-tha-js:not(.is-fw-open) .oa-tha-workspace-head { display: none; }
  .oa-tha .is-fw-open .oa-tha-layout {
    position: fixed; z-index: 1000; inset: 0; display: grid; gap: 0;
    grid-template: "bar" auto "visuals" minmax(0, 1fr) "panel" auto / minmax(0, 1fr);
    height: 100vh; height: 100dvh; background: #0c1b27;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
  }
  .oa-tha .is-fw-open .oa-tha-fwbar { grid-area: bar; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; background: #16202b; border-bottom: 1px solid #263d50; }
  .oa-tha .is-fw-open .oa-tha-fwbar button { min-width: 44px; min-height: 44px; padding: 6px 10px; color: #fff; background: #1e394a; border: 1px solid #426176; border-radius: 8px; font: 700 12px/1.2 var(--sans); cursor: pointer; }
  .oa-tha .is-fw-open .oa-tha-fwtabs { display: flex; gap: 4px; }
  .oa-tha .is-fw-open .oa-tha-fwbar button[aria-pressed="true"] { color: #0c1b27; background: #9fd8f0; border-color: #9fd8f0; }
  .oa-tha .is-fw-open .oa-tha-visuals { grid-area: visuals; display: flex; flex-direction: column; min-height: 0; padding: 0; gap: 0; background: #0c1b27; border: 0; border-radius: 0; box-shadow: none; }
  .oa-tha .is-fw-open .oa-tha-projections { display: contents; }
  .oa-tha .is-fw-open [data-fw-figure] { display: none; flex: 1 1 auto; flex-direction: column; min-height: 0; border: 0; border-radius: 0; }
  .oa-tha .is-fw-open[data-fw-view="three-d"] [data-fw-figure="three-d"],
  .oa-tha .is-fw-open[data-fw-view="ap"] [data-fw-figure="ap"],
  .oa-tha .is-fw-open[data-fw-view="axial"] [data-fw-figure="axial"] { display: flex; }
  .oa-tha .is-fw-open [data-fw-figure] canvas { flex: 1 1 auto; min-height: 0; height: auto; }
  .oa-tha .is-fw-open [data-fw-figure] .oa-fig-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .oa-tha .is-fw-open .oa-tha-model figcaption, .oa-tha .is-fw-open .oa-tha-arc-words, .oa-tha .is-fw-open .oa-tha-key { display: none; }
  .oa-tha .is-fw-open .oa-tha-projections figcaption { padding: 6px 10px 0; }
  .oa-tha .is-fw-open .oa-tha-panel { grid-area: panel; max-height: 40vh; max-height: 40dvh; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 14px; border: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: none; }
  .oa-tha .is-fw-open .oa-tha-fwpanes:not([hidden]) { position: sticky; top: -10px; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; margin: 0 0 8px; padding: 10px 0 8px; background: var(--surface); }
  .oa-tha .is-fw-open .oa-tha-fwpanes button { min-height: 44px; padding: 6px 10px; color: var(--ink); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 8px; font: 700 12px/1.2 var(--sans); cursor: pointer; }
  .oa-tha .is-fw-open .oa-tha-fwpanes button[aria-pressed="true"] { color: var(--blue-dark); background: var(--wash); border-color: var(--blue); }
  .oa-tha .is-fw-open .oa-tha-tour { bottom: calc(46vh + 8px); bottom: calc(46dvh + 8px); }
  .oa-tha .is-fw-open[data-fw-pane="orientation"] [data-fw-group="motion"],
  .oa-tha .is-fw-open[data-fw-pane="motion"] [data-fw-group="orientation"] { display: none; }
  /* A focus step's own control sits in the step card and shows whichever pane is open. */
  .oa-tha .is-fw-open[data-fw-pane] .oa-step-controls [data-fw-group] { display: block; }
  .oa-tha .is-fw-open .oa-tha-motion > p:not(.oa-tha-contact):not(.oa-tha-range-note) { display: none; }
  .oa-tha .is-fw-open .oa-tha-setting { padding: 4px 0 6px; }
  .oa-tha .is-fw-open .oa-tha-setting p { display: none; }
  .oa-tha .is-fw-open .oa-tha-setting input { height: 44px; margin: 0; }
  .oa-tha .is-fw-open .oa-tha-result { margin-top: 8px; padding: 10px 12px; }
  .oa-tha .is-fw-open .oa-tha-result strong { font-size: 26px; }
}
@media (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  .oa-tha .is-fw-open .oa-tha-layout { grid-template: "bar bar" auto "visuals panel" minmax(0, 1fr) / minmax(0, 1fr) minmax(260px, 44%); }
  .oa-tha .is-fw-open .oa-tha-panel { max-height: none; border-top: 0; border-left: 1px solid var(--line); border-radius: 0; }
}
.oa-tha .oa-tha-setting select { width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 10px; color: var(--ink); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); font: 600 14px/1.3 var(--sans); }
.oa-tha .oa-tha-orientation-extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.oa-tha .oa-tha-orientation-extra > summary { min-height: 44px; display: flex; align-items: center; font: 700 13px/1.3 var(--sans); cursor: pointer; }
/* Single-leg stance free body (femoral reconstruction page). */
.oa-tha .oa-tha-levers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 10px 0 0; }
.oa-tha .oa-tha-levers div { min-width: 0; }
.oa-tha .oa-tha-levers dt { color: var(--muted); font-size: 10px; font-weight: 650; }
.oa-tha .oa-tha-levers dd { margin: 2px 0 0; font: 600 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.oa-tha .oa-tha-levers dd b { color: var(--blue-dark); }
.oa-tha .oa-tha-levers dd span { color: var(--muted); font-size: 11px; }
.oa-tha .oa-tha-result p b { color: var(--blue-dark); font-family: var(--mono); }
.oa-tha .oa-tha-check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; font-size: 12px; font-weight: 650; cursor: pointer; }
.oa-tha .oa-tha-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.oa-tha .oa-tha-result .oa-tha-mechanics-note { margin-top: 2px; color: var(--muted); }
.oa-tha .oa-tha-key-abductor { background: #cc8cff; }
.oa-tha .oa-tha-key-load { background: #78bdff; }
.oa-tha .oa-tha-key-force { background: #ff9e4d; }
@media (max-width: 599px), (max-width: 950px) and (max-height: 520px) {
  .oa-tha .is-fw-open .oa-tha-mechanics .oa-tha-weighted { display: none; }
}
/* Dual-mobility text swaps (head size page); author display rules must not override [hidden]. */
.oa-tha [data-dual-show][hidden], .oa-tha [data-dual-hide][hidden] { display: none; }
.oa-tha .oa-tha-setting input:disabled { opacity: .45; cursor: not-allowed; }
/* The motion arc and the impingement-free cone in words, under the 3D figure. */
.oa-tha .oa-tha-cone-summary { margin: 0; color: #d4f5e2; font-size: 11px; line-height: 1.5; }

/* ---- Cases panel (module 5, cases.mjs): the patient, a prediction, and the two at-risk positions. ---- */
.oa-tha .oa-tha-cases { margin-bottom: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius-md); }
.oa-tha .oa-tha-cases-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.oa-tha .oa-tha-cases-head h3 { margin: 0; font-size: 17px; }
.oa-tha .oa-tha-case-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.oa-tha .oa-tha-case-tabs button { min-width: 44px; min-height: 44px; padding: 8px 14px; color: var(--ink); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 999px; font: 700 12px/1.2 var(--sans); cursor: pointer; }
.oa-tha .oa-tha-case-tabs button[aria-pressed="true"] { color: #fff; background: var(--blue); border-color: var(--blue); }
.oa-tha .oa-tha-case-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.oa-tha .oa-tha-case-count { margin: 0 0 4px; color: var(--muted); font: 700 11px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.oa-tha .oa-tha-case-read h4 { margin: 0 0 8px; font: 700 20px/1.25 var(--serif); }
.oa-tha .oa-tha-case-read h4:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.oa-tha .oa-tha-case-read p, .oa-tha .oa-tha-case-feedback p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }
.oa-tha .oa-tha-case-demand { padding: 10px 12px; background: var(--wash); border-radius: var(--radius-sm); }
.oa-tha .oa-tha-case-setup, .oa-tha .oa-tha-case-changes { color: var(--muted); font-size: 13px !important; }
.oa-tha .oa-tha-case-question { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.oa-tha .oa-tha-case-question legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 700; line-height: 1.45; }
.oa-tha .oa-tha-case-question label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.oa-tha .oa-tha-case-question label:hover, .oa-tha .oa-tha-case-question label:focus-within { border-color: var(--blue); }
.oa-tha .oa-tha-case-question input { flex: none; width: 18px; height: 18px; margin: 0; }
.oa-tha .oa-tha-case-missing { margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.oa-tha .oa-tha-case-feedback { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.oa-tha .oa-tha-case-verdict { font-weight: 700; }
.oa-tha .oa-tha-case-status { margin: 4px 0 12px; font-size: 13px; }
.oa-tha .oa-tha-case-status tr[data-clear="true"] td:last-child { color: var(--verified); font-weight: 700; }
.oa-tha .oa-tha-case-status tr[data-clear="false"] td:last-child { color: var(--red); font-weight: 700; }
.oa-tha .oa-tha-case-debrief { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.oa-tha .oa-tha-case-debrief summary { min-height: 44px; padding: 12px 14px; color: var(--blue-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.oa-tha .oa-tha-case-debrief p { margin: 0; padding: 0 14px 12px; }
@media (min-width: 900px) {
  .oa-tha .oa-tha-case-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; }
}

/* ---- Labels on the lines of the model (placeLabels in module.js). The layer lies over the canvas
   and takes no pointer events, so dragging the model is unaffected. ---- */
.oa-tha .oa-tha-labelled { position: relative; }
.oa-tha .oa-tha-labels { position: absolute; overflow: hidden; pointer-events: none; }
.oa-tha .oa-tha-labels span { position: absolute; padding: 2px 6px; color: #f4f8fb; background: rgba(12, 27, 39, .82); border-left: 3px solid #aec4d4; border-radius: 4px; font: 600 11px/1.3 var(--sans); white-space: nowrap; transform: translate(8px, -50%); }
.oa-tha .oa-tha-labels span[data-side="left"] { border-left: 0; border-right: 3px solid #aec4d4; transform: translate(calc(-100% - 8px), -50%); }
.oa-tha .oa-tha-labels span[data-kind="cup"] { border-color: #ff66c4; }
.oa-tha .oa-tha-labels span[data-kind="neck"] { border-color: #83f3e7; }
.oa-tha .oa-tha-labels span[data-kind="angle"] { color: #ffbd40; border-color: #ffbd40; font-family: var(--mono); }
.oa-tha .oa-tha-labels span[data-kind="contact"] { border-color: #ff5c4d; }
.oa-tha .oa-tha-labels span[data-kind="blocked"], .oa-tha .oa-tha-labels span[data-kind="stop"] { border-color: #ffbd40; }
.oa-tha .oa-tha-labels span[data-kind="free"], .oa-tha .oa-tha-labels span[data-kind="mark"] { border-color: #5cdb8f; }
.oa-tha .oa-tha-labels span[data-kind="abductor"] { border-color: #cc8cff; }
.oa-tha .oa-tha-labels span[data-kind="load"] { border-color: #78bdff; }
.oa-tha .oa-tha-labels span[data-kind="joint"] { border-color: #ff9e4d; }
@media (max-width: 599px) { .oa-tha .oa-tha-labels span { font-size: 10px; padding: 1px 5px; } }

/* ---- Viewer first (pages with data-direct-handles, module.js): wherever the focused workspace is not in use,
   the viewers take the full width; the panel becomes a Controls drawer over the 3D view and the live
   readings sit on the viewers. ---- */
.oa-tha .is-viewer-first .oa-tha-layout { grid-template-columns: minmax(0, 1fr); }
.oa-tha .is-viewer-first .oa-tha-model canvas { height: clamp(420px, 64vh, 720px); }
.oa-tha .is-viewer-first .oa-tha-projections canvas { height: clamp(220px, 27vw, 380px); }
.oa-tha .is-viewer-first .oa-tha-panel.oa-fig-drawer { position: absolute; z-index: 3; top: 52px; right: 8px; bottom: 8px; width: min(310px, calc(100% - 16px)); max-height: none; overflow-y: auto; overscroll-behavior: contain; padding: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.oa-tha .is-viewer-first .oa-tha-panel.oa-fig-drawer[hidden] { display: none; }
/* Readings on the 3D view: combined anteversion and the contact line, top left. */
.oa-tha .oa-fig-readout { position: absolute; z-index: 1; top: 8px; left: 8px; display: grid; gap: 6px; width: min(290px, calc(45% - 8px)); }
.oa-tha .oa-fig-readout[hidden] { display: none; }
.oa-tha .oa-fig-readout .oa-tha-result, .oa-tha .oa-fig-readout .oa-tha-contact { margin: 0; padding: 8px 10px; color: #dce9f2; background: rgba(12, 27, 39, .84); border: 1px solid #355268; border-radius: 8px; }
.oa-tha .oa-fig-readout .oa-tha-result > span { color: #aec4d4; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.oa-tha .oa-fig-readout .oa-tha-result strong { margin-top: 2px; color: #9fd8f0; font-size: 26px; }
.oa-tha .oa-fig-readout .oa-tha-result p { margin: 3px 0 0; color: #b5ccda; font-size: 11px; line-height: 1.4; }
.oa-tha .oa-fig-readout .oa-tha-result .oa-tha-weighted, .oa-tha .oa-fig-readout .oa-tha-result .oa-tha-weighted b { color: #b5ccda; }
.oa-tha .oa-fig-readout .oa-tha-result .oa-tha-weighted b { color: #9fd8f0; font-size: 12px; }
.oa-tha .oa-fig-readout .oa-tha-contact { font-size: 11px; line-height: 1.45; border-left: 3px solid #ff5c4d; }
.oa-tha .oa-fig-readout .oa-tha-contact[data-contact="none"] { border-left-color: #5cdb8f; }
/* Readings on the coronal view: module 1's three definitions of the cup, the free body in modules 3 and 5. */
.oa-tha .oa-fig-coronal { position: absolute; z-index: 1; right: 8px; bottom: 8px; padding: 6px 10px; color: #dce9f2; background: rgba(12, 27, 39, .84); border: 1px solid #355268; border-radius: 8px; }
.oa-tha .oa-fig-coronal[hidden] { display: none; }
.oa-tha .oa-fig-coronal .oa-tha-definitions { width: auto; margin: 0; color: #dce9f2; font-size: 11px; }
.oa-tha .oa-fig-coronal .oa-tha-definitions caption { padding: 0 0 4px; color: #aec4d4; font-size: 10px; font-weight: 700; text-align: left; caption-side: top; }
.oa-tha .oa-fig-coronal .oa-tha-definitions th, .oa-tha .oa-fig-coronal .oa-tha-definitions td { padding: 2px 8px 2px 0; color: #dce9f2; background: none; border: 0; }
.oa-tha .oa-fig-coronal .oa-tha-definitions td { color: #9fd8f0; font-family: var(--mono); text-align: right; }
.oa-tha .oa-fig-coronal .oa-tha-definitions thead th { color: #aec4d4; font-size: 10px; }
/* Overlay cards stay short: explanations stay in the drawer's text, the numbers come onto the viewers. */
.oa-tha .oa-fig-readout .oa-tha-result .oa-tha-weighted:not(#thaWeighted) { display: none; }
.oa-tha .oa-fig-readout .oa-tha-result b { color: #9fd8f0; }
.oa-tha .oa-fig-coronal { max-width: min(330px, calc(100% - 16px)); max-height: calc(100% - 60px); overflow-y: auto; }
.oa-tha .oa-fig-coronal .oa-tha-result { margin: 0; padding: 0; color: #dce9f2; background: none; border: 0; }
.oa-tha .oa-fig-coronal .oa-tha-result > span { color: #aec4d4; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.oa-tha .oa-fig-coronal .oa-tha-result strong { margin-top: 2px; color: #9fd8f0; font-size: 22px; }
.oa-tha .oa-fig-coronal .oa-tha-result p { margin: 3px 0 0; color: #b5ccda; font-size: 11px; line-height: 1.4; }
.oa-tha .oa-fig-coronal .oa-tha-result p b, .oa-tha .oa-fig-coronal .oa-tha-levers dd b { color: #9fd8f0; }
.oa-tha .oa-fig-coronal .oa-tha-result .oa-tha-weighted { display: none; }
.oa-tha .oa-fig-coronal .oa-tha-levers { gap: 4px 12px; margin-top: 6px; }
.oa-tha .oa-fig-coronal .oa-tha-levers dt { color: #aec4d4; }
.oa-tha .oa-fig-coronal .oa-tha-levers dd, .oa-tha .oa-fig-coronal .oa-tha-levers dd span { color: #b5ccda; font-size: 11px; }
.oa-tha .oa-fig-coronal .oa-tha-check { min-height: 32px; margin-top: 2px; color: #dce9f2; font-size: 11px; }
.oa-tha .oa-fig-coronal .oa-tha-mechanics-note { color: #b5ccda; }
/* The free-body card is compact on the coronal view; its lever arms open on hover or focus. */
.oa-tha .oa-fig-coronal .oa-tha-mechanics .oa-tha-levers, .oa-tha .oa-fig-coronal .oa-tha-mechanics .oa-tha-mechanics-note { display: none; }
.oa-tha .oa-fig-coronal:hover .oa-tha-mechanics .oa-tha-levers, .oa-tha .oa-fig-coronal:focus-within .oa-tha-mechanics .oa-tha-levers { display: grid; }
.oa-tha .oa-fig-coronal:hover .oa-tha-mechanics .oa-tha-mechanics-note, .oa-tha .oa-fig-coronal:focus-within .oa-tha-mechanics .oa-tha-mechanics-note { display: block; }
.oa-tha .oa-fig-coronal .oa-tha-mechanics > span { white-space: nowrap; }
.oa-tha .oa-fig-coronal { max-width: min(270px, calc(100% - 16px)); }
/* The controls column is compact: each slider's explanation shows while that slider is hovered or
   focused, and the long notes stay in the evidence sections and the arc in words. */
.oa-tha .oa-fig-drawer { padding: 10px 12px; }
.oa-tha .oa-fig-drawer .oa-tha-setting { padding: 6px 0 8px; }
.oa-tha .oa-fig-drawer .oa-tha-setting input { height: 26px; margin: 4px 0 0; }
.oa-tha .oa-fig-drawer .oa-tha-setting p { display: none; }
.oa-tha .oa-fig-drawer .oa-tha-setting:hover p, .oa-tha .oa-fig-drawer .oa-tha-setting:focus-within p { display: block; }
.oa-tha .oa-fig-drawer .oa-tha-motion > p:not(.oa-tha-direction-note):not(.oa-tha-range-note) { display: none; }
.oa-tha .oa-fig-drawer .oa-tha-motion h3 { margin: 6px 0 2px; font-size: 13px; }
.oa-tha .oa-fig-drawer .oa-tha-direction-note, .oa-tha .oa-fig-drawer .oa-tha-range-note { font-size: 10px; }
.oa-tha .oa-fig-drawer .oa-tha-change { font-size: 11px; }

/* Focus step cards: steps.css (shared with the Spinopelvic Motion module). */

/* While a step fixes angles or implant choices: fixed controls are shown as fixed, and what belongs to
   the whole module (Examples A and B) waits for the last step. The hip's motion, the readings and the
   free body show only in a step that names them (data-step-shows: motion, result, mechanics). */
.oa-tha-setting.is-locked { opacity: .5; }
.oa-tha-setting.is-locked label strong::after { content: " · fixed in this step"; color: var(--muted); font-weight: 500; }
[data-tha-orientation].is-focus-step .oa-tha-compare,
[data-tha-orientation].is-focus-step:not(.step-shows-motion) [data-fw-group="motion"],
[data-tha-orientation].is-focus-step:not(.step-shows-motion) button[data-fw-pane="motion"],
[data-tha-orientation].is-focus-step:not(.step-shows-motion) #thaContact,
[data-tha-orientation].is-focus-step:not(.step-shows-motion):not(.step-shows-result) .oa-fig-readout,
[data-tha-orientation].is-focus-step:not(.step-shows-result) .oa-tha-result:not(.oa-tha-mechanics),
[data-tha-orientation].is-focus-step:not(.step-shows-mechanics) .oa-tha-mechanics,
[data-tha-orientation].is-focus-step:not(.step-shows-mechanics) .oa-fig-coronal:has(> .oa-tha-mechanics) { display: none; }
/* A step that moves the hip carries the movement buttons in its card. */
.oa-step-controls .oa-tha-motion-presets { gap: 6px; margin: 8px 0 0; }
.oa-tha .oa-step-controls .oa-tha-motion-presets button { min-height: 34px; padding: 6px 10px; }
.oa-tha .oa-step-controls .oa-tha-motion-presets button span { display: none; }
.oa-tha-projections figure.is-step-view { outline: 3px solid var(--blue); outline-offset: -3px; }
.oa-step-controls .oa-tha-setting { margin: 0; padding: 0; border: 0; }
.oa-step-controls .oa-tha-setting p { display: none; }
/* The phone workspace shows one view at a time, so no view needs pointing out; fixed sliders and the
   step-by-step prompt under them stay out of the short sheet. */
.is-fw-open .oa-tha-projections figure.is-step-view { outline: 0; }
.is-fw-open .oa-tha-projections figure.is-step-view > figcaption::after { content: none; }
.is-fw-open.is-focus-step .oa-tha-setting.is-locked,
.is-fw-open.is-focus-step #thaChange { display: none; }
.oa-tha-projections figure.is-step-view figcaption strong::after,
.oa-tha-projections figure.is-step-view > figcaption::after { content: "Look here"; margin-left: 8px; padding: 2px 8px; color: #fff; background: var(--blue); border-radius: 999px; font: 700 10px/1.4 var(--sans); letter-spacing: .03em; text-transform: uppercase; }

/* The transverse view's stem 0° reference (step 1c, amber) is named in the key, not on the view. */
.oa-tha .oa-tha-key span.oa-tha-key-zero-item { display: none; }
.oa-tha [data-tha-orientation].shows-stem-zero .oa-tha-key span.oa-tha-key-zero-item { display: inline-flex; }
.oa-tha .oa-tha-key i.oa-tha-key-zero { background: #ffbd40; }
