: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;
}

/* First-paint FOUC: all main sections start .hidden, so .container would briefly show as an empty white
   strip on grey before init reveals auth / landing / Ch.16 (notably after PD → IME full navigation). */
body.ime-app-shell-pending .container {
    visibility: hidden;
}

/* PD → IME Go Back: same boot overlay styling as PD Studio (pd-calculator/css/styles.css). */
.pd-boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 25px;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f1f5f9;
    color: #64748b;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.pd-boot-overlay__text {
    margin: 0;
}

body.ime-shell--booting .pd-boot-overlay {
    display: flex;
}

html:has(body.ime-shell--booting) {
    overflow-y: scroll;
}

body.ime-shell--booting .container {
    visibility: hidden;
}

.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: 6px;
}

/* 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: row;
    z-index: 1000;
}

/* PDF column (header + toolbar + page). The chat panel is its sibling column. */
.ama-pdf-main {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* With the chat open on wide screens, the chat column is fixed at the Occ
   chat drawer width (28rem) and the calculator and PDF split the remaining
   space equally: viewer = half the leftover + the chat width. */
@media (min-width: 1301px) {
    body.ama-pdf-open.ama-chat-open {
        --ama-pdf-width: calc(50vw + 14rem);
    }
}

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

.ama-pdf-title {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 178px;
    margin-right: 2px;
    font-weight: 600;
    color: #1E3A8A;
    font-size: 14px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.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;
    margin-left: auto;
    flex-shrink: 1;
    min-width: 0;
}

.ama-pdf-toggle-button {
    position: relative;
    left: 0;
    margin-left: 2px;
    flex-shrink: 0;
    padding: 5px 8px;
    min-width: 64px;
    font-size: 11px;
    border-radius: 999px;
    background-color: #04B583;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.ama-pdf-toggle-button:hover {
    background-color: #039b70;
    box-shadow: 0 0 0 1px rgba(4, 181, 131, 0.2);
}

.ama-pdf-search-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #111827;
    background-color: #eef3ff;
    border-radius: 999px;
    padding: 2px 3px 2px 10px;
    border: 1px solid #c4d2ff;
    flex-shrink: 1;
    min-width: 0;
}

.ama-pdf-search-label input[type="text"] {
    border: none;
    outline: none;
    font-size: 11px;
    padding: 3px 2px;
    min-width: 56px;
    width: 192px;
    max-width: 100%;
    flex: 1 1 auto;
    flex-shrink: 1;
    background: transparent;
    color: #111827;
}

/* Keep the compact search width when AMA Chat takes horizontal space. */
body.ama-chat-open .ama-pdf-search-label input[type="text"] {
    width: 128px;
}

.ama-pdf-search-label input[type="text"]::placeholder {
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
    opacity: 1;
}

.ama-pdf-search-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #1E90FF;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.ama-pdf-search-icon-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.ama-pdf-search-icon-btn:hover {
    background-color: #1877d6;
    box-shadow: 0 0 0 1px rgba(30, 144, 255, 0.25);
}

.ama-pdf-search-icon-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

.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 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #d7dde8;
    background-color: #f8fafc;
}

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

/* True horizontal center of the toolbar (not mid-gap between left/right groups). */
.ama-pdf-zoom-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

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

.ama-pdf-page-word {
    font-size: 12px;
    color: #334155;
    white-space: nowrap;
}

/* Page prev/next: bare blue chevrons (same icon style as Ch. 13/15 section toggles) */
.ama-pdf-page-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #1565c0;
    cursor: pointer;
}

.ama-pdf-page-chevron svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ama-pdf-page-chevron:hover {
    background: #eaf4ff;
    color: #0f3f75;
}

.ama-pdf-page-chevron:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

.ama-pdf-page-chevron:disabled {
    color: #9ccaff;
    background: transparent;
    cursor: default;
}

.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-toggle-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: 6px;
}

.landing-header-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 6px 16px;
    border: 1px solid #d9e2ec;
    border-top: 3px solid #2596ff;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.landing-header-card::before {
    content: "";
    position: absolute;
    inset: 5px 320px 4px 210px;
    background-image: url("../assets/landing-header-wave.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.58;
    pointer-events: none;
    z-index: 0;
}

.landing-header-left {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.landing-header-logo {
    width: 257px;
    height: auto;
    display: block;
}

.landing-header-right {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.landing-header-title {
    margin: -5px 0 6px;
    line-height: 0;
    text-align: right;
}

.wp-studio-logo {
    display: inline-block;
    height: 28px;
    width: auto;
    max-width: min(148px, 38vw);
    object-fit: contain;
    vertical-align: bottom;
    transform: translate(-4px, 3px);
}

.landing-header-links {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 5px;
}

.landing-header-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: calc(0.24rem + 1px) 0.62rem calc(0.24rem - 1px);
    border-radius: 999px;
    border: 1px solid #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.landing-header-pill:hover {
    background: #dbeafe;
}

/* Free left-column space while AMA Chat is open (PDF-only keeps the pills). */
body.ama-chat-open .landing-header-pill,
body.ama-chat-open .ch16-header-pill,
body.ama-chat-open .ch16-header-title {
    display: none;
}

/* When Chat AMA hides the chapter title, show the WP Studio mark in its place
   so the header matches the landing-page look. */
body.ama-chat-open .ch16-header-center::before {
    content: '';
    display: block;
    height: 28px;
    width: 148px;
    max-width: min(148px, 38vw);
    margin: -5px 0 6px;
    background: url('../assets/wp-studio-logo.png') no-repeat right center / contain;
    transform: translate(-4px, 3px);
}

@media (max-width: 900px) {
    .landing-header-card::before {
        display: none;
    }

    .landing-header-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .landing-header-logo {
        width: 242px;
    }

    .landing-header-right {
        width: 100%;
        align-items: flex-start;
    }

    .landing-header-title {
        text-align: left;
    }

    .wp-studio-logo {
        max-width: min(140px, 52vw);
    }
}

@media (max-width: 640px) {
    .landing-header-card {
        padding: 6px 12px;
    }

    .landing-header-logo {
        width: 218px;
    }

    .wp-studio-logo {
        max-width: min(128px, 58vw);
    }

    .landing-header-links {
        flex-wrap: wrap;
        gap: 6px;
    }
}

.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 #9ccaff;
    border-radius: 5px;
    padding: 13px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.2;
    box-sizing: border-box;
    min-height: 82px;
}

.chapter-card::before {
    content: "";
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.96;
}

.chapter-card .chapter-card-label {
    display: inline-block;
    line-height: 1.2;
}

.chapter-card[data-chapter="3"]::before { background-image: url("../chapter-icons/3.png?v=3"); }
.chapter-card[data-chapter="4"]::before { background-image: url("../chapter-icons/4.png?v=2"); }
.chapter-card[data-chapter="5"]::before { background-image: url("../chapter-icons/5.png?v=3"); }
.chapter-card[data-chapter="6"]::before { background-image: url("../chapter-icons/6.png?v=3"); }
.chapter-card[data-chapter="7"]::before { background-image: url("../chapter-icons/7.png?v=2"); }
.chapter-card[data-chapter="8"]::before { background-image: url("../chapter-icons/8.png?v=2"); }
.chapter-card[data-chapter="9"]::before { background-image: url("../chapter-icons/9.png?v=2"); }
.chapter-card[data-chapter="10"]::before { background-image: url("../chapter-icons/10.png?v=2"); }
.chapter-card[data-chapter="11"]::before { background-image: url("../chapter-icons/11.png?v=2"); }
.chapter-card[data-chapter="12"]::before { background-image: url("../chapter-icons/12.png?v=2"); }
.chapter-card[data-chapter="13"]::before { background-image: url("../chapter-icons/13.png?v=3"); }
.chapter-card[data-chapter="gaf"]::before { background-image: url("../chapter-icons/gaf.png?v=3"); }
.chapter-card[data-chapter="15"]::before { background-image: url("../chapter-icons/15.png?v=2"); }
.chapter-card[data-chapter="16"]::before { background-image: url("../chapter-icons/16.png?v=3"); }
.chapter-card[data-chapter="17"]::before { background-image: url("../chapter-icons/17.png?v=3"); }

.chapter-card:hover {
    background-color: #eaf4ff;
    border-color: #9ccaff;
    color: #0f3f75;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
    transform: translateY(-5px);
}

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

.chapter-card.selected::before {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.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;
    height: 44px;
    line-height: 1;
}

#chapterSkipCalculatePd,
#chapterLandingStartOver,
#chapterLandingGoBack,
#chapterProceed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#chapterSkipCalculatePd::before,
#chapterLandingStartOver::before,
#chapterLandingGoBack::before,
#chapterProceed::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#chapterSkipCalculatePd::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

#chapterLandingStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#chapterLandingGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#chapterProceed::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.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,
.ch3-cv-running-totals-wrap,
.ch4-sp-running-totals-wrap,
.ch9-running-totals-wrap,
.ch10-running-totals-wrap,
.ch11-running-totals-wrap,
.ch12-running-totals-wrap,
.ch13-ns-running-totals-wrap,
.ch15-sp-running-totals-wrap,
.ch8-running-totals-wrap {
    margin-top: 16px;
}

.chapter-running-total-card,
.ch16-running-totals-card,
.ch3-cv-running-totals-card,
.ch4-sp-running-totals-card,
.ch9-running-totals-card,
.ch10-running-totals-card,
.ch11-running-totals-card,
.ch12-running-totals-card,
.ch13-ns-running-totals-card,
.ch15-sp-running-totals-card,
.ch8-running-totals-card {
    border: 1px solid #1e90ff;
}

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

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

.ch16-header-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    margin: 6px 0 14px;
    padding: 6px 16px;
    box-sizing: border-box;
    border: 1px solid #d8dee7;
    border-radius: 12px;
    border-top: 3px solid #1E90FF;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ch16-header-card::before {
    content: "";
    position: absolute;
    inset: 5px 440px 4px 225px;
    background-image: url("../assets/ch16-header-wave.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: cover;
    opacity: 0.58;
    pointer-events: none;
    z-index: 0;
}

.ch16-header-logo-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 0 1 320px;
}

.ch16-header-logo {
    width: 257px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Chapter badge + divider + title row: pack to the card’s right edge (same inset as `.landing-header-card` padding). */
.ch16-header-trailing {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.ch16-header-chapter {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 22px;
}

body.ama-pdf-open .ch16-header-chapter {
    display: none;
}

/* Right UE only: chapter badge + grey vertical bar */
.ch16-header-chapter.ch16-header-chapter--ue-right {
    transform: translateX(-3px);
}

/* Left UE only: chapter badge + grey vertical bar */
.ch16-header-chapter.ch16-header-chapter--ue-left {
    transform: translateX(-2px);
}

/* Title + pills vertical rhythm matches `.landing-header-right` + `.landing-header-links`.
   Align the block to the right edge of the card (mirrors home header right column). */
.ch16-header-center {
    display: flex;
    flex: 0 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

/* Match `.landing-header-title` (main header "CA Impairment Rating Engine" / Impairment Rating Engine styling). */
.ch16-header-title {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    transform: translateX(-6px);
    margin: -5px 0 6px;
    color: #1f2937;
    text-align: right;
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 27px;
    font-weight: 650;
    line-height: 1.05;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Right UE only: nudge title row 2px right vs left UE */
.ch16-header-trailing:has(.ch16-header-chapter--ue-right) .ch16-header-title {
    transform: translateX(-3px);
}

.ch16-header-title-text {
    display: inline-block;
    transform: translateY(5px);
}

.ch16-header-links {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 5px;
}

.ch16-header-links .auth-sidebar-toggle {
    margin-left: 2px;
    flex-shrink: 0;
}

.ch16-header-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: calc(0.24rem + 1px) 0.62rem calc(0.24rem - 1px);
    border-radius: 999px;
    border: 1px solid #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.ch16-header-pill:hover {
    background: #dbeafe;
}

.ch16-auth-sidebar-toggle {
    width: 34px;
    height: 34px;
    margin-left: 0;
    flex-shrink: 0;
}

.ch16-header-divider {
    width: 2px;
    height: 49px;
    background: #aab2bf;
    border-radius: 999px;
}

.ch16-header-badge,
.ch16-header-badge:visited,
.ch16-header-badge:active {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #1E90FF;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ch16-header-badge:hover,
.ch16-header-badge:focus-visible {
    background: #1873cc;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 2px 6px rgba(30, 144, 255, 0.28);
    color: #ffffff;
}

.ch16-header-badge-label {
    font-size: 8px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.ch16-header-badge-number {
    margin-top: 2px;
    font-size: 34px;
    line-height: 0.95;
    font-weight: 800;
}

@media (max-width: 900px) {
    .ch16-header-card::before {
        display: none;
    }

    .ch16-header-card {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        min-height: 0;
        padding: 6px 16px;
    }

    .ch16-header-logo-wrap {
        flex-basis: auto;
        justify-content: center;
    }

    .ch16-header-logo {
        width: 220px;
    }

    .ch16-header-trailing {
        flex-direction: column;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .ch16-header-chapter {
        gap: 14px;
    }

    .ch16-header-center {
        min-width: 0;
        width: 100%;
        align-items: center;
    }

    .ch16-header-title {
        font-size: 25px;
        white-space: normal;
        text-align: center;
    }

    .ch16-header-links {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .ch16-header-card {
        padding: 6px 12px;
    }

    .ch16-header-links {
        flex-wrap: wrap;
    }

    .ch16-header-title {
        font-size: 22px;
    }
}

.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%);
}

/* Start Over: tighter vertical padding and button spacing (~half previous) */
.start-over-modal.app-modal {
    padding: 12px 24px;
}

.start-over-modal .app-modal-actions {
    margin-top: 6px;
}

.start-over-modal .app-modal-actions button {
    margin: 10px auto;
}

/* 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%);
}

body.ama-pdf-open .ch16-delete-method-modal {
    left: calc((100vw - var(--ama-pdf-width) - 20px) / 2);
    transform: translate(-50%, -50%);
}

/* Ch.12 Visual modals are body-level siblings (not inside overlay); keep in left app pane when PDF is open. */
body.ama-pdf-open .app-modal.ch12-method-modal,
body.ama-pdf-open .app-modal.ch12-adjust-modal,
body.ama-pdf-open .app-modal.ch12-oneeye-modal,
body.ama-pdf-open .app-modal.ch12-reading-modal,
body.ama-pdf-open .app-modal.ch12-reading-required-modal,
body.ama-pdf-open .app-modal.ch12-loss-of-eye-modal,
body.ama-pdf-open .app-modal.ch13-spinal-region-required-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 #9ccaff;
    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-modal .addon-selection-modal-actions #addonSelectionGoBack,
.addon-modal .addon-selection-modal-actions #addonSelectionNext,
.addon-entry-modal .addon-entry-modal-actions #addonEntryGoBack,
.addon-entry-modal .addon-entry-modal-actions #addonEntryNext,
.addon-entry-modal .addon-entry-modal-actions #ch11TinnitusGoBack,
.addon-entry-modal .addon-entry-modal-actions #ch11TinnitusNext {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.addon-modal .addon-selection-modal-actions #addonSelectionGoBack::before,
.addon-modal .addon-selection-modal-actions #addonSelectionNext::after,
.addon-entry-modal .addon-entry-modal-actions #addonEntryGoBack::before,
.addon-entry-modal .addon-entry-modal-actions #addonEntryNext::after,
.addon-entry-modal .addon-entry-modal-actions #ch11TinnitusGoBack::before,
.addon-entry-modal .addon-entry-modal-actions #ch11TinnitusNext::after {
    content: "";
    display: inline-block;
    width: 19px;
    height: 19px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.addon-modal .addon-selection-modal-actions #addonSelectionGoBack::before,
.addon-entry-modal .addon-entry-modal-actions #addonEntryGoBack::before,
.addon-entry-modal .addon-entry-modal-actions #ch11TinnitusGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

.addon-modal .addon-selection-modal-actions #addonSelectionNext::after,
.addon-entry-modal .addon-entry-modal-actions #addonEntryNext::after,
.addon-entry-modal .addon-entry-modal-actions #ch11TinnitusNext::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.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;
}

.ch11-tinnitus-modal .addon-entry-input {
    width: 76px;
    padding: 8px 6px;
    font-size: 16px;
    border: 1px solid #2196f3;
}

.ch11-tinnitus-modal .addon-max-cap-label:first-of-type {
    margin-top: 22px;
}

.ch11-tinnitus-modal .addon-max-cap-label + .addon-max-cap-label {
    margin-top: 10px;
}

.ch11-tinnitus-modal .addon-hint {
    padding-top: 16px;
}

.ch11-tinnitus-modal p.addon-entry-reference {
    margin-top: 28px;
}

/* 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;
}

.start-over-modal .app-modal-actions #startOverNoButton,
.start-over-modal .app-modal-actions #startOverYesButton,
.start-over-modal .app-modal-actions .ch16-delete-all-digits-no,
.start-over-modal .app-modal-actions .ch16-delete-all-digits-yes,
.start-over-modal .app-modal-actions .ch16-delete-bodypart-no,
.start-over-modal .app-modal-actions .ch16-delete-bodypart-yes,
.start-over-modal .app-modal-actions .ch16-delete-method-no,
.start-over-modal .app-modal-actions .ch16-delete-method-yes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: row-reverse;
    gap: 12px;
}

.start-over-modal .app-modal-actions #startOverNoButton .app-modal-btn-icon,
.start-over-modal .app-modal-actions #startOverYesButton .app-modal-btn-icon,
.start-over-modal .app-modal-actions .ch16-delete-all-digits-no .app-modal-btn-icon,
.start-over-modal .app-modal-actions .ch16-delete-all-digits-yes .app-modal-btn-icon,
.start-over-modal .app-modal-actions .ch16-delete-bodypart-no .app-modal-btn-icon,
.start-over-modal .app-modal-actions .ch16-delete-bodypart-yes .app-modal-btn-icon,
.start-over-modal .app-modal-actions .ch16-delete-method-no .app-modal-btn-icon,
.start-over-modal .app-modal-actions .ch16-delete-method-yes .app-modal-btn-icon {
    width: 18.9px;
    height: 18.9px;
    transform: translateY(0);
}

.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;
}

.extremity-modal-actions #extremityGoBackButton,
.extremity-modal-actions #extremityProceedButton,
.extremity-modal-actions #ch17ExtremityGoBackButton,
.extremity-modal-actions #ch17ExtremityProceedButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.extremity-modal-actions #extremityGoBackButton::before,
.extremity-modal-actions #extremityProceedButton::after,
.extremity-modal-actions #ch17ExtremityGoBackButton::before,
.extremity-modal-actions #ch17ExtremityProceedButton::after {
    content: "";
    display: inline-block;
    width: 19px;
    height: 19px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.extremity-modal-actions #extremityGoBackButton::before,
.extremity-modal-actions #ch17ExtremityGoBackButton::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

.extremity-modal-actions #extremityProceedButton::after,
.extremity-modal-actions #ch17ExtremityProceedButton::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.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 #9ccaff;
    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: #eaf4ff;
    border-color: #9ccaff;
    color: #0f3f75;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
    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 #9ccaff;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#calculatorApp .card-container .ch16-body-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#calculatorApp .card-container .ch16-body-card::before {
    content: "";
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.96;
}

#calculatorApp .card-container .ch16-body-card .ch16-body-card-label {
    display: inline-block;
    line-height: 1.2;
}

#calculatorApp .card-container .ch16-body-card[data-value="shoulder"]::before { background-image: url("../ch16-icons/shoulder.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="elbow"]::before { background-image: url("../ch16-icons/elbow.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="wrist"]::before { background-image: url("../ch16-icons/wrist.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="thumb"]::before { background-image: url("../ch16-icons/thumb.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="index"]::before { background-image: url("../ch16-icons/index.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="middle"]::before { background-image: url("../ch16-icons/middle.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="ring"]::before { background-image: url("../ch16-icons/ring.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="little"]::before { background-image: url("../ch16-icons/little.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="nerve"]::before { background-image: url("../ch16-icons/nerve.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="vascular"]::before { background-image: url("../ch16-icons/vascular.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="grip"]::before { background-image: url("../ch16-icons/grip.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="amputation"]::before { background-image: url("../ch16-icons/amputation.png?v=4"); }
#calculatorApp .card-container .ch16-body-card[data-value="vascular"]::before { margin-left: 20px; }
#calculatorApp .card-container .ch16-body-card[data-value="grip"]::before { margin-left: 22px; }

#calculatorApp .card-container .ch16-body-card.selected::before,
#calculatorApp .card-container .ch16-body-card.ch16-locked-selected::before {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Ch. 17 Lower Extremities body-part cards (ch16 card look, isolated from ch16 selectors) */
/* Ch. 17 grid intentionally does not reuse .card-container: other chapters toggle
   `#calculatorApp .card-container` (the Ch. 16 grid) via querySelector, and the
   ch16-calculator-phase rule would otherwise hide this grid too. */
.ch17-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.ch17-card-container .ch17-body-card {
    background-color: #f9f9f9;
    border: 1px solid #9ccaff;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ch17-card-container .ch17-body-card::before {
    content: "";
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.96;
}

.ch17-card-container .ch17-body-card[data-value="pelvis"]::before { background-image: url("../ch17-icons/pelvis.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="hip"]::before { background-image: url("../ch17-icons/hip.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="femur"]::before { background-image: url("../ch17-icons/femur.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="knee"]::before { background-image: url("../ch17-icons/knee.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="tibia"]::before { background-image: url("../ch17-icons/tibia-fibula.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="ankle"]::before { background-image: url("../ch17-icons/ankle.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="foot"]::before { background-image: url("../ch17-icons/foot.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="toes"]::before { background-image: url("../ch17-icons/toes.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="limbLength"]::before { background-image: url("../ch17-icons/limb-length.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="gait"]::before { background-image: url("../ch17-icons/gait.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="amputation"]::before { background-image: url("../ch17-icons/amputation.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="skinLoss"]::before { background-image: url("../ch17-icons/skin-loss.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="nerve"]::before { background-image: url("../ch17-icons/nerve.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="vascular"]::before { background-image: url("../ch17-icons/vascular.png?v=2"); }
.ch17-card-container .ch17-body-card[data-value="crps"]::before { background-image: url("../ch17-icons/crps.png?v=2"); }

.ch17-card-container .ch17-body-card:hover {
    background-color: #eaf4ff;
    border-color: #9ccaff;
    color: #0f3f75;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
    transform: translateY(-5px);
}

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

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

.ch17-card-container .ch17-body-card.ch17-locked-selected:hover {
    background-color: #6c8fb4;
    transform: none;
    box-shadow: none;
}

.ch17-card-container .ch17-body-card.selected::before,
.ch17-card-container .ch17-body-card.ch17-locked-selected::before {
    filter: brightness(0) invert(1);
    opacity: 1;
}

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

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

.card:hover {
    background-color: #eaf4ff;
    border-color: #9ccaff;
    color: #0f3f75;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
    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;
}

/* Bottom action rows: uniform button height (icon ::before slots were 18–23px). */
.ch16-both-first-actions button,
#ch8BothFirstActions button,
.calculators-final-actions button,
.options-actions button,
.ch16-body-part-actions button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

.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;
}

#ch16BothFirstActions #ch16CalculatorsStartOverFirst,
#ch16BothFirstActions #ch16CalculatorsGoBackFirst,
#ch16BothFirstActions #ch16BothFirstAddOns,
#ch16BothFirstActions #ch16ProceedToRight,
#ch17BothFirstActions #ch17CalculatorsStartOverFirst,
#ch17BothFirstActions #ch17CalculatorsGoBackFirst,
#ch17BothFirstActions #ch17BothFirstAddOns,
#ch17BothFirstActions #ch17ProceedToRight {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch16BothFirstActions #ch16CalculatorsStartOverFirst::before,
#ch16BothFirstActions #ch16CalculatorsGoBackFirst::before,
#ch16BothFirstActions #ch16BothFirstAddOns::before,
#ch16BothFirstActions #ch16ProceedToRight::after,
#ch17BothFirstActions #ch17CalculatorsStartOverFirst::before,
#ch17BothFirstActions #ch17CalculatorsGoBackFirst::before,
#ch17BothFirstActions #ch17BothFirstAddOns::before,
#ch17BothFirstActions #ch17ProceedToRight::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch16BothFirstActions #ch16CalculatorsStartOverFirst::before,
#ch17BothFirstActions #ch17CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch16BothFirstActions #ch16CalculatorsGoBackFirst::before,
#ch17BothFirstActions #ch17CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch16BothFirstActions #ch16BothFirstAddOns::before,
#ch17BothFirstActions #ch17BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

#ch16BothFirstActions #ch16ProceedToRight::after,
#ch17BothFirstActions #ch17ProceedToRight::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.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;
}

.calculators-final-actions #ch16CalculatorsStartOverSecond,
.calculators-final-actions #ch16CalculatorsGoBackSecond,
.calculators-final-actions #painAddOn,
.calculators-final-actions #ch16AddBodyPart,
.calculators-final-actions #rateImpairment,
.calculators-final-actions #ch8CalculatorsStartOver,
.calculators-final-actions #ch8CalculatorsGoBack,
.calculators-final-actions #ch8AddBodyPart,
.calculators-final-actions #ch8PainAddOn,
.calculators-final-actions #ch8RateImpairment,
.calculators-final-actions #ch17CalculatorsStartOver,
.calculators-final-actions #ch17CalculatorsGoBack,
.calculators-final-actions #ch17AddBodyPart,
.calculators-final-actions #ch17PainAddOn,
.calculators-final-actions #ch17RateImpairment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.calculators-final-actions #ch16CalculatorsStartOverSecond::before,
.calculators-final-actions #ch16CalculatorsGoBackSecond::before,
.calculators-final-actions #painAddOn::before,
.calculators-final-actions #ch16AddBodyPart::before,
.calculators-final-actions #rateImpairment::before,
.calculators-final-actions #ch8CalculatorsStartOver::before,
.calculators-final-actions #ch8CalculatorsGoBack::before,
.calculators-final-actions #ch8AddBodyPart::before,
.calculators-final-actions #ch8PainAddOn::before,
.calculators-final-actions #ch8RateImpairment::before,
.calculators-final-actions #ch17CalculatorsStartOver::before,
.calculators-final-actions #ch17CalculatorsGoBack::before,
.calculators-final-actions #ch17AddBodyPart::before,
.calculators-final-actions #ch17PainAddOn::before,
.calculators-final-actions #ch17RateImpairment::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.calculators-final-actions #ch16CalculatorsStartOverSecond::before,
.calculators-final-actions #ch8CalculatorsStartOver::before,
.calculators-final-actions #ch17CalculatorsStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch16CalculatorsGoBackSecond::before,
.calculators-final-actions #ch8CalculatorsGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
    position: relative;
    left: -8px;
    top: 2px;
}

.calculators-final-actions #ch17CalculatorsGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch16CalculatorsGoBackSecond .btn-label {
    display: inline-block;
    line-height: 1.1;
    position: relative;
    top: -2.5px;
}

.calculators-final-actions #painAddOn::before,
.calculators-final-actions #ch8PainAddOn::before,
.calculators-final-actions #ch17PainAddOn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch16AddBodyPart::before,
.calculators-final-actions #ch8AddBodyPart::before,
.calculators-final-actions #ch17AddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #rateImpairment::before,
.calculators-final-actions #ch8RateImpairment::before,
.calculators-final-actions #ch17RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

#ch16CalculatorsGoBackSecond {
    display: none;
}

/* Existing styles remain the same */

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

#optionsList,
#ch17OptionsList,
#ch8DisorderOptionsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ch8-disorder-selection-wrap {
    margin-top: 16px;
}

#ch8DisorderSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

.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;
}

.options-actions #optionsStartOver,
.options-actions #optionsGoBack,
.options-actions #nextCard,
.options-actions #ch17OptionsStartOver,
.options-actions #ch17OptionsGoBack,
.options-actions #ch17NextCard,
#ch8DisorderNav #ch8DisorderStartOver,
#ch8DisorderNav #ch8DisorderGoBack,
#ch8DisorderNav #ch8DisorderProceed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.options-actions #optionsStartOver::before,
.options-actions #optionsGoBack::before,
.options-actions #nextCard::after,
.options-actions #ch17OptionsStartOver::before,
.options-actions #ch17OptionsGoBack::before,
.options-actions #ch17NextCard::after,
#ch8DisorderNav #ch8DisorderStartOver::before,
#ch8DisorderNav #ch8DisorderGoBack::before,
#ch8DisorderNav #ch8DisorderProceed::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.options-actions #optionsStartOver::before,
.options-actions #ch17OptionsStartOver::before,
#ch8DisorderNav #ch8DisorderStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

.options-actions #optionsGoBack::before,
.options-actions #ch17OptionsGoBack::before,
#ch8DisorderNav #ch8DisorderGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

.options-actions #nextCard::after,
.options-actions #ch17NextCard::after,
#ch8DisorderNav #ch8DisorderProceed::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

/* 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;
}

#ch16BodyPartNav #ch16BodyPartsStartOver,
#ch16BodyPartNav #ch16BodyPartsGoBack,
#ch16BodyPartNav #calculate,
#ch17BodyPartNav #ch17BodyPartsStartOver,
#ch17BodyPartNav #ch17BodyPartsGoBack,
#ch17BodyPartNav #ch17BodyPartsNext {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch16BodyPartNav #ch16BodyPartsStartOver::before,
#ch16BodyPartNav #ch16BodyPartsGoBack::before,
#ch16BodyPartNav #calculate::after,
#ch17BodyPartNav #ch17BodyPartsStartOver::before,
#ch17BodyPartNav #ch17BodyPartsGoBack::before,
#ch17BodyPartNav #ch17BodyPartsNext::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch16BodyPartNav #ch16BodyPartsStartOver::before,
#ch17BodyPartNav #ch17BodyPartsStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch16BodyPartNav #ch16BodyPartsGoBack::before,
#ch17BodyPartNav #ch17BodyPartsGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch16BodyPartNav #calculate::after,
#ch17BodyPartNav #ch17BodyPartsNext::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.option {
    background-color: #f0f0f0;
    border: 1px solid #9ccaff;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#optionsList .option-disabled {
    grid-column: 1 / -1;
}

.option:hover {
    background-color: #eaf4ff;
    border-color: #9ccaff;
    color: #0f3f75;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
}

.option-disabled {
    cursor: default;
    background-color: #f5f5f5;
    color: #777;
    border: 1px solid #ddd;
    display: block;
    text-align: left;
    /* keep same box model as normal .option so height matches */
}

.option.option-disabled:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #777;
    box-shadow: none;
}

.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 #9ccaff;
    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;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* GAF Psychiatric studio header — same shell as Ch. 16 UE header */
.gaf-psych-header-card .gaf-psych-header-badge {
    flex-direction: row;
    justify-content: center;
}

.gaf-psych-header-badge-text {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.6px;
}

body.ama-pdf-open .gaf-psych-header-card .ch16-header-chapter {
    display: none;
}

.gaf-calculator-wrap {
    margin-bottom: 20px;
}

.gaf-calculator-wrap .gaf-psych-header-card {
    margin-bottom: 14px;
}

.gaf-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.gaf-overall-total-card.hidden {
    display: none;
}

.gaf-overall-total-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch8-skin-calculator-wrap {
    margin-bottom: 20px;
}

.ch8-skin-calculator-wrap .ch8-skin-header-card {
    margin-bottom: 14px;
}

.ch8-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch8-overall-total-card.hidden {
    display: none;
}

.ch8-overall-total-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch9-hemato-calculator-wrap {
    margin-bottom: 20px;
}

.ch9-hemato-calculator-wrap .ch9-hemato-header-card {
    margin-bottom: 14px;
}

.ch9-hemato-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch9-total-impairment-card.hidden {
    display: none;
}

.ch9-total-impairment-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch10-endo-calculator-wrap {
    margin-bottom: 20px;
}

.ch10-endo-calculator-wrap .ch10-endo-header-card {
    margin-bottom: 14px;
}

.ch10-endo-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch10-total-impairment-card.hidden {
    display: none;
}

.ch10-total-impairment-card:not(.hidden) {
    margin-bottom: 20px;
}

.gaf-psych-card .gaf-psych-instructions {
    margin: 19px 0 12px;
    font-weight: normal;
}

.gaf-psych-score-table {
    max-width: 420px;
}

#gafPsychCard .gaf-psych-score-table thead th,
#gafPsychCard .gaf-psych-score-table thead th:first-child {
    text-align: center !important;
}

#gafPsychCard .gaf-psych-score-table tbody td {
    text-align: center;
}

#gafPsychCard .gaf-psych-score-table input[type="number"] {
    width: 48%;
    min-width: 0;
    padding: 5px;
    box-sizing: border-box;
    text-align: center;
}

.gaf-description-box {
    margin-top: 21px;
    min-height: 88px;
    padding: 12px 14px;
    border: 1px solid #111;
    border-radius: 4px;
    background: #f3f3f3;
    line-height: 1.45;
    white-space: pre-wrap;
}

.gaf-psych-card.is-minimized .gaf-psych-instructions,
.gaf-psych-card.is-minimized .gaf-psych-score-table,
.gaf-psych-card.is-minimized .gaf-description-box,
.gaf-psych-card.is-minimized .gaf-psych-reference,
.gaf-psych-card.is-minimized .gaf-psych-total {
    display: none;
}

.gaf-psych-card h3.ch16-card-header {
    transform: translateY(-3px);
}

.gaf-psych-reference {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.gaf-psych-reference a.ama-pdf-link {
    color: #2563eb;
    text-decoration: underline;
}

.gaf-psych-total {
    margin: 0;
}

/* GAF psyche nav — same button styling/icons as Ch.16 UE calculator rows */
#gafBothFirstActions {
    display: none;
}

#gafBothFirstActions #gafCalculatorsStartOverFirst,
#gafBothFirstActions #gafCalculatorsGoBackFirst,
#gafBothFirstActions #gafBothFirstAddBodyPart,
#gafBothFirstActions #gafBothFirstAddOns,
#gafBothFirstActions #gafProceedToRight {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#gafBothFirstActions #gafCalculatorsStartOverFirst::before,
#gafBothFirstActions #gafCalculatorsGoBackFirst::before,
#gafBothFirstActions #gafBothFirstAddBodyPart::before,
#gafBothFirstActions #gafBothFirstAddOns::before,
#gafBothFirstActions #gafProceedToRight::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#gafBothFirstActions #gafCalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#gafBothFirstActions #gafCalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#gafBothFirstActions #gafBothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

#gafBothFirstActions #gafBothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

#gafBothFirstActions #gafProceedToRight::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

/* Ch. 8 skin nav — Next when psyche and/or UE follow (same pattern as GAF → UE) */
#ch8BothFirstActions {
    display: none;
}

#ch8BothFirstActions #ch8CalculatorsStartOverFirst,
#ch8BothFirstActions #ch8CalculatorsGoBackFirst,
#ch8BothFirstActions #ch8BothFirstAddBodyPart,
#ch8BothFirstActions #ch8BothFirstAddOns,
#ch8BothFirstActions #ch8ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch8BothFirstActions #ch8CalculatorsStartOverFirst::before,
#ch8BothFirstActions #ch8CalculatorsGoBackFirst::before,
#ch8BothFirstActions #ch8BothFirstAddBodyPart::before,
#ch8BothFirstActions #ch8BothFirstAddOns::before,
#ch8BothFirstActions #ch8ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch8BothFirstActions #ch8CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch8BothFirstActions #ch8CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch8BothFirstActions #ch8BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

#ch8BothFirstActions #ch8BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

#ch8BothFirstActions #ch8ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

#gafFinalActions #gafCalculatorsStartOverSecond,
#gafFinalActions #gafCalculatorsGoBackSecond,
#gafFinalActions #gafPainAddOn,
#gafFinalActions #gafAddBodyPart,
#gafFinalActions #gafRateImpairment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#gafFinalActions #gafCalculatorsStartOverSecond::before,
#gafFinalActions #gafCalculatorsGoBackSecond::before,
#gafFinalActions #gafPainAddOn::before,
#gafFinalActions #gafAddBodyPart::before,
#gafFinalActions #gafRateImpairment::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#gafFinalActions #gafCalculatorsStartOverSecond::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#gafFinalActions #gafCalculatorsGoBackSecond::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
    position: relative;
    left: -8px;
    top: 2px;
}

#gafFinalActions #gafCalculatorsGoBackSecond .btn-label {
    display: inline-block;
    line-height: 1.1;
    position: relative;
    top: 1px;
}

#gafFinalActions #gafPainAddOn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

#gafFinalActions #gafAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

#gafFinalActions #gafRateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

.ime-proceed-go-back-dialog .ama-pdf-link {
    color: #2563eb;
    text-decoration: underline;
}

.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));
    /* Half of default .app-modal padding-bottom (24px) under Cancel */
    padding-bottom: 12px;
}

.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: 9px;
}

.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 #9ccaff;
    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: #eaf4ff;
    border-color: #9ccaff;
    color: #0f3f75;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
}

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

.ch16-add-method-option:last-child {
    margin-bottom: 4px;
}

.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;
    border-color: #ddd;
}

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

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

.ch16-add-method-actions .ch16-add-method-cancel,
.ch16-add-method-actions .ch16-add-method-confirm,
.ch16-add-method-actions .ch16-add-digit-method-cancel,
.ch16-add-method-actions .ch16-add-digit-method-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    /* Half of global button margin (20px) between Add/Cancel and under Cancel */
    margin-top: 10px;
    margin-bottom: 10px;
}

.ch16-add-method-actions .ch16-add-method-btn-icon {
    display: block;
    flex: 0 0 auto;
}

.ch16-add-method-actions .ch16-add-digit-cancel,
.ch16-add-method-actions .ch16-add-digit-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.ch16-add-method-actions .ch16-add-method-cancel > span,
.ch16-add-method-actions .ch16-add-method-confirm > span,
.ch16-add-method-actions .ch16-add-digit-method-cancel > span,
.ch16-add-method-actions .ch16-add-digit-method-confirm > span {
    position: relative;
    top: 1px;
}

.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,
.calculator-card:has(.ch17-dbe-options) 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,
.calculator-card:has(.ch17-dbe-options) 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(.ch17-pelvis-arthritis-table) 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,
.calculator-card:has(.ch17-pelvis-arthritis-table) 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.26);
    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;
    /* Keep minimized closed-PDF position aligned with expanded closed-PDF cards. */
    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.ch16-total-card-minimized h3.ch16-card-header .ch16-card-controls {
    top: 50% !important;
    transform: translateY(calc(-50% - 5px)) !important;
}

/* Lock icon row by fixed top inset (no % centering), so expand/minimize toggles don't shift it. */
body:not(.ama-pdf-open) .calculator-card:not(.is-minimized):not(.ch16-total-card-minimized) h3.ch16-card-header .ch16-card-controls {
    top: -20px !important;
    transform: none !important;
}

body.ama-pdf-open .calculator-card:not(.is-minimized):not(.ch16-total-card-minimized) h3.ch16-card-header .ch16-card-controls {
    top: -20px !important;
    transform: none !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;
}

/* UE/LE Almaraz 3-column tables: shorter UE/LE + WPI columns; inputs stay 60px centered */
.rom-table.almaraz-extremity-table {
    table-layout: fixed;
}

.rom-table.almaraz-extremity-table th.almaraz-extremity-col,
.rom-table.almaraz-extremity-table td.almaraz-extremity-col {
    width: 9.5rem;
    text-align: center;
    white-space: nowrap;
    padding-left: 6px;
    padding-right: 6px;
}

.rom-table.almaraz-extremity-table td.almaraz-extremity-col input[type="number"] {
    width: 60px;
    margin: 0 auto;
    display: inline-block;
}

/* 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: #eaf4ff;
    border-color: #9ccaff;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
}

.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;
}

/* Chapter 17 pelvis arthritis — same separated-row structure as UE Rotational Deformity */
.ch17-pelvis-arthritis-table {
    width: 100%;
    table-layout: fixed;
}

.ch17-pelvis-arthritis-table th:nth-child(1),
.ch17-pelvis-arthritis-table td:nth-child(1) {
    width: 22%;
}

.ch17-pelvis-arthritis-table th:nth-child(2),
.ch17-pelvis-arthritis-table td:nth-child(2),
.ch17-pelvis-arthritis-table th:nth-child(3),
.ch17-pelvis-arthritis-table td:nth-child(3),
.ch17-pelvis-arthritis-table th:nth-child(4),
.ch17-pelvis-arthritis-table td:nth-child(4),
.ch17-pelvis-arthritis-table th:nth-child(5),
.ch17-pelvis-arthritis-table td:nth-child(5) {
    width: 19.5%;
}

.ch17-pelvis-arthritis-table thead th:first-child,
.ch17-pelvis-arthritis-table tbody td:first-child,
.ch17-pelvis-arthritis-table td.ch17-pelvis-arthritis-joint {
    text-align: center;
}

.ch17-pelvis-arthritis-table tbody td:first-child,
.ch17-pelvis-arthritis-table td.ch17-pelvis-arthritis-joint {
    font-weight: normal;
}

/* Nudge checkbox side labels down without moving the checkbox */
.synovial-checkbox-value {
    position: relative;
    top: 1px;
}

/* Match Ch16 rotational deformity checkbox style */
.ch17-pelvis-arthritis-mm {
    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;
}

.ch17-pelvis-arthritis-mm:checked {
    background-color: #2196F3;
}

.ch17-pelvis-arthritis-mm: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;
}

.ch17-pelvis-arthritis-mm:hover {
    background-color: #F0F8FF;
}

.ch17-pelvis-arthritis-mm:checked:hover {
    background-color: #2196F3;
}

/* Pelvis arthritis physician-interpolation row (match Ch7 age-adjust / penile side checkbox) */
.ch17-pelvis-arthritis-interp-wrap {
    margin: 10px 0 4px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    /* Match checked-state height (mm shell) so checkbox/text don't shift when it appears */
    min-height: 34px;
}

.ch17-pelvis-arthritis-interp-option {
    display: inline-flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    max-width: 100%;
    font-size: 0.92em;
    cursor: pointer;
    margin: 0;
}

.ch17-pelvis-arthritis-interp-option span {
    position: relative;
    top: 1px;
}

.ch17-pelvis-arthritis-interp-mm-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ch17-pelvis-arthritis-interp-mm-wrap[hidden] {
    display: none !important;
}

/* Custom blue-matching spinners (native spin chrome can't restyle reliably). */
.ch17-pelvis-arthritis-interp-mm-shell {
    display: inline-flex;
    align-items: stretch;
    width: 96px;
    min-height: 30px;
    border: 2px solid #2196f3;
    border-radius: 4px;
    background: #e3f0fd;
    box-sizing: border-box;
    transition: border 0.2s, background 0.2s;
    overflow: hidden;
}

.ch17-pelvis-arthritis-interp-mm-shell:focus-within {
    border-color: #1565c0;
    background: #bbdefb;
}

.ch17-pelvis-arthritis-interp-mm.blue-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 4px 2px 4px 6px;
    text-align: center;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #1a237e;
    font-weight: bold;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}

.ch17-pelvis-arthritis-interp-mm.blue-input::-webkit-outer-spin-button,
.ch17-pelvis-arthritis-interp-mm.blue-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

.ch17-pelvis-arthritis-interp-mm.blue-input:focus {
    border: none;
    background: transparent;
}

.ch17-pelvis-arthritis-interp-spinners {
    display: flex;
    flex-direction: column;
    flex: 0 0 20px;
    width: 20px;
    border-left: 1px solid rgba(33, 150, 243, 0.45);
    background: transparent;
}

/* Override global `button { width: 200px; margin: 20px auto; ... }` */
button.ch17-pelvis-arthritis-interp-spin {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    background-color: transparent;
    color: #0d47a1;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    transition: background-color 0.15s ease;
}

button.ch17-pelvis-arthritis-interp-spin + button.ch17-pelvis-arthritis-interp-spin {
    border-top: 1px solid rgba(33, 150, 243, 0.35);
}

button.ch17-pelvis-arthritis-interp-spin:hover {
    background: rgba(21, 101, 192, 0.16);
    background-color: rgba(21, 101, 192, 0.16);
    color: #002171;
}

button.ch17-pelvis-arthritis-interp-spin svg {
    display: block;
    width: 8px;
    height: 5px;
    flex: 0 0 auto;
}

.ch17-pelvis-arthritis-interp-mm-unit {
    font-size: 0.92em;
    color: #333;
    position: relative;
    top: 1px;
}

/* Chapter 17 pelvis DBE options (match Ch16 instability selectable cards) */
.ch17-dbe-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.ch17-dbe-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;
}

.ch17-dbe-option:not(.ch17-dbe-option-note) {
    cursor: pointer;
}

.ch17-dbe-option:hover:not(.ch17-dbe-option-note) {
    background-color: #eaf4ff;
    border-color: #9ccaff;
    box-shadow: 0 3px 10px rgba(37, 150, 255, 0.16);
}

.ch17-dbe-option:has(input:checked) {
    background-color: #eaf4ff;
}

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

.ch17-dbe-option input[type="checkbox"]:checked + label {
    color: #1E90FF;
    font-weight: bold;
}

.ch17-dbe-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;
}

.ch17-dbe-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%;
}

.ch17-dbe-option input[type="checkbox"] {
    display: none;
}

.ch17-dbe-option-note {
    cursor: default;
}

.ch17-dbe-option-note:hover {
    background-color: white;
    border-color: #1E90FF;
    box-shadow: none;
}

.ch17-dbe-option-note .ch17-dbe-option-text {
    color: #333;
    line-height: 1.35;
    width: 100%;
}

.ch17-dbe-option-inline {
    flex-wrap: nowrap;
    gap: 8px;
}

.ch17-dbe-option-inline > label:not(.ch17-dbe-option-click-fill) {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.ch17-dbe-option-click-fill {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 1.35em;
    padding-left: 0;
    margin: 0;
    cursor: pointer;
    align-self: stretch;
}

.ch17-dbe-option-click-fill::before,
.ch17-dbe-option-click-fill::after {
    content: none !important;
    display: none !important;
}

.ch17-dbe-inline-select {
    flex: 0 0 auto;
    margin-left: 0;
    width: 5.5rem;
    min-width: 5.5rem;
    height: 1.35em;
    padding: 0 4px;
    border: 1px solid #9ccaff;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-size: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    vertical-align: middle;
    cursor: pointer;
}

.ch17-dbe-inline-select:focus,
.ch17-dbe-inline-select:focus-visible {
    outline: 1px solid #1E90FF;
    outline-offset: 0;
    border-color: #1E90FF;
    box-shadow: 0 0 0 1px #1E90FF;
}

.ch17-dbe-inline-select.ch17-dbe-select-pulse {
    border-color: #1E90FF;
    animation: ch17-dbe-select-pulse 1s ease-in-out infinite;
}

@keyframes ch17-dbe-select-pulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(30, 144, 255, 0.55);
        border-color: #1E90FF;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(30, 144, 255, 0.4);
        border-color: #1E90FF;
    }
}

/* Almaraz combine/separate mode options (Ch16 joints/digits + Ch17 body parts) */
.almaraz-mode-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 4px;
}

.almaraz-mode-options[hidden] {
    display: none !important;
}

.almaraz-mode-options.almaraz-mode-pulse .ch4-sp-side-checkbox:not(:checked) {
    border-color: #1E90FF;
    animation: ch17-dbe-select-pulse 1s ease-in-out infinite;
}

.ch17-dbe-option-extra {
    margin-top: 8px;
    margin-left: 25px;
    font-size: 0.85em;
}

.ch17-dbe-combined {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 0.9em;
    font-weight: 400;
    color: inherit;
    line-height: inherit;
}

.ch17-dbe-combined:empty {
    display: none;
    margin: 0;
}

.ch17-body-part-total-card .ch17-body-total-breakdown p {
    margin: 6px 0;
}

/*
 * Pelvis Total Impairment: match Ch16 Shoulder Total Impairment spacing.
 * Shoulder method <p> uses UA margins (≈1em top/bottom) + .total-impairment
 * margin-top: 12px (collapses with method bottom to ≈1em). Keep method
 * line-height normal so half-leading doesn't add extra gap above Total.
 */
.ch17-body-part-total-card[data-ch17-body-part="pelvis"] .ch17-body-total-breakdown p {
    margin: 1em 0;
    line-height: normal;
}

.ch17-body-part-total-card[data-ch17-body-part="pelvis"] .ch17-body-total-breakdown .total-impairment {
    margin-top: 12px;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 700;
}

.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: same width as digit arthroplasty severe-failure accordion */
.fingers-neuroma-options-accordion.wrist-arthroplasty-severe-failure-accordion {
    margin-left: 0;
    margin-right: 0;
    margin-top: 12px;
    width: min(100%, calc(35.67rem + 2px));
}

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

/* Shoulder arthroplasty — severe failure (same width as digit severe-failure accordion) */
.fingers-neuroma-options-accordion.shoulder-arthroplasty-severe-failure-accordion {
    margin-left: 0;
    margin-right: 0;
    margin-top: 12px;
    width: min(100%, calc(35.67rem + 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;
    }
}

/* Authentication gate / account management */
body.auth-active {
    background-color: #050b22;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

body.auth-active .container {
    max-width: 560px;
    width: min(560px, calc(100vw - 24px));
    background: #010515;
    border: 1px solid #31457a;
    border-radius: 14px;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.62),
        0 10px 26px rgba(2, 10, 28, 0.55),
        0 0 0 1px rgba(125, 160, 255, 0.12);
    padding: 18px 22px;
    max-height: calc(100vh - 24px);
    overflow: hidden;
    transform: translateY(-2px);
}

body.auth-active #chapterLandingPage,
body.auth-active #calculatorApp {
    display: none !important;
}

.auth-screen {
    color: #e5ebff;
}

.auth-logo {
    display: block;
    width: min(520px, 94%);
    height: auto;
    margin: 0 auto 10px;
    border-radius: 6px;
}

.auth-title {
    margin: 0 0 4px;
    color: #f6f9ff;
    font-size: 32px;
    font-weight: 600;
}

.auth-title-ca {
    color: #f6f9ff;
}

.auth-subtitle {
    margin: 0 0 12px;
    text-align: center;
    color: #a8b6de;
    font-size: 14px;
}

.auth-setup-title {
    margin: 2px 0 6px;
    color: #f6f9ff;
    text-align: center;
    font-size: 20px;
}

.auth-setup-copy {
    margin: 0 0 14px;
    text-align: center;
    color: #a8b6de;
    font-size: 14px;
}

.auth-form {
    margin: 0;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.auth-field span {
    color: #dce6ff;
    font-size: 13px;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid #304271;
    border-radius: 8px;
    background-color: #0a1638;
    color: #f4f7ff;
    font-size: 14px;
}

.auth-field input::placeholder {
    color: #8ea0cf;
}

.auth-field input:focus-visible {
    outline: 2px solid #52a7ff;
    outline-offset: 2px;
}

.auth-status-message {
    min-height: 20px;
    margin: 1px 0 6px;
    text-align: center;
    font-size: 13px;
    color: #ffb5b5;
}

.auth-status-message.auth-status-message--success {
    color: #9ef4c1;
}

.auth-form button,
.auth-modal .auth-form button {
    display: inline-flex;
    width: 100%;
    margin: 4px 0 0;
    justify-content: center;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    transition: background-color 0.12s ease, box-shadow 0.08s ease;
}

.auth-modal .auth-form button {
    border: none;
    border-radius: 8px;
    background: #1e90ff;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.auth-modal .auth-form button:hover {
    background: #1873cc;
}

.auth-modal .auth-form button:active {
    background: #125a98;
    box-shadow: inset 0 2px 10px rgba(0, 24, 48, 0.35);
}

.auth-login-form .auth-field {
    margin-bottom: 14px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.auth-forgot-link {
    width: 100% !important;
    margin: 0 auto 8px !important;
    max-width: 450px;
    display: block;
    text-align: left;
    position: relative;
    left: -124px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #5da5ff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.1;
}

.auth-forgot-link:hover {
    color: #7eb9ff;
    text-decoration: underline;
    background: transparent !important;
}

#authLoginSubmit {
    display: flex;
    border: 1px solid #536582;
    background: transparent;
    color: #ffffff;
    margin-top: 2px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.08s ease;
}

#authLoginSubmit:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #7292b7;
}

#authLoginSubmit:active {
    background: rgba(255, 255, 255, 0.18);
    border-color: #95bae3;
    box-shadow: inset 0 2px 10px rgba(0, 4, 18, 0.55);
}

/* Sign In / Sign Out in-flight spinner (shared with PD; `js/auth.js` toggles `.auth-btn-loading`) */
@keyframes auth-btn-spin {
    to {
        transform: rotate(360deg);
    }
}

button.auth-btn-loading {
    position: relative;
    pointer-events: none;
    cursor: progress;
    color: transparent !important;
}

button.auth-btn-loading::after {
    content: '';
    position: absolute;
    left: calc(50% - 0.625rem);
    top: calc(50% - 0.625rem);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-btn-spin 0.7s linear infinite;
    box-sizing: border-box;
}

#authLoginSubmit.auth-btn-loading:hover,
#authLoginSubmit.auth-btn-loading:active {
    box-shadow: none;
}

.auth-login-footnote {
    margin: 12px 0 2px;
    text-align: center;
    font-size: 17px;
    color: #48628f;
}

@media (max-height: 820px) {
    body.auth-active .container {
        padding: 14px 16px;
    }

    .auth-logo {
        width: min(460px, 90%);
        margin-bottom: 8px;
    }

    .auth-title {
        font-size: 29px;
        margin-bottom: 2px;
    }

    .auth-subtitle {
        margin-bottom: 8px;
        font-size: 13px;
    }

    .auth-field {
        margin-bottom: 8px;
    }
}

.auth-sidebar-toggle {
    position: static;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #1e90ff;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 144, 255, 0.28);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    letter-spacing: 0.2px;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
}

.auth-sidebar-toggle span {
    transform: translateX(0);
}

.auth-sidebar-toggle.is-visible {
    visibility: visible;
    pointer-events: auto;
}

.auth-sidebar-toggle.is-loading {
    pointer-events: none;
}

.auth-sidebar-toggle.is-loading span {
    opacity: 0;
}

.auth-sidebar-toggle:hover {
    background: #1873cc;
}

.landing-header-links .auth-sidebar-toggle {
    margin-left: 2px;
    flex-shrink: 0;
}

.auth-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2060;
    background: rgba(2, 7, 24, 0.33);
}

.auth-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(340px, calc(100vw - 18px));
    height: 100vh;
    z-index: 2070;
    transform: translateX(103%);
    transition: transform 0.24s ease;
    background: #f8fbff;
    border-left: 1px solid #dce6f7;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.18);
    padding: 14px 14px 18px;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.auth-sidebar.is-open {
    transform: translateX(0);
}

.auth-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.auth-sidebar-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    text-align: left;
}

.auth-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    min-width: 34px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #5b6e95;
    color: #fff;
    border: none;
    font: inherit;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, box-shadow 0.08s ease;
}

.auth-sidebar-close::before {
    content: '×';
    display: block;
    font-size: calc(1rem + 2px);
    line-height: 1;
    transform: translateY(-1px);
}

.auth-sidebar-close:hover {
    background: #1873cc;
}

.auth-sidebar-user {
    margin-top: 12px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #d4e1f7;
    background: #eef5ff;
}

.auth-sidebar-user-label {
    font-size: 11px;
    color: #4b5f85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-sidebar-user-email {
    margin-top: 4px;
    color: #16377f;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.auth-sidebar-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-sidebar-btn {
    width: 100%;
    margin: 0;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    background: #1e90ff;
    color: #fff;
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease, box-shadow 0.08s ease;
}

.auth-sidebar-btn:not(.auth-sidebar-btn-signout):hover {
    background: #1873cc;
}

.auth-sidebar-btn:not(.auth-sidebar-btn-signout):active {
    background: #125a98;
    box-shadow: inset 0 2px 10px rgba(0, 24, 48, 0.35);
}

.auth-sidebar-btn-signout {
    background: #38507e;
}

.auth-sidebar-btn-signout:hover {
    background: #2d4268;
}

.auth-sidebar-btn-signout:active {
    background: #1a2a4a;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.38);
}

.auth-sidebar-section {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #dde7f8;
}

.auth-sidebar-section h3 {
    margin: 0 0 8px;
    text-align: left;
    color: #0f172a;
    font-size: 14px;
}

.auth-sidebar-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
}

.auth-sidebar-list li {
    margin-bottom: 7px;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 24, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2100;
    box-sizing: border-box;
}

.auth-modal {
    width: min(520px, calc(100vw - 24px));
    max-height: min(90vh, 780px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #dbe4f5;
    box-shadow: 0 15px 38px rgba(15, 23, 42, 0.25);
    padding: 16px 16px 18px;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.auth-modal-overlay--manage-users {
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
    background: rgba(3, 8, 24, 0.38);
}

.auth-modal.auth-modal--manage-users {
    width: min(1090px, calc(100vw - 300px));
    max-height: 100vh;
    height: 100vh;
    margin-right: min(340px, calc(100vw - 18px));
    border-radius: 0;
    border-left: 1px solid #d7deeb;
    box-shadow: -8px 0 22px rgba(15, 23, 42, 0.22);
    padding: 16px 20px 22px;
    animation: authManageUsersSlideIn 0.18s ease-out;
}

@keyframes authManageUsersSlideIn {
    from {
        transform: translateX(36px);
        opacity: 0.6;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.auth-modal-header h2 {
    margin: 0;
    text-align: left;
    font-size: 20px;
    color: #111827;
}

.auth-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 36px;
    margin: 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: #5b6e95;
    color: #fff;
    border: none;
    font: inherit;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, box-shadow 0.08s ease;
}

.auth-modal-close::before {
    content: '×';
    display: block;
    position: relative;
    top: -1px;
    font-size: calc(1rem + 2px);
    line-height: 1;
}

.auth-modal-close:hover {
    background: #1873cc;
}

.auth-modal-message {
    min-height: 18px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #b42318;
}

.auth-modal-message.auth-status-message--success {
    color: #027a48;
}

.auth-modal .auth-field input {
    background: #ffffff;
    color: #111827;
    border-color: #bfcee9;
}

.auth-modal .auth-field span {
    color: #111111;
}

.auth-checkbox-field {
    margin: 8px 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 14px;
}

.auth-users-list-wrap {
    margin-top: 12px;
    border-top: 1px solid #e5ebf7;
    padding-top: 12px;
    overflow-x: hidden;
}

.auth-users-two-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-users-section {
    border: 1px solid #dbe5f4;
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px;
}

.auth-users-section .auth-users-list-title {
    margin-bottom: 8px;
}

.auth-users-list-title {
    margin: 0 0 8px;
    text-align: left;
    color: #111827;
    font-size: 15px;
}

.auth-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.auth-users-list-active {
    max-height: 220px;
}

.auth-users-list-deleted {
    max-height: 190px;
}

.auth-users-create-row,
.auth-users-grid-head,
.auth-users-row {
    display: grid;
    grid-template-columns: minmax(132px, 1.12fr) minmax(190px, 1.35fr) minmax(150px, 1.12fr) 84px 94px 140px;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.auth-users-create-row {
    margin: 0 0 10px;
}

.auth-users-grid-head {
    padding: 0 4px;
    margin-bottom: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.auth-users-grid-head span:nth-child(4) {
    padding-left: 22px;
}

.auth-users-grid-head span:nth-child(5) {
    padding-left: 30px;
}

.auth-users-grid-head span:nth-child(6) {
    padding-left: 48px;
}

.auth-deleted-users-grid-head span:nth-child(3) {
    padding-left: 32px;
}

.auth-deleted-users-grid-head span:nth-child(4) {
    padding-left: 30px;
}

.auth-deleted-users-grid-head span:nth-child(5) {
    padding-left: 28px;
}

.auth-deleted-users-grid-head span:nth-child(6) {
    padding-left: 46px;
}

.auth-users-row-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #bfcee9;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: #ffffff;
}

.auth-users-cell {
    padding: 8px 10px;
    border: 1px solid #bfcee9;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-deleted-users-grid-head,
.auth-deleted-users-row {
    grid-template-columns: minmax(132px, 1.16fr) minmax(205px, 1.5fr) 84px 94px 104px 140px;
}

.auth-users-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.auth-users-admin-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #1f4e99;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.auth-users-admin-toggle input {
    margin: 0;
}

.auth-users-admin-toggle-create {
    border: 1px solid #bfcee9;
    border-radius: 8px;
    min-height: 33px;
    background: #ffffff;
}

.auth-users-row-btn {
    width: auto !important;
    margin: 0 !important;
    min-width: 70px;
    padding: 7px 10px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    background: #1e90ff !important;
    transition: background-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.auth-users-create-row .auth-users-row-btn {
    width: 100% !important;
}

#authManageUsersSubmit.auth-users-row-btn {
    width: calc(100% + 6px) !important;
    margin-left: -6px !important;
}

.auth-deleted-users-row .auth-users-row-btn[data-action='reinstate'] {
    width: calc(100% + 6px) !important;
    margin-left: -6px !important;
}

.auth-users-row-btn-delete {
    background: #dc2626 !important;
}

.auth-users-row-btn:not(:disabled):hover {
    background: #1873cc !important;
    box-shadow: 0 0 0 1px rgba(24, 115, 204, 0.18);
}

.auth-users-row-btn-delete:not(:disabled):hover {
    background: #b91c1c !important;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.2);
}

.auth-users-row-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.auth-users-row-empty {
    color: #334155;
    font-size: 13px;
}

.auth-users-add-date-cell {
    font-size: 12px;
    color: #334155;
    text-align: center;
    white-space: nowrap;
}

.auth-user-logs-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-user-logs-section {
    border: 1px solid #dbe5f4;
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px;
}

.auth-user-logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.auth-user-log-item {
    border: 1px solid #d9e3f2;
    border-radius: 9px;
    background: #ffffff;
    padding: 8px 10px;
}

.auth-user-log-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.auth-user-log-meta {
    margin-top: 3px;
    font-size: 12px;
    color: #475569;
}

.auth-app-feedback-coming-soon {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.auth-app-feedback-subtitle {
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.auth-chat-feedback-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.auth-chat-feedback-count-card {
    flex: 1 1 140px;
    border: 1px solid #d9e3f2;
    border-radius: 9px;
    background: #ffffff;
    padding: 8px 10px;
}

.auth-chat-feedback-count-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.auth-chat-feedback-count-values {
    margin-top: 3px;
    font-size: 13px;
    color: #334155;
}

.auth-chat-feedback-body {
    margin-top: 4px;
    font-size: 13px;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}

.auth-chat-feedback-context {
    margin-top: 4px;
    font-size: 11.5px;
    color: #64748b;
    word-break: break-word;
}

.auth-app-feedback-wrap .auth-user-logs-list {
    max-height: 220px;
}

.auth-delete-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 24, 0.5);
    z-index: 2300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.auth-delete-confirm-dialog {
    width: min(420px, calc(100vw - 24px));
    border: 1px solid #d6deed;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
    padding: 14px 14px 12px;
}

.auth-delete-confirm-dialog h4 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
}

.auth-delete-confirm-dialog p {
    margin: 8px 0 0;
    color: #334155;
    font-size: 14px;
}

.auth-success-dialog {
    width: min(420px, calc(100vw - 24px));
}

.auth-delete-confirm-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.auth-delete-confirm-cancel {
    background: #475569 !important;
}

.auth-delete-confirm-cancel:hover {
    background: #334155 !important;
}

@media (max-width: 1120px) {
    .auth-modal.auth-modal--manage-users {
        width: 100vw;
        margin-right: 0;
    }
}

/* ===================== Chapter 9 Hematopoietic nav buttons ===================== */
.ch9-hemato-selection-wrap,
.ch10-endo-selection-wrap,
.ch11-ent-selection-wrap {
    margin-top: 16px;
}

#ch9MethodOptionsList,
#ch10MethodOptionsList,
#ch11MethodOptionsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ch10-method-option--info-only {
    cursor: default;
    background-color: #f5f5f5;
    color: #777;
    border: 1px solid #9ccaff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ch10-method-option--info-only:hover {
    background-color: #f5f5f5;
    border-color: #9ccaff;
    color: #777;
    box-shadow: none;
}

.ch10-method-option--info-only .fingers-arthroplasty-assign-help {
    cursor: pointer;
}

#ch9MethodSelectionMessage,
#ch10MethodSelectionMessage,
#ch11MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch9BothFirstActions,
#ch10BothFirstActions,
#ch11BothFirstActions,
#ch12BothFirstActions {
    display: none;
}

#ch9BothFirstActions button,
#ch9FinalActions button,
#ch9MethodNav button,
#ch10BothFirstActions button,
#ch10FinalActions button,
#ch10MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

/* Selection nav (Start Over / Go Back / Next) */
#ch9MethodNav #ch9MethodStartOver,
#ch9MethodNav #ch9MethodGoBack,
#ch9MethodNav #ch9MethodProceed,
#ch10MethodNav #ch10MethodStartOver,
#ch10MethodNav #ch10MethodGoBack,
#ch10MethodNav #ch10MethodProceed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch9MethodNav #ch9MethodStartOver::before,
#ch9MethodNav #ch9MethodGoBack::before,
#ch9MethodNav #ch9MethodProceed::after,
#ch10MethodNav #ch10MethodStartOver::before,
#ch10MethodNav #ch10MethodGoBack::before,
#ch10MethodNav #ch10MethodProceed::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch9MethodNav #ch9MethodStartOver::before,
#ch10MethodNav #ch10MethodStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch9MethodNav #ch9MethodGoBack::before,
#ch10MethodNav #ch10MethodGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch9MethodNav #ch9MethodProceed::after,
#ch10MethodNav #ch10MethodProceed::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

/* Final actions (Start Over / Go Back / Add Body Part / Add-ons / Rate Impairment) */
.calculators-final-actions #ch9CalculatorsStartOver,
.calculators-final-actions #ch9CalculatorsGoBack,
.calculators-final-actions #ch9AddBodyPart,
.calculators-final-actions #ch9PainAddOn,
.calculators-final-actions #ch9RateImpairment,
#ch9BothFirstActions #ch9CalculatorsStartOverFirst,
#ch9BothFirstActions #ch9CalculatorsGoBackFirst,
#ch9BothFirstActions #ch9BothFirstAddBodyPart,
#ch9BothFirstActions #ch9BothFirstAddOns,
#ch9BothFirstActions #ch9ProceedToNextChapter,
.calculators-final-actions #ch10CalculatorsStartOver,
.calculators-final-actions #ch10CalculatorsGoBack,
.calculators-final-actions #ch10AddBodyPart,
.calculators-final-actions #ch10PainAddOn,
.calculators-final-actions #ch10RateImpairment,
#ch10BothFirstActions #ch10CalculatorsStartOverFirst,
#ch10BothFirstActions #ch10CalculatorsGoBackFirst,
#ch10BothFirstActions #ch10BothFirstAddBodyPart,
#ch10BothFirstActions #ch10BothFirstAddOns,
#ch10BothFirstActions #ch10ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.calculators-final-actions #ch9CalculatorsStartOver::before,
.calculators-final-actions #ch9CalculatorsGoBack::before,
.calculators-final-actions #ch9AddBodyPart::before,
.calculators-final-actions #ch9PainAddOn::before,
.calculators-final-actions #ch9RateImpairment::before,
#ch9BothFirstActions #ch9CalculatorsStartOverFirst::before,
#ch9BothFirstActions #ch9CalculatorsGoBackFirst::before,
#ch9BothFirstActions #ch9BothFirstAddBodyPart::before,
#ch9BothFirstActions #ch9BothFirstAddOns::before,
#ch9BothFirstActions #ch9ProceedToNextChapter::after,
.calculators-final-actions #ch10CalculatorsStartOver::before,
.calculators-final-actions #ch10CalculatorsGoBack::before,
.calculators-final-actions #ch10AddBodyPart::before,
.calculators-final-actions #ch10PainAddOn::before,
.calculators-final-actions #ch10RateImpairment::before,
#ch10BothFirstActions #ch10CalculatorsStartOverFirst::before,
#ch10BothFirstActions #ch10CalculatorsGoBackFirst::before,
#ch10BothFirstActions #ch10BothFirstAddBodyPart::before,
#ch10BothFirstActions #ch10BothFirstAddOns::before,
#ch10BothFirstActions #ch10ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.calculators-final-actions #ch9CalculatorsStartOver::before,
#ch9BothFirstActions #ch9CalculatorsStartOverFirst::before,
.calculators-final-actions #ch10CalculatorsStartOver::before,
#ch10BothFirstActions #ch10CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch9CalculatorsGoBack::before,
#ch9BothFirstActions #ch9CalculatorsGoBackFirst::before,
.calculators-final-actions #ch10CalculatorsGoBack::before,
#ch10BothFirstActions #ch10CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch9AddBodyPart::before,
#ch9BothFirstActions #ch9BothFirstAddBodyPart::before,
.calculators-final-actions #ch10AddBodyPart::before,
#ch10BothFirstActions #ch10BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch9PainAddOn::before,
#ch9BothFirstActions #ch9BothFirstAddOns::before,
.calculators-final-actions #ch10PainAddOn::before,
#ch10BothFirstActions #ch10BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch9RateImpairment::before,
.calculators-final-actions #ch10RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

#ch9BothFirstActions #ch9ProceedToNextChapter::after,
#ch10BothFirstActions #ch10ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

/* ===================== Chapter 3 Cardiovascular (Heart & Aorta) ===================== */
.ch3-cv-calculator-wrap {
    margin-bottom: 20px;
}

.ch3-cv-calculator-wrap .ch3-cv-header-card {
    margin-bottom: 14px;
}

.ch3-cv-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch3-cv-total-impairment-card.hidden {
    display: none;
}

.ch3-cv-total-impairment-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch3-cv-selection-wrap {
    margin-top: 16px;
}

#ch3MethodOptionsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#ch3MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch3BothFirstActions {
    display: none;
}

#ch3BothFirstActions button,
#ch3FinalActions button,
#ch3MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch3MethodNav #ch3MethodStartOver,
#ch3MethodNav #ch3MethodGoBack,
#ch3MethodNav #ch3MethodProceed,
.calculators-final-actions #ch3CalculatorsStartOver,
.calculators-final-actions #ch3CalculatorsGoBack,
.calculators-final-actions #ch3AddBodyPart,
.calculators-final-actions #ch3PainAddOn,
.calculators-final-actions #ch3RateImpairment,
#ch3BothFirstActions #ch3CalculatorsStartOverFirst,
#ch3BothFirstActions #ch3CalculatorsGoBackFirst,
#ch3BothFirstActions #ch3BothFirstAddBodyPart,
#ch3BothFirstActions #ch3BothFirstAddOns,
#ch3BothFirstActions #ch3ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch3MethodNav #ch3MethodStartOver::before,
#ch3MethodNav #ch3MethodGoBack::before,
#ch3MethodNav #ch3MethodProceed::after,
.calculators-final-actions #ch3CalculatorsStartOver::before,
.calculators-final-actions #ch3CalculatorsGoBack::before,
.calculators-final-actions #ch3AddBodyPart::before,
.calculators-final-actions #ch3PainAddOn::before,
.calculators-final-actions #ch3RateImpairment::before,
#ch3BothFirstActions #ch3CalculatorsStartOverFirst::before,
#ch3BothFirstActions #ch3CalculatorsGoBackFirst::before,
#ch3BothFirstActions #ch3BothFirstAddBodyPart::before,
#ch3BothFirstActions #ch3BothFirstAddOns::before,
#ch3BothFirstActions #ch3ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch3MethodNav #ch3MethodStartOver::before,
.calculators-final-actions #ch3CalculatorsStartOver::before,
#ch3BothFirstActions #ch3CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch3MethodNav #ch3MethodGoBack::before,
.calculators-final-actions #ch3CalculatorsGoBack::before,
#ch3BothFirstActions #ch3CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch3MethodNav #ch3MethodProceed::after,
#ch3BothFirstActions #ch3ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch3AddBodyPart::before,
#ch3BothFirstActions #ch3BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch3PainAddOn::before,
#ch3BothFirstActions #ch3BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch3RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===================== Chapter 12 Visual System ===================== */
#ch12VisualOptionsNav button,
#ch12BothFirstActions button,
#ch12FinalActions button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch12VisualOptionsNav #ch12OptionsStartOver,
#ch12VisualOptionsNav #ch12OptionsGoBack,
#ch12VisualOptionsNav #ch12OptionsProceed,
#ch12BothFirstActions #ch12CalculatorsStartOverFirst,
#ch12BothFirstActions #ch12CalculatorsGoBackFirst,
#ch12BothFirstActions #ch12BothFirstAddBodyPart,
#ch12BothFirstActions #ch12BothFirstAddOns,
#ch12BothFirstActions #ch12ProceedToNextChapter,
#ch12FinalActions #ch12CalculatorsStartOver,
#ch12FinalActions #ch12CalculatorsGoBack,
#ch12FinalActions #ch12AddBodyPart,
#ch12FinalActions #ch12PainAddOn,
#ch12FinalActions #ch12RateImpairment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch12VisualOptionsNav #ch12OptionsStartOver::before,
#ch12VisualOptionsNav #ch12OptionsGoBack::before,
#ch12VisualOptionsNav #ch12OptionsProceed::after,
#ch12BothFirstActions #ch12CalculatorsStartOverFirst::before,
#ch12BothFirstActions #ch12CalculatorsGoBackFirst::before,
#ch12BothFirstActions #ch12BothFirstAddBodyPart::before,
#ch12BothFirstActions #ch12BothFirstAddOns::before,
#ch12BothFirstActions #ch12ProceedToNextChapter::after,
#ch12FinalActions #ch12CalculatorsStartOver::before,
#ch12FinalActions #ch12CalculatorsGoBack::before,
#ch12FinalActions #ch12AddBodyPart::before,
#ch12FinalActions #ch12PainAddOn::before,
#ch12FinalActions #ch12RateImpairment::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch12VisualOptionsNav #ch12OptionsStartOver::before,
#ch12BothFirstActions #ch12CalculatorsStartOverFirst::before,
#ch12FinalActions #ch12CalculatorsStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch12VisualOptionsNav #ch12OptionsGoBack::before,
#ch12BothFirstActions #ch12CalculatorsGoBackFirst::before,
#ch12FinalActions #ch12CalculatorsGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch12BothFirstActions #ch12ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

#ch12VisualOptionsNav #ch12OptionsProceed::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.ch12-modal-actions .ch12-modal-goback,
.ch12-modal-actions .ch12-modal-next {
    gap: 9px;
}

.ch12-modal-actions .ch12-modal-goback::before,
.ch12-modal-actions .ch12-modal-next::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.ch12-modal-actions .ch12-modal-goback::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

.ch12-modal-actions .ch12-modal-next::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.ch12-mer-binocular-required-modal .ch12-modal-actions .ch12-mer-binocular-ok::after {
    display: none;
    content: none;
}

.ch12-comingsoon-modal .ch12-modal-text {
    margin-bottom: 8px;
    line-height: 1.45;
}

.ch12-comingsoon-modal .ch12-modal-actions {
    margin-top: 20px;
}

/* Reading Acuity selection required pop-up: blue Okay button. */
.ch12-reading-required-modal .ch12-modal-text {
    margin-bottom: 8px;
    line-height: 1.45;
}

.ch12-reading-required-modal .ch12-modal-actions {
    margin-top: 20px;
}

.ch12-reading-required-modal .ch12-reading-required-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;
}

.ch12-reading-required-modal .ch12-reading-required-ok:hover {
    background-color: #1873CC;
}

.ch13-spinal-region-required-modal .ch13-spinal-region-required-text {
    margin: 6px 0 8px;
    line-height: 1.45;
}

.ch13-spinal-region-required-modal .ch13-spinal-region-required-actions {
    margin-top: 20px;
}

.ch13-spinal-region-required-modal .ch13-spinal-region-required-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;
}

.ch13-spinal-region-required-modal .ch13-spinal-region-required-ok:hover {
    background-color: #1873CC;
}

#ch12BothFirstActions #ch12BothFirstAddBodyPart::before,
#ch12FinalActions #ch12AddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

#ch12BothFirstActions #ch12BothFirstAddOns::before,
#ch12FinalActions #ch12PainAddOn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

#ch12FinalActions #ch12RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===================== Chapter 4 Cardiovascular (Systemic & Pulmonary Arteries) ===================== */
.ch4-sp-calculator-wrap {
    margin-bottom: 20px;
}

.ch4-sp-calculator-wrap .ch4-sp-header-card {
    margin-bottom: 14px;
}

.ch4-sp-header-card .ch16-header-title {
    transform: translateX(-1px);
}

.ch4-sp-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch4-sp-total-impairment-card.hidden {
    display: none;
}

.ch4-sp-total-impairment-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch4-sp-selection-wrap {
    margin-top: 16px;
}

/* ---- Bilateral Peripheral Vascular Disease (Left/Right + opposing extremity) ---- */
.ch4-sp-side-controls {
    margin: 14px 0 4px;
    text-align: left;
}

.ch4-sp-side-selection {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding-top: 6px;
}

.ch4-sp-side-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95em;
    user-select: none;
}

/* Mirror the blue digit sensory selection-box styling. */
.ch4-sp-side-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: #fff;
}

.ch4-sp-side-checkbox:hover:not(:checked) {
    background-color: #F0F8FF;
}

.ch4-sp-side-checkbox:checked {
    background-color: #3B90FF;
}

.ch4-sp-side-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ch4-sp-side-option span {
    position: relative;
    top: 1px;
}

.ch4-sp-side-divider {
    color: #9aa4b2;
    font-weight: 600;
}

.ch4-sp-add-opposing-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 0;
    padding-top: 6px; /* row nudge; padding avoids margin-collapse with checkboxes above */
    margin-bottom: 4px;
    text-align: left;
}

/* Match the PD calculator "add entry row" (+) icon styling. */
.ch4-sp-add-opposing {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    margin: 0; /* override global button { margin: 20px auto } centering */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #1d4ed8;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(29, 78, 216, 0.35);
    flex: 0 0 auto;
}

.ch4-sp-add-opposing:hover {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.ch4-sp-add-opposing:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.ch4-sp-add-opposing-label {
    font-size: 0.9em;
    color: inherit;
    font-weight: normal;
    text-align: left;
    line-height: inherit;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    top: 1px;
}

/* Bilateral PVD combined "Total Impairment" card. */
.ch4-sp-pvd-total-card {
    margin-bottom: 16px;
}

/* "Please select an extremity" pop-up: blue Okay button. */
.ch4-sp-select-extremity-modal .ch4-sp-select-extremity-message {
    margin: 0 0 4px;
}

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

.ch4-sp-select-extremity-modal .ch4-sp-select-extremity-ok:hover {
    background-color: #1873CC;
}

/* Cardiomyopathy + Class 4 hypertensive conflict pop-up (p. 69): three stacked blue choices. */
.ch4-htn-cardio-conflict-modal .ch4-htn-cardio-conflict-message {
    margin: 0 0 4px;
}

.ch4-htn-cardio-conflict-modal .ch4-htn-cardio-conflict-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.ch4-htn-cardio-conflict-modal .ch4-htn-cardio-conflict-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px;
    background-color: #1E90FF;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.ch4-htn-cardio-conflict-modal .ch4-htn-cardio-conflict-btn:hover {
    background-color: #1873CC;
}

#ch4MethodOptionsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#ch4MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch4BothFirstActions {
    display: none;
}

#ch4BothFirstActions button,
#ch4FinalActions button,
#ch4MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch4MethodNav #ch4MethodStartOver,
#ch4MethodNav #ch4MethodGoBack,
#ch4MethodNav #ch4MethodProceed,
.calculators-final-actions #ch4CalculatorsStartOver,
.calculators-final-actions #ch4CalculatorsGoBack,
.calculators-final-actions #ch4AddBodyPart,
.calculators-final-actions #ch4PainAddOn,
.calculators-final-actions #ch4RateImpairment,
#ch4BothFirstActions #ch4CalculatorsStartOverFirst,
#ch4BothFirstActions #ch4CalculatorsGoBackFirst,
#ch4BothFirstActions #ch4BothFirstAddBodyPart,
#ch4BothFirstActions #ch4BothFirstAddOns,
#ch4BothFirstActions #ch4ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch4MethodNav #ch4MethodStartOver::before,
#ch4MethodNav #ch4MethodGoBack::before,
#ch4MethodNav #ch4MethodProceed::after,
.calculators-final-actions #ch4CalculatorsStartOver::before,
.calculators-final-actions #ch4CalculatorsGoBack::before,
.calculators-final-actions #ch4AddBodyPart::before,
.calculators-final-actions #ch4PainAddOn::before,
.calculators-final-actions #ch4RateImpairment::before,
#ch4BothFirstActions #ch4CalculatorsStartOverFirst::before,
#ch4BothFirstActions #ch4CalculatorsGoBackFirst::before,
#ch4BothFirstActions #ch4BothFirstAddBodyPart::before,
#ch4BothFirstActions #ch4BothFirstAddOns::before,
#ch4BothFirstActions #ch4ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch4MethodNav #ch4MethodStartOver::before,
.calculators-final-actions #ch4CalculatorsStartOver::before,
#ch4BothFirstActions #ch4CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch4MethodNav #ch4MethodGoBack::before,
.calculators-final-actions #ch4CalculatorsGoBack::before,
#ch4BothFirstActions #ch4CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch4MethodNav #ch4MethodProceed::after,
#ch4BothFirstActions #ch4ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch4AddBodyPart::before,
#ch4BothFirstActions #ch4BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch4PainAddOn::before,
#ch4BothFirstActions #ch4BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch4RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===================== Chapter 6 Digestive System ===================== */
.ch6-dig-running-totals-wrap {
    margin-top: 16px;
}

.ch6-dig-running-totals-card {
    border: 1px solid #1e90ff;
}

.ch5-resp-calculator-wrap {
    margin-bottom: 20px;
}

.ch5-resp-calculator-wrap .ch5-resp-header-card {
    margin-bottom: 14px;
}

.ch5-resp-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch5-resp-total-impairment-card.hidden,
.ch5-resp-running-totals-wrap.hidden {
    display: none;
}

.ch5-resp-running-totals-wrap {
    margin-top: 16px;
}

.ch5-resp-running-totals-card {
    border: 1px solid #1e90ff;
}

.ch5-resp-selection-wrap {
    margin-top: 16px;
}

#ch5MethodOptionsList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#ch5MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch5BothFirstActions {
    display: none;
}

#ch5BothFirstActions button,
#ch5FinalActions button,
#ch5MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch5MethodNav #ch5MethodStartOver,
#ch5MethodNav #ch5MethodGoBack,
#ch5MethodNav #ch5MethodProceed,
.calculators-final-actions #ch5CalculatorsStartOver,
.calculators-final-actions #ch5CalculatorsGoBack,
.calculators-final-actions #ch5AddBodyPart,
.calculators-final-actions #ch5PainAddOn,
.calculators-final-actions #ch5RateImpairment,
#ch5BothFirstActions #ch5CalculatorsStartOverFirst,
#ch5BothFirstActions #ch5CalculatorsGoBackFirst,
#ch5BothFirstActions #ch5BothFirstAddBodyPart,
#ch5BothFirstActions #ch5BothFirstAddOns,
#ch5BothFirstActions #ch5ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch5MethodNav #ch5MethodStartOver::before,
#ch5MethodNav #ch5MethodGoBack::before,
#ch5MethodNav #ch5MethodProceed::after,
.calculators-final-actions #ch5CalculatorsStartOver::before,
.calculators-final-actions #ch5CalculatorsGoBack::before,
.calculators-final-actions #ch5AddBodyPart::before,
.calculators-final-actions #ch5PainAddOn::before,
.calculators-final-actions #ch5RateImpairment::before,
#ch5BothFirstActions #ch5CalculatorsStartOverFirst::before,
#ch5BothFirstActions #ch5CalculatorsGoBackFirst::before,
#ch5BothFirstActions #ch5BothFirstAddBodyPart::before,
#ch5BothFirstActions #ch5BothFirstAddOns::before,
#ch5BothFirstActions #ch5ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch5MethodNav #ch5MethodStartOver::before,
.calculators-final-actions #ch5CalculatorsStartOver::before,
#ch5BothFirstActions #ch5CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch5MethodNav #ch5MethodGoBack::before,
.calculators-final-actions #ch5CalculatorsGoBack::before,
#ch5BothFirstActions #ch5CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch5MethodNav #ch5MethodProceed::after,
#ch5BothFirstActions #ch5ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch5AddBodyPart::before,
#ch5BothFirstActions #ch5BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch5PainAddOn::before,
#ch5BothFirstActions #ch5BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch5RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

.ch6-dig-calculator-wrap {
    margin-bottom: 20px;
}

.ch6-dig-calculator-wrap .ch6-dig-header-card {
    margin-bottom: 14px;
}

.ch6-dig-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch6-dig-pair-rollup-card.hidden {
    display: none;
}

.ch6-dig-pair-rollup-card:not(.hidden) {
    margin-bottom: 16px;
}

.ch6-dig-total-impairment-card.hidden {
    display: none;
}

.ch6-dig-total-impairment-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch6-dig-selection-wrap {
    margin-top: 16px;
}

#ch6MethodOptionsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#ch6MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch6BothFirstActions {
    display: none;
}

#ch6BothFirstActions button,
#ch6FinalActions button,
#ch6MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch6MethodNav #ch6MethodStartOver,
#ch6MethodNav #ch6MethodGoBack,
#ch6MethodNav #ch6MethodProceed,
.calculators-final-actions #ch6CalculatorsStartOver,
.calculators-final-actions #ch6CalculatorsGoBack,
.calculators-final-actions #ch6AddBodyPart,
.calculators-final-actions #ch6PainAddOn,
.calculators-final-actions #ch6RateImpairment,
#ch6BothFirstActions #ch6CalculatorsStartOverFirst,
#ch6BothFirstActions #ch6CalculatorsGoBackFirst,
#ch6BothFirstActions #ch6BothFirstAddBodyPart,
#ch6BothFirstActions #ch6BothFirstAddOns,
#ch6BothFirstActions #ch6ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch6MethodNav #ch6MethodStartOver::before,
#ch6MethodNav #ch6MethodGoBack::before,
#ch6MethodNav #ch6MethodProceed::after,
.calculators-final-actions #ch6CalculatorsStartOver::before,
.calculators-final-actions #ch6CalculatorsGoBack::before,
.calculators-final-actions #ch6AddBodyPart::before,
.calculators-final-actions #ch6PainAddOn::before,
.calculators-final-actions #ch6RateImpairment::before,
#ch6BothFirstActions #ch6CalculatorsStartOverFirst::before,
#ch6BothFirstActions #ch6CalculatorsGoBackFirst::before,
#ch6BothFirstActions #ch6BothFirstAddBodyPart::before,
#ch6BothFirstActions #ch6BothFirstAddOns::before,
#ch6BothFirstActions #ch6ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch6MethodNav #ch6MethodStartOver::before,
.calculators-final-actions #ch6CalculatorsStartOver::before,
#ch6BothFirstActions #ch6CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch6MethodNav #ch6MethodGoBack::before,
.calculators-final-actions #ch6CalculatorsGoBack::before,
#ch6BothFirstActions #ch6CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch6MethodNav #ch6MethodProceed::after,
#ch6BothFirstActions #ch6ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch6AddBodyPart::before,
#ch6BothFirstActions #ch6BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch6PainAddOn::before,
#ch6BothFirstActions #ch6BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch6RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===================== Chapter 7 Urinary & Reproductive Systems ===================== */
.ch7-ur-running-totals-wrap {
    margin-top: 16px;
}

.ch7-ur-running-totals-card {
    border: 1px solid #1e90ff;
}

.ch7-ur-calculator-wrap {
    margin-bottom: 20px;
}

.ch7-ur-calculator-wrap .ch7-ur-header-card {
    margin-bottom: 14px;
}

.ch7-ur-header-card .ch16-header-title {
    transform: translateX(-6px);
}

.ch7-ur-calculators-list {
    max-width: none;
    margin: 0 0 16px;
}

.ch7-ur-pair-rollup-card.hidden {
    display: none;
}

.ch7-ur-pair-rollup-card:not(.hidden) {
    margin-bottom: 16px;
}

.ch7-ur-total-impairment-card.hidden {
    display: none;
}

.ch7-ur-total-impairment-card:not(.hidden) {
    margin-bottom: 20px;
}

.ch7-ur-selection-wrap {
    margin-top: 16px;
}

/* Male reproductive age modifiers: keep label hit area on checkbox + text only. */
.ch7-age-adjust-wrap {
    margin: 10px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.ch7-age-adjust-option {
    display: inline-flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    max-width: 100%;
    font-size: 0.92em;
    cursor: pointer;
}

.ch7-age-adjust-option span {
    position: relative;
    top: 1px;
}

.ch7-ur-diversion-table .ch7-ur-diversion-cb {
    cursor: pointer;
    vertical-align: middle;
    margin: 0;
}

#ch7MethodOptionsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

/* Gender mutual-exclusion: the conflicting (locked) options are dimmed and non-interactive. */
#ch7MethodOptionsList .ch7-method-option.ch7-option-locked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

#ch7MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch7BothFirstActions {
    display: none;
}

#ch7BothFirstActions button,
#ch7FinalActions button,
#ch7MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch7MethodNav #ch7MethodStartOver,
#ch7MethodNav #ch7MethodGoBack,
#ch7MethodNav #ch7MethodProceed,
.calculators-final-actions #ch7CalculatorsStartOver,
.calculators-final-actions #ch7CalculatorsGoBack,
.calculators-final-actions #ch7AddBodyPart,
.calculators-final-actions #ch7PainAddOn,
.calculators-final-actions #ch7RateImpairment,
#ch7BothFirstActions #ch7CalculatorsStartOverFirst,
#ch7BothFirstActions #ch7CalculatorsGoBackFirst,
#ch7BothFirstActions #ch7BothFirstAddBodyPart,
#ch7BothFirstActions #ch7BothFirstAddOns,
#ch7BothFirstActions #ch7ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch7MethodNav #ch7MethodStartOver::before,
#ch7MethodNav #ch7MethodGoBack::before,
#ch7MethodNav #ch7MethodProceed::after,
.calculators-final-actions #ch7CalculatorsStartOver::before,
.calculators-final-actions #ch7CalculatorsGoBack::before,
.calculators-final-actions #ch7AddBodyPart::before,
.calculators-final-actions #ch7PainAddOn::before,
.calculators-final-actions #ch7RateImpairment::before,
#ch7BothFirstActions #ch7CalculatorsStartOverFirst::before,
#ch7BothFirstActions #ch7CalculatorsGoBackFirst::before,
#ch7BothFirstActions #ch7BothFirstAddBodyPart::before,
#ch7BothFirstActions #ch7BothFirstAddOns::before,
#ch7BothFirstActions #ch7ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch7MethodNav #ch7MethodStartOver::before,
.calculators-final-actions #ch7CalculatorsStartOver::before,
#ch7BothFirstActions #ch7CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch7MethodNav #ch7MethodGoBack::before,
.calculators-final-actions #ch7CalculatorsGoBack::before,
#ch7BothFirstActions #ch7CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch7MethodNav #ch7MethodProceed::after,
#ch7BothFirstActions #ch7ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch7AddBodyPart::before,
#ch7BothFirstActions #ch7BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch7PainAddOn::before,
#ch7BothFirstActions #ch7BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch7RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===================== Chapter 11 ENT & Related Structures nav buttons ===================== */
.ch11-ent-header-card .ch16-header-chapter {
    transform: translateX(-3px);
}

#ch11BothFirstActions button,
#ch11FinalActions button,
#ch11MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch11MethodNav #ch11MethodStartOver,
#ch11MethodNav #ch11MethodGoBack,
#ch11MethodNav #ch11MethodProceed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch11MethodNav #ch11MethodStartOver::before,
#ch11MethodNav #ch11MethodGoBack::before,
#ch11MethodNav #ch11MethodProceed::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch11MethodNav #ch11MethodStartOver::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch11MethodNav #ch11MethodGoBack::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch11MethodNav #ch11MethodProceed::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch11CalculatorsStartOver,
.calculators-final-actions #ch11CalculatorsGoBack,
.calculators-final-actions #ch11AddBodyPart,
.calculators-final-actions #ch11PainAddOn,
.calculators-final-actions #ch11RateImpairment,
#ch11BothFirstActions #ch11CalculatorsStartOverFirst,
#ch11BothFirstActions #ch11CalculatorsGoBackFirst,
#ch11BothFirstActions #ch11BothFirstAddBodyPart,
#ch11BothFirstActions #ch11BothFirstAddOns,
#ch11BothFirstActions #ch11ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.calculators-final-actions #ch11CalculatorsStartOver::before,
.calculators-final-actions #ch11CalculatorsGoBack::before,
.calculators-final-actions #ch11AddBodyPart::before,
.calculators-final-actions #ch11PainAddOn::before,
.calculators-final-actions #ch11RateImpairment::before,
#ch11BothFirstActions #ch11CalculatorsStartOverFirst::before,
#ch11BothFirstActions #ch11CalculatorsGoBackFirst::before,
#ch11BothFirstActions #ch11BothFirstAddBodyPart::before,
#ch11BothFirstActions #ch11BothFirstAddOns::before,
#ch11BothFirstActions #ch11ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

.calculators-final-actions #ch11CalculatorsStartOver::before,
#ch11BothFirstActions #ch11CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch11CalculatorsGoBack::before,
#ch11BothFirstActions #ch11CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch11BothFirstActions #ch11ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch11AddBodyPart::before,
#ch11BothFirstActions #ch11BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch11PainAddOn::before,
#ch11BothFirstActions #ch11BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch11RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===================== Chapter 13 Nervous System ===================== */
.ch13-ns-selection-wrap {
    margin-top: 16px;
}

#ch13MethodOptionsList {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ch13-ns-option-section {
    width: 100%;
}

.ch13-ns-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 2.5rem;
    margin: 0.85em 0 0;
    padding: 0.45em 8px 0.5em 10px;
    border: none;
    border-bottom: 1px solid #bbdefb;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1.35;
    color: #1565c0;
    text-align: left;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ch13-ns-option-section:first-child .ch13-ns-section-toggle {
    margin-top: 0;
}

.ch13-ns-section-toggle:hover {
    background-color: #eaf4ff;
    color: #0f3f75;
    border-bottom-color: #9ccaff;
}

.ch13-ns-section-toggle:hover .ch13-ns-section-chevron {
    color: #0f3f75;
}

.ch13-ns-section-title {
    flex: 1;
    min-width: 0;
}

.ch13-ns-section-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1565c0;
}

.ch13-ns-section-chevron-icon {
    width: 26px;
    height: 26px;
    display: block;
    transition: transform 0.2s ease;
}

.ch13-ns-option-section.is-open .ch13-ns-section-chevron-icon {
    transform: rotate(180deg);
}

.ch13-ns-section-body {
    padding-top: 10px;
}

/* Optic card: collapsible Visual Acuity / Visual Field tables (chevron beside label). */
.ch13-ns-optic-section {
    margin-bottom: 0.35em;
}

.ch13-ns-optic-section-toggle {
    position: relative;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    margin: 0.55em 0 0.35em;
    padding: 0.2em 0.35em 0.2em 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: #1565c0;
    transition: color 0.2s ease;
}

.ch13-ns-optic-section-toggle::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 4px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.ch13-ns-optic-section:first-child .ch13-ns-optic-section-toggle {
    margin-top: 0.15em;
}

.ch13-ns-optic-section-toggle:hover {
    background-color: transparent;
    color: #0f3f75;
}

.ch13-ns-optic-section-toggle:hover::before {
    background-color: #eaf4ff;
}

.ch13-ns-optic-section-toggle:hover .ch13-ns-section-chevron {
    color: #0f3f75;
}

.ch13-ns-optic-section-title {
    flex: 0 0 auto;
    min-width: 9.25rem;
    padding-left: 10px;
    font-size: 1.02em;
    font-weight: bold;
    line-height: 1.2;
    color: inherit;
}

.ch13-ns-optic-section .ch13-ns-section-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    margin-left: -20px;
    color: #1565c0;
    line-height: 0;
}

.ch13-ns-optic-section .ch13-ns-section-chevron-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.ch13-ns-optic-section.is-open > .ch13-ns-optic-section-toggle .ch13-ns-section-chevron-icon {
    transform: rotate(180deg);
}

.ch13-ns-optic-section-body {
    padding-top: 0.35em;
    padding-bottom: 0.15em;
}

/* PNS UE/LE Both: collapsible Left / Right extremity nerve tables. */
.ch13-ns-nerve-dual-stack-section {
    margin-top: 1em;
}

.ch13-ns-nerve-dual-stack-section:first-child {
    margin-top: 0;
}

.ch13-ns-nerve-dual-stack-section .ch13-ns-optic-section-toggle {
    margin-top: 0.15em;
    margin-left: 0;
    padding-right: 5px;
}

.ch13-ns-nerve-dual-stack-section .ch13-ns-optic-section-title {
    flex: 0 0 auto;
    min-width: 9.25rem;
    padding-left: 10px;
    font-size: 0.95em;
    font-weight: 600;
}

.ch13-ns-nerve-dual-stack-section .ch13-ns-section-chevron {
    margin-left: -20px;
}

.ch13-ns-nerve-dual-stack-body {
    padding-top: 0.35em;
}

/* PNS Spine: Cervical / Lumbar toggles — chevrons clear longer labels without excess gap. */
.ch13-ns-spine-region-section.ch13-ns-nerve-dual-stack-section .ch13-ns-optic-section-toggle {
    gap: 2px;
    padding-right: 0;
}

.ch13-ns-spine-region-section.ch13-ns-nerve-dual-stack-section .ch13-ns-optic-section-title {
    min-width: 11.5rem;
    padding-right: 0;
}

.ch13-ns-card[data-ch13-method="pnSpineSensory"]
    .ch13-ns-spine-region-section
    > .ch13-ns-optic-section-toggle
    > .ch13-ns-section-chevron,
.ch13-ns-card[data-ch13-method="pnSpineMotor"]
    .ch13-ns-spine-region-section
    > .ch13-ns-optic-section-toggle
    > .ch13-ns-section-chevron {
    margin-left: 0;
    transform: translateX(-6px);
}

.ch13-ns-card[data-ch13-method="pnSpineSensory"] .ch13-ns-nerve-substack-section .ch13-ns-optic-section-toggle,
.ch13-ns-card[data-ch13-method="pnSpineMotor"] .ch13-ns-nerve-substack-section .ch13-ns-optic-section-toggle {
    gap: 4px;
    padding-right: 4px;
}

.ch13-ns-card[data-ch13-method="pnSpineSensory"] .ch13-ns-nerve-substack-section .ch13-ns-optic-section-title,
.ch13-ns-card[data-ch13-method="pnSpineMotor"] .ch13-ns-nerve-substack-section .ch13-ns-optic-section-title {
    flex: 0 0 10.85rem;
    min-width: 10.85rem;
    padding-right: 4px;
}

/* PNS UE: nested Peripheral Nerves / Brachial Plexus substacks. */
.ch13-ns-nerve-substack-section {
    margin-top: 0.65em;
}

.ch13-ns-nerve-substack-section:first-child {
    margin-top: 0;
}

.ch13-ns-nerve-substack-section .ch13-ns-optic-section-toggle {
    margin-left: 1.25rem;
    padding-right: 5px;
}

.ch13-ns-nerve-substack-section .ch13-ns-optic-section-title {
    flex: 0 0 auto;
    min-width: 9.25rem;
    padding-left: 10px;
    font-size: 0.95em;
    font-weight: 600;
}

.ch13-ns-nerve-substack-section .ch13-ns-section-chevron {
    margin-left: 0;
}

.ch13-ns-nerve-substack-body {
    padding-top: 0.35em;
    padding-left: 1.25rem;
}

.ch13-ns-spine-nerve-tables .ch13-nerve-table--spine-le {
    margin-top: 1em;
}

.ch13-nerve-table .ch13-nerve-input {
    background-color: #ffffff;
}

.ch13-nerve-table .ch13-nerve-input:disabled {
    background-color: #e0e0e0;
}

.ch13-ns-card[data-ch13-method="pnLeSensory"] .ch13-ns-nerve-dual-stack-body .ch13-ns-nerve-max-footnote {
    margin: 0.35em 0 0;
    font-size: 0.9em;
    font-style: italic;
    color: #777;
}

/* Vestibulocochlear: aligned chevrons, gap + wider hover target to the right of label. */
.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-optic-section-toggle {
    margin-left: 5px;
    padding-right: 5px;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-optic-section[data-ch13-part="cnVestibularTinnitus"] .ch13-ns-optic-section-toggle {
    margin-top: calc(0.55em - 2px);
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-optic-section-title {
    flex: 0 0 16.85rem;
    min-width: 16.85rem;
    max-width: 16.85rem;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-optic-section .ch13-ns-section-chevron {
    margin-left: -20px;
    flex: 0 0 22px;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table {
    margin-top: 2px;
}

body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table th:nth-child(2),
body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table td:nth-child(2) {
    width: 17%;
}

body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table th:nth-child(3),
body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table td:nth-child(3) {
    width: 19%;
}

body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table th,
body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-table td {
    padding: 6px;
}

body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-entry-cell input,
body.ama-pdf-open .ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-wpi-cell input {
    width: 72px !important;
    max-width: 100%;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .instructions {
    margin-top: 12px;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .instructions,
.ch13-ns-card[data-ch13-method="cnVestibular"] .reference {
    padding-left: 15px;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-tinnitus-options {
    padding-left: 10px;
    margin-top: 16px;
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-composite-totals {
    margin-top: calc(0.75em + 10px);
}

.ch13-ns-card[data-ch13-method="cnVestibular"] .ch13-ns-composite-totals .total-impairment + .total-impairment {
    margin-top: calc(0.25em + 4px);
}

.ch13-ns-headaches-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 4px;
    padding-left: 15px;
}

.ch13-ns-headaches-toggle {
    position: relative;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0.2em 0.35em 0.2em 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: #1565c0;
    transition: color 0.2s ease;
}

.ch13-ns-headaches-toggle::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    right: 19px;
    bottom: 0;
    left: 0;
    border-radius: 4px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.ch13-ns-headaches-toggle:hover {
    background-color: transparent;
    color: #0f3f75;
}

.ch13-ns-headaches-toggle:hover::before {
    background-color: #eaf4ff;
}

.ch13-ns-headaches-toggle:hover .ch13-ns-section-chevron {
    color: #0f3f75;
}

.ch13-ns-headaches-toggle:hover .ch13-ns-headaches-label {
    color: #0f3f75;
}

.ch13-ns-headaches-label {
    font-weight: 600;
    color: #1565c0;
    white-space: nowrap;
}

.ch13-ns-headaches-entry-label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.ch13-ns-headaches-chapter-label {
    font-size: 0.9em;
    font-weight: normal;
    color: #333;
    white-space: nowrap;
}

.ch13-ns-headaches-input {
    width: 85px;
    box-sizing: border-box;
    padding: 2px 6px;
    text-align: center;
    border: 2px solid #2196f3;
    border-radius: 4px;
    background: #e3f0fd;
    color: #1a237e;
    font-size: 14px;
    line-height: 1.1;
    font-weight: bold;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: border 0.2s, background 0.2s;
}

.ch13-ns-headaches-input::-webkit-outer-spin-button,
.ch13-ns-headaches-input::-webkit-inner-spin-button {
    opacity: 0;
    height: 1.1em;
    width: 1em;
    cursor: pointer;
    margin: 0;
    transition: opacity 0.15s ease;
}

.ch13-ns-headaches-input:hover {
    -moz-appearance: auto;
    appearance: auto;
}

.ch13-ns-headaches-input:hover::-webkit-outer-spin-button,
.ch13-ns-headaches-input:hover::-webkit-inner-spin-button {
    opacity: 1;
}

.ch13-ns-headaches-input:focus {
    border: 2px solid #1565c0;
    background: #bbdefb;
}

.ch13-ns-headaches-row .ch13-ns-section-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 18px;
    color: #1565c0;
}

.ch13-ns-headaches-row .ch13-ns-section-chevron-icon {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform 0.2s ease;
}

.ch13-ns-headaches-row.is-open .ch13-ns-section-chevron-icon {
    transform: rotate(180deg);
}

.ch13-ns-headaches-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
}

.ch13-ns-headaches-body[hidden] {
    display: none;
}

.ch13-ns-section-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

/* Legacy heading class kept for any in-calculator reuse. */
.ch13-ns-group-heading {
    grid-column: 1 / -1;
    margin: 0.75em 0 0.25em;
    font-weight: bold;
    color: #1565c0;
    border-bottom: 1px solid #bbdefb;
    padding-bottom: 0.2em;
}

.ch13-ns-group-heading:first-child {
    margin-top: 0;
}

#ch13MethodSelectionMessage {
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

#ch13BothFirstActions {
    display: none;
}

#ch13BothFirstActions button,
#ch13FinalActions button,
#ch13MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch13MethodNav #ch13MethodStartOver,
#ch13MethodNav #ch13MethodGoBack,
#ch13MethodNav #ch13MethodProceed,
.calculators-final-actions #ch13CalculatorsStartOver,
.calculators-final-actions #ch13CalculatorsGoBack,
.calculators-final-actions #ch13AddBodyPart,
.calculators-final-actions #ch13PainAddOn,
.calculators-final-actions #ch13RateImpairment,
#ch13BothFirstActions #ch13CalculatorsStartOverFirst,
#ch13BothFirstActions #ch13CalculatorsGoBackFirst,
#ch13BothFirstActions #ch13BothFirstAddBodyPart,
#ch13BothFirstActions #ch13BothFirstAddOns,
#ch13BothFirstActions #ch13ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch13MethodNav #ch13MethodStartOver::before,
#ch13MethodNav #ch13MethodGoBack::before,
#ch13MethodNav #ch13MethodProceed::after,
.calculators-final-actions #ch13CalculatorsStartOver::before,
.calculators-final-actions #ch13CalculatorsGoBack::before,
.calculators-final-actions #ch13AddBodyPart::before,
.calculators-final-actions #ch13PainAddOn::before,
.calculators-final-actions #ch13RateImpairment::before,
#ch13BothFirstActions #ch13CalculatorsStartOverFirst::before,
#ch13BothFirstActions #ch13CalculatorsGoBackFirst::before,
#ch13BothFirstActions #ch13BothFirstAddBodyPart::before,
#ch13BothFirstActions #ch13BothFirstAddOns::before,
#ch13BothFirstActions #ch13ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch13MethodNav #ch13MethodStartOver::before,
.calculators-final-actions #ch13CalculatorsStartOver::before,
#ch13BothFirstActions #ch13CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch13MethodNav #ch13MethodGoBack::before,
.calculators-final-actions #ch13CalculatorsGoBack::before,
#ch13BothFirstActions #ch13CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch13MethodNav #ch13MethodProceed::after,
#ch13BothFirstActions #ch13ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch13AddBodyPart::before,
#ch13BothFirstActions #ch13BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch13PainAddOn::before,
#ch13BothFirstActions #ch13BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch13RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* Chapter 15 Spine — action button icons (match Ch.13) */
#ch15MethodNav button {
    box-sizing: border-box;
    height: 44px;
    line-height: 1;
}

#ch15MethodNav #ch15MethodStartOver,
#ch15MethodNav #ch15MethodGoBack,
#ch15MethodNav #ch15MethodProceed,
.calculators-final-actions #ch15CalculatorsStartOver,
.calculators-final-actions #ch15CalculatorsGoBack,
.calculators-final-actions #ch15AddBodyPart,
.calculators-final-actions #ch15PainAddOn,
.calculators-final-actions #ch15RateImpairment,
#ch15BothFirstActions #ch15CalculatorsStartOverFirst,
#ch15BothFirstActions #ch15CalculatorsGoBackFirst,
#ch15BothFirstActions #ch15BothFirstAddBodyPart,
#ch15BothFirstActions #ch15BothFirstAddOns,
#ch15BothFirstActions #ch15ProceedToNextChapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

#ch15MethodNav #ch15MethodStartOver::before,
#ch15MethodNav #ch15MethodGoBack::before,
#ch15MethodNav #ch15MethodProceed::after,
.calculators-final-actions #ch15CalculatorsStartOver::before,
.calculators-final-actions #ch15CalculatorsGoBack::before,
.calculators-final-actions #ch15AddBodyPart::before,
.calculators-final-actions #ch15PainAddOn::before,
.calculators-final-actions #ch15RateImpairment::before,
#ch15BothFirstActions #ch15CalculatorsStartOverFirst::before,
#ch15BothFirstActions #ch15CalculatorsGoBackFirst::before,
#ch15BothFirstActions #ch15BothFirstAddBodyPart::before,
#ch15BothFirstActions #ch15BothFirstAddOns::before,
#ch15BothFirstActions #ch15ProceedToNextChapter::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.98;
    flex-shrink: 0;
}

#ch15MethodNav #ch15MethodStartOver::before,
.calculators-final-actions #ch15CalculatorsStartOver::before,
#ch15BothFirstActions #ch15CalculatorsStartOverFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4C7.58 4 4.01 7.58 4.01 12S7.58 20 12 20c3.73 0 6.84-2.55 7.73-6h-2.08A5.98 5.98 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");
}

#ch15MethodNav #ch15MethodGoBack::before,
.calculators-final-actions #ch15CalculatorsGoBack::before,
#ch15BothFirstActions #ch15CalculatorsGoBackFirst::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5.5L8.5 12 16 18.5'/%3E%3C/svg%3E");
}

#ch15MethodNav #ch15MethodProceed::after,
#ch15BothFirstActions #ch15ProceedToNextChapter::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.5L15.5 12 8 18.5'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch15AddBodyPart::before,
#ch15BothFirstActions #ch15BothFirstAddBodyPart::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.8' cy='8' r='3.2'/%3E%3Cpath d='M3.6 18.2c0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2'/%3E%3Cpath d='M19.2 11.2v7.2'/%3E%3Cpath d='M15.8 14.8h6.4'/%3E%3C/svg%3E");
    position: relative;
    left: -2px;
}

.calculators-final-actions #ch15PainAddOn::before,
#ch15BothFirstActions #ch15BothFirstAddOns::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='6' cy='12' r='2.1'/%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Ccircle cx='18' cy='12' r='2.1'/%3E%3C/svg%3E");
}

.calculators-final-actions #ch15RateImpairment::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2' ry='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='11' y2='12'/%3E%3Cline x1='13' y1='12' x2='16' y2='12'/%3E%3Cline x1='10' y1='16' x2='14' y2='16'/%3E%3C/svg%3E");
}

/* ===== AMA methodology chat (inside AMA PDF viewer) ===== */

.ama-chat-toggle {
    background-color: #2f5fd0;
}

.ama-chat-toggle:hover {
    background-color: #2750ae;
    box-shadow: 0 0 0 1px rgba(47, 95, 208, 0.25);
}

.ama-chat-toggle-active {
    background-color: #1d3f8f;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Full-height right column styled to match the Occ Code Help drawer
   (dark navy, light text). No backdrop: the rest of the app stays usable. */
.ama-chat-panel {
    flex: 0 0 28rem;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #0b1220;
    color: #e5e7eb;
    border-left: 1px solid #1f2a3d;
}

.ama-chat-panel.hidden {
    display: none;
}

/* Small screens: keep the PDF at its normal width and let the chat overlay
   part of the calculator area to its left instead of squeezing three columns. */
@media (max-width: 1300px) {
    .ama-chat-panel {
        position: fixed;
        top: 0;
        right: var(--ama-pdf-width);
        width: min(28rem, 44vw);
        height: 100vh;
        z-index: 1001;
        box-shadow: -8px 0 28px rgba(0, 0, 0, 0.45);
    }
}

/* Header metrics mirror the Occ chat drawer (.occ-chat-header). */
.ama-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid #243044;
    background: linear-gradient(90deg, #111827 0%, #0b1220 68%);
}

.ama-chat-header-text {
    min-width: 0;
}

.ama-chat-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #f8fafc;
}

.ama-chat-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    color: #94a3b8;
}

.ama-chat-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ama-chat-header-btn,
.ama-chat-close-btn {
    font: inherit;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ama-chat-header-btn {
    width: auto;
    min-width: 0;
    height: 28px;
    margin: 0;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
    box-sizing: border-box;
}

.ama-chat-close-btn {
    width: 28px;
    height: 28px;
    margin: 0;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.ama-chat-header-btn:hover,
.ama-chat-close-btn:hover {
    background: #172033;
    border-color: #475569;
    color: #f8fafc;
}

.ama-chat-sources {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #334155;
    font-size: 10.5px;
    color: #64748b;
}

.ama-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background-color: #111827;
}

.ama-chat-messages::-webkit-scrollbar {
    width: 10px;
}

.ama-chat-messages::-webkit-scrollbar-track {
    background: #0b1220;
}

.ama-chat-messages::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 6px;
}

.ama-chat-message {
    max-width: 94%;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #e5e7eb;
    overflow-wrap: break-word;
}

.ama-chat-message-user {
    align-self: flex-end;
    background-color: #1d4ed8;
    border: 1px solid #3b82f6;
    color: #eff6ff;
    white-space: pre-wrap;
}

.ama-chat-message-assistant {
    align-self: flex-start;
    background-color: #0b1220;
    border: 1px solid #334155;
}

.ama-chat-message-assistant p {
    margin: 0 0 8px 0;
}

.ama-chat-message-assistant p:last-child {
    margin-bottom: 0;
}

.ama-chat-message-assistant ul,
.ama-chat-message-assistant ol {
    margin: 4px 0 8px 0;
    padding-left: 20px;
}

.ama-chat-message-assistant li {
    margin-bottom: 3px;
}

.ama-chat-message-assistant blockquote {
    margin: 6px 0;
    padding: 6px 10px;
    border-left: 3px solid #3b82f6;
    background-color: #0f172a;
    color: #cbd5e1;
    font-style: italic;
}

.ama-chat-message-assistant code {
    background-color: rgba(148, 163, 184, 0.18);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 12px;
}

.ama-chat-heading {
    font-weight: 700;
    margin: 6px 0 4px 0;
    color: #93c5fd;
}

.ama-chat-table {
    border-collapse: collapse;
    margin: 6px 0 8px 0;
    font-size: 12px;
    width: 100%;
}

.ama-chat-table th,
.ama-chat-table td {
    border: 1px solid #334155;
    padding: 4px 7px;
    text-align: left;
    vertical-align: top;
}

.ama-chat-table th {
    background-color: #0f172a;
    color: #93c5fd;
}

.ama-chat-citation {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background-color: rgba(59, 130, 246, 0.16);
    border: 1px solid #3b82f6;
    color: #93c5fd;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ama-chat-citation:hover {
    background-color: rgba(59, 130, 246, 0.35);
    color: #dbeafe;
}

/* Status strip (Thinking…); hidden unless there is something to show.
   Matches .occ-chat-toolbar placement: centered above the composer. */
.ama-chat-toolbar {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-top: 1px solid #243044;
    background: #0b1220;
    min-height: 1.9rem;
    box-sizing: border-box;
}

.ama-chat-toolbar--visible {
    display: flex;
}

.ama-chat-status {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 1.6rem);
    min-height: 1em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: #dbeafe;
    letter-spacing: 0.01em;
}

.ama-chat-status--thinking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: ama-chat-status-pulse 1.25s ease-in-out infinite;
}

.ama-chat-thinking {
    display: inline-flex;
    align-items: baseline;
    gap: 0.02em;
}

.ama-chat-thinking__dynamic {
    display: inline-block;
    width: 2.2ch;
    text-align: left;
    font-weight: 800;
}

@keyframes ama-chat-status-pulse {
    0%,
    100% {
        opacity: 0.78;
    }

    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ama-chat-status--thinking {
        animation: none;
    }
}

.ama-chat-notice {
    align-self: center;
    font-size: 12px;
    color: #fca5a5;
    background-color: rgba(239, 68, 68, 0.12);
    border: 1px solid #7f1d1d;
    border-radius: 8px;
    padding: 6px 10px;
}

.ama-chat-welcome {
    border-style: dashed;
    border-color: #334155;
    background-color: #0f172a;
    color: #94a3b8;
}

/* Icon row under each assistant answer: copy thread, thumbs up, thumbs down. */
.ama-chat-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    align-self: flex-start;
    margin: -5px 0 0 6px;
}

.ama-chat-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    min-width: 0;
    height: 26px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ama-chat-action-btn:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.ama-chat-action-btn svg {
    width: 15px;
    height: 15px;
}

.ama-chat-action-btn.is-active {
    color: #60a5fa;
}

.ama-chat-action-btn.ama-chat-action-down.is-active {
    color: #f87171;
}

.ama-chat-action-btn.ama-chat-action-copied {
    color: #4ade80;
}

/* Star rating + comment card opened by the feedback icon. */
.ama-chat-feedback-card {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 2px 4px 4px;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 10px;
    background-color: #0f172a;
}

.ama-chat-feedback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ama-chat-feedback-title {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
}

.ama-chat-feedback-close {
    width: 22px;
    min-width: 0;
    height: 22px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.ama-chat-feedback-close:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.ama-chat-feedback-prompt {
    font-size: 12px;
    color: #cbd5e1;
}

.ama-chat-feedback-stars {
    display: flex;
    gap: 2px;
}

.ama-chat-feedback-star {
    width: 26px;
    min-width: 0;
    height: 26px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.ama-chat-feedback-star:hover {
    background: #1e293b;
}

.ama-chat-feedback-star.is-filled {
    color: #fbbf24;
}

.ama-chat-feedback-text {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 56px;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12.5px;
    font-family: inherit;
    line-height: 1.4;
    background-color: #111827;
    color: #e5e7eb;
}

.ama-chat-feedback-text:focus {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 1px;
    border-color: #2563eb;
}

.ama-chat-feedback-error {
    font-size: 12px;
    color: #fca5a5;
}

.ama-chat-feedback-send {
    align-self: flex-start;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    background-color: #2563eb;
    color: #eff6ff;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
}

.ama-chat-feedback-send:hover {
    background-color: #1d4ed8;
}

.ama-chat-feedback-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.ama-chat-feedback-thanks {
    font-size: 13px;
    color: #4ade80;
    text-align: center;
    padding: 6px 0;
}

/* Stacked composer like the Occ chat: full-width textarea, Send below it. */
.ama-chat-input-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid #243044;
    background-color: #0b1220;
}

.ama-chat-input-row textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    /* Match Occ chat open height (Occ uses 4.5rem + 2.45rem bottom padding for the + fab). */
    min-height: calc(4.5rem + 2.45rem);
    max-height: 11rem;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    background-color: #111827;
    color: #e5e7eb;
}

.ama-chat-input-row textarea::placeholder {
    color: #64748b;
}

/* Occ chat focus ring: 2px accent outline over the 1px border reads as a thick edge. */
.ama-chat-input-row textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 1px;
    border-color: #2563eb;
}

/* Same dimensions and type as .occ-chat-send-btn (Occ page body font at 1rem). */
.ama-chat-send-btn {
    flex-shrink: 0;
    align-self: flex-start;
    width: auto;
    min-width: 5rem;
    margin: 0;
    padding: 0.38rem 0.85rem;
    border: 1px solid #1e90ff;
    border-radius: 8px;
    background-color: #1e90ff;
    color: #fff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ama-chat-send-btn:hover:not(:disabled) {
    background-color: #1578c4;
    border-color: #126aa8;
}

.ama-chat-send-btn:disabled {
    opacity: 0.62;
    cursor: default;
}

.ama-chat-disclaimer {
    padding: 5px 14px 9px;
    font-size: 10.5px;
    color: #64748b;
    background-color: #0b1220;
}

/* ---------- Floating app feedback widget (bottom-right, all screens) ---------- */

.app-feedback-root {
    position: fixed;
    right: 26px;
    bottom: 18px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Hide while a chat drawer/panel occupies the right edge. */
body.ama-chat-open .app-feedback-root,
body.occ-chat-open .app-feedback-root {
    display: none;
}

/* Hide on the sign-in screen; only signed-in users can send feedback. */
body.auth-active .app-feedback-root {
    display: none;
}

.app-feedback-fab {
    position: relative;
    width: 52px;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 4px;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.35));
    transition: transform 0.15s ease, filter 0.15s ease;
}

.app-feedback-fab svg {
    display: block;
    width: 100%;
    height: 100%;
}

.app-feedback-fab:hover {
    /* Override global button:hover (#1873CC) — keep the surround light. */
    background-color: rgba(30, 144, 255, 0.12);
    transform: scale(1.08);
    filter: drop-shadow(0 5px 12px rgba(30, 144, 255, 0.28));
}

/* Hide the bubble while the feedback card is open. */
.app-feedback-fab.is-active {
    display: none;
}

/* Hover label above the button so the cursor never covers it. */
.app-feedback-fab[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 4px 7px;
    border-radius: 5px;
    background: #1e293b;
    color: #f8fafc;
    font-size: 9.6px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    z-index: 2;
}

.app-feedback-fab[data-tooltip]:hover::after,
.app-feedback-fab[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.app-feedback-card {
    width: 300px;
    max-width: calc(100vw - 36px);
    padding: 12px 14px;
    border: 1px solid #d7dfeb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.app-feedback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-feedback-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.app-feedback-close {
    width: 24px;
    min-width: 0;
    height: 24px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.app-feedback-close:hover {
    background: #eef2f7;
    color: #1e293b;
}

.app-feedback-prompt {
    font-size: 12.5px;
    color: #475569;
}

.app-feedback-category {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    font-family: inherit;
}

.app-feedback-stars {
    display: flex;
    gap: 2px;
}

.app-feedback-star {
    width: 30px;
    min-width: 0;
    height: 30px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
}

.app-feedback-star:hover {
    transform: scale(1.12);
}

.app-feedback-star.is-filled {
    color: #f59e0b;
}

.app-feedback-text {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    resize: vertical;
    min-height: 96px;
    max-height: 180px;
    margin-top: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    background: #f8fafc;
    color: #1e293b;
}

.app-feedback-text:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 1px;
    border-color: #2563eb;
}

.app-feedback-error {
    font-size: 12px;
    color: #b91c1c;
}

.app-feedback-error.hidden {
    display: none;
}

.app-feedback-send {
    align-self: flex-end;
    width: auto;
    min-width: 0;
    margin: 4px 0 0;
    padding: 7px 14px;
    border: 1px solid #1e90ff;
    border-radius: 8px;
    background: #1e90ff;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.app-feedback-send:hover:not(:disabled) {
    background: #1578c4;
    border-color: #126aa8;
}

.app-feedback-send:disabled {
    opacity: 0.62;
    cursor: default;
}

.app-feedback-thanks {
    padding: 10px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    text-align: center;
}
