:root {
    --ama-pdf-width: 50vw;
}

/* Main page viewport scrollbar — blue thumb on a dark track (#252525). 25px wide to match PDF panel. */
html {
    scrollbar-color: #1E90FF #252525;
    scrollbar-width: auto;
}

html::-webkit-scrollbar {
    width: 25px;
    height: 25px;
}

html::-webkit-scrollbar-track {
    background: #252525;
}

html::-webkit-scrollbar-thumb {
    background-color: #1E90FF;
    border-radius: 10px;
    border: 2px solid #252525;
    min-height: 40px;
}

html::-webkit-scrollbar-corner {
    background: #252525;
}

html::-webkit-scrollbar-thumb:hover {
    background-color: #1873CC;
}

/* Larger arrow buttons (Windows-style scrollbars in Chrome/Edge) */
html::-webkit-scrollbar-button:single-button:vertical:decrement,
html::-webkit-scrollbar-button:single-button:vertical:increment {
    display: block;
    width: 25px;
    height: 25px;
    background-color: #1E90FF;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 8px;
}

html::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M5%200%20L10%206%20L0%206z'/%3E%3C/svg%3E");
}

html::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M0%200%20L10%200%20L5%206z'/%3E%3C/svg%3E");
}

html::-webkit-scrollbar-button:single-button:vertical:decrement:hover,
html::-webkit-scrollbar-button:single-button:vertical:increment:hover {
    background-color: #1873CC;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    width: min(1200px, calc(100vw - 40px));
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    box-sizing: border-box;
}

/* Landing only: shorten card bottom ~15px without changing inner layout (Ch. 16 keeps full padding). */
.container:has(#chapterLandingPage:not(.hidden)) {
    padding-bottom: 5px;
}

/* AMA Guides side-by-side PDF viewer */
.ama-pdf-viewer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--ama-pdf-width);
    min-width: 420px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.18);
    border-left: 1px solid #d0d7e2;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.ama-pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e6f0;
    background: linear-gradient(90deg, #f4f8ff 0%, #ffffff 60%);
}

.ama-pdf-title {
    font-weight: 600;
    color: #1E3A8A;
    font-size: 14px;
    line-height: 1.15;
}

.ama-pdf-subtitle {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-weight: 400;
    font-size: 11px;
    color: #4b5563;
}

.ama-pdf-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ama-pdf-search-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #111827;
    background-color: #eef3ff;
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid #c4d2ff;
}

.ama-pdf-search-label input[type="text"] {
    border: none;
    outline: none;
    font-size: 11px;
    padding: 3px 4px;
    min-width: 128px;
    background: transparent;
}

.ama-pdf-search-button {
    padding: 5px 8px;
    min-width: 64px;
    font-size: 11px;
    border-radius: 999px;
    background-color: #1E90FF;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.ama-pdf-search-button:hover {
    background-color: #1873CC;
    box-shadow: 0 0 0 1px rgba(24, 115, 204, 0.15);
}

.ama-pdf-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #111827;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ama-pdf-close-btn:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.2);
}

body.ama-pdf-open .container {
    width: calc(100vw - var(--ama-pdf-width) - 40px);
    max-width: calc(100vw - var(--ama-pdf-width) - 40px);
    margin-left: 20px;
    margin-right: auto;
}

.ama-pdf-body {
    flex: 1;
    background-color: #e5e7eb;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ama-pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #d7dde8;
    background-color: #f8fafc;
}

.ama-pdf-page-controls,
.ama-pdf-zoom-controls,
.ama-pdf-search-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ama-pdf-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
    white-space: nowrap;
}

.ama-pdf-page-indicator,
.ama-pdf-search-status {
    font-size: 12px;
    color: #334155;
    white-space: nowrap;
}

.ama-pdf-page-jump input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
    width: 56px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background-color: #ffffff;
    color: #111827;
    font-size: 12px;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}

.ama-pdf-page-jump input[type="number"]:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

.ama-pdf-page-jump input[type="number"]::-webkit-outer-spin-button,
.ama-pdf-page-jump input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ama-pdf-search-status {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ama-pdf-mini-button,
.ama-pdf-search-button,
.ama-pdf-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
}

.ama-pdf-mini-button {
    min-width: 34px;
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #111827;
    cursor: pointer;
}

.ama-pdf-mini-button:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
}

.ama-pdf-mini-button:disabled {
    opacity: 0.5;
    cursor: default;
    background-color: #f8fafc;
    border-color: #dbe3ee;
}

.ama-pdf-scroll-container {
    flex: 1;
    overflow: auto;
    padding: 14px;
    background-color: #dbe2ea;
    scrollbar-color: #94a3b8 #cdd5df;
    scrollbar-width: auto;
}

.ama-pdf-scroll-container::-webkit-scrollbar {
    width: 25px;
    height: 25px;
}

.ama-pdf-scroll-container::-webkit-scrollbar-track {
    background: #cdd5df;
}

.ama-pdf-scroll-container::-webkit-scrollbar-thumb {
    background-color: #94a3b8;
    border-radius: 10px;
    border: 2px solid #cdd5df;
}

.ama-pdf-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: #7c8494;
}

.ama-pdf-page-container {
    position: relative;
    width: fit-content;
    margin: 0 auto;
    background-color: #ffffff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.18);
}

.ama-pdf-canvas {
    display: block;
    max-width: 100%;
}

.ama-pdf-text-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.ama-pdf-text-layer span {
    position: absolute;
    transform-origin: 0 0;
    white-space: pre;
    color: transparent;
    -webkit-text-fill-color: transparent;
    pointer-events: auto;
    line-height: 1;
}

.ama-pdf-text-layer span::selection {
    background: rgba(59, 130, 246, 0.32);
}

.ama-pdf-text-layer span.ama-pdf-match {
    background: rgba(250, 204, 21, 0.45);
    border-radius: 2px;
}

.ama-pdf-text-layer span.ama-pdf-match-active {
    background: rgba(249, 115, 22, 0.55);
}

.ama-pdf-link {
    color: #1E40AF;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.ama-pdf-link:hover {
    color: #1D4ED8;
}

h1, h2, h3 {
    color: #333;
    text-align: center;
}

.landing-page {
    padding-top: 8px;
}

.landing-brand {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
}

.landing-logo {
    width: 122px;
    height: auto;
    flex-shrink: 0;
    display: block;
}

.landing-logo-wrapper {
    position: relative;
    flex-shrink: 0;
}

.landing-logo-hotspot {
    position: absolute;
    left: 0;
    width: 100%;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.landing-logo-hotspot-top {
    top: 0;
    height: 50%;
}

.landing-logo-hotspot-bottom {
    bottom: 0;
    height: 50%;
}

.landing-brand-title {
    margin: 24px 0 0;
    font-size: 2em;
    font-weight: bold;
    line-height: normal;
    color: #333;
    text-align: left;
}

.chapter-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.chapter-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 17px 15px 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.2;
    box-sizing: border-box;
    min-height: 74px;
}

.chapter-card:hover {
    background-color: #e9e9e9;
    transform: translateY(-5px);
}

.chapter-card.selected {
    background-color: #1E90FF;
    color: white;
}

.landing-page-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 25px auto 0;
    width: 100%;
}

.landing-page-actions button {
    display: inline-block;
    width: 200px;
    margin: 0;
    box-sizing: border-box;
}

.chapter-selection-message {
    min-height: 24px;
    margin-top: 8px;
    text-align: center;
    color: #c62828;
    font-size: 14px;
}

/* Keep selection message aligned after lowering .landing-page-actions by 5px */
.landing-page .chapter-selection-message {
    margin-top: 3px;
}

.chapter-running-total-wrap {
    margin-top: 16px;
}

.chapter-running-total-card,
.ch16-running-totals-card {
    border: 1px solid #1e90ff;
}

.calculator-card.overall-total.chapter-running-total-card,
.calculator-card.overall-total.ch16-running-totals-card {
    border: 1px solid #1e90ff !important;
}

.chapter-running-total-card h3 {
    margin-top: 0;
}

.chapter-title-prefix {
    color: #1E90FF;
}

.chapter-title-link,
.chapter-title-link:hover,
.chapter-title-link:visited,
.chapter-title-link:active {
    color: #1E90FF;
    text-decoration: none;
}

.chapter-title-link {
    font: inherit;
    font-weight: inherit;
}

.chapter-title-main {
    color: #000000;
}

#ch16SideSuffix {
    display: inline-flex;
    align-items: center;
}

.ch16-side-triangle {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 6px 0 6px;
    vertical-align: middle;
}

.ch16-side-triangle svg {
    display: block;
    width: 100%;
    height: 100%;
}

.app-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.app-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
    padding: 24px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    text-align: center;
    box-sizing: border-box;
}

.ch16-transition-overlay {
    position: fixed;
    inset: 0;
    background-color: #ffffff; /* fully hide background during transition */
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ch16-transition-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #333;
}

.ch16-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(30, 144, 255, 0.2);
    border-top-color: #1E90FF;
    animation: ch16-spin 0.8s linear infinite;
}

@keyframes ch16-spin {
    to {
        transform: rotate(360deg);
    }
}

.addon-modal-overlay {
    z-index: 1001;
}

/* When PDF viewer is open, overlay only covers left (main app) so PDF stays ungreyed */
body.ama-pdf-open .addon-modal-overlay,
body.ama-pdf-open .app-modal-overlay {
    left: 0;
    right: auto;
    width: calc(100vw - var(--ama-pdf-width) - 20px);
    top: 0;
    bottom: 0;
}

/* When PDF viewer is open, shift modals left so they don't block the PDF */
body.ama-pdf-open .addon-modal-overlay .app-modal,
body.ama-pdf-open .app-modal-overlay .app-modal {
    left: 8%;
    transform: translateY(-50%);
}

/* When PDF viewer is open, limit CRPS warning overlay to left panel */
body.ama-pdf-open .crps-warning {
    left: 0;
    width: calc(100vw - var(--ama-pdf-width) - 20px);
}

/* When PDF viewer is open, shift inline-styled overlays and dialogs left */
body.ama-pdf-open .app-fixed-overlay {
    left: 0 !important;
    right: auto !important;
    width: calc(100vw - var(--ama-pdf-width) - 20px) !important;
    top: 0 !important;
    bottom: 0 !important;
}

/* Dialog is a sibling of overlay (both on body); position in left half of viewport */
body.ama-pdf-open .app-fixed-dialog {
    left: 25% !important;
    transform: translate(-50%, -50%) !important;
}

/* Start Over dialog is appended as a body-level sibling, so position it in the left app pane. */
body.ama-pdf-open .start-over-modal {
    left: calc((100vw - var(--ama-pdf-width) - 20px) / 2);
    transform: translate(-50%, -50%);
}

/* Extremity selection dialog is also body-level; keep it in the app pane when PDF is open. */
body.ama-pdf-open .app-modal--extremity-selection {
    left: calc((100vw - var(--ama-pdf-width) - 20px) / 2);
    transform: translate(-50%, -50%);
}

/* Delete body part dialog is a body-level modal; keep it within the app pane when PDF is open. */
body.ama-pdf-open .ch16-delete-bodypart-modal {
    left: calc((100vw - var(--ama-pdf-width) - 20px) / 2);
    transform: translate(-50%, -50%);
}

/* All Add Method dialogs share this class; keep them in left app pane when PDF is open. */
body.ama-pdf-open .ch16-add-method-modal {
    left: calc((100vw - var(--ama-pdf-width) - 20px) / 2);
}

/* Grip/pinch invalid-readings modals: when PDF is open, dim only the main panel; PDF stays clear and usable */
body.ama-pdf-open #invalidModal,
body.ama-pdf-open #pinchInvalidModal {
    background-color: transparent;
    pointer-events: none;
    /* Above PDF viewer (1000) so transparent area still passes clicks through; dialog stacks above ::before */
    z-index: 1002;
    isolation: isolate;
}

body.ama-pdf-open #invalidModal::before,
body.ama-pdf-open #pinchInvalidModal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100vw - var(--ama-pdf-width) - 20px);
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    z-index: 0;
}

body.ama-pdf-open #invalidModal .modal-content,
body.ama-pdf-open #pinchInvalidModal .pinch-modal-content {
    pointer-events: auto;
    position: relative;
    z-index: 1;
    margin-top: 15vh;
    margin-bottom: 0;
    margin-left: max(20px, 4vw);
    margin-right: auto;
}

/* Invalid readings (grip/pinch): separate the call-to-action from the citation paragraph */
.invalid-readings-prompt {
    display: block;
    margin-top: 1.15em;
    padding-top: 0.4em;
    font-weight: 600;
    color: #333;
}

.addon-modal,
.addon-entry-modal {
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: left 0.25s ease, transform 0.25s ease;
}

.addon-hint,
.addon-entry-instruction {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
}

.addon-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.addon-option {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
}

.addon-option:hover {
    background-color: #e9e9e9;
}

.addon-option.selected {
    background-color: #1E90FF;
    color: white;
    border-color: #1E90FF;
}

.addon-modal .addon-selection-modal-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Narrow modal (~372px inner): fixed 200px×2 wraps; share row with flex + max-width */
.addon-modal .addon-selection-modal-actions button {
    display: inline-block;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: 200px;
    margin: 0;
    box-sizing: border-box;
}

.addon-entry-modal h2 {
    text-align: center;
}

.addon-entry-modal .addon-entry-instruction {
    text-align: center;
}

.addon-entry-list {
    overflow-y: auto;
    max-height: 40vh;
    margin: 12px 0;
    padding-right: 4px;
}

.addon-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.addon-entry-row:last-child {
    border-bottom: none;
}

.addon-entry-label {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Match ROM table number inputs for consistent look and spinner placement */
.addon-entry-input {
    width: 60px;
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box;
}

.addon-entry-total {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.45;
    color: #000000;
    margin-top: 8px;
}

.addon-max-cap-label {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.addon-max-cap-label .addon-max-cap-cb {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    cursor: pointer;
}

/* Higher specificity so .app-modal p doesn't override: subdued but readable */
.addon-entry-modal p.addon-entry-reference {
    margin: 44px 0 0;
    font-size: 14px;
    color: #333;
}

.addon-entry-reference .ama-pdf-link {
    color: #1E90FF;
    text-decoration: underline;
}

.addon-entry-modal .app-modal-actions {
    margin-top: 16px;
    text-align: center;
}

.addon-entry-modal .addon-entry-modal-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.addon-entry-modal .addon-entry-modal-actions button {
    display: inline-block;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: 200px;
    margin: 0;
    box-sizing: border-box;
}

.app-modal h2 {
    margin: 0 0 12px;
}

.app-modal p {
    margin: 0;
    font-size: 18px;
}

.ch16-delete-bodypart-message span {
    display: inline-block;
    margin-top: 4px;
}

.app-modal-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
}

.app-modal-list div {
    line-height: 1.3;
}

.app-modal-actions {
    margin-top: 12px;
}

.app-modal-extremity-hint {
    margin-bottom: 12px !important;
}

/* Injured extremity modal: room for Left/Right + Go Back | Next on one row */
.app-modal.app-modal--extremity-selection {
    width: min(440px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
}

/* Footer: Go Back left of Next, single horizontal row (avoid wrap from two×200px in narrow modal) */
.extremity-modal-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding-top: 8px;
}

.extremity-modal-actions button {
    display: inline-block;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: 200px;
    margin: 0;
}

.fingers-arthroplasty-assign-info-modal {
    text-align: left;
    width: min(520px, calc(100vw - 32px));
    max-height: min(85vh, 640px);
    overflow-y: auto;
}

.fingers-arthroplasty-assign-info-body {
    text-align: left;
}

.fingers-arthroplasty-assign-info-modal .fingers-arthroplasty-assign-info-body p {
    font-size: 15px;
    line-height: 1.45;
    margin: 0 0 12px;
    text-align: left;
}

.fingers-arthroplasty-assign-info-list {
    margin: 0 0 12px 1.35em;
    padding: 0;
    font-size: 15px;
    line-height: 1.45;
}

.fingers-arthroplasty-assign-info-list li {
    margin-bottom: 8px;
}

.fingers-arthroplasty-assign-info-list li:last-child {
    margin-bottom: 0;
}

.fingers-arthroplasty-assign-info-actions {
    text-align: center;
    margin-top: 18px;
}

.fingers-arthroplasty-assign-info-modal .fingers-arthroplasty-assign-info-ok {
    display: block;
    width: 200px;
    margin: 0 auto;
    padding: 10px;
    background-color: #1E90FF;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.fingers-arthroplasty-assign-info-modal .fingers-arthroplasty-assign-info-ok:hover {
    background-color: #1873CC;
}

.extremity-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 30px 0 6px 0;
}

.extremity-option {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 17px 24px 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
    text-align: center;
}

.extremity-option:hover {
    background-color: #e9e9e9;
    transform: translateY(-2px);
}

.extremity-option.selected {
    background-color: #1E90FF;
    color: white;
    border-color: #1E90FF;
}

.contralateral-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.contralateral-disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card:hover {
    background-color: #e9e9e9;
    transform: translateY(-5px);
}

.card.selected {
    background-color: #1E90FF;
    color: white;
}

.card.ch16-locked-selected {
    background-color: #6c8fb4;
    color: #fff;
    cursor: not-allowed;
}

.card.ch16-locked-selected:hover {
    background-color: #6c8fb4;
    transform: none;
}

.card-container.ch16-body-parts-locked {
    opacity: 0.58;
    pointer-events: none;
    user-select: none;
    filter: grayscale(0.2);
}

.card-container.ch16-body-parts-locked .card {
    cursor: not-allowed;
}

/* Ch. 16: hide body-part picker during calculator entry; tuck list under title */
#calculatorApp.ch16-calculator-phase .card-container {
    display: none;
}

#calculatorApp.ch16-calculator-phase #ch16BodyPartNav {
    display: none !important;
}

#calculatorApp.ch16-calculator-phase .calculators-container {
    margin-top: 8px;
}

button {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 10px;
    background-color: #1E90FF;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #1873CC;
}

.ch16-both-first-actions {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.ch16-both-first-actions button {
    display: inline-block;
    width: 200px;
    margin: 0;
}

.calculators-final-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.calculators-final-actions button {
    display: inline-block;
    width: 200px;
    margin: 0;
}

#ch16CalculatorsGoBackSecond {
    display: none;
}

/* Existing styles remain the same */

.options-container, .calculators-container {
    margin-top: 16px;
}

.options-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.options-actions button {
    display: inline-block;
    width: 200px;
    margin: 0;
}

/* Ch. 16 body-part grid: Go Back + Next (same treatment as .options-actions) */
.ch16-body-part-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.ch16-body-part-actions button {
    display: inline-block;
    width: 200px;
    margin: 0;
}

.option {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.option:hover {
    background-color: #e0e0e0;
}

.option-disabled {
    cursor: default;
    background-color: #f5f5f5;
    color: #777;
    /* keep same box model as normal .option so height matches */
}

.options-go-back-btn {
    position: relative;
    float: right;
    margin-top: -1px; /* nudge up ~1px to center vertically */
    margin-left: 8px;
    padding: 4px 6px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    background-color: #1E90FF;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    width: 80px; /* make button visibly about half the previous width */
}

.options-go-back-btn:hover {
    background-color: #1873CC;
}

.option.selected {
    background-color: #1E90FF;
    color: white;
}

.option.option-locked-selected {
    background-color: #6c8fb4;
    color: #fff;
    cursor: not-allowed;
}

.option.option-locked-selected:hover {
    background-color: #6c8fb4;
}

.calculator-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    /* Bottom inset below last content; nerve/vascular cards keep 20px */
    --ch16-card-pad-bottom: 16px;
    padding: 20px 20px var(--ch16-card-pad-bottom) 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: visible;
}

/* Needed for top tooltips: overflow-x:auto forces y-clipping in browsers */
.calculator-card.ch16-controls-card {
    overflow: visible;
}

.calculator-card:has(#other-nerves-total),
.calculator-card:has(#spinal-total),
.calculator-card:has(#brachial-total),
.calculator-card:has(#pv-total),
.calculator-card.overall-total {
    --ch16-card-pad-bottom: 20px;
}

/* Digit sensory calculators: no internal scrollbars needed */
.fingers-calculator-card {
    overflow-x: visible;
    overflow-y: visible;
}

.calculator-card h3 {
    margin-top: 0;
}

.ch16-card-header {
    position: relative;
    display: block;
    text-align: center;
    margin: 0;
}

.ch16-card-title {
    display: inline;
    line-height: inherit;
}

.ch16-card-title.ch16-pdf-open-two-line-title {
    display: inline-block;
    white-space: pre-line;
    text-align: center;
    line-height: 1.45;
}

.ch16-card-minimized-summary {
    display: block;
    margin-top: 6px;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.ch16-card-minimized-summary-line + .ch16-card-minimized-summary-line {
    margin-top: 2px;
}

.ch16-card-minimized-summary-line--used-crps {
    color: #999;
}

.ch16-card-controls {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(calc(-50% - 5px));
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ch16-card-control-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0;
}

.ch16-card-control-btn:hover {
    opacity: 0.7;
}

.ch16-card-control-btn[data-tooltip] {
    position: relative;
}

.ch16-card-control-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.12s ease;
}

.ch16-card-control-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.88);
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.12s ease;
}

.ch16-card-control-btn[data-tooltip]:hover::after,
.ch16-card-control-btn[data-tooltip]:hover::before,
.ch16-card-control-btn[data-tooltip]:focus-visible::after,
.ch16-card-control-btn[data-tooltip]:focus-visible::before {
    opacity: 1;
}

.ch16-card-control-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    overflow: visible;
}

.ch16-total-card-add-method-btn svg {
    width: 22px;
    height: 22px;
}

/* Body-part Total Impairment cards should not show horizontal scrollbars. */
.calculator-card:has([id^="totalImpairment-"]) {
    overflow: visible;
}

/* Keep Total Impairment lines wrapping so no horizontal scrollbar is needed. */
.calculator-card:has([id^="totalImpairment-"]) [id^="totalImpairment-"] p,
.calculator-card:has([id^="totalImpairment-"]) [id^="totalImpairment-"] strong,
.calculator-card:has([id^="totalImpairment-"]) [id^="totalImpairment-"] span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ch16-add-method-modal {
    width: min(440px, calc(100vw - 28px));
}

.ch16-add-method-instruction {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
    padding-bottom: 14px;
}

.ch16-add-method-list {
    margin-top: 0;
    padding-top: 8px;
    max-height: 320px;
    overflow: auto;
    /* Keep row borders/labels clear of the scrollbar track. */
    padding-right: 14px;
    box-sizing: content-box;
}

/* Keep the Add Method (digit) modal fully visible in shorter browser heights. */
.ch16-add-digit-method-modal {
    top: 16px;
    transform: translateX(-50%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding-top: 18px;
    padding-bottom: 18px;
}

.ch16-add-digit-method-modal .ch16-add-method-list {
    max-height: 240px;
}

.ch16-add-method-option {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease;
    box-sizing: border-box;
}

.ch16-add-method-option:hover {
    background-color: #eef6ff;
    border-color: #b8d7fb;
}

.ch16-add-method-option:first-child {
    margin-top: 6px;
}

.ch16-add-method-option input[type="checkbox"] {
    margin: 0;
}

.ch16-add-method-option-note {
    margin-left: auto;
    font-size: 12px;
    color: #888;
}

.ch16-add-method-option.is-disabled {
    color: #888;
    background: #f3f3f3;
    cursor: not-allowed;
}

.ch16-add-method-option.is-disabled:hover {
    background: #f3f3f3;
    border-color: #d8d8d8;
}

.ch16-add-method-actions {
    margin-top: 14px;
}

.calculator-card h3.ch16-card-header {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 8px;
}

/* Give a bit more space under headers for arthroplasty + shoulder instability cards */
.calculator-card:has([id$="-arthroplasty-total"]) h3.ch16-card-header,
.calculator-card:has(#shoulder-instability-total) h3.ch16-card-header {
    padding-bottom: 19px;
}

.calculator-card:has([id$="-arthroplasty-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has(#shoulder-instability-total) h3.ch16-card-header .ch16-card-controls {
    top: calc(50% - 5px);
}

/* Synovial cards need slightly tighter spacing under the header than default */
.calculator-card:has([id$="-synovial-hypertrophy-total"]) h3.ch16-card-header {
    padding-bottom: 1px;
}

.calculator-card:has([id$="-synovial-hypertrophy-total"]) h3.ch16-card-header .ch16-card-controls {
    transform: translateY(calc(-50% - 0px));
}

/* Match synovial header/icon spacing for instability variants requested */
.calculator-card:has([id$="-subluxation-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-passive-instability-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-active-deviation-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-carpal-instability-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-constrictive-tenosynovitis-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-rotational-deformity-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-lateral-deviation-total"]) h3.ch16-card-header,
.calculator-card:has([id$="-intrinsic-tightness-total"]) h3.ch16-card-header,
.calculator-card:has(#other-nerves-total) h3.ch16-card-header,
.calculator-card:has(#spinal-total) h3.ch16-card-header,
.calculator-card:has(#brachial-total) h3.ch16-card-header {
    padding-bottom: 1px;
}

/* Nerve entry tables need a larger visual gap under header */
.calculator-card:has(#other-nerves-total) h3.ch16-card-header,
.calculator-card:has(#spinal-total) h3.ch16-card-header,
.calculator-card:has(#brachial-total) h3.ch16-card-header,
.calculator-card:has(#pv-total) h3.ch16-card-header {
    padding-bottom: 19px;
}

.calculator-card:has(#other-nerves-total) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has(#spinal-total) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has(#brachial-total) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has(#pv-total) h3.ch16-card-header .ch16-card-controls {
    transform: translateY(calc(-50% - 9px));
}

.calculator-card:has([id$="-subluxation-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-passive-instability-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-active-deviation-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-carpal-instability-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-constrictive-tenosynovitis-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-rotational-deformity-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-lateral-deviation-total"]) h3.ch16-card-header .ch16-card-controls,
.calculator-card:has([id$="-intrinsic-tightness-total"]) h3.ch16-card-header .ch16-card-controls {
    transform: translateY(calc(-50% - 0px));
}

/* Digit amputation cards: add space below title for image/slider without moving header icons */
.calculator-card:has([id$="-amputation-total"]) h3.ch16-card-header {
    padding-bottom: 20px;
}

.calculator-card:has([id$="-amputation-total"]) h3.ch16-card-header .ch16-card-controls {
    top: calc(50% - 6px);
}

/* Optical alignment: refresh glyph sits lower in its viewbox than the others */
.ch16-card-controls .ch16-card-control-btn:nth-child(1) svg {
    transform: scale(1.05);
    transform-origin: center;
}

.ch16-card-controls .ch16-card-control-btn:nth-child(2) svg {
    transform: translate(-2px, -3px);
}

.ch16-card-controls .ch16-card-control-btn:nth-child(3) svg {
    transform: scale(1.1);
    transform-origin: center;
}

/* Total impairment controls are Minimize | Add Method | Trash; keep Add Method icon centered. */
.ch16-total-card-add-controls .ch16-card-control-btn:nth-child(2) svg {
    transform: translateY(-1px);
}

/* Hand/Multiple Fingers total card uses Minimize | Add Digit | Trash. */
.ch16-total-card-hand-controls .ch16-card-control-btn:nth-child(2) svg {
    transform: translateY(-1px) scale(1);
    transform-origin: center;
}

.calculator-card.is-minimized {
    /* Single-line minimized cards: tighter bottom inset (multi-line PN uses .ch16-minimized-with-summary below). */
    padding-bottom: 11px;
}

/* Grip/Pinch single-line minimized cards render slightly taller; tighten only these two without affecting others. */
.calculator-card.is-minimized:has(#grip-strength-total-line),
.calculator-card.is-minimized:has(#pinch-strength-total-line) {
    padding-bottom: 0;
}

/* Arm amputation minimized card only: tighten bottom padding without changing other minimized cards. */
.calculator-card.is-minimized:has(#armWpiValue) {
    padding-bottom: 10px;
}

.calculator-card.is-minimized h3.ch16-card-header {
    padding-bottom: 1px !important;
}

.calculator-card.is-minimized h3.ch16-card-header .ch16-card-controls {
    top: 50% !important;
    /* Nudge icons up; multi-line PN card overrides via .ch16-minimized-with-summary */
    transform: translateY(calc(-50% - 5px)) !important;
}

.calculator-card.is-minimized.ch16-minimized-with-summary {
    padding-bottom: 8px;
}

.calculator-card.is-minimized.ch16-minimized-with-summary h3.ch16-card-header {
    padding-bottom: 10px !important;
}

.calculator-card.is-minimized.ch16-minimized-with-summary h3.ch16-card-header .ch16-card-controls {
    transform: translateY(calc(-50% - 5px)) !important;
}

.calculator-card.is-minimized > :not(.ch16-card-header) {
    display: none !important;
}

/* Total impairment cards keep their header nested under #totalImpairment-*; hide only content when minimized. */
.calculator-card.ch16-total-card-minimized [id^="totalImpairment-"] > :not(.ch16-card-header) {
    display: none !important;
}

.calculator-card.ch16-total-card-minimized {
    padding-bottom: 11px;
}

.calculator-card.ch16-total-card-minimized h3.ch16-card-header {
    padding-bottom: 1px !important;
}

.rom-table, .strength-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.rom-table th, .rom-table td, .strength-table th, .strength-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.rom-table th, .strength-table .header-row th {
    background-color: #1E90FF;
    color: white;
}

.rom-table input[type="number"], .strength-table input[type="number"] {
    width: 60px;
    padding: 5px;
    text-align: center;
}

/* Almaraz calculator: reference column full width, text input left-aligned */
/* Almaraz calculator: reference column full width.
   Keep the generic left-alignment here, but override it for
   the standard ROM calculators (shoulder, elbow, wrist) below. */
.rom-table thead th:first-child,
.rom-table tbody td:first-child { text-align: left; }
.rom-table tbody td:first-child input[type="text"] {
    width: 100%;
    min-width: 200px;
    box-sizing: border-box;
    text-align: left;
}

/* Center the first-column labels (Angle° / Imp%) for
   shoulder, elbow, and wrist ROM calculators so they
   align visually with the rest of their columns. */
#shoulder-rom-simple .rom-table tbody td:first-child,
#shoulder-rom-contralateral .rom-table tbody td:first-child,
#elbow-rom-simple .rom-table tbody td:first-child,
#elbow-rom-contralateral .rom-table tbody td:first-child,
#wrist-rom-simple .rom-table tbody td:first-child,
#wrist-rom-contralateral .rom-table tbody td:first-child {
    text-align: center;
}

/* Thumb ROM: center joint labels and key text entries */
#thumb-rom-simple .rom-table td[rowspan="2"],
#thumb-rom-contralateral .rom-table td[rowspan="2"],
#thumb-rom-simple .rom-table td[rowspan="6"],
#thumb-rom-contralateral .rom-table td[rowspan="6"] {
    text-align: center;
    vertical-align: middle;
}

/* Center the Angle° / Imp% labels in the thumb ROM tables */
#thumb-rom-simple .rom-table tbody td.thumb-imp-label,
#thumb-rom-contralateral .rom-table tbody td.thumb-imp-label {
    text-align: center;
}

/* Digit ROM (index/middle/ring/little): center joint names and Imp% labels */
#index-rom-simple .rom-table td.digit-joint-label,
#middle-rom-simple .rom-table td.digit-joint-label,
#ring-rom-simple .rom-table td.digit-joint-label,
#little-rom-simple .rom-table td.digit-joint-label,
#index-rom-contralateral .rom-table td.digit-joint-label,
#middle-rom-contralateral .rom-table td.digit-joint-label,
#ring-rom-contralateral .rom-table td.digit-joint-label,
#little-rom-contralateral .rom-table td.digit-joint-label {
    text-align: center;
    vertical-align: middle;
}

#index-rom-simple .rom-table tbody td.digit-imp-label,
#middle-rom-simple .rom-table tbody td.digit-imp-label,
#ring-rom-simple .rom-table tbody td.digit-imp-label,
#little-rom-simple .rom-table tbody td.digit-imp-label,
#index-rom-contralateral .rom-table tbody td.digit-imp-label,
#middle-rom-contralateral .rom-table tbody td.digit-imp-label,
#ring-rom-contralateral .rom-table tbody td.digit-imp-label,
#little-rom-contralateral .rom-table tbody td.digit-imp-label {
    text-align: center;
}

.rom-table-contralateral .rom-subheader td {
    background-color: #e8eef5;
    font-size: 0.9em;
}

.rom-table-contralateral .rom-total-cell {
    background-color: #e0e0e0;
}

.rom-table-contralateral .rom-imp-output-cell {
    background-color: #e0e0e0;
}

.rom-table-contralateral input.rom-input-disabled,
.rom-table-contralateral input:disabled,
.rom-table input.rom-input-disabled,
.rom-table input:disabled {
    background-color: #e0e0e0;
    color: #888;
    cursor: not-allowed;
}

/* Thumb ROM CMC table: remove inner row lines between Radial/Adduction and Adduction/Opposition */
.thumb-rom-cmc-table tr:nth-child(4),
.thumb-rom-cmc-table tr:nth-child(6) {
    border-bottom: none;
}
.thumb-rom-cmc-table tr:nth-child(4) td,
.thumb-rom-cmc-table tr:nth-child(6) td {
    border-bottom: none;
}

.shoulder-rom-contralateral-option label {
    cursor: pointer;
    font-size: 0.95em;
}

.shoulder-rom-contralateral-option input[type="checkbox"],
.elbow-rom-contralateral-option input[type="checkbox"],
.wrist-rom-contralateral-option input[type="checkbox"],
.index-rom-contralateral-option input[type="checkbox"],
.middle-rom-contralateral-option input[type="checkbox"],
.ring-rom-contralateral-option input[type="checkbox"],
.little-rom-contralateral-option input[type="checkbox"],
.thumb-rom-contralateral-option input[type="checkbox"] {
    margin-right: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    vertical-align: middle;
}

.elbow-rom-contralateral-option label,
.wrist-rom-contralateral-option label,
.index-rom-contralateral-option label,
.middle-rom-contralateral-option label,
.ring-rom-contralateral-option label,
.little-rom-contralateral-option label,
.thumb-rom-contralateral-option label {
    cursor: pointer;
    font-size: 0.95em;
}

.instructions, .reference, .key {
    margin-top: 20px;
    font-size: 0.9em;
}

.key p {
    margin: 5px 0;
}

.arthroplasty-options, .instability-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.arthroplasty-option, .instability-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #1E90FF;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: white;
    margin-bottom: 10px;
}

.arthroplasty-option:hover, .instability-option:hover {
    background-color: #F0F8FF;
}

.arthroplasty-option label, .instability-option label {
    cursor: pointer;
    padding-left: 25px;
    position: relative;
    width: 100%;
    color: black;
    transition: color 0.3s ease;
}

.arthroplasty-option input[type="radio"]:checked + label,
.instability-option input[type="radio"]:checked + label {
    color: #1E90FF;
    font-weight: bold;
}

.arthroplasty-option label::before, .instability-option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #1E90FF;
    border-radius: 50%;
    background-color: white;
}

.arthroplasty-option input[type="radio"]:checked + label::after,
.instability-option input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #1E90FF;
    border-radius: 50%;
}

.arthroplasty-option input[type="radio"],
.instability-option input[type="radio"] {
    display: none;
}

.synovial-hypertrophy-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 15px;
}

.synovial-hypertrophy-table th,
.synovial-hypertrophy-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.synovial-hypertrophy-table thead th {
    background-color: #1E90FF;
    color: white;
    font-weight: bold;
}

/* Thumb amputation joint-level exclusion visual state for non-ROM cards */
.synovial-hypertrophy-table tr.thumb-amputation-joint-disabled td {
    background-color: #f3f3f3;
    color: #8a8a8a;
}

.arthroplasty-option.thumb-amputation-joint-disabled {
    background: #f3f3f3;
    color: #8a8a8a;
    border-color: #d9d9d9;
}

/* Unified "Total: …" line at bottom of calculator cards (matches breakdown <p> totals) */
.total-impairment,
.fingers-total-impairment,
#total-imp {
    text-align: left;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 0;
    color: #000000;
}

.total-impairment strong,
.fingers-total-impairment strong,
#total-imp strong {
    font-weight: 700;
}

.crps-result-item.total-impairment {
    text-align: left;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 0;
    color: #000000;
}

.crps-result-item.total-impairment strong {
    font-weight: 700;
}

.overall-total h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 25px;
}

.overall-total p {
    font-size: 1.1em;
    margin: 15px 0;
}

.ch16-running-totals-wrap {
    margin-top: 20px;
    margin-bottom: 4px;
}

.ch16-running-totals-card {
    margin-bottom: 16px;
    color: #4a4a4a;
}

.ch16-running-totals-card h3,
.ch16-running-totals-card p,
.ch16-running-totals-card strong {
    color: #4a4a4a;
}

.ch16-running-totals-card a {
    color: #1e90ff;
}

/* Update these styles for all checkbox types */
.synovial-checkbox,
.subluxation-checkbox,
.passive-instability-checkbox,
.active-deviation-checkbox,
.wrist-active-deviation-checkbox,
.carpal-instability-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #1E90FF;  /* Blue border */
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
    background-color: white;
}

.synovial-checkbox:checked,
.subluxation-checkbox:checked,
.passive-instability-checkbox:checked,
.active-deviation-checkbox:checked,
.wrist-active-deviation-checkbox:checked,
.carpal-instability-checkbox:checked {
    background-color: #1E90FF;  /* Blue fill when checked */
}

.synovial-checkbox:checked::after,
.subluxation-checkbox:checked::after,
.passive-instability-checkbox:checked::after,
.active-deviation-checkbox:checked::after,
.wrist-active-deviation-checkbox:checked::after,
.carpal-instability-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.synovial-checkbox:hover,
.subluxation-checkbox:hover,
.passive-instability-checkbox:hover,
.active-deviation-checkbox:hover,
.wrist-active-deviation-checkbox:hover,
.carpal-instability-checkbox:hover {
    background-color: #F0F8FF;  /* Light blue on hover */
}

.synovial-checkbox:checked:hover,
.subluxation-checkbox:checked:hover,
.passive-instability-checkbox:checked:hover,
.active-deviation-checkbox:checked:hover,
.wrist-active-deviation-checkbox:checked:hover,
.carpal-instability-checkbox:checked:hover {
    background-color: #1E90FF;  /* Keep blue when checked and hovered */
}

/* Update the arthroplasty-option styles */
.arthroplasty-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #1E90FF;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: white;
    margin-bottom: 10px;
}

.arthroplasty-option:hover {
    background-color: #F0F8FF;
}

.arthroplasty-option label {
    cursor: pointer;
    padding-left: 25px;
    position: relative;
    width: 100%;
    color: black;
    transition: color 0.3s ease;
}

/* Style for both radio and checkbox inputs */
.arthroplasty-option input[type="radio"],
.arthroplasty-option input[type="checkbox"] {
    display: none;
}

/* Style for both radio and checkbox labels */
.arthroplasty-option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #1E90FF;
    border-radius: 50%;
    background-color: white;
}

/* Style for both checked radio and checkbox labels */
.arthroplasty-option input[type="radio"]:checked + label,
.arthroplasty-option input[type="checkbox"]:checked + label {
    color: #1E90FF;
    font-weight: bold;
}

/* Style for both checked radio and checkbox indicators */
.arthroplasty-option input[type="radio"]:checked + label::after,
.arthroplasty-option input[type="checkbox"]:checked + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #1E90FF;
    border-radius: 50%;
}

/* Thumb ROM Calculator Styles */
#thumbCalculator {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

#thumbCalculator h3 {
    text-align: center;
    margin-bottom: 15px;
}

#thumbCalculator table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

#thumbCalculator th,
#thumbCalculator td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#thumbCalculator .blue-header {
    background-color: #1E90FF;
    color: white;
}

#thumbCalculator .blue-cell {
    background-color: #1E90FF;
}

#thumbCalculator .grey-cell {
    background-color: #f0f0f0;
}

#thumbCalculator .joints {
    text-align: left;
    font-weight: bold;
}

#thumbCalculator .empty {
    background-color: #ffffff;
}

#thumbCalculator .no-bottom-border {
    border-bottom: none;
}

#thumbCalculator .vertical-center {
    vertical-align: middle;
}

#thumbCalculator input[type="number"] {
    width: 60px;
    padding: 4px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    -moz-appearance: textfield;
    appearance: textfield;
}

#thumbCalculator input[type="number"]:focus {
    outline: none;
    border-color: #1E90FF;
}

/* Remove spinner buttons from number inputs */
#thumbCalculator input[type="number"]::-webkit-inner-spin-button,
#thumbCalculator input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#thumbCalculator input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Add these styles for the thumb subluxation checkboxes */
.thumb-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.thumb-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

/* Add these hover effects */
.thumb-subluxation-checkbox:hover {
    background-color: #F0F8FF;  /* Light blue on hover */
}

.thumb-subluxation-checkbox:checked:hover {
    background-color: #2196F3;  /* Keep blue when checked and hovered */
}

/* Styles for the index finger subluxation checkboxes */
.index-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.index-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

/* Hover effects for index subluxation checkboxes */
.index-subluxation-checkbox:hover {
    background-color: #F0F8FF;  /* Light blue on hover */
}

.index-subluxation-checkbox:checked:hover {
    background-color: #2196F3;  /* Keep blue when checked and hovered */
}

/* Styles for the middle finger subluxation checkboxes */
.middle-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.middle-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

/* Hover effects for middle subluxation checkboxes */
.middle-subluxation-checkbox:hover {
    background-color: #F0F8FF;  /* Light blue on hover */
}

.middle-subluxation-checkbox:checked:hover {
    background-color: #2196F3;  /* Keep blue when checked and hovered */
}

/* Styles for the ring finger subluxation checkboxes */
.ring-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.ring-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

/* Hover effects for ring subluxation checkboxes */
.ring-subluxation-checkbox:hover {
    background-color: #F0F8FF;  /* Light blue on hover */
}

.ring-subluxation-checkbox:checked:hover {
    background-color: #2196F3;  /* Keep blue when checked and hovered */
}
  
/* Styles for the little finger subluxation checkboxes */
.little-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.little-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

/* Hover effects for little subluxation checkboxes */
.little-subluxation-checkbox:hover {
    background-color: #F0F8FF;  /* Light blue on hover */
}

.little-subluxation-checkbox:checked:hover {
    background-color: #2196F3;  /* Keep blue when checked and hovered */
}

/* Styles for shoulder synovial hypertrophy checkboxes */
.shoulder-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.shoulder-synovial-checkbox:checked {
    background-color: #2196F3;
}

.shoulder-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.shoulder-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.shoulder-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for elbow synovial hypertrophy checkboxes */
.elbow-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.elbow-synovial-checkbox:checked {
    background-color: #2196F3;
}

.elbow-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.elbow-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.elbow-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for wrist synovial hypertrophy checkboxes */
.wrist-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.wrist-synovial-checkbox:checked {
    background-color: #2196F3;
}

.wrist-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.wrist-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.wrist-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb synovial hypertrophy checkboxes */
.thumb-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-synovial-checkbox:checked {
    background-color: #2196F3;
}

.thumb-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Thumb total impairment — p. 499 add vs combine option row */
.thumb-p499-total-option-row {
    margin-top: 10px;
    padding: 0 16px;
    border: 1px solid #b3d9f2;
    border-radius: 8px;
    background: #f5fafd;
    font-size: 16px;
    line-height: 1.5;
    color: #1a237e;
    box-sizing: border-box;
    width: fit-content;
    max-width: calc(100% - 50px);
}

.thumb-p499-total-option-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
}

.thumb-p499-total-option-label {
    font-weight: 600;
    margin-right: 0;
    font-size: 17px;
    flex-shrink: 0;
}

.thumb-p499-total-option-text {
    flex: 0 1 auto;
    font-size: 17px;
}

/* Pull “Add…” ~one space closer to “Option:” (flex gap still separates from Yes/No) */
.thumb-p499-total-option-label + .thumb-p499-total-option-text {
    margin-left: -5px;
}

.thumb-p499-total-option-answers {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Override global `button { width: 200px }` — p.499 Yes/No compact but readable */
.thumb-p499-toggle {
    display: inline-block;
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #cfd8dc;
    background: #fff;
    color: #1565c0;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
}

.thumb-p499-toggle:hover {
    border-color: #90caf9;
    background: #fafafa;
}

.thumb-p499-toggle:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.thumb-p499-toggle--active {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: 700;
}

.thumb-p499-toggle--active:hover {
    background: #d4e9fc;
    border-color: #1976d2;
}

.thumb-p499-info-btn {
    width: 28px;
    height: 28px;
    margin-left: 0;
    border-radius: 50%;
    border: 2px solid #2196f3;
    background: #fff;
    color: #2196f3;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.thumb-p499-info-btn:hover {
    background: #e3f2fd;
}

.thumb-p499-modal-title {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: #0d47a1;
}

.thumb-p499-modal-body {
    margin-bottom: 8px;
}

.thumb-p499-modal-quote {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.55;
}

.thumb-p499-modal-prompt {
    margin: 0;
    font-weight: 600;
}

.thumb-p499-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.thumb-p499-modal-btn {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid #1976d2;
    background: #2196f3;
    color: #fff;
    cursor: pointer;
}

.thumb-p499-modal-btn:hover {
    background: #1976d2;
}

/* p. 499 ? info modal (no title — body spacing tuned for first-line start) */
.thumb-p499-info-modal {
    padding-top: 28px;
    padding-bottom: 27px;
}

.thumb-p499-info-modal-body {
    margin: 0 0 4px;
    padding: 0 4px 0 2px;
}

.thumb-p499-info-modal-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #000;
}

.thumb-p499-info-modal-message .ama-pdf-link {
    color: #1e40af;
}

.thumb-p499-info-modal-message .thumb-p499-info-only-bold {
    font-style: normal;
    font-weight: 700;
}

.thumb-p499-info-modal-actions {
    margin-top: 18px;
    padding-top: 0;
}

/* Override global `button { margin: 20px auto }` for this modal footer */
.thumb-p499-info-modal button.thumb-p499-info-ok {
    margin: 0 auto;
}

/* Index finger total impairment — p. 499 add vs combine (same layout as thumb) */
.index-p499-total-option-row {
    margin-top: 10px;
    padding: 0 16px;
    border: 1px solid #b3d9f2;
    border-radius: 8px;
    background: #f5fafd;
    font-size: 16px;
    line-height: 1.5;
    color: #1a237e;
    box-sizing: border-box;
    width: fit-content;
    max-width: calc(100% - 50px);
}

.index-p499-total-option-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
}

.index-p499-total-option-label {
    font-weight: 600;
    margin-right: 0;
    font-size: 17px;
    flex-shrink: 0;
}

.index-p499-total-option-text {
    flex: 0 1 auto;
    font-size: 17px;
}

.index-p499-total-option-label + .index-p499-total-option-text {
    margin-left: -5px;
}

.index-p499-total-option-answers {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.index-p499-toggle {
    display: inline-block;
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #cfd8dc;
    background: #fff;
    color: #1565c0;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
}

.index-p499-toggle:hover {
    border-color: #90caf9;
    background: #fafafa;
}

.index-p499-toggle:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.index-p499-toggle--active {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: 700;
}

.index-p499-toggle--active:hover {
    background: #d4e9fc;
    border-color: #1976d2;
}

.index-p499-info-btn {
    width: 28px;
    height: 28px;
    margin-left: 0;
    border-radius: 50%;
    border: 2px solid #2196f3;
    background: #fff;
    color: #2196f3;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.index-p499-info-btn:hover {
    background: #e3f2fd;
}

.index-p499-info-modal {
    padding-top: 28px;
    padding-bottom: 27px;
}

.index-p499-info-modal-body {
    margin: 0 0 4px;
    padding: 0 4px 0 2px;
}

.index-p499-info-modal-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #000;
}

.index-p499-info-modal-message .ama-pdf-link {
    color: #1e40af;
}

.index-p499-info-modal-message .index-p499-info-only-bold {
    font-style: normal;
    font-weight: 700;
}

.index-p499-info-modal-actions {
    margin-top: 18px;
    padding-top: 0;
}

.index-p499-info-modal button.index-p499-info-ok {
    margin: 0 auto;
}

/* Middle finger total impairment — p. 499 add vs combine (same layout as index) */
.middle-p499-total-option-row {
    margin-top: 10px;
    padding: 0 16px;
    border: 1px solid #b3d9f2;
    border-radius: 8px;
    background: #f5fafd;
    font-size: 16px;
    line-height: 1.5;
    color: #1a237e;
    box-sizing: border-box;
    width: fit-content;
    max-width: calc(100% - 50px);
}

.middle-p499-total-option-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
}

.middle-p499-total-option-label {
    font-weight: 600;
    margin-right: 0;
    font-size: 17px;
    flex-shrink: 0;
}

.middle-p499-total-option-text {
    flex: 0 1 auto;
    font-size: 17px;
}

.middle-p499-total-option-label + .middle-p499-total-option-text {
    margin-left: -5px;
}

.middle-p499-total-option-answers {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.middle-p499-toggle {
    display: inline-block;
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #cfd8dc;
    background: #fff;
    color: #1565c0;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
}

.middle-p499-toggle:hover {
    border-color: #90caf9;
    background: #fafafa;
}

.middle-p499-toggle:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.middle-p499-toggle--active {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: 700;
}

.middle-p499-toggle--active:hover {
    background: #d4e9fc;
    border-color: #1976d2;
}

.middle-p499-info-btn {
    width: 28px;
    height: 28px;
    margin-left: 0;
    border-radius: 50%;
    border: 2px solid #2196f3;
    background: #fff;
    color: #2196f3;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.middle-p499-info-btn:hover {
    background: #e3f2fd;
}

.middle-p499-info-modal {
    padding-top: 28px;
    padding-bottom: 27px;
}

.middle-p499-info-modal-body {
    margin: 0 0 4px;
    padding: 0 4px 0 2px;
}

.middle-p499-info-modal-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #000;
}

.middle-p499-info-modal-message .ama-pdf-link {
    color: #1e40af;
}

.middle-p499-info-modal-message .middle-p499-info-only-bold {
    font-style: normal;
    font-weight: 700;
}

.middle-p499-info-modal-actions {
    margin-top: 18px;
    padding-top: 0;
}

.middle-p499-info-modal button.middle-p499-info-ok {
    margin: 0 auto;
}

/* Ring finger total impairment — p. 499 add vs combine (same layout as index/middle) */
.ring-p499-total-option-row {
    margin-top: 10px;
    padding: 0 16px;
    border: 1px solid #b3d9f2;
    border-radius: 8px;
    background: #f5fafd;
    font-size: 16px;
    line-height: 1.5;
    color: #1a237e;
    box-sizing: border-box;
    width: fit-content;
    max-width: calc(100% - 50px);
}

.ring-p499-total-option-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
}

.ring-p499-total-option-label {
    font-weight: 600;
    margin-right: 0;
    font-size: 17px;
    flex-shrink: 0;
}

.ring-p499-total-option-text {
    flex: 0 1 auto;
    font-size: 17px;
}

.ring-p499-total-option-label + .ring-p499-total-option-text {
    margin-left: -5px;
}

.ring-p499-total-option-answers {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.ring-p499-toggle {
    display: inline-block;
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #cfd8dc;
    background: #fff;
    color: #1565c0;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
}

.ring-p499-toggle:hover {
    border-color: #90caf9;
    background: #fafafa;
}

.ring-p499-toggle:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.ring-p499-toggle--active {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: 700;
}

.ring-p499-toggle--active:hover {
    background: #d4e9fc;
    border-color: #1976d2;
}

.ring-p499-info-btn {
    width: 28px;
    height: 28px;
    margin-left: 0;
    border-radius: 50%;
    border: 2px solid #2196f3;
    background: #fff;
    color: #2196f3;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.ring-p499-info-btn:hover {
    background: #e3f2fd;
}

.ring-p499-info-modal {
    padding-top: 28px;
    padding-bottom: 27px;
}

.ring-p499-info-modal-body {
    margin: 0 0 4px;
    padding: 0 4px 0 2px;
}

.ring-p499-info-modal-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #000;
}

.ring-p499-info-modal-message .ama-pdf-link {
    color: #1e40af;
}

.ring-p499-info-modal-message .ring-p499-info-only-bold {
    font-style: normal;
    font-weight: 700;
}

.ring-p499-info-modal-actions {
    margin-top: 18px;
    padding-top: 0;
}

.ring-p499-info-modal button.ring-p499-info-ok {
    margin: 0 auto;
}

/* Little finger total impairment — p. 499 add vs combine (same layout as index/middle/ring) */
.little-p499-total-option-row {
    margin-top: 10px;
    padding: 0 16px;
    border: 1px solid #b3d9f2;
    border-radius: 8px;
    background: #f5fafd;
    font-size: 16px;
    line-height: 1.5;
    color: #1a237e;
    box-sizing: border-box;
    width: fit-content;
    max-width: calc(100% - 50px);
}

.little-p499-total-option-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
}

.little-p499-total-option-label {
    font-weight: 600;
    margin-right: 0;
    font-size: 17px;
    flex-shrink: 0;
}

.little-p499-total-option-text {
    flex: 0 1 auto;
    font-size: 17px;
}

.little-p499-total-option-label + .little-p499-total-option-text {
    margin-left: -5px;
}

.little-p499-total-option-answers {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.little-p499-toggle {
    display: inline-block;
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #cfd8dc;
    background: #fff;
    color: #1565c0;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
}

.little-p499-toggle:hover {
    border-color: #90caf9;
    background: #fafafa;
}

.little-p499-toggle:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.little-p499-toggle--active {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: 700;
}

.little-p499-toggle--active:hover {
    background: #d4e9fc;
    border-color: #1976d2;
}

.little-p499-info-btn {
    width: 28px;
    height: 28px;
    margin-left: 0;
    border-radius: 50%;
    border: 2px solid #2196f3;
    background: #fff;
    color: #2196f3;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.little-p499-info-btn:hover {
    background: #e3f2fd;
}

.little-p499-info-modal {
    padding-top: 28px;
    padding-bottom: 27px;
}

.little-p499-info-modal-body {
    margin: 0 0 4px;
    padding: 0 4px 0 2px;
}

.little-p499-info-modal-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #000;
}

.little-p499-info-modal-message .ama-pdf-link {
    color: #1e40af;
}

.little-p499-info-modal-message .little-p499-info-only-bold {
    font-style: normal;
    font-weight: 700;
}

.little-p499-info-modal-actions {
    margin-top: 18px;
    padding-top: 0;
}

.little-p499-info-modal button.little-p499-info-ok {
    margin: 0 auto;
}

/* Styles for index synovial hypertrophy checkboxes */
.index-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-synovial-checkbox:checked {
    background-color: #2196F3;
}

.index-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.index-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle synovial hypertrophy checkboxes */
.middle-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-synovial-checkbox:checked {
    background-color: #2196F3;
}

.middle-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring synovial hypertrophy checkboxes */
.ring-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-synovial-checkbox:checked {
    background-color: #2196F3;
}

.ring-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little synovial hypertrophy checkboxes */
.little-synovial-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-synovial-checkbox:checked {
    background-color: #2196F3;
}

.little-synovial-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-synovial-checkbox:hover {
    background-color: #F0F8FF;
}

.little-synovial-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb excessive passive mediolateral instability checkboxes */
.thumb-passive-instability-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-passive-instability-checkbox:checked {
    background-color: #2196F3;
}

.thumb-passive-instability-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-passive-instability-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-passive-instability-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for index excessive passive mediolateral instability checkboxes */
.index-passive-instability-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-passive-instability-checkbox:checked {
    background-color: #2196F3;
}

.index-passive-instability-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-passive-instability-checkbox:hover {
    background-color: #F0F8FF;
}

.index-passive-instability-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle excessive passive mediolateral instability checkboxes */
.middle-passive-instability-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-passive-instability-checkbox:checked {
    background-color: #2196F3;
}

.middle-passive-instability-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-passive-instability-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-passive-instability-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring excessive passive mediolateral instability checkboxes */
.ring-passive-instability-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-passive-instability-checkbox:checked {
    background-color: #2196F3;
}

.ring-passive-instability-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-passive-instability-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-passive-instability-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little excessive passive mediolateral instability checkboxes */
.little-passive-instability-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-passive-instability-checkbox:checked {
    background-color: #2196F3;
}

.little-passive-instability-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-passive-instability-checkbox:hover {
    background-color: #F0F8FF;
}

.little-passive-instability-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb constrictive tenosynovitis checkboxes */
.thumb-constrictive-tenosynovitis-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-constrictive-tenosynovitis-checkbox:checked {
    background-color: #2196F3;
}

.thumb-constrictive-tenosynovitis-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-constrictive-tenosynovitis-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-constrictive-tenosynovitis-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for index constrictive tenosynovitis checkboxes */
.index-constrictive-tenosynovitis-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-constrictive-tenosynovitis-checkbox:checked {
    background-color: #2196F3;
}

.index-constrictive-tenosynovitis-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-constrictive-tenosynovitis-checkbox:hover {
    background-color: #F0F8FF;
}

.index-constrictive-tenosynovitis-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle constrictive tenosynovitis checkboxes */
.middle-constrictive-tenosynovitis-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-constrictive-tenosynovitis-checkbox:checked {
    background-color: #2196F3;
}

.middle-constrictive-tenosynovitis-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-constrictive-tenosynovitis-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-constrictive-tenosynovitis-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring constrictive tenosynovitis checkboxes */
.ring-constrictive-tenosynovitis-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-constrictive-tenosynovitis-checkbox:checked {
    background-color: #2196F3;
}

.ring-constrictive-tenosynovitis-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-constrictive-tenosynovitis-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-constrictive-tenosynovitis-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little constrictive tenosynovitis checkboxes */
.little-constrictive-tenosynovitis-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-constrictive-tenosynovitis-checkbox:checked {
    background-color: #2196F3;
}

.little-constrictive-tenosynovitis-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-constrictive-tenosynovitis-checkbox:hover {
    background-color: #F0F8FF;
}

.little-constrictive-tenosynovitis-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb rotational deformity checkboxes */
.thumb-rotational-deformity-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-rotational-deformity-checkbox:checked {
    background-color: #2196F3;
}

.thumb-rotational-deformity-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-rotational-deformity-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-rotational-deformity-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for index rotational deformity checkboxes */
.index-rotational-deformity-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-rotational-deformity-checkbox:checked {
    background-color: #2196F3;
}

.index-rotational-deformity-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-rotational-deformity-checkbox:hover {
    background-color: #F0F8FF;
}

.index-rotational-deformity-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle rotational deformity checkboxes */
.middle-rotational-deformity-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-rotational-deformity-checkbox:checked {
    background-color: #2196F3;
}

.middle-rotational-deformity-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-rotational-deformity-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-rotational-deformity-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring rotational deformity checkboxes */
.ring-rotational-deformity-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-rotational-deformity-checkbox:checked {
    background-color: #2196F3;
}

.ring-rotational-deformity-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-rotational-deformity-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-rotational-deformity-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little rotational deformity checkboxes */
.little-rotational-deformity-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-rotational-deformity-checkbox:checked {
    background-color: #2196F3;
}

.little-rotational-deformity-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-rotational-deformity-checkbox:hover {
    background-color: #F0F8FF;
}

.little-rotational-deformity-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb lateral deviation checkboxes */
.thumb-lateral-deviation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-lateral-deviation-checkbox:checked {
    background-color: #2196F3;
}

.thumb-lateral-deviation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-lateral-deviation-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-lateral-deviation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for index lateral deviation checkboxes */
.index-lateral-deviation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-lateral-deviation-checkbox:checked {
    background-color: #2196F3;
}

.index-lateral-deviation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-lateral-deviation-checkbox:hover {
    background-color: #F0F8FF;
}

.index-lateral-deviation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle lateral deviation checkboxes */
.middle-lateral-deviation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-lateral-deviation-checkbox:checked {
    background-color: #2196F3;
}

.middle-lateral-deviation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-lateral-deviation-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-lateral-deviation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring lateral deviation checkboxes */
.ring-lateral-deviation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-lateral-deviation-checkbox:checked {
    background-color: #2196F3;
}

.ring-lateral-deviation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-lateral-deviation-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-lateral-deviation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little lateral deviation checkboxes */
.little-lateral-deviation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-lateral-deviation-checkbox:checked {
    background-color: #2196F3;
}

.little-lateral-deviation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-lateral-deviation-checkbox:hover {
    background-color: #F0F8FF;
}

.little-lateral-deviation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb intrinsic tightness checkboxes */
.thumb-intrinsic-tightness-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-intrinsic-tightness-checkbox:checked {
    background-color: #2196F3;
}

.thumb-intrinsic-tightness-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-intrinsic-tightness-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-intrinsic-tightness-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for index intrinsic tightness checkboxes */
.index-intrinsic-tightness-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-intrinsic-tightness-checkbox:checked {
    background-color: #2196F3;
}

.index-intrinsic-tightness-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-intrinsic-tightness-checkbox:hover {
    background-color: #F0F8FF;
}

.index-intrinsic-tightness-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle intrinsic tightness checkboxes */
.middle-intrinsic-tightness-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-intrinsic-tightness-checkbox:checked {
    background-color: #2196F3;
}

.middle-intrinsic-tightness-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-intrinsic-tightness-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-intrinsic-tightness-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring intrinsic tightness checkboxes */
.ring-intrinsic-tightness-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-intrinsic-tightness-checkbox:checked {
    background-color: #2196F3;
}

.ring-intrinsic-tightness-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-intrinsic-tightness-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-intrinsic-tightness-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little intrinsic tightness checkboxes */
.little-intrinsic-tightness-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-intrinsic-tightness-checkbox:checked {
    background-color: #2196F3;
}

.little-intrinsic-tightness-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-intrinsic-tightness-checkbox:hover {
    background-color: #F0F8FF;
}

.little-intrinsic-tightness-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for thumb extensor tendon subluxation checkboxes */
.thumb-extensor-tendon-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.thumb-extensor-tendon-subluxation-checkbox {
    background-color: #2196F3;
}

.thumb-extensor-tendon-subluxation-checkbox::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.thumb-extensor-tendon-subluxation-checkbox:hover {
    background-color: #F0F8FF;
}

.thumb-extensor-tendon-subluxation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for index extensor tendon subluxation checkboxes */
.index-extensor-tendon-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.index-extensor-tendon-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.index-extensor-tendon-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.index-extensor-tendon-subluxation-checkbox:hover {
    background-color: #F0F8FF;
}

.index-extensor-tendon-subluxation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for middle extensor tendon subluxation checkboxes */
.middle-extensor-tendon-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.middle-extensor-tendon-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.middle-extensor-tendon-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.middle-extensor-tendon-subluxation-checkbox:hover {
    background-color: #F0F8FF;
}

.middle-extensor-tendon-subluxation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for ring extensor tendon subluxation checkboxes */
.ring-extensor-tendon-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.ring-extensor-tendon-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.ring-extensor-tendon-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.ring-extensor-tendon-subluxation-checkbox:hover {
    background-color: #F0F8FF;
}

.ring-extensor-tendon-subluxation-checkbox:checked:hover {
    background-color: #2196F3;
}

/* Styles for little extensor tendon subluxation checkboxes */
.little-extensor-tendon-subluxation-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #2196F3;
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 5px;
}

.little-extensor-tendon-subluxation-checkbox:checked {
    background-color: #2196F3;
}

.little-extensor-tendon-subluxation-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    z-index: 1;
}

.little-extensor-tendon-subluxation-checkbox:hover {
    background-color: #F0F8FF;
}

.little-extensor-tendon-subluxation-checkbox:checked:hover {
    background-color: #2196F3;
}

  /* Styles for digit amputation calculators */
.finger-diagram {
    position: relative;
    width: 200px;
    height: 400px;
    margin: 0 auto;
}

.finger-diagram img {
    position: relative;
    height: 100%;
    width: auto;
    display: block;
    margin: 0 auto;
}

.slider-container {
    position: absolute;
    top: 0;
    left: -50px;
    height: 100%;
    width: 60px;
}

input[type="range"] {
    position: absolute;
    left: 20px;
    top: 85px;
    width: 350px;
    height: 20px;
    -webkit-appearance: none;
    background: transparent;
    transform-origin: left;
    transform: rotate(90deg) translateX(-150px);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #0066ff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -8px;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0066ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

/* Styles for Digit - Sensory calculators */
.fingers-distribution-selection,
.fingers-sensory-quality {
    margin-bottom: 20px;
}

.fingers-nerve-selection {
    margin: 10px 0;
}

.fingers-nerve-line {
    display: flex;
    align-items: center;
    margin: 8px 0;
    gap: 4px;
    margin-left: 40px;
}

.fingers-nerve-line .fingers-options-container {
    display: flex;
    margin-left: -20px;
    gap: 4px;
}

.fingers-nerve-label {
    min-width: 160px;
    margin-left: 3px;
}

.fingers-nerve-line label {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    position: relative;
    top: 3px;
}

.fingers-nerve-line input[type="checkbox"] {
    margin-right: 2px;
}

.fingers-finger-diagram {
    position: relative;
    width: 200px;
    height: 400px;
    margin: 0 auto;
}

.fingers-finger-diagram img {
    position: relative;
    height: 100%;
    width: auto;
    display: block;
    margin: 0 auto;
    left: -4.5px;
}

.fingers-slider-group {
    position: absolute;
    top: 0;
    height: calc(100% + 20px);
    width: 60px;
}

.fingers-slider-group.left {
    left: -211px;
    top: 192px;
}

.fingers-slider-group.right {
    right: 138px;
    top: 192px;
}

.fingers-highlight-area {
    position: absolute;
    width: 98px;
    background-color: rgba(82, 144, 238, 0.2);
    pointer-events: none;
    left: 180px;
    transform: translateY(-174px);
    box-sizing: border-box;
    padding: 0px;
    margin: 0px;
    border-radius: 0px;
    transition: opacity 0.2s ease;
}

.fingers-slider-group.left .fingers-highlight-area {
    left: 200px;
    transform: translateY(-174px) scaleX(-1) scaleY(1);
}

.fingers-slider-group.right .fingers-highlight-area {
    left: 105px;
    transform: translateY(-174px) scaleX(-1) scaleY(1);
}

input[type="range"].fingers-slider {
    position: absolute;
    width: 390px;
    height: 20px;
    -webkit-appearance: none;
    background: transparent;
    transform-origin: center;
    transform: rotate(90deg) translateY(15px) translateX(-86px);
    pointer-events: none;
}

.fingers-slider-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.fingers-slider-container:first-child {
    bottom: 0;
}

.fingers-slider-container:last-child {
    bottom: 0px;
}

input[type="range"].fingers-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #0066ff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -8px;
    pointer-events: auto;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

input[type="range"].fingers-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    pointer-events: none;
}

.fingers-slider-container:last-child .fingers-slider::-webkit-slider-runnable-track {
    background: transparent;
}

.fingers-digit-lengths {
    position: relative;
    width: 100%;
    height: 0;
    margin: 20px 0;
}

.fingers-digit-length-left, .fingers-digit-length-right {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    top: -200px;
}

.fingers-digit-length-left {
    left: 65px;
    text-align: right;
}

.fingers-digit-length-right {
    right: 75px;
    text-align: left;
}

.fingers-digit-length-input {
    width: 65px;
    height: 24px;
    border: 1px solid #3B90FF;
    border-radius: 4px;
    background-color: #EBF3FF;
    text-align: center;
    font-size: 14px;
    color: #333;
    -moz-appearance: textfield;
    padding-right: 8px;
}

.fingers-digit-length-input::-webkit-outer-spin-button,
.fingers-digit-length-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fingers-digit-length-wrapper {
    position: relative;
    display: inline-block;
}

.fingers-spinner-buttons {
    position: absolute;
    right: 1px;
    top: 1px;
    width: 14px;
    height: 25.6px; 
    display: none;
    flex-direction: column;
    background-color: #f0f0f0;
    border-radius: 0 3px 3px 0;
}

.fingers-digit-length-wrapper:hover .fingers-spinner-buttons {
    display: flex;
}

.fingers-spinner-up,
.fingers-spinner-down {
    height: 12.8px;
    width: 14px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.fingers-spinner-up {
        border-radius: 0 3px 0 0;
}

.fingers-spinner-down {
    border-radius: 0 0 3px 0;
}

.fingers-spinner-up:hover,
.fingers-spinner-down:hover {
    background-color: #c7c7c7; /* Darker grey on hover */
}

.fingers-spinner-up::after,
.fingers-spinner-down::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    position: absolute;
}

.fingers-spinner-up::after {
    border-bottom: 4px solid #666;
    margin-top: 0;
}

.fingers-spinner-down::after {
    border-top: 4px solid #666;
    margin-top: 0;
}

.fingers-reference {
    font-size: 0.9em;
    color: #000000;
    margin: 20px 0;
}

/* Ensure full reference link text remains clickable. */
.fingers-reference .ama-pdf-link {
    display: inline-block;
    position: relative;
    z-index: 2;
}

/* Neuroma alternative options "Next" button */
.fingers-neuroma-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 40px;
}

.fingers-neuroma-option label {
    display: flex !important;
    align-items: center;
    margin-left: 0 !important;
    margin-bottom: 0 !important;
}

.fingers-neuroma-next-button {
    display: inline-block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    width: auto;
    margin: 0;
    padding: 6px 10px;
    background-color: #1E90FF;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.fingers-neuroma-next-button.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.fingers-neuroma-next-button:hover {
    background-color: #1873CC;
}

/* Collapsible neuroma options (digit sensory cards) */
.fingers-neuroma-options-accordion {
    margin: 12px 0 16px 40px;
    /* Fixed width open/closed so the right border does not shift (room for option 2 + Next) */
    width: min(100%, calc(53.5rem + 2px));
    box-sizing: border-box;
    border: 1px solid #1e90ff;
    border-radius: 4px;
    overflow: hidden;
    /* Match header grey so no white sliver shows above bottom border when collapsed */
    background: #e8e8e8;
}

/* Thumb amputation card: about 1/3 shorter than the default accordion width */
.thumb-amputation-options-accordion {
    width: min(100%, calc(35.67rem + 2px));
    margin-top: 22px;
}

.thumb-amputation-card .total-impairment {
    margin-top: 16px;
}

.thumb-proximal-disabled {
    opacity: 0.55;
}

.arm-amputation-excluded-disabled {
    opacity: 0.55;
}

.synovial-hypertrophy-table tr.arm-amputation-joint-disabled td {
    background-color: #f3f3f3;
    color: #8a8a8a;
}

.arthroplasty-option.arm-amputation-joint-disabled {
    background: #f3f3f3;
    color: #8a8a8a;
    border-color: #d9d9d9;
}

.fingers-neuroma-options-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    /* Right padding insets chevron from card edge (matches panel inner for second-row Next) */
    padding: 6px 13px 6px 12px;
    border: none;
    background: #e8e8e8;
    font: inherit;
    font-weight: 600;
    color: #222;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.fingers-neuroma-options-toggle:hover {
    background: #dde8f4;
}

.fingers-neuroma-options-toggle:active {
    background: #d0dfef;
}

.fingers-neuroma-options-toggle:focus-visible {
    outline: 2px solid #1e90ff;
    outline-offset: 2px;
}

.fingers-neuroma-options-toggle-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #1e90ff;
    border-radius: 4px;
    transition: transform 0.3s ease;
    /* ::after draws a down chevron; 90deg CW makes it point left when closed */
    transform: rotate(90deg);
}

.fingers-neuroma-options-accordion.is-open .fingers-neuroma-options-toggle-chevron {
    transform: rotate(0deg);
}

/* White caret: points down when open (parent 0deg); points left when closed (parent 90deg) */
.fingers-neuroma-options-toggle-chevron::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    margin-top: -2px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

/* max-height collapse avoids grid 0fr subpixel gaps that showed white above the bottom border */
.fingers-neuroma-options-panel {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.fingers-neuroma-options-accordion.is-open .fingers-neuroma-options-panel {
    max-height: 22rem;
}

.fingers-neuroma-options-panel-inner {
    overflow: hidden;
    min-height: 0;
    /* Left 12px with title; right matches toggle — second-row Next aligns under chevron */
    padding: 0 13px 5px 12px;
    background: #fff;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option {
    margin-left: 0;
    gap: 8px;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option label {
    gap: 0.35rem;
    /* Don't shrink label so text wraps early; let row use accordion max-width first */
    flex: 0 1 auto;
    min-width: max-content;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option label input[type="checkbox"] {
    top: 4px;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option:first-of-type label input[type="checkbox"] {
    top: 6px;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option ~ .fingers-neuroma-option label input[type="checkbox"] {
    top: 3px;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option:first-of-type {
    margin-top: 10px;
    /* Next sits after option text; second row keeps space-between for right-aligned Next */
    justify-content: flex-start;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option:first-of-type label span {
    top: 7px;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option:first-of-type .fingers-neuroma-next-button {
    position: relative;
    top: 6px;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option ~ .fingers-neuroma-option .fingers-neuroma-next-button {
    position: relative;
    top: 2px;
}

.fingers-neuroma-options-panel-inner .fingers-neuroma-option ~ .fingers-neuroma-option label span {
    top: 4px;
}

@media (max-width: 640px) {
    .fingers-neuroma-options-accordion {
        margin-left: 16px;
        margin-right: 8px;
    }

    .fingers-arthroplasty-assign-options.fingers-neuroma-options-accordion {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Digit arthroplasty — Assigning/Combining Options (~2/3 width of Neuroma accordion; same open/closed width) */
.fingers-arthroplasty-assign-options.fingers-neuroma-options-accordion {
    margin-top: 20px;
    margin-left: 0;
    margin-right: 0;
    width: min(100%, calc(35.67rem + 2px));
}

/* Thumb — severe implant failure (p. 505); matches Assigning/Combining accordion width */
.fingers-arthroplasty-severe-failure-options.fingers-neuroma-options-accordion {
    margin-top: 12px;
    margin-left: 0;
    margin-right: 0;
    width: min(100%, calc(35.67rem + 2px));
}

.fingers-arthroplasty-severe-failure-option-list.arthroplasty-options {
    margin-bottom: 0;
    gap: 8px;
}

/* Wrist arthroplasty — severe failure (no digit assign/combine row; align to card width) */
.fingers-neuroma-options-accordion.wrist-arthroplasty-severe-failure-accordion {
    margin-left: 0;
    margin-right: 0;
    margin-top: 12px;
    width: 100%;
    max-width: min(100%, calc(53.5rem + 2px));
}

/* Elbow arthroplasty — severe failure (same layout as wrist) */
.fingers-neuroma-options-accordion.elbow-arthroplasty-severe-failure-accordion {
    margin-left: 0;
    margin-right: 0;
    margin-top: 12px;
    width: 100%;
    max-width: min(100%, calc(53.5rem + 2px));
}

/* Shoulder arthroplasty — severe failure (same layout as elbow) */
.fingers-neuroma-options-accordion.shoulder-arthroplasty-severe-failure-accordion {
    margin-left: 0;
    margin-right: 0;
    margin-top: 12px;
    width: 100%;
    max-width: min(100%, calc(53.5rem + 2px));
}

/* Arthroplasty accordions: grey header row = title (flex) + ? + blue chevron */
.fingers-arthroplasty-accordion-header-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    background: #e8e8e8;
    box-sizing: border-box;
}

.fingers-arthroplasty-accordion-header-bar .fingers-neuroma-options-toggle--title {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 6px 6px 12px;
}

.fingers-arthroplasty-accordion-header-bar .fingers-neuroma-options-toggle--chevron {
    flex: 0 0 auto;
    width: auto;
    justify-content: center;
    padding: 6px 13px 6px 4px;
    gap: 0;
}

.fingers-arthroplasty-assign-help.fingers-arthroplasty-assign-help--header {
    position: static;
    flex-shrink: 0;
    margin: 0 6px 0 0;
}

.fingers-arthroplasty-assign-help {
    position: absolute;
    top: 8px;
    right: 18px;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: 2px solid #1e90ff;
    border-radius: 50%;
    background: #fff;
    color: #1e90ff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.fingers-arthroplasty-assign-help:hover,
.fingers-arthroplasty-assign-help:focus-visible {
    background: #eef6ff;
}

.fingers-arthroplasty-assign-help:focus-visible {
    outline: 2px solid #1e90ff;
    outline-offset: 2px;
}

/* Space below grey header when accordion is open (Assigning/Combining + severe failure) */
.fingers-arthroplasty-assign-options-inner {
    padding-top: 20px;
}

.fingers-arthroplasty-assign-options-inner .fingers-arthroplasty-assign-option label {
    margin-left: 0;
}

.fingers-arthroplasty-assign-options-inner .fingers-arthroplasty-assign-option:first-of-type {
    margin-top: 0;
}

/* Custom checkbox styles */
.fingers-distribution-selection label,
.fingers-nerve-selection label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    margin-left: 40px;
    display: block;
}

/* Add this to center the title */
.fingers-calculator-card h3 {
    text-align: center;
    margin-bottom: 20px;
}

/* Add styling for the new section */
.fingers-involvement-section {
    margin-bottom: 20px;
}

.fingers-involvement-section p {
    margin-bottom: 15px;
}

/* Primary slider track */
.fingers-primary-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    pointer-events: none;
}

/* Secondary slider track (transparent) */
.fingers-secondary-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: transparent !important;
    border: none !important;
    border-radius: 2px;
    pointer-events: none;
}

.fingers-secondary-slider::-moz-range-track {
    background: transparent !important;
    border: none !important;
}

/* Add these new styles for the digit length labels */
.fingers-digit-length-label {
    text-align: right;
    line-height: 1.2;
}

.fingers-digit-length-right .fingers-digit-length-label {
    text-align: left;
}

/* Update the existing digit-length styles to accommodate the new structure */
.fingers-digit-length-left, .fingers-digit-length-right {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    top: -260px;
}

.fingers-digit-length-left {
    left: 215px;
}

.fingers-digit-length-right {
    right: 225px;
}
/* Add these styles to adjust the label alignment */
.fingers-digit-length-label div:first-child {
    margin-right: 15px;
}

/* Add styles for focus state and when spinbuttons are active */
.fingers-digit-length-input:focus,
.fingers-digit-length-wrapper:hover .fingers-digit-length-input {
    outline: none;
    border: 1px solid #3B90FF;
    box-shadow: 0 0 0 1px #3B90FF;
}

/* Add hover state */
.fingers-distribution-selection input[type="checkbox"]:hover:not(:checked),
.fingers-nerve-selection input[type="checkbox"]:hover:not(:checked) {
    background-color: #F0F8FF;
}

/* Add styles for the checkbox label text */
.fingers-distribution-selection label span {
    position: relative;
    top: 2px;
}

.fingers-nerve-line label span {
    position: relative;
    top: 2px;
    left: -2px;
}

.fingers-slider-group.right .fingers-slider-container {
    position: absolute;
    width: 100%;
    height: 100%;
    left: -2px;
}

.fingers-slider-group.left .fingers-slider-container {
    position: absolute;
    width: 100%;
    height: 100%;
    left: -3px;
}

/* Add these styles back for checkboxes */
.fingers-distribution-selection input[type="checkbox"],
.fingers-nerve-selection input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #3B90FF;
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.2s ease;
    background-color: white;
}

/* Add back the checkbox checked state */
.fingers-distribution-selection input[type="checkbox"]:checked,
.fingers-nerve-selection input[type="checkbox"]:checked {
    background-color: #3B90FF;
}

/* Add back the checkmark */
.fingers-distribution-selection input[type="checkbox"]:checked::after,
.fingers-nerve-selection input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Add back the spinner buttons positioning */
.fingers-digit-length-input:focus ~ .fingers-spinner-buttons,
.fingers-digit-length-wrapper:hover .fingers-spinner-buttons {
    display: flex;
    right: 2px;
}

/*Specific to Thumb - Sensory */
.thumb-sensory-diagram {
    position: relative;
    width: 208px;
    height: 416px;
    margin: 0 auto;
}

.thumb-sensory-diagram img {
    position: relative;
    height: 100%;
    width: auto;
    display: block;
    margin: 0 auto;
    left: -.3px;
    top: -4.5px;
}

/* PDF-open thumb sensory: keep side boxes out of diagram center and place labels above inputs. */
body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-left,
body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-right {
    flex-direction: column;
    gap: 8px;
    top: -272px;
}

body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-left {
    left: 40px;
    align-items: center;
    text-align: center;
}

body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-left .fingers-digit-length-wrapper {
    transform: translateX(-4px);
}

body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-right {
    right: 40px;
    align-items: center;
    text-align: center;
}

body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-label,
body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-right .fingers-digit-length-label {
    text-align: center;
    line-height: 1.15;
}

body.ama-pdf-open #thumb-sensory-general-wrap .fingers-digit-length-label div:first-child {
    margin-right: 0;
}

/* PDF-open finger sensory (index/middle/ring/little): move side boxes out and stack labels above. */
body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-right,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-right,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-right,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-right {
    flex-direction: column;
    gap: 8px;
    top: -272px;
}

body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-left,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-left {
    left: 52px;
    align-items: center;
    text-align: center;
}

body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-right,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-right,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-right,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-right {
    right: 52px;
    align-items: center;
    text-align: center;
}

body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-right .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-right .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-right .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-label,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-right .fingers-digit-length-label {
    text-align: center;
    line-height: 1.15;
}

body.ama-pdf-open .calculator-card:has(#if-ulnar-length) .fingers-digit-length-label div:first-child,
body.ama-pdf-open .calculator-card:has(#mf-ulnar-length) .fingers-digit-length-label div:first-child,
body.ama-pdf-open .calculator-card:has(#rf-ulnar-length) .fingers-digit-length-label div:first-child,
body.ama-pdf-open .calculator-card:has(#lf-ulnar-length) .fingers-digit-length-label div:first-child {
    margin-right: 0;
}

/* PDF-open thumb + digit sensory: Neuroma Options — full card width; label row wraps; Next on its own row (visible beside PDF viewer). */
body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-accordion {
    width: 100%;
    max-width: 100%;
    margin-left: 16px;
    margin-right: 0;
    box-sizing: border-box;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-accordion.is-open .fingers-neuroma-options-panel {
    max-height: 28rem;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner {
    padding-top: 10px;
    padding-bottom: 12px;
}

/* Neuroma rows also use .fingers-distribution-selection (default margin-bottom: 20px) — tighten for PDF-open layout. */
body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option.fingers-distribution-selection {
    margin-bottom: 0;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option {
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    row-gap: 6px;
    column-gap: 8px;
    margin-top: 0;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option:first-of-type {
    margin-top: 6px;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option ~ .fingers-neuroma-option {
    margin-top: 14px;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option label {
    /* Shrink to longest line so Next sits beside text, not at far right of card */
    flex: 0 1 auto;
    width: max-content;
    max-width: calc(100% - 4.75rem);
    min-width: 0;
    align-items: flex-start;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option label span {
    white-space: normal;
    min-width: 0;
    flex: 0 1 auto;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-next-button {
    margin-left: 0;
    flex: 0 0 auto;
    position: relative;
    top: 0;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option label input[type="checkbox"] {
    top: 0;
    flex: 0 0 auto;
    align-self: flex-start;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    box-sizing: border-box;
}

body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option:first-of-type label span,
body.ama-pdf-open .fingers-calculator-card:has([id$="-sensory-general-wrap"]) .fingers-neuroma-options-panel-inner .fingers-neuroma-option ~ .fingers-neuroma-option label span {
    top: 0;
}

/* Index / middle / ring — Sensory (Neuroma) */
.fingers-sensory-general-wrap {
    display: block;
}

.fingers-sensory-neuroma-wrap {
    max-width: 100%;
    width: 100%;
    margin: 0 0 1rem;
    text-align: left;
    box-sizing: border-box;
}

.fingers-neuroma-sensory-heading {
    text-align: left;
    margin-bottom: 0.75rem;
}

.fingers-neuroma-sensory-instruction {
    margin: 0 0 1rem;
    text-align: left;
    max-width: none;
}

.fingers-neuroma-sensory-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    margin: 0 0 1.25rem;
    width: 100%;
}

.fingers-neuroma-sensory-field--side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 0 0 auto;
    margin-top: 9rem;
    text-align: left;
    font-size: inherit;
}

.fingers-neuroma-sensory-field--side .fingers-digit-length-wrapper {
    flex-shrink: 0;
}

/* Option 2: nerve already fixed from general sensory — locked neuroma % field */
.fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-pct-input:disabled {
    background-color: #e8e8e8;
    color: #555;
    cursor: not-allowed;
}

.fingers-sensory-neuroma-wrap .fingers-digit-length-wrapper:has(.fingers-neuroma-sensory-pct-input:disabled)
    .fingers-spinner-up:disabled,
.fingers-sensory-neuroma-wrap .fingers-digit-length-wrapper:has(.fingers-neuroma-sensory-pct-input:disabled)
    .fingers-spinner-down:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Nudge only the Ulnar input (blue box) left; label and diagram positions unchanged in layout. */
.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-digit-length-wrapper {
    transform: translateX(-0.25rem);
}

/* Match regular digit sensory label typography, but keep neuroma wording in 3 lines. */
.fingers-neuroma-sensory-label-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.2;
    color: #333;
    font-size: inherit;
    font-weight: 400;
    min-width: 84px;
}

.fingers-neuroma-sensory-label-line {
    display: block;
    line-height: 1.2;
}

/* Left side label should face inward toward its box/image. */
.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-neuroma-sensory-label-stack {
    align-items: center;
    text-align: center;
    transform: translateX(-1.2rem);
}

.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-neuroma-sensory-label-line:first-child {
    transform: translateX(0.16rem);
}

.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child .fingers-neuroma-sensory-label-line:last-child {
    transform: translateX(0.32rem);
}

/* Nudge ulnar group left so image-to-box spacing matches radial side. */
.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child {
    margin-right: 2.75rem;
}

/* Right side label should read left-to-right toward its box. */
.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child .fingers-neuroma-sensory-label-stack {
    align-items: flex-start;
    text-align: left;
}

/* Radial column sits closer to the diagram than ulnar (label width / wrap); offset right for symmetric gaps. */
.fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child {
    margin-left: 2.5rem;
}

/* PDF-open neuroma sensory: place side labels above blue inputs and nudge right input left. */
body.ama-pdf-open .fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-field--side {
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

body.ama-pdf-open .fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-label-stack {
    min-width: 0;
    align-items: center;
    text-align: center;
    transform: none;
}

body.ama-pdf-open .fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-label-line:first-child,
body.ama-pdf-open .fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-label-line:last-child {
    transform: none;
}

/* Keep left input as-is; move the right-side input slightly left for centering. */
body.ama-pdf-open .fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child .fingers-digit-length-wrapper {
    transform: translateX(-6px);
}

/* Left hand: DOM order Radial | diagram | Ulnar — mirror label/box nudges from right-hand (Ulnar | diagram | Radial). */
.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-digit-length-wrapper {
    transform: none;
}

.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child .fingers-digit-length-wrapper {
    transform: translateX(-0.25rem);
}

.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-neuroma-sensory-label-stack {
    align-items: flex-start;
    text-align: left;
    transform: none;
}

.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-neuroma-sensory-label-line:first-child {
    transform: none;
}

.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child .fingers-neuroma-sensory-label-line:last-child {
    transform: translateX(0.32rem);
}

.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child .fingers-neuroma-sensory-label-stack {
    align-items: center;
    text-align: center;
    transform: translateX(-1.2rem);
}

.fingers-sensory-neuroma-wrap--left-hand .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child .fingers-neuroma-sensory-label-line:first-child {
    transform: translateX(0.16rem);
}

.fingers-neuroma-sensory-diagram-wrap {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}

.fingers-neuroma-sensory-diagram-img {
    display: block;
    max-height: 380px;
    width: auto;
    max-width: min(220px, 100%);
    margin: 0.35rem auto 0;
    object-fit: contain;
}

/* Ring neuroma: less space between p.448 swap row and exit bar (vs default 20px on .fingers-distribution-selection) */
#rf-neuroma-p448-swap-row {
    margin-bottom: 8px;
}

/* Reference sits below exit bar */
.fingers-sensory-neuroma-wrap .fingers-neuroma-sensory-reference-below-exit {
    margin: 12px 0 12px;
    overflow-x: visible;
}

/* Neuroma sensory “exit” row — shrink-wraps to label + button (not full card width) */
.fingers-neuroma-sensory-exit-shell {
    display: inline-block;
    vertical-align: top;
    margin: 12px 0 7px 40px;
    width: max-content;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #1e90ff;
    border-radius: 4px;
    overflow: hidden;
    background: #e8e8e8;
}

.fingers-neuroma-sensory-exit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 6px 10px;
    box-sizing: border-box;
    background: #e8e8e8;
    font: inherit;
    font-weight: 600;
    color: #222;
    text-align: left;
}

.fingers-neuroma-sensory-exit-bar-label {
    flex: 0 1 auto;
    min-width: 0;
    line-height: 1.25;
}

.fingers-neuroma-sensory-go-back {
    flex-shrink: 0;
    margin: 0;
    min-width: 0;
    width: auto;
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 9px;
    background-color: #1e90ff;
    color: #fff;
    border: 1px solid #1e90ff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.fingers-neuroma-sensory-go-back:hover {
    background-color: #1873cc;
    border-color: #1873cc;
}

.fingers-neuroma-sensory-go-back:focus-visible {
    outline: 2px solid #1e90ff;
    outline-offset: 2px;
}

/* Same typography as digit sensory .fingers-reference; wrap naturally — no horizontal scroll region */
.fingers-sensory-neuroma-wrap .fingers-reference {
    overflow-x: visible;
}

.fingers-sensory-neuroma-wrap .fingers-reference p {
    margin: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 640px) {
    .fingers-neuroma-sensory-layout {
        flex-wrap: wrap;
        justify-content: center;
    }

    .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:last-child {
        margin-left: 0;
    }

    .fingers-neuroma-sensory-layout > .fingers-neuroma-sensory-field--side:first-child {
        margin-right: 0;
    }

    .fingers-neuroma-sensory-field--side {
        margin-top: 0;
    }

    .fingers-neuroma-sensory-diagram-wrap {
        flex: 1 1 100%;
        order: -1;
    }

    .fingers-neuroma-sensory-exit-shell {
        margin-left: 16px;
        margin-right: 8px;
    }
}
