html, body, input, button, textarea, select {
    font-family: 'Inter', sans-serif;
}

body {
    margin: 0;
    overflow: hidden;
}

#vtk-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

#main-nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    box-shadow: none;
    transition: height 0.3s ease, overflow 0s, background-color 0.3s ease;
    overflow: visible;
    z-index: 1000;
}

#main-nav .main-nav-inner {
    width: min(100%, 34rem);
    padding: 1.5rem;
}

#case-access-form {
    margin: 0;
    padding: 2.5rem 2rem 2rem;
}

#case-access-form .input-field {
    margin-bottom: 1.5rem;
}

#case-access-form .input-field:last-of-type {
    margin-bottom: 0;
}

#case-access-form input[type=text]:focus,
#case-access-form input[type=password]:focus {
    border-bottom-color: #9e9e9e !important;
    box-shadow: 0 1px 0 0 #9e9e9e !important;
}

#case-access-form label {
    font-size: 0.8rem;
}

#case-access-form input[type=text]:focus + label,
#case-access-form input[type=password]:focus + label {
    color: #9e9e9e !important;
}

#case-access-form .form-actions {
    margin-top: 2rem;
    text-align: right;
}

#case-access-form .btn {
    background-color: #000;
    color: #fff;
}

#main-nav.autohide {
    inset: 0 0 auto 0;
    display: block;
    background-color: #000;
    height: 0.3em;
    overflow: hidden;
}

#main-nav.autohide:hover {
    height: 100px;
    overflow: visible;
}

#main-nav.autohide .main-nav-inner {
    width: 100%;
    max-width: none;
    padding: 0 1rem;
}

#main-nav.autohide #case-access-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

#main-nav.autohide #case-access-form .input-field {
    flex: 1 1 0;
    margin: 0;
}

#main-nav.autohide #case-access-form input[type=text],
#main-nav.autohide #case-access-form input[type=password] {
    color: #fff;
    border-bottom-color: #bbb !important;
}

#main-nav.autohide #case-access-form input[type=text]:focus,
#main-nav.autohide #case-access-form input[type=password]:focus {
    border-bottom-color: #bbb !important;
    box-shadow: 0 1px 0 0 #bbb !important;
}

#main-nav.autohide #case-access-form label {
    color: #bbb;
}

#main-nav.autohide #case-access-form .form-actions {
    margin-top: 0;
    flex: 0 0 auto;
}

#main-nav.autohide #case-access-form .btn {
    background-color: #fff;
    color: #000;
}

#summary-drawer {
    position: fixed;
    top: 100px;
    right: 0;
    width: 50vw;
    height: calc(100vh - 100px);
    background-color: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease, top 0.3s ease, height 0.3s ease;
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
}

#summary-drawer.active {
    transform: translateX(calc(100% - 1em));
}

#summary-drawer.active:hover {
    transform: translateX(0);
}

.summary-drawer-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.reset-view-btn {
    flex-shrink: 0;
    align-self: flex-start;
    margin: 0.75rem;
    background-color: #000 !important;
    color: #fff;
    font-size: 0.75rem;
    height: 1.8rem;
    line-height: 1.8rem;
    padding: 0 1rem;
}

.reset-view-btn .waves-ripple {
    background-color: rgba(150, 150, 150, 0.45) !important;
}

.summary-content {
    padding: 0 1.5rem 1.5rem;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.summary-table thead th {
    text-align: center;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #333;
    color: #333;
}

.summary-table thead th:first-child {
    text-align: left;
}

.summary-table .section-header td {
    font-weight: 700;
    padding: 0.9rem 0.75rem 0.3rem;
    color: #333;
    font-size: 0.9rem;
    border-bottom: 1px solid #ccc;
}

.summary-table tbody td {
    padding: 0.3rem 0.75rem;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.summary-table tbody td:first-child {
    text-align: left;
    color: #555;
    white-space: nowrap;
}

.summary-table tbody td span {
    font-weight: 300;
    -webkit-text-stroke: 0.7px #000;
    paint-order: stroke fill;
}

.summary-table .range-graph {
    display: block;
    width: 100%;
    max-width: 10rem;
    height: 1rem;
    margin: 0.15rem auto 0;
    border-radius: 2px;
}

.colormap-graph-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.colormap-graph-main {
    flex: 0 1 10rem;
    max-width: 10rem;
    min-width: 0;
}

.colormap-graph-labels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
    line-height: 1.2;
    font-weight: 600;
    color: #222;
    text-shadow:
        0.4px 0 0 rgba(0, 0, 0, 0.2),
        -0.4px 0 0 rgba(0, 0, 0, 0.2),
        0 0.4px 0 rgba(0, 0, 0, 0.2),
        0 -0.4px 0 rgba(0, 0, 0, 0.2);
}

.colormap-graph-label {
    text-align: center;
}

.summary-table td.summary-cell-colormap-femoral {
    text-align: center;
}

.summary-table td.summary-cell-colormap-femoral .colormap-femoral-wrap {
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 9rem;
}

.colormap-femoral-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.2rem;
    width: 100%;
    max-width: 9rem;
}

.colormap-femoral-unit {
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 0.15rem;
    line-height: 1.2;
    text-shadow:
        0.4px 0 0 rgba(0, 0, 0, 0.2),
        -0.4px 0 0 rgba(0, 0, 0, 0.2),
        0 0.4px 0 rgba(0, 0, 0, 0.2),
        0 -0.4px 0 rgba(0, 0, 0, 0.2);
}

.colormap-femoral-bar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
}

.colormap-femoral-edge {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1.2;
    font-weight: 600;
    color: #222;
    text-shadow:
        0.4px 0 0 rgba(0, 0, 0, 0.2),
        -0.4px 0 0 rgba(0, 0, 0, 0.2),
        0 0.4px 0 rgba(0, 0, 0, 0.2),
        0 -0.4px 0 rgba(0, 0, 0, 0.2);
}

.summary-table .colormap-femoral-img.range-graph {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 5.25rem;
    height: auto;
    aspect-ratio: 800 / 60;
    margin: 0;
    border-radius: 2px;
}

.summary-table .colormap-graph-img.range-graph {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: 800 / 60;
    margin: 0;
    border-radius: 2px;
}

.colormap-graph-unit {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    text-shadow:
        0.4px 0 0 rgba(0, 0, 0, 0.2),
        -0.4px 0 0 rgba(0, 0, 0, 0.2),
        0 0.4px 0 rgba(0, 0, 0, 0.2),
        0 -0.4px 0 rgba(0, 0, 0, 0.2);
}

#main-nav.autohide ~ #summary-drawer {
    top: 0.3em;
    height: calc(100vh - 0.3em);
}

#main-nav.autohide:hover ~ #summary-drawer {
    top: 100px;
    height: calc(100vh - 100px);
}

.summary-table td.clickable {
    cursor: pointer;
}

#loading-modal .progress {
    background-color: #ccc;
}

#loading-modal .progress .indeterminate {
    background-color: #000;
}

#case-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 1.8rem;
    padding: 0 1rem;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    font-size: 0.75rem;
    color: #000;
    z-index: 998;
}

#image-carousel-wrapper {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 1350px;
    height: 300px;
    z-index: 500;
    pointer-events: auto;
}

#image-carousel-wrapper .carousel {
    height: 100%;
}

#image-carousel-wrapper .carousel .carousel-item img {
    background: #fff;
}

.carousel-item-caption {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 0.2rem 0.5rem;
    border-radius: 3px 3px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.AnalysisRed { color: rgb(192, 0, 0); }
.AnalysisGreen { color: rgb(79, 184, 71); }
.AnalysisOrange { color: rgb(255, 192, 0); }
