body {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.main {
	width: 100%;
	height: 100vh;
	overflow-y: auto;
	overflow-x: hidden;
}

.main.main-snomed-fill {
	box-sizing: border-box;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100vh;
	max-height: 100vh;
	flex: 1 1 auto;
	min-height: 0;
}

.main.main-snomed-fill > :first-child {
	flex-shrink: 0;
}

.main.main-snomed-fill #snomed-mini-browser.snomed-browser-active {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	display: flex !important;
	flex-direction: column;
}

.main.main-snomed-fill #snomed-mini-browser.snomed-browser-active > .snomed-mini-chrome {
	flex-shrink: 0;
}

.main.main-snomed-fill #snomed-mini-browser.snomed-browser-active > .snomed-mini-main {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.main.main-snomed-fill #snomed-mini-browser.snomed-browser-active .snomed-mini-layout {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	align-self: stretch;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-taxonomy-pane {
	display: flex;
	flex-direction: column;
	min-height: 0;
	align-self: stretch;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-taxonomy-pane .snomed-panel {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-taxonomy-pane .snomed-panel > .alert,
.main.main-snomed-fill #snomed-mini-browser .snomed-taxonomy-pane .fw-semibold {
	flex-shrink: 0;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-taxonomy-pane .snomed-tree-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-mini-detail-pane {
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-mini-detail-pane > .border.rounded.bg-white.mb-3 {
	flex-shrink: 0;
}

.main.main-snomed-fill #snomed-mini-browser .snomed-mini-detail-pane > .snomed-detail-panel.snomed-panel {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	max-height: none;
}

/* Vertically center cell content in dashboard tables (main area + modals) */
.main table td,
.main table th,
.modal .table td,
.modal .table th {
    vertical-align: middle;
}

#sidebar {
    width: 220px;
    background-color: #1f2a36;
    color: white;
    padding-top: 1rem;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

#sidebar a {
    color: #ccc;
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
}

#sidebar a:hover {
    background-color: #2c3e50;
    color: white;
}

#sidebar a.sidebar-link-disabled {
    color: #8ea0b3;
    opacity: 0.75;
    cursor: not-allowed;
}

#sidebar a.sidebar-link-disabled:hover {
    background-color: transparent;
    color: #8ea0b3;
}

#sidebar .sidebar-logo {
    width: 150px;
    height: auto;
    display: inline-block;
}

.code-system-warnings {
    position: fixed;
    left: 220px;
    right: 0;
    bottom: 0;
    z-index: 1080;
    padding: 0.75rem 1rem;
}

#resources,
#syndication,
.snomed-mini-browser-pane {
	flex-grow: 1;
	overflow: visible;
}

[x-cloak] {
    display: none !important;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

/* ConceptMap details: wide URIs must wrap and stay inside the modal */
#conceptmapModal .modal-body .row > [class*="col-"] {
    min-width: 0;
}
#conceptmapModal .table {
    table-layout: fixed;
    width: 100%;
}
#conceptmapModal .table td {
    vertical-align: top;
}
#conceptmapModal .table td:not(.fw-bold) {
    word-break: break-word;
    overflow-wrap: anywhere;
}
#conceptmapModal .alert,
#conceptmapModal .text-muted {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Copy-to-clipboard button in URL cells */
.copy-url-btn {
    font-size: 0.75rem;
    opacity: 0.35;
    transition: opacity 0.15s;
    line-height: 1;
}

.copy-url-btn:hover {
    opacity: 1;
}

/* Content preview in resource modals */
.preview-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.preview-stat {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    background: #f8f9fa;
}

.preview-stat-label {
    color: #6c757d;
    font-size: 0.75rem;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.preview-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

.preview-scroll {
    max-height: 360px;
    overflow: auto;
}

.preview-scroll-sm {
    max-height: 220px;
    overflow: auto;
}

.preview-table {
    table-layout: fixed;
    margin-bottom: 0;
}

.preview-table th,
.preview-table td,
.preview-related {
    overflow-wrap: anywhere;
}

.preview-link {
    white-space: normal;
}

@media (max-width: 767.98px) {
    .preview-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* SNOMED CT browser tab */
.snomed-panel {
    min-height: 12rem;
}

.snomed-tree-scroll {
    overflow-y: auto;
}

.snomed-tree-row-selected {
    background-color: rgba(13, 110, 253, 0.08);
    border-radius: 0.25rem;
}

.snomed-tree-chevron {
    line-height: 1;
}

.snomed-tree-glyph-col {
	width: 1.35rem;
	min-height: 1.35rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.snomed-tree-glyph {
	width: 1.35rem;
	min-height: 1.35rem;
}

.snomed-tree-expand-btn {
	line-height: 1;
	padding: 2px !important;
	min-width: 0;
	color: var(--bs-primary);
	text-decoration: none !important;
}

.snomed-tree-expand-btn:hover {
	color: var(--bs-primary);
}

.snomed-tree-expand-btn:disabled {
	opacity: 0.55;
}

.snomed-tree-leaf-dash {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
}

/* Bundle lookup in flight: chevron only (matches disabled expand control weight). */
.snomed-tree-hint-pending-glyph {
	opacity: 0.55;
}

/**
 * Concept marker aligned with SNOMED CT Browser taxonomy (Bootstrap 3 .badge.alert-warning).
 * Gradient matches sct-browser-frontend bootstrap-theme.css .alert-warning.
 * Primitive: non-breaking spaces; sufficiently defined: ≡ (U+2261).
 */
.snomed-concept-marker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	min-height: 1.05rem;
	padding: 0.12rem 0.32rem;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	color: #8a6d3b;
	text-align: center;
	white-space: nowrap;
	vertical-align: middle;
	background-color: #fcf8e3;
	background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
	background-repeat: repeat-x;
	border: 1px solid #f5e79e;
	border-radius: 10px;
	box-sizing: border-box;
}

.snomed-detail-panel {
    max-height: 36rem;
    overflow-y: auto;
}

.snomed-pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

.snomed-designations li {
    overflow-wrap: anywhere;
}

/* SNOMED Mini Browser redesigned layout ------------------------------------ */
.snomed-mini-chrome .snomed-mini-brand {
    letter-spacing: 0.02em;
}

.snomed-mini-brand-icon {
    color: #f0ad4e;
    font-size: 1.15rem;
}

.snomed-mini-scope-select {
	flex: 1 1 7.5rem;
	max-width: 16rem;
	min-width: 6.5rem;
	background-color: #e8f4ff;
	border-color: #b6daff !important;
	color: #0d3183;
	cursor: pointer;
}

.snomed-mini-language-cluster {
	width: auto;
	max-width: 10rem;
}

.snomed-mini-language-select {
	min-width: 4.5rem;
	max-width: 6.5rem;
	background-color: #f8f9fa;
	border-color: #dee2e6 !important;
	color: #495057;
	cursor: pointer;
}

.snomed-mini-pane-divider {
	flex: 0 0 10px;
	width: 10px;
	min-width: 10px;
	cursor: col-resize;
	align-self: stretch;
	touch-action: none;
	user-select: none;
	position: relative;
	z-index: 2;
	margin-left: -15px;
	margin-right: -15px;
}

.snomed-mini-pane-divider::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 4px;
	transform: translateX(-50%);
	border-radius: 3px;
	background: transparent;
	transition: background-color 0.12s ease;
}

.snomed-mini-pane-divider:hover::after,
.snomed-mini-layout--divider-drag .snomed-mini-pane-divider::after {
	background: rgba(13, 110, 253, 0.28);
}

.snomed-mini-layout--divider-drag {
	cursor: col-resize;
	user-select: none;
}

@media (max-width: 1199px) {
	#snomed-mini-browser .snomed-taxonomy-pane.snomed-taxonomy-pane--sized {
		width: auto !important;
		flex: 0 1 auto !important;
		flex-basis: auto !important;
		max-width: none !important;
	}
}

.snomed-mini-search-cluster .form-control {
    min-width: 0;
}

.snomed-mini-pill-muted {
    background-color: #f8f9fa;
    max-width: 14rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#snomed-mini-browser .snomed-mini-layout {
    align-items: stretch;
}

.snomed-taxonomy-pane {
    flex: 0 1 18rem;
    max-width: 22rem;
    min-width: 15rem;
}

@media (max-width: 1199px) {
    .snomed-taxonomy-pane {
        max-width: none;
        min-width: 0;
        width: 100%;
    }
}

.snomed-mini-search-results {
    max-height: 11rem;
    overflow-y: auto;
}

.snomed-mini-breadcrumbs .btn-link {
    font-size: 0.8125rem;
}

.snomed-mini-hero-marker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	min-height: 1.25rem;
	padding: 0.1rem 0.35rem;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
	color: #8a6d3b;
	text-align: center;
	background-color: #fcf8e3;
	border: 1px solid #f5e79e;
	border-radius: 10px;
	flex-shrink: 0;
	margin-top: 0.125rem;
}

.snomed-mini-hero-star.btn-link:disabled {
    opacity: 1;
	pointer-events: none;
	cursor: default;
}

.snomed-mini-hero-star-icon {
	color: #f0ce56;
	filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

.snomed-mini-hero-synonyms {
	word-break: break-word;
	overflow-wrap: anywhere;
}

.snomed-mini-tabs .nav-link.active {
	cursor: default;
}

.snomed-mini-tabs .nav-item .nav-link {
	padding-top: 0.35rem;
	padding-bottom: 0.35rem;
	font-size: 0.9rem;
}

.snomed-mini-h3 {
	font-size: 0.72rem;
	letter-spacing: 0.04em;
}

.snomed-mini-chip-btn {
	overflow-wrap: anywhere;
	word-break: break-word;
	max-width: 100%;
	text-align: start;
	line-height: 1.35;
}

.snomed-mini-children-collapsed {
	max-height: 7.75rem;
	overflow-y: auto;
}

.snomed-mini-rel-card {
	background-color: #f7fbfe;
	align-items: center;
	border-color: #cfe9fc !important;
}

.snomed-mini-rel-target-icon {
	min-width: 0.72rem;
	width: 0.72rem;
	height: 0.72rem;
	background: linear-gradient(to bottom, #fce588 0%, #f7d147 100%);
	box-shadow: 0 0 0 1px rgba(212, 160, 20, 0.35);
}

