/* Surgeon research workspace. Load after style.css. */
:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --text: #162b3d;
  --muted: #536777;
  --border: #d8e2e8;
  --accent: #087d79;
  --accent-hover: #076560;
  --good: #187459;
  --warn: #996019;
  --danger: #a4313a;
  --workspace-max: 1460px;
  --shadow-sm: 0 2px 9px rgb(22 43 61 / 4%);
}

html { scroll-padding-top: 26px; }
body { font-size: 15px; line-height: 1.55; }
button, input, select { font: inherit; }
button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 38px; }
button { border-radius: 7px; font-size: 14px; font-weight: 600; }
button.primary { padding: 11px 20px; }
button:disabled { opacity: .58; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible,
[tabindex]:focus-visible, summary:focus-visible {
  outline: 3px solid #146aad;
  outline-offset: 3px;
  box-shadow: none;
}
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
input, select { border-color: #bdcdd7; border-radius: 6px; }
input:focus, select:focus { border-color: var(--accent); }
a { color: #086d77; text-underline-offset: 3px; }
[hidden] { display: none !important; }

.workspace-header {
  position: static;
  padding: 19px max(24px, calc((100vw - var(--workspace-max)) / 2));
  background: #152e40;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 0;
}
.workspace-header .brand { gap: 12px; }
.workspace-header .brand h1 { color: #fff; font-size: 22px; letter-spacing: -.45px; font-weight: 650; }
.workspace-header .tagline { color: #c9dce4; font-size: 13px; }
.research-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid #53707f; border-radius: 20px; color: #e6f3f5; font-size: 12px; font-weight: 600; white-space: nowrap; }
.research-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8cd8c8; }
.disclaimer-banner {
  max-width: var(--workspace-max);
  margin: 18px auto 0;
  padding: 11px 16px;
  border: 1px solid #e1d8b7;
  border-radius: 8px;
  background: #fcf9ef;
  color: #66552e;
  font-size: 12px;
}
.disclaimer-banner strong { color: #58451f; }
.workspace-intro { max-width: var(--workspace-max); margin: 28px auto 20px; padding: 0; }
.workspace-intro h1, .workspace-intro h2 { margin: 0 0 6px; color: #162f41; font-size: clamp(25px, 2.5vw, 34px); line-height: 1.2; letter-spacing: -.8px; }
.workspace-intro p { max-width: 840px; margin: 0; color: var(--muted); font-size: 15px; }
.workflow-nav {
  display: flex;
  gap: 8px;
  max-width: var(--workspace-max);
  margin: 0 auto 20px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #eaf0f3;
}
.workflow-step { display: flex; align-items: center; gap: 10px; justify-content: flex-start; flex: 1 1 0; min-width: 0; min-height: 54px; padding: 9px 13px; border: 1px solid transparent; color: #4b6272; background: transparent; text-align: left; line-height: 1.25; }
.workflow-step:hover { background: #f9fbfc; border-color: #d5e0e5; }
.workflow-step.active { background: #fff; color: #076c67; border-color: #b9d6d3; box-shadow: var(--shadow-sm); }
.step-number { display: inline-flex; justify-content: center; align-items: center; flex: 0 0 28px; height: 28px; border: 1px solid #c5d3dc; border-radius: 50%; font-size: 13px; color: #587180; background: #f5f8fa; }
.workflow-step.active .step-number { border-color: #087d79; background: #087d79; color: #fff; }

.layout { max-width: var(--workspace-max); margin: 0 auto; padding: 0 0 24px; gap: 24px; grid-template-columns: minmax(480px, 1.25fr) minmax(330px, .85fr); align-items: start; }
.layout > *, .workflow-pane, .panel, .results-grid, .plan-card { min-width: 0; }
.panel { padding: 25px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.panel h2 { text-transform: none; font-size: 21px; color: var(--text); letter-spacing: -.35px; line-height: 1.25; }
.panel.input { min-height: 580px; }
.workflow-pane:not(.active) { display: none; }
.step-heading { margin-bottom: 22px; padding-bottom: 19px; border-bottom: 1px solid #e3ebef; }
.step-heading .kicker, .step-heading > span { display: block; margin-bottom: 7px; color: #287c7c; font-size: 11px; font-weight: 750; letter-spacing: 1.2px; text-transform: uppercase; }
.step-heading h2 { margin: 0 0 8px; }
.step-heading p { margin: 0; max-width: 68ch; color: var(--muted); font-size: 14px; }
.step-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #e3ebef; padding-top: 20px; margin-top: 23px; }
.step-footer .next-step { background: var(--accent); color: #fff; border-color: var(--accent); margin-left: auto; }
.step-footer .next-step:hover { background: var(--accent-hover); }
.step-footer .back-step { background: #fff; color: #3b5364; }
fieldset { border: 1px solid #dce6eb; padding: 15px; margin-bottom: 18px; border-radius: 9px; min-width: 0; }
fieldset legend { font-size: 14px; font-weight: 650; padding: 0 7px; color: #243e50; }
fieldset fieldset { background: #f9fbfc; }
fieldset.collapsible > legend { padding: 4px 7px; }
.legend-toggle { background: transparent; border: 0; padding: 4px 3px; color: inherit; text-align: left; }
.grid.two { gap: 13px 18px; }
label { font-size: 13px; color: #425a6c; gap: 6px; }
label.check { font-size: 13px; line-height: 1.45; }
.param-slider-row { gap: 12px; }
.param-slider-row input[type="number"] { flex-basis: 72px; width: 72px; color: #19384c; background: #f9fbfc; font-size: 15px; font-weight: 600; text-align: right; }
.param-slider-row input[type="range"] { min-height: 28px; height: 28px; }
.small, .muted.small { font-size: 12px; line-height: 1.55; }
.profile-row { flex-wrap: wrap; gap: 9px; }
.profile-row label { min-height: 40px; padding: 8px 11px; border: 1px solid #cfdee5; border-radius: 7px; background: #f9fbfc; color: #294556; }
.profile-row label:has(input:checked) { background: #e9f6f2; border-color: #7ab9ae; }
.profile-desc { margin-top: 13px; line-height: 1.55; }
.actions { flex-wrap: wrap; gap: 10px; }
.actions #run { min-height: 43px; }
.actions #reset { color: #6b4450; border-color: #d9cbd0; background: #fff; }
.actions #stop { color: #785821; background: #fff8e9; border-color: #e1d1ae; }
.status { font-size: 13px; }
.status:empty { display: none; }
.status-banner:has(.status:empty) { display: none; }
.failure-rule { flex-wrap: wrap; white-space: normal; gap: 8px 10px; margin: 12px 0; }
.failure-rule .check { flex-shrink: 1; }
.construct-hw .check, label.check.nowrap { white-space: normal; flex-wrap: wrap; }
table.surgical-prefs { table-layout: fixed; }
table.surgical-prefs th, table.surgical-prefs td { padding: 9px 5px; font-size: 12px; line-height: 1.4; }
table.surgical-prefs td { border-bottom: 1px solid #edf1f3; }
table.surgical-prefs th:first-child, table.surgical-prefs td:first-child { width: 48%; }
table.surgical-prefs td:nth-child(n+2) { width: auto; }
table.surgical-prefs input { vertical-align: middle; }
table.surgical-prefs .preference-choice { display: flex; justify-content: center; align-items: center; min-height: 36px; min-width: 32px; cursor: pointer; }
table.surgical-prefs td.prefs-section { padding-top: 16px; color: #244c59; }
.level-region { gap: 8px; flex-wrap: wrap; }
.level-region-label { font-size: 12px; }
.level-chips { gap: 8px; }
.level-chip { min-height: 36px; min-width: 43px; padding: 7px 10px; border-radius: 6px; color: #3b5768; }
.level-chip input { display: block; position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.level-chip:has(input:focus-visible) { outline: 3px solid #146aad; outline-offset: 3px; }
.level-chip:has(input:checked) { background: #fff0ec; border-color: #c57b68; color: #914c39; }
.level-chip:has(input:checked)::after { background: #a35b49; }
.constraints, .maneuvers { font-size: 12px; }
.constraints input, .constraints select, .maneuvers input, .maneuvers select { font-size: 13px; min-width: 0; max-width: 100%; }
.constraints th, .maneuvers th { font-size: 11px; font-weight: 650; }
.constraints td, .constraints th { padding: 6px 3px; }

.panel.preview { position: sticky; top: 18px; padding: 21px; overflow: hidden; }
.viewer-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 9px; margin-bottom: 8px; }
.viewer-heading h2 { margin: 0; font-size: 18px; }
.viewer-heading p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.viewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 8px 0 12px; }
.viewer-tools button { min-height: 34px; font-size: 12px; padding: 5px 9px; }
.mobile-viewer-toggle { display: none; }
.viewer-content { min-width: 0; }
.spine-frame { height: clamp(360px, 48vh, 535px); border: 1px solid #d8e6ea; border-radius: 9px; padding: 12px; background: linear-gradient(180deg, #f9fcfc 0%, #f0f6f7 100%); }
.spine-svg { overflow: visible; }
.viewer-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 11px 0; }
.viewer-metrics > * { min-width: 0; border: 1px solid #dce8eb; border-radius: 7px; padding: 7px 9px; background: #f8fbfc; font-size: 12px; color: #426171; }
.viewer-metrics b, .viewer-metrics strong { color: #153b49; font-size: 15px; font-variant-numeric: tabular-nums; }
.geometry-note { font-size: 11px; line-height: 1.5; color: #667b88; margin: 10px 0 0; }
.decision-summary { border-top: 1px solid #dce7eb; padding-top: 14px; margin-top: 16px; font-size: 12px; line-height: 1.55; }
.decision-summary h3 { margin: 0 0 7px; font-size: 13px; color: #234b59; }
.decision-summary ul { padding-left: 18px; margin: 5px 0; }
.decision-summary li { margin: 4px 0; color: #4c6573; }
.decision-summary strong { color: #294653; }
.search-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 15px 0 20px; }
.summary-item { padding: 14px; border: 1px solid #d5e6e7; border-radius: 8px; background: #f2f9f8; font-size: 13px; line-height: 1.5; }
.summary-item span, .summary-item small { display: block; font-size: 11px; color: #607c81; margin-bottom: 4px; }
.summary-item strong { color: #205458; }
.search-review-list { padding: 13px 17px 13px 31px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafb; font-size: 13px; }
.search-review-list li { padding: 4px 0; }
.search-mode-note, .results-stale { padding: 11px 13px; border: 1px solid #e0d6b9; background: #fbf8ee; border-radius: 8px; font-size: 12px; color: #6f5b31; }

button.info { min-height: 27px; width: 27px; height: 27px; flex: 0 0 27px; border-color: #b8ccd4; color: #27747d; font-size: 12px; background: #f7fbfc; margin-left: 4px; }
button.info:hover, button.info[aria-expanded="true"] { background: #e2f2ef; border-color: #6baba3; color: #075b57; }
.info-popover { width: min(390px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: min(600px, calc(100vh - 32px)); overflow-y: auto; padding: 18px; border: 1px solid #b4ced6; border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.6; box-shadow: 0 10px 35px rgb(25 51 66 / 17%); }
.info-popover .popover-title { padding-right: 28px; font-size: 15px; color: #173d50; margin-bottom: 8px; }
.info-popover .popover-close { display: inline-flex; align-items: center; justify-content: center; position: absolute; top: 8px; right: 8px; min-height: 36px; width: 36px; height: 36px; border: 1px solid #d6e3e8; border-radius: 6px; background: #f5f9fa; color: #425e70; padding: 0; font-size: 18px; }
.info-popover .popover-norm, .info-popover .popover-ref { font-size: 12px; margin-top: 10px; }
.info-popover table { overflow-wrap: anywhere; }

#resultsWrap { max-width: var(--workspace-max); margin: 0 auto 28px; padding: 25px; }
#resultsWrap > h2 { font-size: 23px; }
.results-grid { display: grid; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); gap: 22px; overflow: visible; scroll-snap-type: none; padding-bottom: 0; }
.plan-card { --plan-accent: #317c81; --plan-tint: #f0f8f7; border: 1px solid #cddfe2; border-left: 4px solid var(--plan-accent); border-radius: 10px; background: #fff; padding: 19px; }
.plan-card:nth-child(4n + 2) { --plan-accent: #506da2; --plan-tint: #f0f4fa; }
.plan-card:nth-child(4n + 3) { --plan-accent: #997348; --plan-tint: #faf6ef; }
.plan-card:nth-child(4n + 4) { --plan-accent: #886486; --plan-tint: #f8f3f7; }
.plan-card.plan-card-manual { --plan-accent: #785595; --plan-tint: #f7f3fa; border-style: solid; border-color: #d9cde5; border-left-color: #785595; }
.plan-card h3 { margin: -19px -19px 15px; padding: 12px 17px; border-radius: 8px 8px 0 0; background: var(--plan-tint); color: #263e50; font-size: 16px; line-height: 1.5; gap: 9px 16px; flex-wrap: wrap; }
.plan-card .badge { font-size: 11px; padding: 4px 8px; border-radius: 6px; background: #e2eff0; color: #24575b; border: 1px solid #c2dcdd; }
.plan-card .badge.warn { color: #785820; background: #faf1db; border-color: #e5d3a4; }
.plan-card .badge.danger { color: #863c42; background: #faebec; border-color: #e9cbd0; }
.plan-card .badge.manual { color: #674880; background: #eee6f5; border-color: #d9cbe5; }
.plan-card .badge.badge-mf-yes { color: #863c42; background: #faebec; border-color: #e9cbd0; }
.plan-card .badge.badge-mf-no { color: #25654f; background: #e9f5ee; border-color: #c8dfd1; }
.plan-card .plan-text { font-family: inherit; font-size: 13px; line-height: 1.6; border-radius: 7px; padding: 11px 13px; margin: 0 0 10px; background: #fbfcfd; }
.plan-card .plan-row { padding: 2px 0; align-items: flex-start; gap: 9px; }
.plan-card .plan-key { width: 160px; }
.plan-card .plan-val { min-width: 0; overflow-wrap: anywhere; }
.plan-card > .muted.small { font-size: 13px; margin: 4px 0; }
.spine-strip { overflow-x: auto; max-width: 100%; margin-top: 15px; padding-bottom: 10px; border-top: 1px solid #e4ebee; scrollbar-color: #9db7c1 #eef3f6; }
.plan-card .spine-strip .tp-row,
.plan-card .spine-strip .tp-spines { min-width: 890px; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; overflow: visible; gap: 10px !important; }
.plan-card .spine-strip .tp-row-4,
.plan-card .spine-strip .tp-spines-4 { min-width: 712px; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.plan-card .tp-row { margin-top: 16px !important; }
.plan-card .tp { min-width: 0; font-size: 12px; }
.plan-card .tp .label, .plan-card .tp-spines .tp-spine-label { font-size: 12px; text-transform: none; color: #355567; letter-spacing: 0; font-weight: 650; margin-bottom: 9px; }
.plan-card .tp-row .params-mini { font-family: inherit; font-size: 12px; line-height: 1.6; gap: 2px 6px; padding: 10px 12px; border-radius: 7px; background: #f7fafb; border: 1px solid #e0eaee; }
.plan-card .params-mini .k { font-weight: 550; color: #546a79; }
.plan-card .params-mini .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.plan-card .tp-spines .tp-spine { min-width: 0; }
.plan-card .tp-spines .spine-mini { height: 330px; padding: 8px; border: 1px solid #dbe7eb; border-radius: 7px; background: #f6fafb; }
.plan-card .tp-spines .tp-spine:first-child .spine-mini { background: #f7f8fa; border-color: #dce1e7; }
.footer { max-width: var(--workspace-max); margin: 0 auto 20px; padding: 20px 0; color: #647b89; line-height: 1.6; }

@media (min-width: 961px) and (max-height: 800px) {
  .panel.preview { position: static; }
}
@media (max-width: 1508px) {
  .disclaimer-banner, .workspace-intro, .workflow-nav, .layout, #resultsWrap, .footer { margin-left: 24px; margin-right: 24px; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .panel.preview { position: static; }
  .mobile-viewer-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border-color: #bdd8d7; color: #146d69; background: #edf7f4; font-size: 12px; padding: 8px 11px; }
  .panel.input { min-height: 0; }
  .spine-frame { height: 480px; }
  .workflow-step { font-size: 12px; padding: 9px 7px; gap: 6px; }
  .workflow-step .step-number { flex-basis: 24px; height: 24px; }
  .viewer-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 44px; }
  body { font-size: 14px; }
  .workspace-header { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .workspace-header .tagline { display: none; }
  .workspace-header .brand h1 { font-size: 21px; }
  .research-pill { font-size: 11px; padding: 4px 8px; }
  .disclaimer-banner, .workspace-intro, .workflow-nav, .layout, #resultsWrap, .footer { margin-left: 12px; margin-right: 12px; }
  .disclaimer-banner { padding: 10px 12px; font-size: 11px; }
  .workspace-intro { margin-top: 22px; margin-bottom: 16px; }
  .workspace-intro p { font-size: 13px; }
  .workflow-nav { padding: 5px; gap: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-step { min-height: 44px; font-size: 12px; }
  .panel, #resultsWrap { padding: 17px; border-radius: 10px; }
  .step-heading h2 { font-size: 21px; }
  .step-heading p { font-size: 13px; }
  .grid.two { gap: 12px; grid-template-columns: minmax(0, 1fr); }
  fieldset { padding: 12px 10px; }
  fieldset legend { font-size: 13px; }
  .param-slider-row { gap: 7px; }
  .param-slider-row input[type="number"] { width: 63px; flex-basis: 63px; font-size: 14px; }
  .viewer-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spine-frame { height: 430px; padding: 10px; }
  .search-summary { grid-template-columns: minmax(0, 1fr); }
  .plan-card { padding: 13px; }
  .plan-card h3 { margin: -13px -13px 13px; padding: 11px 13px; font-size: 15px; }
  .plan-card .plan-key { width: 125px; font-size: 12px; }
  .plan-card .plan-text { padding: 8px 9px; font-size: 12px; }
  .plan-card .plan-two-col { flex-direction: column; }
  .plan-card .plan-two-col > * { width: 100%; min-width: 0 !important; }
  .constraints { display: block; overflow-x: auto; padding-bottom: 8px; }
  .constraints input, .constraints select { min-width: 58px; }
  .constraints th:first-child, .constraints td:first-child { min-width: 105px; }
  .actions { align-items: stretch; }
  .actions #run { flex: 1 1 100%; }
  .step-footer button { padding: 8px 12px; font-size: 13px; }
  .info-popover { font-size: 13px; }
}
@media (max-width: 380px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .viewer-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.surgical-prefs, table.surgical-prefs tbody { display: block; width: 100%; }
  table.surgical-prefs tr:has(th) { display: none; }
  table.surgical-prefs tr:has(.preference-choice) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 0; border-bottom: 1px solid #dce7eb; }
  table.surgical-prefs tr:has(.preference-choice) td { border: 0; padding: 4px 2px; width: auto; }
  table.surgical-prefs tr:has(.preference-choice) td:first-child { grid-column: 1 / -1; width: auto; }
  table.surgical-prefs .preference-choice { flex-direction: column; gap: 6px; min-height: 54px; border: 1px solid #d2e2e5; border-radius: 6px; }
  table.surgical-prefs .preference-choice:has(input:checked) { background: #e8f6f2; border-color: #6baba3; }
  .preference-choice:has(input[value="allow"])::after { content: 'Allow'; }
  .preference-choice:has(input[value="forbid"])::after { content: 'Exclude'; }
  .preference-choice:has(input[value="require"])::after { content: 'Require'; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .workspace-header { background: #fff; color: #162b3d; border-bottom: 1px solid #aaa; }
  .workspace-header .brand h1 { color: #162b3d; }
  .workflow-nav, .step-footer, .info-popover, .actions, button.info { display: none !important; }
  .panel.preview { position: static; }
  .workflow-pane { display: block !important; }
  .layout { display: block; }
  .plan-card { break-inside: avoid; margin-bottom: 18px; }
  .spine-strip { overflow: visible; }
}

/* Form labels and compact navigation to the phone preview. */
.parameter-title { display: flex; align-items: center; gap: 6px; min-height: 29px; font-weight: 600; color: #254555; }
.parameter-title button.info { margin-left: 0; }
.case-actions { display: flex; align-items: center; margin-bottom: 15px; }
.case-actions label { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-actions button { min-height: 40px; padding: 8px 12px; }
.case-actions > select { width: auto; min-height: 40px; }
.preview-shortcut { display: none; }
@media (max-width: 960px) {
  .preview-shortcut { display: inline-block; margin-top: 12px; border: 1px solid #c3dbda; background: #eef7f5; color: #146d69; padding: 6px 12px; }
}
.model-rules { margin: 14px 0; padding: 13px; border: 1px solid #d5e2e8; border-radius: 8px; font-size: 12px; color: #536777; }
.model-rules summary { cursor: pointer; color: #254555; font-weight: 600; min-height: 30px; }
.model-rules ul { padding-left: 20px; }
.model-rules li { margin: 6px 0; }
#preopClassifications { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; white-space: normal !important; overflow: visible !important; }
#preopSchwab { margin-left: 0 !important; white-space: normal !important; }
.viewer-heading { flex-wrap: wrap; }
.comparison-disclosure { margin-top: 14px; }
.comparison-disclosure > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #225b67; padding: 12px 10px; background: #f1f7f8; border: 1px solid #d3e3e7; border-radius: 7px; }
.comparison-disclosure > summary:focus-visible { outline: 3px solid #146aad; outline-offset: 2px; }
#manualLiteratureFields { min-width: 0; }
#maneuversTable { display: block; width: 100%; overflow-x: auto; padding-bottom: 8px; }
#maneuversTable input, #maneuversTable select { min-width: 62px; }
#maneuversTable th, #maneuversTable td { min-width: 70px; }
.geometry-details { margin: 10px 0 16px; border: 1px solid #d5e2e8; border-radius: 7px; padding: 10px 12px; color: #536777; font-size: 12px; }
.geometry-details > summary { cursor: pointer; min-height: 28px; color: #254555; font-weight: 600; }
.geometry-details > summary:focus-visible { outline: 3px solid #146aad; outline-offset: 2px; }
.geometry-measurements { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.geometry-measurements th, .geometry-measurements td { padding: 5px 4px; text-align: left; border-bottom: 1px solid #e5edf1; }
.geometry-measurements th { font-weight: 600; color: #254555; }
.geometry-details p { line-height: 1.5; overflow-wrap: anywhere; }

/* Clinical target review and enlarged, read-only drawing inspection. */
.target-review { padding: 14px; margin-top: 14px; border: 1px solid #d8e4e8; border-radius: 8px; background: #f8fbfc; }
.target-review h4 { margin: 0 0 6px; color: #244c59; font-size: 14px; }
.target-review p { font-size: 12px; line-height: 1.5; margin: 6px 0 10px; }
.target-review summary { padding: 12px 0; cursor: pointer; font-weight: 600; }
.target-table-wrap, .candidate-overview-wrap, .candidate-overview-scroll { overflow-x: auto; }
.target-table, .candidate-overview-table, .goal-summary-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.target-table th, .target-table td, .candidate-overview-table th, .candidate-overview-table td, .goal-summary-table th, .goal-summary-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #dae6ea; vertical-align: top; }
.candidate-overview { margin: 16px 0 22px; padding: 14px; background: #f2f8f8; border: 1px solid #cddfe2; border-radius: 8px; }
.candidate-overview h3 { margin: 0 0 8px; font-size: 17px; }
.candidate-overview table { min-width: 750px; }
.inspect-drawing { min-height: 44px; margin: 6px 0; padding: 8px 12px; font-size: 12px; color: #176568; background: #eef8f6; border: 1px solid #bad6d2; }
.drawing-inspector { width: min(850px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; overflow-y: auto; border: 1px solid #a8c6d0; border-radius: 12px; color: #254555; }
.drawing-inspector::backdrop { background: rgb(20 41 53 / 65%); }
.drawing-inspector h2 { margin: 0 0 8px; font-size: 20px; }
.inspector-close { min-height: 44px; padding: 8px 14px; margin-bottom: 12px; }
.inspector-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.inspected-spine { width: 100%; height: 650px; max-height: 72dvh; background: #f5fafb; border: 1px solid #d7e5ea; border-radius: 8px; }
.drawing-warning { padding: 10px; border: 1px solid #e0cfa1; border-radius: 6px; background: #fff8e7; color: #735321; font-size: 12px; line-height: 1.5; }
.inspector-measurements .tp { width: auto; }
.patient-demographics { margin: 12px 0; }
.advanced-model-settings { padding: 14px; border: 1px solid #cddfe2; border-radius: 8px; margin: 18px 0; }
.advanced-model-settings > summary, .candidate-overview > summary { min-height: 32px; cursor: pointer; font-weight: 600; color: #244c59; }
.target-review-table { width: 100%; border-collapse: collapse; }
.target-review-table caption, .candidate-overview-table caption { text-align: left; padding: 8px 0; color: #486573; font-size: 12px; }
.baseline-target-note summary { min-height: 32px; padding: 8px 0; cursor: pointer; }
@media (max-width: 600px) {
  input[type="number"], input[type="text"], select, .param-slider-row input[type="number"], .constraints input, .constraints select, .maneuvers input, .maneuvers select { font-size: 16px; }
  table.surgical-prefs .preference-choice { min-height: 44px; min-width: 44px; }
  .level-chip, .mobile-viewer-toggle, .legend-toggle, .case-actions button, .case-actions > select { min-height: 44px; }
  button.info { min-height: 44px; width: 44px; height: 44px; flex-basis: 44px; }
  .constraints { display: table; overflow: visible; }
  .constraints thead { display: none; }
  .constraints tbody { display: grid; gap: 14px; }
  .constraints tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid #cddfe2; border-radius: 8px; background: #f8fbfc; }
  .constraints tbody td { display: block; padding: 0; min-width: 0 !important; }
  .constraints tbody td:first-child, .constraints tbody td:last-child { grid-column: 1 / -1; }
  .constraints tbody td::before { display: block; content: attr(data-label); color: #486573; font-size: 12px; margin-bottom: 5px; }
  .constraints input, .constraints select { width: 100%; min-width: 0; min-height: 44px; }
  .constraints .c-tp { margin-top: 8px; }
  .constraints .c-del { min-height: 44px; }
  .target-table thead { display: none; }
  .target-table tbody tr { display: block; padding: 8px 0; border-bottom: 1px solid #d7e5ea; }
  .target-table td { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: 9px; border: 0; padding: 5px 0; }
  .target-table td::before { content: attr(data-label); color: #486573; }
  .inspector-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .inspected-spine { height: 540px; max-height: 66dvh; }
  .drawing-inspector { padding: 14px; }
}

/* Additive research-goal controls. Hidden sections must stay hidden at every width. */
[hidden] { display: none !important; }
.alignment-objective-label { display: block; font-weight: 600; margin-bottom: 6px; }
#alignmentObjective { width: 100%; max-width: 100%; min-height: 44px; font-size: 1rem; }
.research-goal-description { line-height: 1.55; margin: 12px 0 16px; }
.research-score { margin: 10px 0; font-weight: 600; }
.research-score-components { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(100px, 1fr); gap: 8px 16px; }
.research-score-components dt { color: var(--muted); }
.research-score-components dd { margin: 0; overflow-wrap: anywhere; }
.research-goal-details details { margin-top: 14px; }
@media (max-width: 480px) { .research-score-components { grid-template-columns: 1fr; gap: 4px; } .research-score-components dd { margin-bottom: 8px; } }
