.viewer-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background-color: var(--color-page-background);
}

.viewer-page > .navbar {
    flex-shrink: 0;
}

.viewer {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.viewer-cases-sidebar {
    display: flex;
    flex-direction: column;
    width: 20rem;
    flex-shrink: 0;
    min-height: 0;
    overflow: hidden;
    background-color: var(--gray-800);
    border-right: 1px solid var(--gray-700);
}

.viewer-cases-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.viewer-mode-tabs {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-shrink: 0;
    align-items: center;
}

.viewer-mode-tabs .tw-cursor-pointer {
    display: contents;
}

.viewer-cases-content .search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--gray-700);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
    position: static;
}

.viewer-cases-content .search-box svg {
    position: static;
    flex-shrink: 0;
}

.viewer-cases-content .search-box input {
    width: 100%;
    height: auto;
    border-radius: 0.25rem;
    padding: 0.35rem 0.5rem;
}

.viewer-case-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.viewer-case-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border-radius: 0.3125rem;
    background-color: var(--gray-700);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    color: var(--color-font-light);
    width: 100%;
    box-sizing: border-box;
}

.viewer-case-card:hover:not(.disabled):not(:disabled) {
    background-color: var(--gray-600);
}

.viewer-case-card.active {
    border-color: var(--primary-purple-500);
    background-color: var(--gray-600);
}

.viewer-case-card.disabled,
.viewer-case-card:disabled {
    opacity: 0.5;
    cursor: default;
}

.viewer-case-card h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-workspace {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.viewer-workspace .sidebar-left,
.viewer-workspace .sidebar-right {
    display: flex;
    flex-direction: column;
    width: var(--hc-sidebar-width);
    flex-shrink: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--gray-800);
}

.viewer-workspace .sidebar-left {
    border-right: 1px solid var(--gray-700);
}

.viewer-workspace .sidebar-right {
    border-left: 1px solid var(--gray-700);
}

.viewer-panel-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem;
    min-height: 0;
}

.viewer-canvas-area {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: var(--gray-700);
}

.viewer-canvas-area > *:not(.viewer-canvas-loading) {
    flex: 1;
    min-height: 0;
    min-width: 0;
    height: 100%;
}

.viewer-canvas-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 10;
}

.viewer-canvas-placeholder {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.viewer-canvas-placeholder-main {
    flex: 1;
    min-width: 0;
    background-color: var(--gray-800);
}

.viewer-canvas-placeholder-ct {
    display: flex;
    flex-direction: column;
    width: 25%;
    min-width: 8rem;
    max-width: 14rem;
    flex-shrink: 0;
    gap: 0.25rem;
    padding: 0.25rem;
    background-color: var(--gray-700);
}

.viewer-ct-slot {
    flex: 1;
    min-height: 0;
    background-color: var(--gray-800);
    border: 1px solid var(--gray-600);
    border-radius: 0.25rem;
}

.viewer-segment-empty {
    color: var(--gray-300);
    font-size: 0.875rem;
    padding: 0.5rem 0;
    margin: 0;
}

.viewer-loading {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 6rem;
}

.navbar-hospital-name {
    color: var(--color-font-light);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    margin-left: 2rem;
    align-self: center;
}

.page {
    height: 100vh;
    min-height: 0;
}

.page > .main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
