/* ============================================================
   Legacy Help Modal (non-new-help containers)
   ============================================================ */

.focus-help {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.focus-help-iframe-container {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 50px;
	left: 0;
}

.focus-help-iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-bottom: 1px solid #AAA;
}

.focus-help-preferences {
	box-sizing: border-box;
	position: absolute;
	display: block;
	right: 0;
	bottom: 0;
	left: 0;
	height: 50px;
	padding: 10px;
	border-top: 1px solid #AAA;
	box-shadow: 0 -3px 3px rgba(0, 0, 0, .2);
}

.focus-help-new-window-container {
	margin-bottom: 10px;
}

.focus-help-new-window:before {
	content: url('../../assets/new_window.png');
	display: inline-block;
	vertical-align: middle;
	margin-right: 0.5em;
}


/* ============================================================
   New Help Modal — Tabbed Design
   ============================================================ */

/* Blurring the page behind Help drops frames during opening and scrolling. */
body:has(> .focus-modal .focus-help-new-help) > .site-container.focus-modal-blur {
	filter: none;
}

.focus-help-new-help {
	position: relative;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	width: 100%;
	height: 100%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: #fcfcfa;
	animation: focus-help-entrance 350ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* The modal system revives hidden content as display:block; new help needs flex layout. */
.focus-modal .focus-help-new-help.focus-modal-hidden {
	display: flex !important;
}

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

/* Hide legacy elements in new help mode */
.focus-help-new-help .focus-help-iframe-container {
	display: none;
}

.focus-help-new-help .focus-help-preferences {
	display: none;
}

/* Header */
.focus-help-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	position: relative;
	z-index: 4;
	padding: 12px 20px;
	border-bottom: 1px solid #e8e7e4;
	background: #fcfcfa;
	flex-shrink: 0;
}

.focus-help-new-help .focus-help-header .focus-help-search {
	left: 50%;
	position: absolute;
	transform: translateX(-50%);
	width: min(480px, calc(100% - 480px));
}

/* Tabs — pill segmented control */
.focus-help-tabs {
	display: flex;
	flex-shrink: 0;
	gap: 3px;
	background: #f7f6f3;
	border-radius: 6px;
	padding: 3px;
	border: 1px solid #e8e7e4;
}

.focus-help-tab {
	padding: 6px 14px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	font-family: system-ui, -apple-system, sans-serif;
	color: #64648b;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color 150ms cubic-bezier(0.16, 1, 0.3, 1),
	            background 150ms cubic-bezier(0.16, 1, 0.3, 1),
	            box-shadow 150ms cubic-bezier(0.16, 1, 0.3, 1);
	white-space: nowrap;
	letter-spacing: -0.01em;
	line-height: 1.4;
}

.focus-help-tab:hover {
	color: #1a1a2e;
	background: rgba(255, 255, 255, 0.6);
}

.focus-help-tab.active {
	color: #1a1a2e;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06),
	            0 1px 2px rgba(26, 26, 46, 0.04);
}

/* District tab hidden until JS reveals it */
.focus-help-tab-district {
	display: none;
}

/* Actions area (right side of header) */
.focus-help-actions {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 6px;
}

.focus-help-search {
	align-items: center;
	background: linear-gradient(105deg, #fff 67%, #e1f4ff 100%);
	border: 1px solid #a9cde9;
	border-radius: 8px;
	box-shadow: 0 0 0 2px rgba(78, 156, 216, 0.1);
	display: flex;
	flex: 1 1 360px;
	max-width: 480px;
	min-width: 160px;
	position: relative;
}

.focus-help-search:focus-within {
	border-color: #8db4f6;
	box-shadow: 0 0 0 3px rgba(61, 90, 241, 0.12);
}

.focus-help-search-icon {
	color: #71839b;
	cursor: text;
	display: flex;
	padding-left: 9px;
}

.focus-help-search-icon svg {
	height: 15px;
	width: 15px;
}

.focus-help-chat-search {
	background: transparent;
	border: 0;
	color: #1a1a2e;
	flex: 1;
	font: 13px system-ui, -apple-system, sans-serif;
	min-width: 0;
	outline: 0;
	padding: 7px 9px;
}

/* Override the legacy :before pseudo-element in new-help mode */
.focus-help-new-help .focus-help-new-window:before {
	content: none;
	display: none;
}

.focus-help-new-help .focus-help-new-window {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-family: system-ui, -apple-system, sans-serif;
	font-weight: 450;
	color: #64648b;
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 4px;
	transition: color 150ms cubic-bezier(0.16, 1, 0.3, 1),
	            background 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.focus-help-new-help .focus-help-new-window:hover {
	color: #3d5af1;
	background: #eef0ff;
}

.focus-help-new-help .focus-help-new-window svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* Share button — a <button>, styled to match the new-window action */
.focus-help-new-help .focus-help-share {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-family: system-ui, -apple-system, sans-serif;
	font-weight: 450;
	color: #64648b;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 4px;
	transition: color 150ms cubic-bezier(0.16, 1, 0.3, 1),
	            background 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.focus-help-new-help .focus-help-share:hover {
	color: #3d5af1;
	background: #eef0ff;
}

.focus-help-new-help .focus-help-share svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.focus-help-new-help .focus-help-share.copied {
	color: #1a7f47;
	background: #e6f5ec;
}

.focus-help-new-help .focus-help-share.copy-failed {
	color: #c0392b;
	background: #fdecea;
}

.focus-help-search .focus-help-chat-button {
	align-items: center;
	background: transparent;
	border: none;
	border-radius: 4px;
	color: #64648b;
	cursor: pointer;
	display: flex;
	gap: 5px;
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 12px;
	font-weight: 450;
	padding: 3px 6px;
	transition: color 150ms cubic-bezier(0.16, 1, 0.3, 1),
	            background 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.focus-help-search .focus-help-chat-button:hover {
	color: #3d5af1;
}

.focus-help-search .focus-help-chat-button:focus-visible {
	color: #3d5af1;
	outline: none;
}

.focus-help-search .focus-help-chat-button[aria-expanded="true"] {
	color: #3d5af1;
}

.focus-help-search .focus-assistant-diamond {
	height: 18px;
	width: 18px;
}

/* Body — holds iframes */
.focus-help-body {
	flex: 1;
	min-height: 0;
	position: relative;
	overflow: hidden;
}

.focus-help-new-help .focus-help-iframe {
	width: 100%;
	height: 100%;
	border: none;
	position: absolute;
	top: 0;
	left: 0;
}

.focus-help-iframe-district {
	display: none;
}

.help-docs-viewer {
	background: #fcfcfa;
	display: flex;
	flex-direction: column;
	inset: 0;
	position: fixed;
}

.help-docs-viewer-header {
	align-items: center;
	background: #fcfcfa;
	border-bottom: 1px solid #e8e7e4;
	display: flex;
	justify-content: center;
	padding: 8px 18px;
	position: relative;
	z-index: 4;
}

.help-docs-viewer-header .focus-help-search {
	flex: 0 1 480px;
}

.help-docs-viewer-iframe {
	border: 0;
	flex: 1;
	min-height: 0;
	width: 100%;
}

@media (max-width: 1024px) {
	.focus-help-new-help .focus-help-header {
		flex-wrap: wrap;
		gap: 8px;
		padding: 8px 12px;
	}

	.focus-help-new-help .focus-help-actions {
		flex-wrap: wrap;
		gap: 4px;
		order: 2;
	}

	.focus-help-new-help .focus-help-header .focus-help-search {
		flex-basis: 100%;
		left: auto;
		max-width: none;
		order: 3;
		position: relative;
		transform: none;
		width: 100%;
	}
}
