:root {
	--saw-blue-800: #082c59;
	--saw-blue-700: #0c3b7a;
	--saw-blue-600: #2f6fd6;
	--saw-blue-100: #eaf2ff;
	--saw-ink: #10243e;
	--saw-paper: #ffffff;
	--saw-line: rgba(17, 32, 51, 0.12);
	--saw-shadow: 0 16px 36px rgba(8, 35, 76, 0.22);
	--saw-focus-ring: #ffbf47;
}

.saw-root {
	position: fixed;
	top: 50vh;
	right: max(0.75rem, env(safe-area-inset-right));
	bottom: auto;
	transform: translateY(-50%);
	z-index: 10002;
	font-family: "Atkinson Hyperlegible", "Arial", sans-serif;
}

.skip-link.screen-reader-text {
	position: fixed;
	left: 1rem;
	top: 1rem;
	z-index: 10001;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1rem;
	border-radius: 0.85rem;
	background: #0b1f3b;
	color: #ffffff;
	font-weight: 700;
	text-decoration: none;
	transform: translateY(-140%);
	transition: transform 0.18s ease;
	box-shadow: var(--saw-shadow);
}

.skip-link.screen-reader-text:focus,
.skip-link.screen-reader-text:active {
	transform: translateY(0);
	clip: auto !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	overflow: visible !important;
	white-space: normal !important;
}

#content:focus {
	outline: 4px solid var(--saw-focus-ring);
	outline-offset: 0.35rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--saw-focus-ring);
	outline-offset: 3px;
}

.saw-trigger {
	display: inline-grid;
	align-items: center;
	border: 0;
	border-radius: 999px;
	width: 3.2rem;
	height: 3.2rem;
	padding: 0;
	background: linear-gradient(160deg, var(--saw-blue-800), var(--saw-blue-600));
	color: var(--saw-paper);
	box-shadow: var(--saw-shadow);
	font-size: 0.82rem;
	font-weight: 700;
	place-items: center;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.saw-trigger__icon {
	display: inline-grid;
	place-items: center;
	width: 2.15rem;
	height: 2.15rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	line-height: 1;
}

.saw-trigger__icon svg {
	width: 1.15rem;
	height: 1.15rem;
	fill: currentColor;
}

.saw-panel {
	position: absolute;
	right: 0;
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
	width: min(26rem, calc(100vw - 1.5rem));
	padding: 1.1rem;
	border: 1px solid var(--saw-line);
	border-radius: 1.25rem;
	background: rgba(255, 255, 255, 0.99);
	box-shadow: var(--saw-shadow);
	backdrop-filter: blur(14px);
	color: var(--saw-ink);
	max-height: min(80vh, 42rem);
	overflow: auto;
	overscroll-behavior: contain;
}

.saw-panel[hidden] {
	display: none;
}

.saw-panel__header {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 1rem;
}

.saw-kicker {
	margin: 0 0 0.2rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--saw-blue-600);
}

.saw-panel__header h2 {
	margin: 0;
	font-size: 1.4rem;
	line-height: 1.1;
	color: var(--saw-ink);
}

.saw-close {
	border: 0;
	background: transparent;
	color: var(--saw-blue-700);
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.125rem 0.25rem;
}

.saw-panel__intro {
	margin: 0.8rem 0 1rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.saw-group + .saw-group {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--saw-line);
}

.saw-group__title {
	margin: 0 0 0.6rem;
	font-size: 0.86rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #4a607b;
}

.saw-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
}

.saw-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
}

.saw-chip,
.saw-tile,
.saw-reset {
	border: 1px solid var(--saw-line);
	background: var(--saw-paper);
	color: var(--saw-ink);
	cursor: pointer;
}

.saw-chip {
	border-radius: 999px;
	padding: 0.65rem 0.95rem;
	font-weight: 700;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.saw-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 4rem;
	padding: 0.85rem;
	border-radius: 0.95rem;
	text-align: center;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.35;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.saw-tile.is-active,
.saw-chip:hover,
.saw-tile:hover,
.saw-reset:hover,
.saw-chip:focus-visible,
.saw-tile:focus-visible,
.saw-reset:focus-visible,
.saw-trigger:focus-visible,
.saw-close:focus-visible {
	outline: 3px solid var(--saw-focus-ring);
	outline-offset: 2px;
}

.saw-tile.is-active {
	background: var(--saw-blue-100);
	border-color: rgba(12, 59, 122, 0.35);
	color: var(--saw-blue-700);
}

.saw-panel__footer {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--saw-line);
}

.saw-reset {
	width: 100%;
	border-radius: 0.95rem;
	padding: 0.85rem 1rem;
	font-weight: 700;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.saw-trigger:hover,
.saw-chip:hover,
.saw-tile:hover,
.saw-reset:hover,
.saw-close:hover {
	transform: translateY(-1px);
}

.saw-trigger[aria-expanded="true"] {
	background: linear-gradient(160deg, var(--saw-blue-700), var(--saw-blue-600));
}

.saw-chip.is-active {
	background: var(--saw-blue-100);
	border-color: rgba(12, 59, 122, 0.35);
	color: var(--saw-blue-700);
}

body {
	--saw-font-scale-factor: 1;
	font-size: calc(1rem * var(--saw-font-scale-factor));
}

body.saw-contrast {
	filter: contrast(1.2);
}

body.saw-grayscale {
	filter: grayscale(1);
}

body.saw-readable-font,
body.saw-readable-font button,
body.saw-readable-font input,
body.saw-readable-font select,
body.saw-readable-font textarea {
	font-family: "Atkinson Hyperlegible", "Arial", sans-serif !important;
}

body.saw-text-spacing {
	letter-spacing: 0.02em;
	word-spacing: 0.12em;
	line-height: 1.85;
}

body.saw-underline-links a {
	text-decoration: underline !important;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.12em;
}

body.saw-focus-highlight *:focus-visible {
	outline: 4px solid var(--saw-focus-ring) !important;
	outline-offset: 3px !important;
	border-radius: 0.2rem;
}

body.saw-pause-motion *,
body.saw-pause-motion *::before,
body.saw-pause-motion *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}

body.saw-highlight-headings h1,
body.saw-highlight-headings h2,
body.saw-highlight-headings h3,
body.saw-highlight-headings h4,
body.saw-highlight-headings h5,
body.saw-highlight-headings h6 {
	background: linear-gradient(180deg, transparent 60%, rgba(255, 191, 71, 0.4) 60%);
	display: inline;
}

html[data-saw-font-scale="-3"] {
	font-size: 62.5%;
}

html[data-saw-font-scale="-2"] {
	font-size: 75%;
}

html[data-saw-font-scale="-1"] {
	font-size: 87.5%;
}

html[data-saw-font-scale="1"] {
	font-size: 112.5%;
}

html[data-saw-font-scale="2"] {
	font-size: 125%;
}

html[data-saw-font-scale="3"] {
	font-size: 137.5%;
}

html[data-saw-contrast="1"] {
	filter: contrast(1.15);
}

html[data-saw-grayscale="1"] {
	filter: grayscale(1);
}

html[data-saw-readable-font="1"] body,
html[data-saw-readable-font="1"] button,
html[data-saw-readable-font="1"] input,
html[data-saw-readable-font="1"] select,
html[data-saw-readable-font="1"] textarea {
	font-family: "Atkinson Hyperlegible", "Arial", sans-serif !important;
}

html[data-saw-text-spacing="1"] body {
	letter-spacing: 0.02em;
	word-spacing: 0.12em;
	line-height: 1.85;
}

html[data-saw-underline-links="1"] a {
	text-decoration: underline !important;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.12em;
}

html[data-saw-focus-highlight="1"] *:focus-visible {
	outline: 4px solid var(--saw-focus-ring) !important;
	outline-offset: 3px !important;
	border-radius: 0.2rem;
}

html[data-saw-pause-motion="1"] *,
html[data-saw-pause-motion="1"] *::before,
html[data-saw-pause-motion="1"] *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}

html[data-saw-highlight-headings="1"] h1,
html[data-saw-highlight-headings="1"] h2,
html[data-saw-highlight-headings="1"] h3,
html[data-saw-highlight-headings="1"] h4,
html[data-saw-highlight-headings="1"] h5,
html[data-saw-highlight-headings="1"] h6 {
	background: linear-gradient(180deg, transparent 60%, rgba(255, 191, 71, 0.4) 60%);
	display: inline;
}

@media (prefers-reduced-motion: reduce) {
	.skip-link.screen-reader-text,
	.saw-trigger,
	.saw-panel,
	.saw-chip,
	.saw-tile,
	.saw-reset {
		transition: none !important;
	}
}

@media (max-width: 700px) {
	.saw-root {
		top: auto;
		right: 0.75rem;
		left: 0.75rem;
		bottom: 0.75rem;
		transform: none;
	}

	.saw-trigger {
		width: 3.45rem;
		height: 3.45rem;
		font-size: 0.86rem;
		margin-left: auto;
	}

	.saw-panel {
		left: 0;
		right: 0;
		top: auto;
		bottom: calc(100% + 0.75rem);
		transform: none;
		width: auto;
		max-height: min(68vh, 36rem);
	}

	.saw-grid {
		grid-template-columns: 1fr;
	}
}
