/* AnatomyBase — Member Clinical Workspace & Print Styles */
.app-body {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 64px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(5, 9, 17, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.app-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-progress-group {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(12, 20, 36, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.progress-track {
    width: 110px;
    height: 6px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #34d399);
    transition: width 0.25s ease;
}

.progress-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #cbd5e1;
    white-space: nowrap;
}

.progress-meta strong {
    color: var(--emerald);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.patient-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.82);
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.patient-toggle-btn.is-active {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.16));
    border-color: rgba(52, 211, 153, 0.6);
    color: #a7f3d0;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.18);
}

.patient-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}

.patient-toggle-btn.is-active .patient-dot {
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

/* Main Workspace Layout */
.workspace-main {
    padding: 24px 0 64px;
    position: relative;
    z-index: 2;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.app-module-embed {
    min-height: 0;
}

.app-module-embed .app-header,
.app-module-embed .nav-rail,
.app-module-embed .library-section,
.app-module-embed .specimen-switch,
.app-module-embed #app-expand-btn,
.app-module-embed #app-standalone-link {
    display: none;
}

.app-module-embed .workspace-main,
.app-module-embed .workspace-main > .container {
    max-width: none;
    padding: 0;
}

.app-module-embed .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
}

.app-module-embed .app-studio-card {
    border: 0;
    border-radius: 0;
}

.app-module-embed .app-stage-iframe {
    height: clamp(580px, 56vw, 720px);
}

@media (min-width: 1020px) {
    .app-module-embed .app-studio-card {
        display: grid;
        grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
        gap: 14px;
        align-items: start;
        padding: 12px;
    }

    .app-module-embed .app-module-stage,
    .app-module-embed .app-companion-wrap,
    .app-module-embed .patient-panel {
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        overflow: hidden;
    }

    .app-module-embed .app-companion-grid,
    .app-module-embed .patient-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Left Column: 3D Body Navigator & Filters */
.nav-rail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.body-nav-card {
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.body-nav-head {
    padding: 13px 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(7, 12, 22, 0.82);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.body-nav-head strong {
    font-size: 13px;
    color: #ffffff;
}

.body-nav-stage {
    position: relative;
    height: 360px;
    background: radial-gradient(circle at 50% 42%, #0e2038 0%, #060b16 74%, #03060c 100%);
    cursor: grab;
    overflow: hidden;
}

.body-nav-stage:active {
    cursor: grabbing;
}

#body-nav-canvas {
    position: absolute;
    inset: 0;
}

#body-nav-pins {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}

.body-nav-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px 3px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(6, 11, 20, 0.88);
    color: #f1f5f9;
    font-size: 10.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.body-nav-pin:hover,
.body-nav-pin.is-active {
    transform: translate(-50%, -50%) scale(1.07);
    border-color: var(--cyan);
    background: rgba(14, 34, 56, 0.95);
    z-index: 12;
}

.body-pin-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 8px currentColor;
}

.body-nav-foot {
    padding: 10px 14px;
    border-top: 1px solid var(--glass-border);
    background: rgba(7, 12, 22, 0.85);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--cyan);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-card {
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-cat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-cat-btn {
    width: 100%;
    text-align: left;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.62);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.16s ease;
}

.app-cat-btn:hover {
    border-color: rgba(56, 189, 248, 0.4);
    color: #ffffff;
}

.app-cat-btn.is-active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    color: #e0f2fe;
}

.app-select {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(10, 17, 30, 0.9);
    color: #f1f5f9;
    font-size: 13px;
}

/* Main Stage Column */
.studio-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-studio-card {
    border-radius: 20px;
    overflow: hidden;
}

.app-studio-topbar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(7, 12, 22, 0.88);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.app-studio-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-studied {
    border-color: rgba(148, 163, 184, 0.25);
}

.btn-studied.is-done {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.55);
    color: #a7f3d0;
}

.app-stage-box {
    position: relative;
    min-height: 450px;
    background: radial-gradient(circle at 50% 42%, #0f1d35 0%, #050a14 85%);
}

.app-stage-iframe {
    width: 100%;
    height: 500px;
    border: 0;
    display: block;
    background: #060a12;
}

.app-stage-iframe.is-hidden {
    display: none;
}

.app-module-podcast {
    border-top: 1px solid var(--glass-border);
    padding: 16px 18px;
    background: rgba(8, 14, 26, 0.82);
}

.app-module-podcast h3 {
    margin: 4px 0 10px;
    font-size: 16px;
}

.app-module-podcast audio {
    display: block;
    width: 100%;
    max-width: 480px;
}

.app-companion-wrap {
    border-top: 1px solid var(--glass-border);
    background: rgba(8, 14, 26, 0.82);
}

.app-study-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    flex-wrap: wrap;
    align-items: center;
}

.app-companion-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.app-companion-grid.is-single {
    grid-template-columns: 1fr;
}

/* Patient Counseling Bedside Mode */
.patient-panel {
    padding: 24px;
    background: linear-gradient(155deg, rgba(10, 34, 42, 0.55), rgba(8, 16, 28, 0.9));
}

.patient-panel.is-hidden {
    display: none;
}

.patient-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.patient-panel-head h3 {
    font-size: 22px;
    color: #ecfdf5;
}

.patient-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.patient-step-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(15, 28, 40, 0.78);
    border: 1px solid rgba(52, 211, 153, 0.32);
}

.patient-step-card h4 {
    font-size: 16px;
    color: #6ee7b7;
    margin-bottom: 8px;
}

.patient-step-card p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: #f1f5f9;
}

/* Workspace 30-Module Library Section */
.library-section {
    margin-top: 28px;
    padding: 24px;
    border-radius: 22px;
}

.library-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.library-search-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.library-search-row input {
    flex: 1;
    min-width: 240px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(10, 17, 30, 0.9);
    color: #ffffff;
    font-size: 14px;
}

/* Printable 1-Page Clinical Cheat-Sheet */
#printable-sheet {
    display: none;
}

@media print {
    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    .app-screen-only,
    .bg-grid,
    .modal-backdrop {
        display: none !important;
    }

    #printable-sheet {
        display: block !important;
        padding: 20px 28px;
        font-family: 'Inter', Arial, sans-serif;
        color: #0f172a;
    }

    .print-header {
        border-bottom: 2px solid #0284c7;
        padding-bottom: 10px;
        margin-bottom: 14px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }

    .print-header h1 {
        color: #0f172a;
        font-size: 20px;
        margin: 4px 0 0;
    }

    .print-kicker {
        font-family: monospace;
        font-size: 11px;
        color: #0284c7;
        font-weight: 700;
        text-transform: uppercase;
    }

    .print-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .print-card {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        padding: 12px 14px;
        break-inside: avoid;
    }

    .print-card h2 {
        color: #0f172a;
        font-size: 14px;
        margin: 0 0 6px;
    }

    .print-card ul {
        margin: 0;
        padding-left: 18px;
        font-size: 12px;
        line-height: 1.5;
    }

    .print-foot {
        margin-top: 14px;
        font-size: 10px;
        color: #475569;
        border-top: 1px solid #e2e8f0;
        padding-top: 8px;
    }
}

@media (max-width: 1060px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .patient-cards-grid,
    .app-companion-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-progress-group,
    .app-landing-link {
        display: none;
    }
}
