:root {
	--background: #090619;
	--background-soft: #140b2e;
	--panel: rgba(35, 19, 70, 0.72);
	--panel-strong: rgba(48, 24, 94, 0.88);
	--border: rgba(216, 180, 254, 0.22);
	--border-bright: rgba(216, 180, 254, 0.48);
	--text: #f8f5ff;
	--muted: #c9bde0;
	--purple: #a855f7;
	--purple-light: #d8b4fe;
	--blue: #818cf8;
	--green: #4ade80;
	--yellow: #facc15;
	--red: #fb7185;
	--shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
	--radius: 20px;
	--radius-small: 12px;
	--space-1: 0.35rem;
	--space-2: 0.65rem;
	--space-3: 0.85rem;
	--space-4: 1rem;
	--space-5: 1.25rem;
	--space-6: 1.5rem;
	--space-7: 2rem;
	--glass-bg: linear-gradient(145deg, rgba(48, 25, 93, 0.44), rgba(18, 10, 42, 0.5));
	--glass-bg-strong: linear-gradient(145deg, rgba(48, 25, 93, 0.54), rgba(18, 10, 42, 0.6));
	--glass-bg-opaque: linear-gradient(145deg, rgba(46, 24, 89, 0.94), rgba(17, 9, 38, 0.96));
	--glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
	--glass-blur: saturate(165%) blur(22px);
}

* {
	box-sizing: border-box;
}

html {
	width: 100%;
	max-width: 100%;
	min-height: 100%;
	overflow-x: hidden;
	overscroll-behavior-x: none;
	background: #110724;
	color-scheme: dark;
}

body {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-height: 100vh;
	margin: 0;
	overflow-x: hidden;
	overscroll-behavior-x: none;
	/* Transparent so the fixed body::before glow layer remains visible.
	   The base color lives on <html> to avoid any scroll/overscroll flash. */
	background-color: transparent;
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.5;
}

/* Viewport-fixed decorative ambient gradient. It stays put as long pages scroll
   and never captures pointer events. Content sits above it, and translucent
   glass surfaces refract it via backdrop-filter as they move over it. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: #110724;
	background-image:
		radial-gradient(circle at 18% 8%, rgba(126, 34, 206, 0.4), transparent 34rem),
		radial-gradient(circle at 88% 22%, rgba(79, 70, 229, 0.3), transparent 32rem),
		radial-gradient(circle at 62% 82%, rgba(129, 140, 248, 0.2), transparent 34rem),
		radial-gradient(circle at 8% 92%, rgba(168, 85, 247, 0.16), transparent 30rem),
		linear-gradient(145deg, #070512 0%, #110724 46%, #080615 100%);
}

img,
svg,
canvas {
	max-width: 100%;
}

a {
	color: var(--purple-light);
	text-decoration: none;
}

a:hover {
	color: #ffffff;
}

button,
input,
select,
textarea {
	max-width: 100%;
	font: inherit;
}

button,
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-height: 2.75rem;
	padding: 0.66rem 1rem;
	border: 1px solid var(--border-bright);
	border-radius: 11px;
	background: linear-gradient(135deg, #7e22ce, #4f46e5);
	color: #ffffff;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 9px 24px rgba(91, 33, 182, 0.25);
	transition: transform 140ms ease, border-color 140ms ease, filter 140ms ease, background 140ms ease;
}

button:hover,
.button:hover {
	border-color: rgba(255, 255, 255, 0.65);
	color: #ffffff;
	filter: brightness(1.12);
	transform: translateY(-1px);
}

button:disabled {
	cursor: not-allowed;
	filter: grayscale(0.55);
	opacity: 0.62;
	transform: none;
}

.button-secondary {
	border-color: var(--border-bright);
	background: rgba(255, 255, 255, 0.1);
	box-shadow: none;
}

.button-secondary:hover {
	background: rgba(255, 255, 255, 0.16);
}

.button-danger {
	border-color: rgba(251, 113, 133, 0.55);
	background: linear-gradient(135deg, #be123c, #9f1239);
}

.button-small {
	min-height: 2.2rem;
	padding: 0.42rem 0.72rem;
	font-size: 0.88rem;
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
progress:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid rgba(216, 180, 254, 0.8);
	outline-offset: 3px;
}

.app-shell {
	position: relative;
	z-index: 1;
	width: min(1440px, calc(100% - 2rem));
	max-width: 100%;
	margin: 0 auto;
	padding-top: 0.75rem;
}

.topbar {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	width: 100%;
	margin-top: 0;
	padding: 0.5rem 0;
	border: 0;
	background: transparent;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	color: #ffffff;
	font-size: 1.15rem;
	font-weight: 800;
}

.brand img {
	width: 35px;
	height: 35px;
}

.nav {
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

.nav a {
	padding: 0.58rem 0.72rem;
	border: 1px solid transparent;
	border-radius: 9px;
	color: var(--muted);
	font-size: 0.93rem;
	font-weight: 650;
}

.nav a:hover,
.nav a.active {
	border-color: rgba(168, 85, 247, 0.22);
	background: rgba(168, 85, 247, 0.16);
	color: #ffffff;
}

.nav-toggle {
	display: none;
	min-height: 2.35rem;
	padding: 0.4rem 0.65rem;
}

.inline-form {
	display: inline-flex;
	margin: 0;
}

main {
	min-width: 0;
	min-height: calc(100vh - 180px);
	padding: var(--space-7) 0;
}

.page-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-5);
	margin-bottom: var(--space-5);
}

.page-header h1 {
	margin: 0;
	font-size: clamp(1.7rem, 4vw, 2.55rem);
	letter-spacing: -0.04em;
	overflow-wrap: anywhere;
}

.page-header p {
	max-width: 54rem;
	margin: var(--space-1) 0 0;
	color: var(--muted);
	overflow-wrap: anywhere;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	max-width: 100%;
}

.actions > form {
	display: inline-flex;
}

.grid {
	display: grid;
	gap: var(--space-4);
}

.grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid > *,
.form-grid > *,
.page-header > *,
.topbar > *,
.actions > * {
	min-width: 0;
}

.panel,
.metric,
.auth-card {
	position: relative;
	min-width: 0;
	max-width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--glass-bg);
	box-shadow: var(--shadow), var(--glass-highlight);
	-webkit-backdrop-filter: var(--glass-blur);
	backdrop-filter: var(--glass-blur);
}

/* A soft top light-streak reinforces the iOS glass refraction as surfaces move
   over the fixed glow while scrolling. It never captures pointer events. */
.panel::before,
.metric::before,
.auth-card::before,
.info-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 42%);
}

.panel {
	padding: var(--space-5);
}

.panel h2,
.panel h3 {
	margin-top: 0;
	margin-bottom: var(--space-4);
}

.panel > :last-child {
	margin-bottom: 0;
}

.metric {
	padding: var(--space-5);
}

.metric-label {
	color: var(--muted);
	font-size: 0.84rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.metric-value {
	margin-top: 0.25rem;
	font-size: clamp(1.7rem, 4vw, 2.45rem);
	font-weight: 850;
	letter-spacing: -0.04em;
}

/* Keep panel/metric/card content above their decorative light-streak layer. */
.panel > *,
.metric > *,
.auth-card > *,
.info-footer > * {
	position: relative;
	z-index: 1;
}

.section-gap {
	margin-top: var(--space-4);
}

.muted {
	color: var(--muted);
}

.small {
	font-size: 0.88rem;
}

.notice {
	max-width: 100%;
	margin-bottom: var(--space-4);
	padding: var(--space-3) var(--space-4);
	border: 1px solid rgba(129, 140, 248, 0.38);
	border-radius: var(--radius-small);
	background: rgba(79, 70, 229, 0.13);
	overflow-wrap: anywhere;
}

.notice-success {
	border-color: rgba(74, 222, 128, 0.45);
	background: rgba(34, 197, 94, 0.12);
}

.notice-error {
	border-color: rgba(251, 113, 133, 0.48);
	background: rgba(190, 18, 60, 0.15);
}

.notice-warning {
	border-color: rgba(250, 204, 21, 0.43);
	background: rgba(161, 98, 7, 0.16);
}

/* Symmetric vertical margin so standalone compact notices (such as the site
   attribution date) keep clear space above and below. In-panel / details
   contexts reset the trailing margin via their own :last-child rules. */
.notice-compact {
	margin: var(--space-4) 0;
	font-size: 0.88rem;
}

/* Reusable glass-style informational footer component. */
.info-footer {
	position: relative;
	margin-top: var(--space-5);
	padding: var(--space-4) var(--space-5);
	border: 1px solid var(--border);
	border-radius: var(--radius-small);
	background: linear-gradient(145deg, rgba(48, 25, 93, 0.34), rgba(18, 10, 42, 0.4));
	box-shadow: var(--glass-highlight);
	-webkit-backdrop-filter: saturate(150%) blur(16px);
	backdrop-filter: saturate(150%) blur(16px);
	color: var(--muted);
	font-size: 0.88rem;
	overflow-wrap: anywhere;
}

.info-footer > :first-child {
	margin-top: 0;
}

.info-footer > :last-child {
	margin-bottom: 0;
}

.info-footer p {
	margin: var(--space-2) 0 0;
}

.info-footer p:first-child {
	margin-top: 0;
}

.info-footer-note {
	color: var(--muted);
}

.info-footer-privacy {
	border-color: rgba(129, 140, 248, 0.3);
}

.chart-legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-4);
}

.chart-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text);
	font-weight: 700;
	font-size: 0.9rem;
}

.chart-legend-swatch {
	width: 0.9rem;
	height: 0.9rem;
	border-radius: 50%;
	box-shadow: 0 0 10px currentColor;
}

.chart-legend-swatch-page-views {
	background: var(--purple);
	color: var(--purple);
}

.chart-legend-swatch-visitors {
	background: var(--blue);
	color: var(--blue);
}

.chart-legend-hint {
	margin: var(--space-3) 0 0;
	color: var(--muted);
	font-size: 0.84rem;
}

form {
	max-width: 100%;
	margin: 0;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-4);
}

.form-stack {
	display: grid;
	gap: var(--space-4);
}

.form-stack > button,
.form-stack > .button {
	justify-self: start;
}

.field {
	display: flex;
	min-width: 0;
	max-width: 100%;
	flex-direction: column;
	gap: 0.38rem;
}

.field-full {
	grid-column: 1 / -1;
}

label,
.label {
	color: #f3e8ff;
	font-size: 0.9rem;
	font-weight: 700;
}

.label-row,
.checkbox-help {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: var(--space-1);
}

.checkbox-help {
	flex-wrap: wrap;
}

input,
select,
textarea {
	width: 100%;
	min-width: 0;
	min-height: 2.8rem;
	padding: 0.7rem 0.78rem;
	border: 1px solid var(--border-bright);
	border-radius: 10px;
	background: rgba(8, 5, 22, 0.74);
	color: var(--text);
}

input:hover,
select:hover,
textarea:hover {
	border-color: rgba(216, 180, 254, 0.62);
}

textarea {
	min-height: 7rem;
	resize: vertical;
}

input::placeholder,
textarea::placeholder {
	color: #9385ac;
}

.checkbox {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: var(--space-2);
}

.checkbox input {
	flex: 0 0 auto;
	width: 1.1rem;
	min-height: auto;
	height: 1.1rem;
}

.help {
	margin: 0;
	color: var(--muted);
	font-size: 0.84rem;
}

.member-access {
	display: grid;
	gap: var(--space-2);
}

.member-access select {
	min-height: 2.5rem;
}

.site-scope-list {
	display: grid;
	gap: 0.4rem;
	max-height: 12rem;
	overflow-y: auto;
	padding: var(--space-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.16);
}

.site-scope-list[hidden] {
	display: none;
}

.site-scope-list .label {
	margin: 0;
}

.member-role-hint {
	margin: 0;
}

.glossary-link {
	display: inline-flex;
	flex: 0 0 auto;
	width: 1.18rem;
	height: 1.18rem;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid rgba(216, 180, 254, 0.45);
	border-radius: 50%;
	background: rgba(168, 85, 247, 0.13);
	color: var(--purple-light);
	font-size: 0.72rem;
	font-weight: 850;
	letter-spacing: 0;
	line-height: 1;
	text-transform: none;
	vertical-align: middle;
}

.glossary-link:hover {
	border-color: rgba(255, 255, 255, 0.72);
	background: rgba(168, 85, 247, 0.28);
	color: #ffffff;
}

details {
	max-width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius-small);
	background: rgba(255, 255, 255, 0.04);
}

details summary {
	padding: var(--space-3);
	cursor: pointer;
	font-weight: 750;
	overflow-wrap: anywhere;
}

.details-content {
	min-width: 0;
	padding: 0 var(--space-3) var(--space-3);
}

.details-content > :first-child {
	margin-top: 0;
}

.details-content > :last-child {
	margin-bottom: 0;
}

.table-wrap {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 0.85rem 0.7rem;
	border-bottom: 1px solid rgba(216, 180, 254, 0.14);
	text-align: left;
	vertical-align: middle;
}

th {
	color: var(--muted);
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

th .glossary-link {
	position: relative;
	top: -0.02rem;
}

tbody tr:last-child td {
	border-bottom: 0;
}

tbody tr {
	transition: background 140ms ease, box-shadow 140ms ease;
}

tbody tr:hover {
	background: rgba(255, 255, 255, 0.025);
}

.clickable-row {
	cursor: pointer;
}

.clickable-row:hover {
	background: rgba(168, 85, 247, 0.1);
	box-shadow: inset 3px 0 0 var(--purple-light);
}

.clickable-row:focus-visible {
	background: rgba(168, 85, 247, 0.12);
	box-shadow: inset 3px 0 0 var(--purple-light);
	outline: 2px solid var(--purple-light);
	outline-offset: -2px;
}

.clickable-row:hover .row-action,
.clickable-row:focus-visible .row-action {
	border-color: var(--border-bright);
	background: rgba(168, 85, 247, 0.2);
	color: #ffffff;
}

.row-action {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	padding: 0.4rem 0.58rem;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.055);
	white-space: nowrap;
	font-size: 0.84rem;
	font-weight: 750;
}

.status {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.42rem;
	padding: 0.28rem 0.58rem;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.07);
	font-size: 0.8rem;
	font-weight: 750;
	white-space: nowrap;
	cursor: help;
}

.status::before {
	flex: 0 0 auto;
	width: 0.48rem;
	height: 0.48rem;
	border-radius: 50%;
	background: currentColor;
	content: "";
	box-shadow: 0 0 9px currentColor;
}

.status-tooltip {
	position: absolute;
	bottom: calc(100% + 0.6rem);
	left: 50%;
	z-index: 50;
	width: max-content;
	max-width: min(18rem, 70vw);
	padding: 0.62rem 0.72rem;
	border: 1px solid var(--border-bright);
	border-radius: 9px;
	background: rgba(8, 5, 22, 0.98);
	box-shadow: var(--shadow);
	color: var(--text);
	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.4;
	opacity: 0;
	pointer-events: none;
	white-space: normal;
	transform: translate(-50%, 0.25rem);
	transition: opacity 120ms ease, transform 120ms ease;
}

.status-tooltip::after {
	position: absolute;
	top: 100%;
	left: 50%;
	border: 6px solid transparent;
	border-top-color: var(--border-bright);
	content: "";
	transform: translateX(-50%);
}

.status:hover .status-tooltip,
.status:focus .status-tooltip,
.status:focus-visible .status-tooltip {
	opacity: 1;
	transform: translate(-50%, 0);
}

.table-wrap .status-tooltip {
	display: none;
}

.status-healthy {
	color: var(--green);
}

.status-waiting {
	color: var(--yellow);
}

.status-attention {
	color: var(--red);
}

.status-stale {
	color: #fbbf24;
}

.status-disabled {
	color: #94a3b8;
}

.health-guide {
	margin-top: var(--space-4);
}

.health-legend {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-3);
	padding-top: var(--space-1);
}

.health-legend-item {
	min-width: 0;
	padding: var(--space-3);
	border: 1px solid rgba(216, 180, 254, 0.12);
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.12);
}

.health-legend-item strong {
	display: block;
	margin-bottom: var(--space-1);
}

.health-legend-item p {
	margin: 0;
	color: var(--muted);
	font-size: 0.84rem;
}

.health-label-healthy {
	color: var(--green);
}

.health-label-waiting {
	color: var(--yellow);
}

.health-label-attention {
	color: var(--red);
}

.health-label-stale {
	color: #fbbf24;
}

.health-label-disabled {
	color: #94a3b8;
}

.range-control {
	display: inline-flex;
	max-width: 100%;
	align-items: center;
	gap: var(--space-1);
}

.range-nav {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.2rem;
	max-width: 100%;
	padding: 0.25rem;
	border: 1px solid var(--border);
	border-radius: 11px;
	background: rgba(0, 0, 0, 0.18);
}

.range-nav a {
	padding: 0.42rem 0.65rem;
	border-radius: 8px;
	color: var(--muted);
	font-size: 0.86rem;
	font-weight: 750;
	white-space: nowrap;
}

.range-nav a.active {
	background: rgba(168, 85, 247, 0.27);
	color: #ffffff;
}

.chart {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 260px;
	margin-top: 0.5rem;
}

.panel:has(.chart-shell) {
	z-index: 20;
}

.chart-shell {
	position: relative;
	z-index: 30;
	min-width: 0;
	max-width: 100%;
	overflow: visible;
	padding-top: 0.5rem;
}

.panel:has(.chart-shell) > .chart-shell {
	z-index: 30;
}

.chart-shell .chart {
	margin-top: 0;
	touch-action: pan-y;
}

.chart-tooltip {
	position: absolute;
	z-index: 80;
	width: max-content;
	max-width: min(22rem, calc(100% - 1rem));
	max-height: min(22rem, 70vh);
	overflow-x: hidden;
	overflow-y: auto;
	padding: 0.7rem 0.78rem;
	border: 1px solid rgba(216, 180, 254, 0.58);
	border-radius: 10px;
	background: rgba(8, 5, 22, 0.97);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
	color: var(--text);
	font-size: 0.82rem;
	line-height: 1.35;
	pointer-events: auto;
}

.chart-tooltip-breakdown {
	margin-top: 0.65rem;
}

.chart-tooltip-heading {
	margin: 0.55rem 0 0.28rem;
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.chart-tooltip-heading:first-child {
	margin-top: 0;
}

.chart-tooltip-list {
	display: grid;
	gap: 0.22rem;
}

.chart-tooltip-list-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
}

.chart-tooltip-list-label {
	min-width: 0;
	overflow-wrap: anywhere;
}

.chart-tooltip-empty {
	color: var(--muted);
}

.chart-tooltip[hidden] {
	display: none;
}

.chart-tooltip-date {
	margin-bottom: 0.45rem;
	color: #ffffff;
	font-weight: 800;
}

.chart-tooltip-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.45rem;
	min-width: 10.5rem;
}

.chart-tooltip-row + .chart-tooltip-row {
	margin-top: 0.28rem;
}

.chart-tooltip-row strong {
	margin-left: 0.45rem;
	color: #ffffff;
}

.chart-tooltip-swatch {
	width: 0.58rem;
	height: 0.58rem;
	border-radius: 50%;
	box-shadow: 0 0 8px currentColor;
}

.chart-tooltip-swatch-page-views {
	background: var(--purple);
	color: var(--purple);
}

.chart-tooltip-swatch-visitors {
	background: var(--blue);
	color: var(--blue);
}

.analytics-context {
	display: flex;
	min-width: 0;
	max-width: 100%;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin-top: var(--space-4);
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--border);
	border-radius: var(--radius-small);
	background: rgba(255, 255, 255, 0.035);
	color: var(--muted);
	font-size: 0.88rem;
	overflow-wrap: anywhere;
}

.bar-list {
	display: grid;
	gap: 0.8rem;
}

.bar-row {
	display: grid;
	grid-template-columns: minmax(8rem, 1.3fr) 3fr auto;
	align-items: center;
	gap: 0.8rem;
	min-width: 0;
}

.bar-label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bar-progress {
	width: 100%;
	min-width: 0;
	height: 0.62rem;
	overflow: hidden;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	appearance: none;
}

.bar-progress::-webkit-progress-bar {
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
}

.bar-progress::-webkit-progress-value {
	border-radius: 999px;
	background: linear-gradient(90deg, var(--purple), var(--blue));
}

.bar-progress::-moz-progress-bar {
	border-radius: 999px;
	background: linear-gradient(90deg, var(--purple), var(--blue));
}

.auth-page {
	position: relative;
	z-index: 1;
	display: grid;
	width: 100%;
	max-width: 100%;
	min-height: 100vh;
	place-items: center;
	padding: var(--space-5);
}

.auth-card {
	width: min(500px, 100%);
	padding: var(--space-6);
	background: var(--glass-bg-strong);
}

.auth-logo {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	margin-bottom: var(--space-4);
}

.auth-logo img {
	width: 52px;
	height: 52px;
}

.auth-logo h1 {
	margin: 0;
}

.auth-card .field {
	margin-bottom: 0.9rem;
}

.footer {
	padding: var(--space-5) 0 var(--space-7);
	color: var(--muted);
	text-align: center;
	font-size: 0.85rem;
}

.footer span {
	display: block;
}

.empty {
	padding: var(--space-7) var(--space-4);
	color: var(--muted);
	text-align: center;
}

.code {
	display: block;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
	padding: 0.75rem;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: rgba(0, 0, 0, 0.3);
	color: #e9d5ff;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.84rem;
}

.help-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	max-width: 100%;
	margin-bottom: var(--space-3);
}

.help-tab {
	min-height: 2.25rem;
	padding: 0.4rem 0.65rem;
	background: rgba(255, 255, 255, 0.07);
	box-shadow: none;
}

.help-tab.active {
	background: rgba(168, 85, 247, 0.3);
}

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

.signature-list {
	display: grid;
	gap: var(--space-2);
	margin: var(--space-3) 0 0;
	padding-left: 1.2rem;
}

.signature-list code {
	color: #e9d5ff;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.glossary-index {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-top: var(--space-4);
}

.glossary-index a {
	padding: 0.42rem 0.62rem;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.045);
	color: var(--muted);
	font-size: 0.84rem;
	font-weight: 700;
}

.glossary-index a:hover {
	border-color: var(--border-bright);
	background: rgba(168, 85, 247, 0.16);
	color: #ffffff;
}

.glossary-list {
	display: grid;
	gap: var(--space-4);
}

.glossary-term {
	scroll-margin-top: var(--space-5);
	padding: var(--space-5);
	border: 1px solid rgba(216, 180, 254, 0.16);
	border-radius: var(--radius-small);
	background: rgba(0, 0, 0, 0.14);
	overflow-wrap: anywhere;
}

.glossary-term:target {
	border-color: var(--purple-light);
	background: rgba(168, 85, 247, 0.13);
	box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.glossary-term h2 {
	margin: 0 0 var(--space-2);
	font-size: 1.3rem;
}

.glossary-term p {
	margin: var(--space-2) 0 0;
	color: var(--muted);
}

.glossary-term ul {
	margin: var(--space-2) 0 0;
	padding-left: 1.25rem;
	color: var(--muted);
}

.glossary-term li + li {
	margin-top: var(--space-1);
}

.glossary-term code {
	color: #e9d5ff;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.member-forms {
	display: none;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 0.75rem;
	top: 0.75rem;
	z-index: 100;
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--border-bright);
	border-radius: 10px;
	background: var(--glass-bg-opaque);
	color: #ffffff;
	font-weight: 750;
	transform: translateY(-160%);
}

.skip-link:focus,
.skip-link:focus-visible {
	transform: none;
}

/* Graceful fallback for browsers without backdrop-filter support: use more
   opaque surfaces so the fixed ambient glow does not wash out text contrast. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.panel,
	.metric,
	.auth-card {
		background: var(--glass-bg-opaque);
	}

	.info-footer {
		background: linear-gradient(145deg, rgba(46, 24, 89, 0.9), rgba(17, 9, 38, 0.94));
	}

	.nav {
		background: rgba(15, 8, 34, 0.98);
	}
}

@media (min-width: 801px) {
	.member-table td {
		vertical-align: top;
	}

	.member-table td:last-child .button-small {
		min-height: 2.8rem;
	}
}

@media (max-width: 960px) {
	.grid-4,
	.grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.nav-toggle {
		display: inline-flex;
	}

	.nav {
		position: absolute;
		top: calc(100% + 0.5rem);
		right: 0;
		display: none;
		width: min(280px, calc(100vw - 2rem));
		max-width: calc(100vw - 2rem);
		flex-direction: column;
		align-items: stretch;
		padding: var(--space-2);
		border: 1px solid var(--border-bright);
		border-radius: 14px;
		background: rgba(15, 8, 34, 0.9);
		box-shadow: var(--shadow), var(--glass-highlight);
		-webkit-backdrop-filter: saturate(150%) blur(20px);
		backdrop-filter: saturate(150%) blur(20px);
	}

	.nav.open {
		display: flex;
	}

	.nav .inline-form,
	.nav .inline-form button {
		width: 100%;
	}
}

@media (max-width: 800px) {
	.table-wrap {
		overflow: visible;
	}

	.table-wrap table,
	.table-wrap tbody,
	.table-wrap tr,
	.table-wrap td {
		display: block;
		width: 100%;
	}

	.table-wrap table {
		border-collapse: separate;
	}

	.table-wrap thead {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.table-wrap tbody {
		display: grid;
		gap: var(--space-3);
	}

	.table-wrap tbody tr {
		padding: 0.2rem var(--space-3);
		border: 1px solid rgba(216, 180, 254, 0.16);
		border-radius: var(--radius-small);
		background: rgba(0, 0, 0, 0.13);
	}

	.table-wrap tbody tr:last-child td {
		border-bottom: 1px solid rgba(216, 180, 254, 0.12);
	}

	.table-wrap tbody tr td:last-child {
		border-bottom: 0;
	}

	.table-wrap td {
		padding: 0.68rem 0;
		border-bottom: 1px solid rgba(216, 180, 254, 0.12);
		overflow-wrap: normal;
		word-break: normal;
	}

	.table-wrap td::before {
		display: block;
		margin-bottom: 0.22rem;
		color: var(--muted);
		font-size: 0.72rem;
		font-weight: 750;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		content: attr(data-label);
	}

	.table-wrap td[data-label=""]::before {
		display: none;
	}

	.table-wrap td .small {
		overflow-wrap: anywhere;
	}

	.table-wrap .actions {
		justify-content: flex-start;
	}

	.table-wrap .clickable-row:hover,
	.table-wrap .clickable-row:focus-visible {
		box-shadow: inset 3px 0 0 var(--purple-light);
	}
}

@media (max-width: 680px) {
	.app-shell {
		width: min(1440px, calc(100% - 1rem));
		max-width: calc(100% - 1rem);
		padding-top: 0.35rem;
	}

	.topbar {
		margin-top: 0;
	}

	main {
		padding: var(--space-5) 0;
	}

	.page-header {
		width: 100%;
		flex-direction: column;
	}

	.grid-4,
	.grid-3,
	.grid-2,
	.form-grid,
	.health-legend {
		grid-template-columns: minmax(0, 1fr);
	}

	.field-full {
		grid-column: auto;
	}

	.panel,
	.metric {
		padding: var(--space-4);
	}

	.info-footer {
		padding: var(--space-3) var(--space-4);
	}

	.chart-legend {
		gap: var(--space-3);
	}

	.bar-row {
		grid-template-columns: minmax(0, 1fr) minmax(4rem, 1.6fr) auto;
		gap: var(--space-2);
	}

	.actions {
		width: 100%;
		align-items: stretch;
	}

	.actions > form,
	.actions > a,
	.actions > button {
		flex: 1 1 auto;
		min-width: 0;
		max-width: 100%;
	}

	.actions > form button {
		width: 100%;
		white-space: normal;
	}

	.actions > .range-control {
		width: 100%;
		align-items: flex-start;
	}

	.range-nav {
		flex: 1 1 auto;
		flex-direction: column;
		width: 100%;
	}

	.range-nav a {
		flex: 0 0 auto;
		width: 100%;
		text-align: left;
	}

	.row-action {
		padding: 0.38rem 0.5rem;
	}

	.status-tooltip {
		display: none;
	}

	.chart-tooltip {
		max-width: min(20rem, calc(100% - 0.75rem));
		max-height: min(18rem, 60vh);
		font-size: 0.78rem;
	}

	.chart-tooltip-row {
		min-width: 9.5rem;
	}

	.glossary-index a {
		flex: 1 1 calc(50% - var(--space-2));
		text-align: center;
	}

	.glossary-term {
		padding: var(--space-4);
	}

	.auth-page {
		padding: var(--space-4);
	}

	.auth-card {
		padding: var(--space-5);
	}
}

@media (max-width: 420px) {
	.glossary-index a {
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
	}

	button,
	.button,
	tbody tr,
	.status-tooltip {
		transition: none;
	}
}