:root {
	--teal: #025C5F;
	--teal-light: #034E50;
	--red: #E5242D;
	--orange: #F97316;
	--amber: #D97706;
	--green: #16A34A;
	--slate-900: #0F172A;
	--slate-700: #334155;
	--slate-600: #475569;
	--slate-500: #64748B;
	--slate-300: #CBD5E1;
	--slate-200: #E2E8F0;
	--slate-100: #F1F5F9;
	--slate-50: #F8FAFC;
	--white: #FFFFFF;
	--body-text: #3D4D5A;
	--radius: 10px;
	--radius-sm: 6px;
	--shadow: 0 1px 3px rgba(0,0,0,0.08);
	--shadow-md: 0 4px 12px rgba(0,0,0,0.1);
	--shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
	--transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	background: var(--slate-50);
	color: var(--body-text);
	font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
	line-height: 1.6;
	padding: 2rem;
	max-width: 1400px;
	margin: 0 auto;
}

/* Header */
header {
	background: var(--white);
	text-align: center;
	padding: 2rem 2rem 1.5rem;
	border-radius: var(--radius) var(--radius) 0 0;
	border-top: 4px solid var(--red);
	box-shadow: var(--shadow);
	margin-bottom: 1.5rem;
}
.header-top {
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
}
.header-logo { max-width: 200px; height: auto; margin: 0 auto 1rem; display: block; }
.dna-bar { width: 100%; height: 20px; display: block; margin: 1rem 0; }
header h1 { color: var(--red); font-size: 2rem; margin-bottom: 0.25rem; letter-spacing: -0.025em; }
.subtitle { color: var(--slate-500); font-size: 1.1rem; font-weight: 300; }

/* Global controls */
.global-controls {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}
.global-controls label {
	font-weight: 600;
	color: var(--teal);
	font-size: 0.9rem;
}
.global-controls select {
	width: auto;
	min-width: 120px;
}

/* Inline group (toggle + button row) */
.inline-group {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 0.75rem;
}
.toggle-label {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--slate-600);
	cursor: pointer;
}
.toggle-label input[type="checkbox"] { cursor: pointer; }
.btn-sm {
	padding: 0.35rem 0.75rem;
	font-size: 0.8rem;
	border: 1px solid var(--slate-300);
	background: var(--white);
	color: var(--slate-600);
	border-radius: var(--radius-sm);
	cursor: pointer;
	font-weight: 500;
	transition: var(--transition);
}
.btn-sm:hover { background: var(--slate-50); border-color: var(--slate-500); }

/* Top-level tab bar */
.top-tab-bar {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	margin-bottom: 1.5rem;
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.top-tab-btn {
	padding: 0.75rem 1.1rem;
	white-space: nowrap;
	border: none;
	background: var(--white);
	color: var(--slate-600);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	border-bottom: 3px solid transparent;
}
.top-tab-btn:hover { background: var(--slate-50); color: var(--teal); }
.top-tab-btn.active { color: var(--white); background: var(--teal); border-bottom-color: var(--red); }

/* Page content */
.page-content { display: none; }
.page-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Panel */
.panel {
	background: var(--white);
	border-radius: var(--radius);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow);
	border-top: 3px solid var(--teal);
	transition: var(--transition);
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel h2 { color: var(--teal); font-size: 1.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--slate-200); padding-bottom: 0.5rem; letter-spacing: -0.025em; }
.panel h3 { color: var(--body-text); font-size: 1rem; margin: 1rem 0 0.5rem; }
.panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--slate-200);
	padding-bottom: 0.5rem;
}
.panel-header h2 {
	margin-bottom: 0;
	border-bottom: none;
	padding-bottom: 0;
}
.manual-link {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--slate-500);
	text-decoration: none;
	padding: 0.4rem 0.75rem;
	border-radius: var(--radius-sm);
	background: var(--slate-100);
	transition: var(--transition);
}
.manual-link:hover {
	background: var(--teal);
	color: var(--white);
}
/* File picker and textarea */
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-weight: 600; color: var(--teal); margin-bottom: 0.5rem; font-size: 0.9rem; }
.file-picker {
	width: 100%;
	padding: 0.6rem 1rem;
	border: 1px solid var(--slate-300);
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	color: var(--body-text);
	background: var(--white);
	cursor: pointer;
	transition: var(--transition);
}
.file-picker:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(2,92,95,0.1); }

.transcript-input {
	width: 100%;
	min-height: 200px;
	padding: 1rem;
	border: 1px solid var(--slate-300);
	border-radius: var(--radius-sm);
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--body-text);
	resize: vertical;
	transition: var(--transition);
}
.transcript-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(2,92,95,0.1); }

/* Buttons */
.btn-group { display: flex; gap: 0.75rem; margin-top: 1rem; }
.btn {
	padding: 0.6rem 1.5rem;
	border: none;
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
}
.btn-primary {
	background: var(--teal);
	color: var(--white);
}
.btn-primary:hover { background: var(--teal-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { background: var(--slate-300); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
	background: var(--white);
	color: var(--slate-600);
	border: 1px solid var(--slate-300);
}
.btn-secondary:hover { background: var(--slate-50); border-color: var(--slate-500); }

/* Loading overlay */
.loading-overlay {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(255,255,255,0.85);
	backdrop-filter: blur(4px);
	z-index: 100;
	justify-content: center;
	align-items: center;
	flex-direction: column;
}
.loading-overlay.active { display: flex; }
.spinner {
	width: 48px;
	height: 48px;
	border: 4px solid var(--slate-200);
	border-top-color: var(--teal);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 1rem; color: var(--teal); font-weight: 600; font-size: 1.1rem; }

/* Summary cards */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.card {
	background: var(--white);
	border-radius: var(--radius);
	padding: 1.5rem 1.25rem;
	text-align: center;
	color: var(--body-text);
	box-shadow: var(--shadow);
	border-top: 3px solid var(--teal);
	transition: var(--transition);
	animation: fadeIn 0.4s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-value { font-size: 2rem; font-weight: 700; }
.card-title { color: var(--slate-500); font-size: 0.85rem; margin-top: 0.25rem; }
.card-red { border-top-color: var(--red); }
.card-red .card-value { color: var(--red); }
.card-amber { border-top-color: var(--amber); }
.card-amber .card-value { color: var(--amber); }
.card-green { border-top-color: var(--green); }
.card-green .card-value { color: var(--green); }

/* Tab bar */
.tab-bar { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--slate-200); margin-bottom: 1rem; }
.tab-btn {
	background: none; border: none; cursor: pointer;
	padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 500;
	color: var(--slate-500); border-bottom: 2px solid transparent;
	margin-bottom: -2px; transition: var(--transition);
}
.tab-btn:hover { color: var(--teal); }
.tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* Detail sections */
.detail-section { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--slate-200); }
.detail-section:last-child { border-bottom: none; }
.detail-section h4 { color: var(--teal); font-size: 0.95rem; margin-bottom: 0.5rem; }
.detail-section ul { padding-left: 1.25rem; }
.detail-section li { color: var(--body-text); margin-bottom: 0.25rem; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge { padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.85rem; font-weight: 500; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-orange { background: #FFF7ED; color: #9A3412; }
.badge-amber { background: #FFFBEB; color: #92400E; }
.badge-green { background: #F0FDF4; color: #166534; }
.badge-grey { background: var(--slate-100); color: var(--slate-600); }
.badge-outline { background: transparent; border: 1px solid var(--slate-200); color: var(--slate-500); }

/* Risk table */
.risk-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 0.5rem; }
.risk-table td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--slate-200); }
.risk-table td:first-child { font-weight: 600; width: 180px; }

/* Operator grid */
.op-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.entity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.entity-block ul { padding-left: 1rem; }
.entity-block li { font-size: 0.85rem; }

/* Urgency classes */
.urgency-critical { color: var(--red); font-weight: 700; }
.urgency-high { color: var(--orange); font-weight: 600; }
.urgency-medium { color: var(--amber); }
.urgency-low { color: var(--green); }
.urgency-routine { color: var(--slate-500); }

/* Vulnerability classes */
.vuln-critical { color: var(--red); font-weight: 700; }
.vuln-high { color: var(--orange); font-weight: 600; }
.vuln-medium { color: var(--amber); }
.vuln-low { color: var(--green); }

/* Flags */
.flags { margin-top: 0.5rem; padding-left: 1.25rem; }
.flags li { color: #9A3412; font-size: 0.85rem; }

/* Bool */
.bool-yes { color: var(--green); font-weight: 600; }
.bool-no { color: var(--red); font-weight: 600; }
.muted { color: var(--slate-500); font-style: italic; }

/* Transcript viewer */
.transcript-viewer {
	background: var(--slate-50);
	color: var(--body-text);
	font-size: 0.9rem;
	line-height: 1.6;
	max-height: 500px;
	overflow-y: auto;
	padding: 1rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--slate-200);
	word-wrap: break-word;
}

/* Raw transcript tab keeps monospace/pre-wrap */
pre.transcript-viewer {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.85rem;
	white-space: pre-wrap;
}

/* Markdown body styles for LLM responses */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
	color: var(--teal);
	margin-top: 1rem;
	margin-bottom: 0.5rem;
	line-height: 1.3;
}
.markdown-body h1 { font-size: 1.4rem; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body h4 { font-size: 1rem; }

.markdown-body p { margin-bottom: 0.75rem; }

.markdown-body ul, .markdown-body ol {
	padding-left: 1.5rem;
	margin-bottom: 0.75rem;
}
.markdown-body li { margin-bottom: 0.25rem; }

.markdown-body table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
	font-size: 0.85rem;
}
.markdown-body th {
	background: var(--teal);
	color: var(--white);
	padding: 0.5rem 0.75rem;
	text-align: left;
	font-weight: 600;
}
.markdown-body td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--slate-200);
}
.markdown-body tr:hover td { background: var(--slate-50); }

.markdown-body pre {
	background: var(--slate-900);
	color: var(--slate-200);
	padding: 1rem;
	border-radius: var(--radius-sm);
	overflow-x: auto;
	margin-bottom: 0.75rem;
	font-size: 0.85rem;
	line-height: 1.5;
}
.markdown-body pre code {
	background: transparent;
	color: inherit;
	padding: 0;
	font-size: inherit;
}
.markdown-body code {
	background: var(--slate-200);
	color: var(--teal);
	padding: 0.15rem 0.4rem;
	border-radius: 3px;
	font-size: 0.85em;
	font-family: 'Courier New', Courier, monospace;
}

.markdown-body blockquote {
	border-left: 4px solid var(--teal);
	background: var(--white);
	padding: 0.75rem 1rem;
	margin: 0 0 0.75rem 0;
	color: var(--slate-600);
}
.markdown-body blockquote p:last-child { margin-bottom: 0; }

.markdown-body strong { color: var(--slate-900); }

.markdown-body a {
	color: var(--teal);
	text-decoration: underline;
}
.markdown-body a:hover { color: var(--teal-light); }

.markdown-body hr {
	border: none;
	border-top: 1px solid var(--slate-200);
	margin: 1rem 0;
}

.markdown-body img { max-width: 100%; border-radius: var(--radius-sm); }

/* Results section */
#results { display: none; }
#results.visible { display: block; }

/* Error toast */
.error-toast {
	position: fixed;
	top: -80px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--red);
	color: var(--white);
	padding: 1rem 2rem;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	z-index: 200;
	font-size: 0.9rem;
	font-weight: 500;
	transition: top 0.3s ease;
	max-width: 600px;
	text-align: center;
}
.error-toast.visible { top: 1rem; }

/* Footer */
footer {
	text-align: center;
	color: var(--slate-500);
	font-size: 0.8rem;
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--slate-200);
}
.confidential {
	color: var(--red);
	font-weight: 600;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
}

/* Fade-in animation */
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }

/* Two-column layout */
.two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	margin-bottom: 1rem;
}

@media (max-width: 768px) {
	body { padding: 1rem; }
	.cards { grid-template-columns: repeat(2, 1fr); }
	.two-col { grid-template-columns: 1fr; }
}
/* Resident Notes */
.text-input {
	width: 100%;
	max-width: 300px;
	padding: 0.65rem 1rem;
	border: 1px solid var(--slate-300);
	border-radius: var(--radius-sm);
	font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.95rem;
	background: var(--white);
	transition: var(--transition);
}
.text-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(2,92,95,0.1); }
.text-input::placeholder { color: var(--slate-500); }

.section-description {
	color: var(--slate-600);
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

.resident-info-bar { margin-bottom: 1rem; }

.resident-summary-bar {
	display: flex;
	gap: 2rem;
	flex-wrap: wrap;
	padding: 0.75rem 1rem;
	background: var(--slate-100);
	border-radius: var(--radius-sm);
	border-left: 4px solid var(--teal);
	font-size: 0.9rem;
}

/* Real-Time Simulation */
.sim-control-row {
	display: flex;
	gap: 1rem;
	align-items: flex-end;
	flex-wrap: wrap;
}

.sim-split {
	display: flex;
	gap: 0;
	min-height: 500px;
}

.sim-panel-left {
	flex: 0 0 60%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.sim-panel-right {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.sim-panel-left h3,
.sim-panel-right h3 {
	color: var(--teal);
	font-size: 0.95rem;
	margin-bottom: 0.5rem;
	padding: 0 0.5rem;
}

.sim-splitter {
	flex: 0 0 6px;
	background: var(--slate-200);
	cursor: col-resize;
	transition: background 0.15s ease;
	border-radius: 3px;
}
.sim-splitter:hover,
.sim-splitter.active {
	background: var(--teal);
}

.sim-transcript-viewer {
	flex: 1;
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.85rem;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-y: auto;
	padding: 1rem;
	background: var(--slate-50);
	border: 1px solid var(--slate-200);
	border-radius: var(--radius-sm);
}

.sim-advice-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	overflow-y: auto;
	padding: 0 0.5rem;
}

.sim-advice-card {
	background: var(--white);
	border-left: 4px solid var(--teal);
	border-radius: var(--radius-sm);
	padding: 1rem;
	box-shadow: var(--shadow);
	animation: simFadeIn 0.4s ease;
	transition: opacity 0.5s ease;
}
.sim-advice-header {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--teal);
	margin-bottom: 0.5rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--slate-200);
	letter-spacing: 0.02em;
}
.sim-advice-card .markdown-body { font-size: 0.85rem; }
.sim-advice-card.fade-out {
	opacity: 0;
}

.sim-progress-container {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
	padding: 0.5rem 0;
}

.sim-progress-bar {
	flex: 1;
	height: 6px;
	background: var(--slate-200);
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}
.sim-progress-bar::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: var(--progress, 0%);
	background: var(--teal);
	border-radius: 3px;
	transition: width 0.3s ease;
}

.sim-time {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--slate-600);
	white-space: nowrap;
}

@keyframes simFadeIn {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ─── Cognitive Screening ───────────────────────────────────────────────── */

/* Disclaimer notice */
.cognitive-disclaimer {
	background: #FFFBEB;
	border-left: 4px solid var(--amber);
	padding: 0.75rem 1rem;
	border-radius: var(--radius-sm);
	font-size: 0.85rem;
	color: var(--slate-700);
	margin-bottom: 1.25rem;
	line-height: 1.5;
}

/* Risk banner */
.cognitive-risk-banner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 1.25rem 1.5rem;
	border-radius: var(--radius);
	margin-bottom: 1rem;
	animation: fadeIn 0.4s ease;
}
.cog-risk-label {
	font-size: 1.75rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	text-transform: uppercase;
}
.cog-risk-sub {
	font-size: 1rem;
	font-weight: 500;
	opacity: 0.85;
}
.cog-risk-none     { background: #F0FDF4; color: #166534; border: 2px solid #BBF7D0; }
.cog-risk-low      { background: #EFF6FF; color: #1E40AF; border: 2px solid #BFDBFE; }
.cog-risk-moderate { background: #FFFBEB; color: #92400E; border: 2px solid #FDE68A; }
.cog-risk-high     { background: #FFF7ED; color: #9A3412; border: 2px solid #FDBA74; }
.cog-risk-critical { background: #FEF2F2; color: #991B1B; border: 2px solid #FECACA; }

/* Risk table header */
.risk-table th {
	background: var(--teal);
	color: var(--white);
	padding: 0.5rem 0.75rem;
	text-align: left;
	font-weight: 600;
	font-size: 0.85rem;
}

/* Call snapshot timeline */
.cognitive-timeline {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0;
	overflow-x: auto;
	padding-bottom: 0.5rem;
}
.cog-snapshot {
	flex: 1 1 220px;
	min-width: 200px;
	max-width: 320px;
	background: var(--slate-50);
	border: 1px solid var(--slate-200);
	border-radius: var(--radius);
	padding: 1rem;
	animation: fadeIn 0.4s ease;
}
.cog-timeline-arrow {
	align-self: center;
	font-size: 1.5rem;
	color: var(--slate-300);
	padding: 0 0.5rem;
	flex-shrink: 0;
}
.cog-snapshot-header {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--slate-200);
}
.cog-call-label {
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--teal);
}
.cog-call-date {
	font-size: 0.85rem;
	color: var(--slate-600);
}
.cog-call-id {
	font-size: 0.78rem;
}
.cog-score-row {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.cog-score {
	display: grid;
	grid-template-columns: 110px 1fr 36px;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.8rem;
}
.cog-score-label {
	color: var(--slate-600);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cog-score-bar-wrap {
	height: 8px;
	background: var(--slate-200);
	border-radius: 99px;
	overflow: hidden;
}
.cog-score-bar {
	height: 100%;
	border-radius: 99px;
	transition: width 0.5s ease;
}
.score-high { background: var(--green); }
.score-med  { background: var(--amber); }
.score-low  { background: var(--red); }
.cog-score-value {
	font-weight: 700;
	font-size: 0.78rem;
	text-align: right;
	color: var(--slate-700);
}
.cog-note {
	margin-top: 0.6rem;
	font-size: 0.8rem;
	line-height: 1.4;
}

@media (max-width: 768px) {
	.cognitive-timeline { flex-direction: column; }
	.cog-timeline-arrow { transform: rotate(90deg); align-self: flex-start; padding: 0.25rem 0; }
	.cog-snapshot { max-width: 100%; }
}

/* ─── Group Living Portal ──────────────────────────────────────────────── */

.gl-resident-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1rem;
}
.gl-resident-card {
	background: var(--white);
	border-radius: var(--radius);
	padding: 1.25rem;
	box-shadow: var(--shadow);
	border-top: 4px solid var(--green);
	cursor: pointer;
	transition: var(--transition);
	animation: fadeIn 0.4s ease;
}
.gl-resident-card:hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px);
}
.gl-resident-card.gl-risk-high { border-top-color: var(--red); }
.gl-resident-card.gl-risk-medium { border-top-color: var(--amber); }
.gl-resident-card.gl-risk-low { border-top-color: var(--green); }

.gl-resident-card h4 {
	color: var(--teal);
	margin-bottom: 0.25rem;
	font-size: 1rem;
}
.gl-resident-card .gl-su-id {
	color: var(--slate-500);
	font-size: 0.8rem;
	margin-bottom: 0.5rem;
}

.gl-risk-badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.gl-risk-badge.gl-badge-high { background: #FEE2E2; color: #991B1B; }
.gl-risk-badge.gl-badge-medium { background: #FFFBEB; color: #92400E; }
.gl-risk-badge.gl-badge-low { background: #F0FDF4; color: #166534; }

.gl-alert-banner {
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	margin-bottom: 1rem;
	animation: fadeIn 0.4s ease;
	font-size: 0.9rem;
}
.gl-alert-banner.gl-alert-critical {
	background: #FEF2F2;
	border-left: 4px solid var(--red);
	color: #991B1B;
}
.gl-alert-banner.gl-alert-warning {
	background: #FFFBEB;
	border-left: 4px solid var(--amber);
	color: #92400E;
}
.gl-alert-banner strong { margin-right: 0.5rem; }

.gl-back-btn { margin-bottom: 1rem; }

.gl-assessment-section { margin-bottom: 1rem; }
.gl-assessment-section h4 {
	color: var(--teal);
	font-size: 0.95rem;
	margin-bottom: 0.5rem;
}

.gl-charts-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.gl-chart-panel {
	padding: 1rem 1.25rem;
	margin-bottom: 0;
}
.gl-chart-wrap {
	position: relative;
	height: 250px;
	width: 100%;
	overflow: hidden;
}
.gl-chart-panel h3 {
	color: var(--teal);
	font-size: 0.9rem;
	margin-bottom: 0.75rem;
	text-align: center;
}

.gl-concerns-list {
	list-style: none;
	padding: 0;
	margin: 0.5rem 0 0;
}
.gl-concerns-list li {
	font-size: 0.85rem;
	color: var(--slate-600);
	padding: 0.15rem 0;
}
.gl-concerns-list li::before {
	content: '\2022';
	color: var(--amber);
	margin-right: 0.4rem;
}

.gl-actions-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1rem;
}
.gl-actions-block {
	background: var(--slate-50);
	border-radius: var(--radius-sm);
	padding: 1rem;
	border-left: 3px solid var(--teal);
}
.gl-actions-block h4 {
	color: var(--teal);
	font-size: 0.9rem;
	margin-bottom: 0.5rem;
}
.gl-actions-block ul {
	padding-left: 1.25rem;
	margin: 0;
}
.gl-actions-block li {
	font-size: 0.85rem;
	margin-bottom: 0.25rem;
}

.gl-location-risk {
	display: inline-block;
	padding: 0.2rem 0.75rem;
	border-radius: 12px;
	font-weight: 700;
	font-size: 0.85rem;
	text-transform: uppercase;
}
.gl-location-risk.gl-loc-red { background: #FEE2E2; color: #991B1B; }
.gl-location-risk.gl-loc-amber { background: #FFFBEB; color: #92400E; }
.gl-location-risk.gl-loc-green { background: #F0FDF4; color: #166534; }

/* Date range row */
.gl-date-range-row {
	display: flex;
	align-items: flex-end;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 0.25rem;
	margin-top: 0.5rem;
}
.gl-date-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}
.gl-date-btn {
	padding: 0.3rem 0.75rem;
	font-size: 0.8rem;
	font-weight: 500;
	border: 1px solid var(--slate-300);
	background: var(--white);
	color: var(--slate-600);
	border-radius: 20px;
	cursor: pointer;
	transition: var(--transition);
	white-space: nowrap;
}
.gl-date-btn:hover {
	border-color: var(--teal);
	color: var(--teal);
}
.gl-date-btn.active {
	background: var(--teal);
	color: var(--white);
	border-color: var(--teal);
}
.gl-date-inputs {
	display: flex;
	gap: 0.75rem;
	align-items: flex-end;
}
.gl-date-inputs .text-input {
	max-width: 160px;
}

/* Resident detail: assessments + chart side by side */
.gl-detail-row {
	display: flex;
	align-items: stretch;
	margin-bottom: 1.5rem;
}
.gl-detail-assessments {
	flex: 0 0 60%;
	min-width: 0;
}
.gl-detail-chart {
	flex: 1 1 auto;
	min-width: 0;
}
.gl-detail-splitter {
	flex: 0 0 6px;
	background: var(--slate-200);
	cursor: col-resize;
	transition: background 0.15s ease;
	border-radius: 3px;
	margin: 0 2px;
}
.gl-detail-splitter:hover,
.gl-detail-splitter.active {
	background: var(--teal);
}

@media (max-width: 1024px) {
	.gl-charts-row { grid-template-columns: repeat(2, 1fr); }
	.gl-detail-row { flex-direction: column; }
	.gl-detail-assessments,
	.gl-detail-chart { flex: 1 1 100%; }
	.gl-detail-splitter { display: none; }
}
@media (max-width: 768px) {
	.gl-charts-row { grid-template-columns: 1fr; }
	.gl-resident-grid { grid-template-columns: 1fr; }
	.gl-date-range-row { flex-direction: column; align-items: flex-start; }
}

/* ── Team Page ── */
.team-container { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.team-container h2 { color: var(--teal); font-size: 1.8rem; margin-bottom: 0.5rem; }
.team-intro { color: var(--slate-600); font-size: 1rem; margin-bottom: 2rem; line-height: 1.6; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.team-card {
	background: var(--white);
	border: 1px solid var(--slate-200);
	border-radius: var(--radius);
	padding: 1.25rem 1.5rem;
	box-shadow: var(--shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.team-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.team-name { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.4rem; }
.team-name a { color: var(--teal); text-decoration: none; }
.team-name a:hover { text-decoration: underline; }

