/*
 * ACE GENCO Score Analysis — front-end styles.
 *
 * Everything is scoped under .agx so the plugin cannot leak into a theme.
 *
 * Layout architecture: a workspace shell — top bar, a sticky section nav rail,
 * a two-up intake row (form + live snapshot), and a full-width report below.
 * Visual language: lavender canvas, white cards on hairline borders, soft
 * violet accents, pill segments and switch controls.
 */

.agx {
	--agx-primary: #6d4aff;
	--agx-primary-deep: #5a37e8;
	--agx-primary-soft: #f3f0ff;
	--agx-primary-line: #e4ddff;
	--agx-ring: rgba(109, 74, 255, .18);

	--agx-ink: #15142b;
	--agx-ink-2: #5c5b7a;
	--agx-ink-3: #9a99b5;

	--agx-surface: #fff;
	--agx-canvas: #faf9ff;
	--agx-line: #ecebf7;
	--agx-line-2: #f4f3fb;

	--agx-ok: #0f9d6f;
	--agx-ok-soft: #e8f7f1;
	--agx-bad: #e5484d;
	--agx-bad-soft: #fdeef0;
	--agx-warn: #c2750a;
	--agx-warn-soft: #fdf3e3;
	--agx-mute: #8b8aa6;
	--agx-mute-soft: #f2f1f8;

	--agx-r: 14px;
	--agx-r-sm: 10px;
	--agx-shadow: 0 1px 2px rgba(21, 20, 43, .04), 0 8px 24px -14px rgba(21, 20, 43, .14);

	box-sizing: border-box;
	color: var(--agx-ink);
	font-family: "Inter", "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
	font-size: 14.5px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.agx *,
.agx *::before,
.agx *::after {
	box-sizing: inherit;
}

.agx-app {
	position: relative;
	max-width: 1180px;
	margin: 0 auto;
	padding: 22px 18px 14px;
}

/* Soft violet wash behind the top of the workspace. */
.agx-app::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 320px;
	background: linear-gradient(180deg, #f1ebff 0%, rgba(250, 249, 255, 0) 100%);
	border-radius: 20px 20px 0 0;
	pointer-events: none;
	z-index: 0;
}

.agx-app > * {
	position: relative;
	z-index: 1;
}

/* ------------------------------------------------------------------
 * Shell: nav rail + content
 * ------------------------------------------------------------------ */

.agx-frame {
	display: grid;
	grid-template-columns: 194px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
}

.agx-frame.is-bare {
	grid-template-columns: minmax(0, 1fr);
}

.agx-nav {
	position: sticky;
	top: 18px;
	padding: 12px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
	box-shadow: var(--agx-shadow);
}

.agx-frame.is-bare .agx-nav {
	display: none;
}

.agx-nav-label {
	padding: 4px 8px 8px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--agx-ink-3);
}

.agx-nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	font-size: 13.5px;
	font-weight: 550;
	color: var(--agx-ink-2);
	text-decoration: none;
	border-radius: var(--agx-r-sm);
	transition: background .15s, color .15s;
}

.agx-nav a:hover {
	color: var(--agx-ink);
	background: var(--agx-line-2);
}

.agx-nav a.is-active {
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	font-weight: 650;
}

.agx-nav svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: .85;
}

.agx-content {
	min-width: 0;
}

/* ------------------------------------------------------------------
 * Intake row: form + snapshot
 * ------------------------------------------------------------------ */

.agx-intake {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 316px;
	gap: 20px;
	align-items: start;
}

.agx-h1 {
	margin: 0 0 4px;
	font-size: 23px;
	font-weight: 720;
	letter-spacing: -.025em;
	color: var(--agx-ink);
}

.agx-lede {
	margin: 0 0 16px;
	max-width: 62ch;
	font-size: 13.5px;
	color: var(--agx-ink-2);
}

/* Segmented pill switcher. */
.agx-segment {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 14px;
	background: var(--agx-primary-soft);
	border: 1px solid var(--agx-primary-line);
	border-radius: 12px;
}

.agx-seg {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: #6b62a4;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 9px;
	cursor: pointer;
	transition: background .15s, color .15s, box-shadow .15s;
}

.agx-seg:hover {
	color: var(--agx-primary-deep);
}

.agx-seg.is-active {
	color: var(--agx-ink);
	background: var(--agx-surface);
	border-color: var(--agx-line);
	box-shadow: 0 1px 3px rgba(21, 20, 43, .07);
}

.agx-seg svg {
	width: 15px;
	height: 15px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.agx-card {
	padding: 20px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
	box-shadow: var(--agx-shadow);
}

/* The URL field sits in its own raised well with the action inside it. */
.agx-well {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 10px 10px 10px 16px;
	background: var(--agx-canvas);
	border: 1px solid var(--agx-line);
	border-radius: 12px;
}

.agx-well:focus-within {
	border-color: var(--agx-primary-line);
	box-shadow: 0 0 0 3px var(--agx-ring);
}

.agx-well input {
	flex: 1 1 240px;
	min-width: 0;
	padding: 8px 0;
	font: inherit;
	font-size: 14px;
	color: var(--agx-ink);
	background: transparent;
	border: 0;
	outline: none;
}

.agx-well input::placeholder {
	color: var(--agx-ink-3);
}

.agx-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
	gap: 14px;
	margin-top: 16px;
}

.agx-field {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.agx-field > label,
.agx-label {
	font-size: 12px;
	font-weight: 650;
	color: var(--agx-ink-2);
}

.agx-field .agx-opt {
	font-weight: 500;
	color: var(--agx-ink-3);
}

.agx-field select,
.agx-field input {
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	font-size: 13.5px;
	color: var(--agx-ink);
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r-sm);
	outline: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}

.agx-field select {
	background-image: linear-gradient(45deg, transparent 50%, var(--agx-ink-3) 50%), linear-gradient(135deg, var(--agx-ink-3) 50%, transparent 50%);
	background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 32px;
}

.agx-field select:focus,
.agx-field input:focus {
	border-color: var(--agx-primary);
	box-shadow: 0 0 0 3px var(--agx-ring);
}

.agx-field.has-error select,
.agx-field.has-error input {
	border-color: var(--agx-bad);
	box-shadow: 0 0 0 3px rgba(229, 72, 77, .12);
}

.agx-hint {
	font-size: 12px;
	color: var(--agx-ink-3);
}

.agx-err {
	font-size: 12px;
	font-weight: 600;
	color: var(--agx-bad);
}

.agx-err:empty {
	display: none;
}

.agx-prefixed {
	display: flex;
	align-items: stretch;
	max-width: 280px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r-sm);
	overflow: hidden;
}

.agx-prefixed:focus-within {
	border-color: var(--agx-primary);
	box-shadow: 0 0 0 3px var(--agx-ring);
}

.agx-prefixed span {
	display: grid;
	place-items: center;
	padding: 0 11px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .05em;
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	border-right: 1px solid var(--agx-primary-line);
}

.agx-prefixed input {
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	letter-spacing: .18em;
	font-variant-numeric: tabular-nums;
}

.agx-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 16px 0 0;
	font-size: 12.5px;
	color: var(--agx-ink-2);
}

.agx-consent input {
	margin-top: 2px;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	accent-color: var(--agx-primary);
}

.agx-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
}

.agx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 650;
	color: #fff;
	background: var(--agx-primary);
	border: 0;
	border-radius: var(--agx-r-sm);
	cursor: pointer;
	white-space: nowrap;
	box-shadow: 0 6px 16px -8px var(--agx-ring);
	transition: background .15s, transform .06s;
}

.agx-btn:hover:not(:disabled) {
	background: var(--agx-primary-deep);
}

.agx-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.agx-btn:disabled {
	opacity: .6;
	cursor: progress;
}

.agx-btn-soft {
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	border: 1px solid var(--agx-primary-line);
	box-shadow: none;
}

.agx-btn-soft:hover:not(:disabled) {
	background: #ebe5ff;
}

.agx-ghost {
	padding: 7px 12px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--agx-ink-2);
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: 8px;
	cursor: pointer;
}

.agx-ghost:hover {
	color: var(--agx-primary-deep);
	border-color: var(--agx-primary-line);
	background: var(--agx-primary-soft);
}

.agx-note {
	font-size: 12px;
	color: var(--agx-ink-3);
}

.agx-spin {
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: agx-spin .7s linear infinite;
}

@keyframes agx-spin {
	to {
		transform: rotate(360deg);
	}
}

.agx-alert {
	display: none;
	margin-top: 14px;
	padding: 11px 14px;
	font-size: 13px;
	background: var(--agx-primary-soft);
	border: 1px solid var(--agx-primary-line);
	border-radius: var(--agx-r-sm);
	color: #5b53a0;
}

.agx-alert.is-shown {
	display: block;
}

.agx-alert.is-error {
	color: #b02b30;
	background: var(--agx-bad-soft);
	border-color: #f8d6d8;
}

/* ------------------------------------------------------------------
 * Rail cards (snapshot / leaderboard)
 * ------------------------------------------------------------------ */

.agx-rail {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.agx-rail-card {
	padding: 16px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
	box-shadow: var(--agx-shadow);
}

.agx-rail-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.agx-rail-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -.015em;
	flex: 1 1 auto;
}

.agx-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--agx-primary-deep);
	text-decoration: none;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}

.agx-link:hover {
	text-decoration: underline;
}

/* Small segmented branch switch inside a rail card. */
.agx-mini-seg {
	display: flex;
	gap: 3px;
	padding: 3px;
	margin-bottom: 12px;
	background: var(--agx-mute-soft);
	border-radius: 9px;
}

.agx-mini-seg button {
	flex: 1;
	padding: 6px 4px;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	color: var(--agx-ink-2);
	background: transparent;
	border: 0;
	border-radius: 7px;
	cursor: pointer;
}

.agx-mini-seg button.is-active {
	color: var(--agx-primary-deep);
	background: var(--agx-surface);
	box-shadow: 0 1px 2px rgba(21, 20, 43, .08);
}

/* A row in the rail: label, meta, and a value pill on the right. */
.agx-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 0;
	border-top: 1px solid var(--agx-line-2);
}

.agx-row:first-of-type {
	border-top: 0;
}

.agx-row-main {
	flex: 1 1 auto;
	min-width: 0;
}

.agx-row-title {
	font-size: 13.5px;
	font-weight: 620;
	color: var(--agx-ink);
}

.agx-row-meta {
	margin-top: 2px;
	font-size: 11.5px;
	color: var(--agx-ink-3);
	font-variant-numeric: tabular-nums;
}

.agx-badge {
	display: inline-grid;
	place-items: center;
	min-width: 40px;
	padding: 5px 9px;
	font-size: 14px;
	font-weight: 720;
	letter-spacing: -.01em;
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	border-radius: 8px;
	font-variant-numeric: tabular-nums;
}

.agx-badge.is-flat {
	color: var(--agx-ink-2);
	background: var(--agx-mute-soft);
}

.agx-rank {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	color: var(--agx-ink-2);
	background: var(--agx-mute-soft);
	border-radius: 8px;
	font-variant-numeric: tabular-nums;
}

.agx-rank.is-top {
	color: #fff;
	background: linear-gradient(140deg, var(--agx-primary), #9d7bff);
}

/* ------------------------------------------------------------------
 * Report
 * ------------------------------------------------------------------ */

.agx-report {
	margin-top: 22px;
}

.agx-report-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	margin-bottom: 16px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
	box-shadow: var(--agx-shadow);
}

.agx-avatar {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(140deg, var(--agx-primary), #9d7bff);
	border-radius: 11px;
}

.agx-who {
	flex: 1 1 auto;
	min-width: 0;
}

.agx-who-name {
	margin: 0;
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: -.015em;
}

.agx-who-meta {
	margin: 1px 0 0;
	font-size: 12px;
	color: var(--agx-ink-3);
	font-variant-numeric: tabular-nums;
}

.agx-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
}

.agx-pill {
	padding: 5px 11px;
	font-size: 11.5px;
	font-weight: 650;
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	border: 1px solid var(--agx-primary-line);
	border-radius: 999px;
}

.agx-sec {
	margin-bottom: 20px;
	scroll-margin-top: 18px;
}

.agx-sec-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 11px;
}

.agx-h2 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -.02em;
	flex: 1 1 auto;
}

.agx-sub {
	margin: 0;
	font-size: 12.5px;
	color: var(--agx-ink-3);
}

/* Score hero: dial plus stat chips. */
.agx-hero {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 22px;
	align-items: center;
	padding: 20px 22px;
	background: linear-gradient(135deg, #f5f1ff, var(--agx-surface) 62%);
	border: 1px solid var(--agx-primary-line);
	border-radius: var(--agx-r);
}

.agx-dial {
	position: relative;
	width: 126px;
	height: 126px;
	flex: 0 0 auto;
}

.agx-dial svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.agx-dial-track {
	fill: none;
	stroke: #e7e1ff;
	stroke-width: 10;
}

.agx-dial-fill {
	fill: none;
	stroke: var(--agx-primary);
	stroke-width: 10;
	stroke-linecap: round;
	transition: stroke-dashoffset .9s cubic-bezier(.22, .8, .3, 1);
}

.agx-dial-face {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	text-align: center;
}

.agx-dial-num {
	font-size: 36px;
	font-weight: 760;
	line-height: 1;
	letter-spacing: -.035em;
	font-variant-numeric: tabular-nums;
}

.agx-dial-cap {
	margin-top: 4px;
	font-size: 10.5px;
	font-weight: 650;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--agx-ink-3);
}

.agx-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
	gap: 10px;
}

.agx-stat {
	padding: 10px 12px;
	background: rgba(255, 255, 255, .72);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r-sm);
}

.agx-stat span {
	display: block;
	font-size: 10.5px;
	font-weight: 650;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--agx-ink-3);
}

.agx-stat b {
	display: block;
	margin-top: 2px;
	font-size: 19px;
	font-weight: 720;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
}

.agx-stat b small {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--agx-ink-3);
}

.agx-ok {
	color: var(--agx-ok);
}

.agx-bad {
	color: var(--agx-bad);
}

/* Tiles */
.agx-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
	gap: 12px;
}

.agx-tile {
	padding: 14px 15px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r-sm);
}

.agx-tile.is-key {
	background: var(--agx-primary-soft);
	border-color: var(--agx-primary-line);
}

.agx-tile-cap {
	font-size: 10.5px;
	font-weight: 650;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--agx-ink-3);
}

.agx-tile-val {
	margin-top: 4px;
	font-size: 22px;
	font-weight: 730;
	letter-spacing: -.025em;
	font-variant-numeric: tabular-nums;
}

.agx-tile-val small {
	font-size: 13px;
	font-weight: 600;
	color: var(--agx-ink-3);
}

.agx-tile-desc {
	margin-top: 5px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--agx-ink-2);
}

/* Gap rail */
.agx-gap {
	padding: 18px 20px 14px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
}

.agx-gap-track {
	position: relative;
	height: 10px;
	margin: 26px 0 8px;
	background: var(--agx-mute-soft);
	border-radius: 999px;
}

.agx-gap-own {
	position: absolute;
	inset: 0 auto 0 0;
	background: linear-gradient(90deg, var(--agx-primary), #9d7bff);
	border-radius: 999px;
}

.agx-gap-rest {
	position: absolute;
	top: 0;
	bottom: 0;
	background: repeating-linear-gradient(135deg, var(--agx-primary-line) 0 5px, transparent 5px 10px);
	border-radius: 999px;
}

.agx-gap-tag {
	position: absolute;
	bottom: 18px;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 680;
	white-space: nowrap;
	color: #fff;
	background: var(--agx-primary);
	border-radius: 6px;
	font-variant-numeric: tabular-nums;
}

.agx-gap-tag.is-high {
	bottom: auto;
	top: 18px;
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	border: 1px solid var(--agx-primary-line);
}

.agx-gap-ends {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--agx-ink-3);
	font-variant-numeric: tabular-nums;
}

.agx-gap-say {
	margin: 24px 0 0;
	font-size: 13px;
	color: var(--agx-ink-2);
}

/* ------------------------------------------------------------------
 * Tables
 * ------------------------------------------------------------------ */

.agx-tw {
	overflow-x: auto;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
	-webkit-overflow-scrolling: touch;
}

.agx-table {
	width: 100%;
	min-width: 640px;
	border-collapse: collapse;
	font-size: 13px;
}

.agx-table th,
.agx-table td {
	padding: 10px 13px;
	text-align: center;
	white-space: nowrap;
	border-bottom: 1px solid var(--agx-line-2);
	font-variant-numeric: tabular-nums;
}

.agx-table thead th {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--agx-ink-3);
	background: var(--agx-canvas);
	border-bottom: 1px solid var(--agx-line);
}

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

.agx-table tbody tr:hover td {
	background: #fbfaff;
}

.agx-l {
	text-align: left !important;
	white-space: normal !important;
	min-width: 180px;
}

.agx-total td {
	background: var(--agx-canvas);
	font-weight: 700;
	border-top: 1px solid var(--agx-line);
}

.agx-mark {
	background: var(--agx-primary-soft) !important;
	font-weight: 720;
	color: var(--agx-primary-deep);
	box-shadow: inset 0 0 0 1px var(--agx-primary-line);
}

.agx-up {
	color: var(--agx-ok);
	font-weight: 680;
}

.agx-down {
	color: var(--agx-bad);
	font-weight: 680;
}

.agx-tag {
	display: inline-block;
	padding: 2px 9px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	border-radius: 999px;
}

.agx-tag.strong {
	color: var(--agx-ok);
	background: var(--agx-ok-soft);
}

.agx-tag.stable {
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
}

.agx-tag.weak {
	color: var(--agx-warn);
	background: var(--agx-warn-soft);
}

.agx-tag.critical {
	color: var(--agx-bad);
	background: var(--agx-bad-soft);
}

/* Inline bar inside the section table. */
.agx-bar {
	position: relative;
	width: 74px;
	height: 6px;
	margin: 0 auto;
	background: var(--agx-mute-soft);
	border-radius: 999px;
	overflow: hidden;
}

.agx-bar i {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--agx-primary);
	border-radius: 999px;
}

/* ------------------------------------------------------------------
 * Focus checklist (persisted per report in the visitor's browser)
 * ------------------------------------------------------------------ */

.agx-todo {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.agx-todo-item {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	padding: 13px 15px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r-sm);
	cursor: pointer;
	transition: border-color .15s, background .15s;
}

.agx-todo-item:hover {
	border-color: var(--agx-primary-line);
}

.agx-todo-item input {
	margin-top: 2px;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	accent-color: var(--agx-primary);
}

.agx-todo-item.is-done {
	background: var(--agx-canvas);
}

.agx-todo-item.is-done .agx-todo-text {
	text-decoration: line-through;
	color: var(--agx-ink-3);
}

.agx-todo-body {
	min-width: 0;
}

.agx-todo-text {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--agx-ink);
}

.agx-todo-meta {
	margin-top: 3px;
	font-size: 12px;
	color: var(--agx-ink-2);
}

/* ------------------------------------------------------------------
 * Switches
 * ------------------------------------------------------------------ */

.agx-switches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin-bottom: 12px;
}

.agx-switch {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--agx-ink-2);
	cursor: pointer;
	user-select: none;
}

.agx-switch input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.agx-switch i {
	position: relative;
	width: 34px;
	height: 20px;
	flex: 0 0 auto;
	background: #dedcec;
	border-radius: 999px;
	transition: background .18s;
}

.agx-switch i::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(21, 20, 43, .22);
	transition: transform .18s;
}

.agx-switch input:checked + i {
	background: var(--agx-primary);
}

.agx-switch input:checked + i::after {
	transform: translateX(14px);
}

.agx-switch input:focus-visible + i {
	box-shadow: 0 0 0 3px var(--agx-ring);
}

/* ------------------------------------------------------------------
 * Distribution
 * ------------------------------------------------------------------ */

.agx-dist {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 158px;
	padding: 14px 16px 0;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
}

.agx-dbar {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	height: 100%;
	min-width: 0;
}

.agx-dbar-n {
	font-size: 11px;
	font-weight: 680;
	color: var(--agx-ink-3);
	font-variant-numeric: tabular-nums;
}

/*
 * The fill's height is a percentage set by JS. That percentage must resolve
 * against a track whose own height is only the space left after the count
 * and the axis label — not the full bar height — otherwise a 100% bar plus
 * its label pushes past the top of the card. flex:1 + min-height:0 gives the
 * track a definite, already-shrunk height for the fill's percentage to use.
 */
.agx-dbar-track {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
}

.agx-dbar-f {
	width: 100%;
	min-height: 3px;
	background: #e9e4fb;
	border-radius: 6px 6px 0 0;
	transition: height .8s cubic-bezier(.22, .8, .3, 1);
}

.agx-dbar.is-mine .agx-dbar-f {
	background: linear-gradient(180deg, var(--agx-primary), #9d7bff);
}

.agx-dbar.is-mine .agx-dbar-n,
.agx-dbar.is-mine .agx-dbar-l {
	color: var(--agx-primary-deep);
	font-weight: 720;
}

.agx-dbar-l {
	padding-bottom: 9px;
	font-size: 10px;
	color: var(--agx-ink-3);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------
 * Question map
 * ------------------------------------------------------------------ */

.agx-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 7px 12px;
	margin-bottom: 12px;
	font-size: 11.5px;
}

.agx-key {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	font-weight: 650;
	border-radius: 999px;
}

.agx-key::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 3px;
}

.agx-key.ok {
	color: var(--agx-ok);
	background: var(--agx-ok-soft);
}

.agx-key.ok::before {
	background: var(--agx-ok);
}

.agx-key.bad {
	color: var(--agx-bad);
	background: var(--agx-bad-soft);
}

.agx-key.bad::before {
	background: var(--agx-bad);
}

.agx-key.skip {
	color: var(--agx-mute);
	background: var(--agx-mute-soft);
}

.agx-key.skip::before {
	background: var(--agx-mute);
}

.agx-key.flag {
	color: var(--agx-warn);
	background: var(--agx-warn-soft);
}

.agx-key.flag::before {
	background: var(--agx-warn);
}

.agx-map {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	gap: 5px;
	padding: 14px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
}

.agx-q {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	font-size: 11.5px;
	font-weight: 680;
	border-radius: 9px;
	cursor: help;
	font-variant-numeric: tabular-nums;
	transition: transform .1s;
}

.agx-q:hover {
	transform: scale(1.09);
	z-index: 2;
}

.agx-q.ok {
	color: var(--agx-ok);
	background: var(--agx-ok-soft);
}

.agx-q.bad {
	color: var(--agx-bad);
	background: var(--agx-bad-soft);
}

.agx-q.skip {
	color: var(--agx-mute);
	background: var(--agx-mute-soft);
}

.agx-q.na {
	color: var(--agx-ink-3);
	background: var(--agx-canvas);
	border: 1px solid var(--agx-line);
}

.agx-q.is-flag::after {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	width: 5px;
	height: 5px;
	background: var(--agx-warn);
	border-radius: 50%;
}

.agx-fold {
	margin-top: 11px;
	background: var(--agx-surface);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r);
	overflow: hidden;
}

.agx-fold > summary {
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 650;
	color: var(--agx-ink-2);
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

.agx-fold > summary::-webkit-details-marker {
	display: none;
}

.agx-fold > summary::before {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.8px solid var(--agx-primary);
	border-bottom: 1.8px solid var(--agx-primary);
	transform: rotate(-45deg);
	transition: transform .18s;
}

.agx-fold[open] > summary::before {
	transform: rotate(45deg);
}

.agx-fold .agx-tw {
	border: 0;
	border-top: 1px solid var(--agx-line);
	border-radius: 0;
}

.agx-qt {
	display: block;
	max-width: 46ch;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 400;
	color: var(--agx-ink-3);
	white-space: normal;
}

/* Beats the display:block above when the detail switch turns text off. */
.agx-qt[hidden],
.agx-table tr[hidden] {
	display: none;
}

/* ------------------------------------------------------------------
 * Notices
 * ------------------------------------------------------------------ */

.agx-notice {
	padding: 13px 16px;
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--agx-ink-2);
	background: var(--agx-canvas);
	border: 1px solid var(--agx-line);
	border-radius: var(--agx-r-sm);
}

.agx-notice + .agx-notice {
	margin-top: 10px;
}

.agx-notice strong {
	color: var(--agx-ink);
}

.agx-notice.is-warn {
	color: #8a5406;
	background: var(--agx-warn-soft);
	border-color: #f6e3c4;
}

.agx-notice.is-warn strong {
	color: #6f4304;
}

.agx-plan {
	margin: 8px 0 0;
	padding-left: 18px;
}

.agx-plan li + li {
	margin-top: 5px;
}

.agx-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
}

.agx-share span {
	font-size: 12.5px;
	font-weight: 650;
	color: var(--agx-ink-2);
	margin-right: 2px;
}

.agx-share a {
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 650;
	text-decoration: none;
	color: var(--agx-primary-deep);
	background: var(--agx-primary-soft);
	border: 1px solid var(--agx-primary-line);
	border-radius: 8px;
}

.agx-share a:hover {
	background: #ebe5ff;
}

.agx-loading {
	margin: 0;
	padding: 22px 0;
	text-align: center;
	font-size: 12.5px;
	color: var(--agx-ink-3);
}

.agx-foot {
	margin: 20px 0 0;
	padding: 0;
	font-size: 11.5px;
	line-height: 1.6;
	color: var(--agx-ink-3);
}

.agx-board {
	margin-top: 20px;
}

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 1020px) {

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

	/* The nav rail becomes a horizontal strip above the report. */
	.agx-nav {
		position: static;
		display: flex;
		gap: 6px;
		overflow-x: auto;
		padding: 8px;
	}

	.agx-nav-label {
		display: none;
	}

	.agx-nav a {
		white-space: nowrap;
	}

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

@media (max-width: 640px) {

	.agx-app {
		padding: 18px 12px 12px;
	}

	.agx-app::before {
		height: 220px;
	}

	.agx-card,
	.agx-gap {
		padding: 16px;
	}

	.agx-hero {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		text-align: center;
		padding: 18px 16px;
	}

	.agx-stats {
		width: 100%;
		text-align: left;
	}

	.agx-segment {
		display: flex;
		width: 100%;
	}

	.agx-seg {
		flex: 1;
		justify-content: center;
		padding: 9px 8px;
		font-size: 12.5px;
	}

	.agx-map {
		grid-template-columns: repeat(auto-fill, minmax(31px, 1fr));
	}

	.agx-btn {
		width: 100%;
	}
}

/* ------------------------------------------------------------------
 * Dark mode
 * ------------------------------------------------------------------ */

@media (prefers-color-scheme: dark) {

	.agx {
		--agx-primary: #8b6cff;
		--agx-primary-deep: #a58cff;
		--agx-primary-soft: #211d3a;
		--agx-primary-line: #322b55;
		--agx-ring: rgba(139, 108, 255, .3);

		--agx-ink: #edecf7;
		--agx-ink-2: #a6a4bf;
		--agx-ink-3: #7d7b96;

		--agx-surface: #16151f;
		--agx-canvas: #1b1a26;
		--agx-line: #272631;
		--agx-line-2: #201f2a;

		--agx-ok: #43c896;
		--agx-ok-soft: rgba(67, 200, 150, .14);
		--agx-bad: #f2777b;
		--agx-bad-soft: rgba(242, 119, 123, .14);
		--agx-warn: #e0a758;
		--agx-warn-soft: rgba(224, 167, 88, .14);
		--agx-mute: #9694ae;
		--agx-mute-soft: #232231;

		--agx-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 28px -16px rgba(0, 0, 0, .8);
	}

	.agx-app::before {
		background: linear-gradient(180deg, #221d3d 0%, rgba(27, 26, 38, 0) 100%);
	}

	.agx-hero {
		background: linear-gradient(135deg, #201c37, var(--agx-surface) 62%);
	}

	.agx-dial-track {
		stroke: #2c2846;
	}

	.agx-dbar-f {
		background: #2c2846;
	}

	.agx-stat {
		background: rgba(255, 255, 255, .03);
	}

	.agx-switch i {
		background: #33323f;
	}

	.agx-table tbody tr:hover td {
		background: rgba(255, 255, 255, .022);
	}

	.agx-alert.is-error {
		color: #f4a1a3;
		border-color: rgba(242, 119, 123, .3);
	}

	.agx-notice.is-warn,
	.agx-notice.is-warn strong {
		color: #e8bd80;
		border-color: rgba(224, 167, 88, .28);
	}
}

/* ------------------------------------------------------------------
 * Print
 * ------------------------------------------------------------------ */

@media print {

	.agx-nav,
	.agx-intake,
	.agx-tools,
	.agx-share,
	.agx-switches,
	.agx-board {
		display: none !important;
	}

	.agx-app::before {
		display: none;
	}

	.agx {
		font-size: 10.5px;
		color: #000;
	}

	.agx-frame {
		display: block;
	}

	.agx-report {
		margin: 0;
	}

	.agx-hero,
	.agx-tile,
	.agx-tw,
	.agx-fold,
	.agx-dist,
	.agx-map,
	.agx-gap,
	.agx-sec {
		break-inside: avoid;
		box-shadow: none;
	}

	.agx-table {
		min-width: 0;
	}

	/* Expand every collapsed list so the printed report is complete. */
	.agx-fold > *:not(summary) {
		display: block !important;
	}
}

@media (prefers-reduced-motion: reduce) {

	.agx *,
	.agx *::before,
	.agx *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
