/* misconfig.ai app additions
   Everything the hosted product needs that the marketing page did not have:
   the one input, the one map, the one Recheck button, and the five states a
   finding can be in. It only uses tokens and shapes from theme.css, so the
   two files read as one site. Load theme.css first. */

:root {
	/* The map's node kinds. Company is the signal; the rest step down the
	   text scale, so the eye lands on the company and reads outward. */
	--node-company: var(--signal);
	--node-host: #f4f6fc;
	--node-service: #a6acba;
	--node-finding: var(--high);
	--edge: rgba(244, 246, 252, 0.18);
	/* Finding states. New and Returned borrow the severity reds and oranges;
	   Fixed is the signal, since fixed things sit square. */
	--state-new: var(--high);
	--state-still: var(--medium);
	--state-fixed: var(--signal);
	--state-returned: var(--critical);
	--state-inconclusive: var(--text-3);
}

/* --- The one input ---------------------------------------------------------- */
/* The marketing page's command box, turned into a form. Same border, same
   gradient, same shadow, so the input looks like the command everyone
   already knows. */

.scan {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 40em;
	margin-top: 34px;
	padding: 8px 8px 8px 18px;
	border: 1px solid var(--line-2);
	border-radius: 13px;
	background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px -24px rgba(0, 0, 0, 0.8);
	transition: border-color 0.2s;
}
.scan:hover,
.scan:focus-within {
	border-color: var(--line-3);
}
.scan:focus-within {
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 3px rgba(234, 255, 87, 0.14), 0 24px 48px -24px rgba(0, 0, 0, 0.8);
}
.scan .prompt {
	color: var(--signal);
	font: 500 17px/1 var(--mono);
	user-select: none;
}
.scan input {
	flex: 1;
	min-width: 0;
	padding: 10px 0;
	border: 0;
	background: none;
	color: var(--text);
	font: 500 17px/1.4 var(--mono);
	outline: none;
}
.scan input::placeholder {
	color: var(--text-3);
}
.scan-note {
	max-width: 36em;
	margin-top: 14px;
	color: var(--text-3);
	font-size: 14.5px;
}

/* --- The one map ------------------------------------------------------------ */
/* The report demo's window, with the map inside. The dot grid from the hero
   band shows through where there are no nodes yet. */

.map-stage {
	position: relative;
	margin-top: 36px;
	overflow: hidden;
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	background: var(--bg-1);
	box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.map-stage::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(244, 246, 252, 0.09) 1px, transparent 1.2px);
	background-size: 22px 22px;
	-webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 85%);
	mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 85%);
	pointer-events: none;
}
.map-bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 54px;
	padding: 8px 16px;
	border-bottom: 1px solid var(--line);
	background: var(--bg-2);
}
.map-bar .map-title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 620;
	font-size: 15px;
}
.map-bar .map-title {
	flex: 0 0 auto;
	min-width: 0;
}
.map-bar .map-title #scan-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* The status reads as one line; a long message is cut with an ellipsis and
   kept whole in the title and in the progress card. */
.map-bar .map-meta {
	flex: 1 1 10em;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-3);
	font: 13px var(--mono);
	line-height: 1.4;
}
.map-bar .map-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}
.map-bar .map-actions .recheck-when {
	margin-right: 6px;
}
/* Ownership proof: shown under the bar while the target is unverified. */
.verify-panel {
	display: grid;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--line);
	background: var(--bg-1);
	font-size: 14px;
	color: var(--text-2);
}
.verify-panel[hidden] {
	display: none;
}
.verify-panel p {
	margin: 0;
}
.verify-panel b {
	color: var(--text);
}
.verify-proofs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 30em), 1fr));
	gap: 10px 24px;
	margin: 0;
}
.verify-proofs div {
	display: grid;
	gap: 4px;
	align-content: start;
}
.verify-proofs dt {
	color: var(--text-3);
	font: 12px var(--mono);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.verify-proofs dd {
	margin: 0;
	line-height: 1.9;
}
.verify-proofs .verify-join {
	color: var(--text-3);
	font-size: 13px;
}
/* Each value is one chip. A chip moves to its own line before it breaks, and
   only breaks inside when it is wider than the panel. */
.verify-proofs code {
	display: inline-block;
	max-width: 100%;
	padding: 1px 7px;
	border: 1px solid var(--line-2);
	border-radius: 6px;
	background: var(--bg-2);
	color: var(--text);
	font: 13px var(--mono);
	line-height: 1.6;
	vertical-align: baseline;
	overflow-wrap: anywhere;
	user-select: all;
}
.verify-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
/* The other two routes are folded shut; one line each until opened. */
.verify-more {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 22em), 1fr));
	gap: 0 24px;
	border-top: 1px dashed var(--line);
}
.verify-program {
	min-width: 0;
	padding-top: 8px;
}
.verify-program > summary {
	position: relative;
	display: block;
	padding: 4px 0 4px 16px;
	color: var(--text-3);
	font-size: 13px;
	line-height: 1.5;
	list-style: none;
	cursor: pointer;
}
.verify-program > summary::-webkit-details-marker {
	display: none;
}
.verify-program > summary::before {
	content: "";
	position: absolute;
	left: 1px;
	top: 10px;
	width: 6px;
	height: 6px;
	border-right: 1.4px solid var(--text-3);
	border-bottom: 1.4px solid var(--text-3);
	transform: rotate(-45deg);
	transition: transform 0.2s;
}
.verify-program[open] > summary::before {
	top: 8px;
	transform: rotate(45deg);
}
.verify-program > summary:hover,
.verify-program > summary:focus-visible {
	color: var(--text);
	outline: none;
}
.verify-program > summary:focus-visible b {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.verify-program form {
	display: grid;
	gap: 8px;
	padding: 6px 0 10px 16px;
}
.verify-program label {
	color: var(--text-3);
	font-size: 13px;
}
.verify-program label b {
	color: var(--text);
}
.verify-program label a {
	color: var(--text);
	text-underline-offset: 2px;
}
.verify-program input {
	flex: 1 1 18em;
	min-width: 0;
	padding: 7px 10px;
	border: 1px solid var(--line-2);
	border-radius: 8px;
	background: var(--bg-2);
	color: var(--text);
	font: 13px var(--mono);
}
.verify-message {
	color: var(--text-3);
	font: 13px var(--mono);
}
.verify-message[role="alert"] {
	color: var(--text);
}

/* Export menu: the header's details/summary menu, anchored to its button. */
.export-menu {
	position: relative;
}
.export-menu > summary {
	display: inline-flex;
	list-style: none;
	cursor: pointer;
}
.export-menu[hidden] {
	display: none;
}
.export-menu > summary::-webkit-details-marker {
	display: none;
}
.export-menu .export-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 5;
	display: grid;
	gap: 2px;
	min-width: 12em;
	padding: 6px;
	border: 1px solid var(--line-2);
	border-radius: 10px;
	background: var(--bg-1);
	box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.8);
}
.export-menu .export-panel a {
	display: block;
	padding: 8px 10px;
	border-radius: 7px;
	color: var(--text);
	font-size: 14px;
	text-decoration: none;
}
.export-menu .export-panel a:hover,
.export-menu .export-panel a:focus-visible {
	background: var(--bg-2);
	color: var(--signal);
}
.map-canvas {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 360px;
}
.map-stage.is-grouped .map-canvas {
	aspect-ratio: 4 / 3;
}
.map-canvas canvas,
.map-canvas svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* The legend sits inside the window, bottom left, like the chips on the hero. */
.map-legend {
	position: absolute;
	left: 16px;
	bottom: 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 9px 13px;
	border: 1px solid var(--line-2);
	border-radius: 11px;
	background: rgba(21, 24, 29, 0.86);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--text-2);
	font-size: 13px;
	list-style: none;
}
.map-legend li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.node-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--node, var(--text-3));
}
.node-company { --node: var(--node-company); }
.node-host { --node: var(--node-host); }
.node-service { --node: var(--node-service); }
.node-finding {
	--node: var(--node-finding);
	border-radius: 2px;
	transform: rotate(var(--tilt-brand));
}

/* Findings on the map sit askew, the brand's tilt, until they are fixed. */
.map-node-finding {
	transform-box: fill-box;
	transform-origin: center;
	transform: rotate(var(--tilt-brand));
	transition: transform 0.6s var(--ease);
}
.map-node-finding.is-fixed {
	transform: rotate(0deg);
}

/* --- The one button --------------------------------------------------------- */
/* Recheck is the page's only primary action, so it is the signal button. While
   a recheck runs, the brand dot inside it pulses like the live dot. */

.recheck {
	position: relative;
}
.recheck .recheck-mark {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 2px;
	background: var(--on-signal);
	transform: rotate(var(--tilt-brand));
	transition: transform 0.6s var(--ease);
}
.recheck[aria-busy="true"] .recheck-mark {
	transform: rotate(0deg);
	animation: recheck-pulse 1.2s ease-in-out infinite;
}
.recheck[aria-busy="true"] {
	cursor: progress;
}
@keyframes recheck-pulse {
	50% {
		opacity: 0.35;
	}
}
.recheck-when {
	color: var(--text-3);
	font: 13px var(--mono);
	white-space: nowrap;
}

/* --- Finding states --------------------------------------------------------- */
/* New, Still exposed, Fixed, Returned, Inconclusive. A small square, tilted
   while the finding is open and square once it is fixed. */

.state {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 10px 4px 8px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	color: var(--text-2);
	font: 500 12.5px/1.2 var(--mono);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}
.state::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--st, var(--text-3));
	transform: rotate(var(--tilt-brand));
}
.state-new { --st: var(--state-new); }
.state-still { --st: var(--state-still); }
.state-returned { --st: var(--state-returned); }
.state-inconclusive { --st: var(--state-inconclusive); }
.state-fixed {
	--st: var(--state-fixed);
	border-color: rgba(234, 255, 87, 0.35);
	color: var(--text);
}
.state-fixed::before {
	transform: rotate(0deg);
}

/* A finding row in the app: the report's .finding, with the state on the right. */
.finding summary .state {
	align-self: center;
}

/* --- Workspace chrome ------------------------------------------------------- */
/* The header gains a workspace switcher and an account button; both reuse the
   pill and the small button, so nothing new is drawn. */

.workspace {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 6px 12px 6px 10px;
	border: 1px solid var(--line-2);
	border-radius: 10px;
	background: rgba(244, 246, 252, 0.03);
	color: var(--text);
	font: 520 14px/1.2 var(--sans);
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.15s, background-color 0.15s;
}
.workspace:hover {
	border-color: var(--line-3);
	background: var(--bg-2);
}
.workspace .pill-mark {
	width: 9px;
	height: 9px;
}
.avatar {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--line-2);
	border-radius: 50%;
	background: var(--bg-2);
	color: var(--text);
	font: 620 13px var(--sans);
	text-decoration: none;
}

/* --- Auth and account pages ------------------------------------------------- */
/* Sign in, passkeys, two-factor and workspace settings share one card. */

.auth {
	max-width: 26em;
	margin: 0 auto;
	padding-top: 88px;
	padding-bottom: 40px;
}
.auth .square {
	width: 48px;
}
.auth h1 {
	margin-top: 28px;
	font-size: clamp(30px, 4vw, 40px);
	letter-spacing: -0.035em;
	line-height: 1.06;
}
.auth > p {
	margin-top: 14px;
	color: var(--text-2);
}
.card {
	margin-top: 28px;
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-1);
}
.field {
	display: grid;
	gap: 6px;
}
.field + .field {
	margin-top: 16px;
}
.field label {
	color: var(--text-2);
	font-size: 14px;
	font-weight: 560;
}
.input {
	width: 100%;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line-2);
	border-radius: 10px;
	background: var(--bg);
	color: var(--text);
	font: 400 15.5px/1.4 var(--sans);
	transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
	border-color: var(--line-3);
	outline: none;
	box-shadow: 0 0 0 3px rgba(234, 255, 87, 0.14);
}
.input::placeholder {
	color: var(--text-3);
}
.button-ghost {
	border-color: var(--line-2);
	background: transparent;
	color: var(--text);
	box-shadow: none;
}
.button-ghost:hover {
	border-color: var(--line-3);
	background: var(--bg-2);
}
.button-block {
	width: 100%;
}
.or {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 18px 0;
	color: var(--text-3);
	font: 500 12px/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.or::before,
.or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.turnstile {
	margin-top: 14px;
}
.turnstile:empty {
	display: none;
}

/* --- Plans ------------------------------------------------------------------ */

.plans {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin-top: 48px;
}
.plan {
	display: flex;
	flex-direction: column;
	padding: 26px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-1);
}
.plan.is-featured {
	position: relative;
	border-color: var(--line-2);
	background: linear-gradient(180deg, rgba(234, 255, 87, 0.045), transparent 140px), var(--bg-1);
}
.plan.is-featured::before {
	content: "";
	position: absolute;
	left: 28px;
	right: 28px;
	top: -1px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(234, 255, 87, 0.7), transparent);
}
.plan h3 {
	font-size: 19px;
	letter-spacing: -0.02em;
}
.plan .price {
	margin-top: 14px;
	font: 680 40px/1 var(--sans);
	letter-spacing: -0.035em;
	font-variant-numeric: tabular-nums;
}
.plan .price small {
	color: var(--text-3);
	font: 400 15px var(--sans);
	letter-spacing: 0;
}
.plan ul {
	display: grid;
	gap: 0;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}
.plan li {
	display: flex;
	gap: 10px;
	align-items: baseline;
	padding: 10px 0;
	border-top: 1px solid var(--line);
	color: var(--text-2);
	font-size: 15px;
}
.plan li::before {
	content: "";
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-radius: 1.5px;
	background: var(--signal);
	transform: rotate(var(--tilt-brand));
}
.plan .button {
	margin-top: auto;
	padding-top: 0;
}
.plan ul + .button {
	margin-top: 24px;
}

/* --- Smaller screens -------------------------------------------------------- */

@media (max-width: 900px) {
	.plans {
		grid-template-columns: 1fr;
	}
}
@media (max-width: 720px) {
	.scan {
		flex-wrap: wrap;
		padding: 8px;
	}
	.scan .prompt {
		padding-left: 10px;
	}
	.scan input {
		font-size: 15px;
	}
	.scan .button {
		width: 100%;
	}
	.map-canvas {
		aspect-ratio: 4 / 5;
	}
	.verify-proofs code {
		padding-inline: 5px;
		font-size: 12px;
	}
	.map-legend {
		left: 10px;
		right: 10px;
		bottom: 10px;
	}
	.map-bar .map-meta,
	.recheck-when {
		display: none;
	}
	/* The workspace name moves into the menu on phones. */
	.header-actions .workspace {
		display: none;
	}
}

/* --- The app page ----------------------------------------------------------- */
/* What index.html and app.js add on top of the pieces above: the live
   counters, the detail panel beside the map, the snapshot timeline, the
   upgrade strip, and the sign-in sheet. Still only tokens from theme.css. */

/* theme.css sets display on .pill and .live-dot after its [hidden] rule, so
   restate hidden for the elements app.js toggles. */
[hidden] {
	display: none !important;
}
.access-pill {
	white-space: nowrap;
}
.scan-note[role="alert"] {
	color: var(--high);
}
.scan input[aria-invalid="true"] {
	color: var(--high);
}

/* Public inventory page (/p/:domain): what the owner chose to publish. */
.public-summary {
	display: grid;
	gap: 10px;
	margin: 0 0 18px;
	padding: 18px 20px;
}
.public-summary p {
	margin: 0;
}
.public-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--text);
	font: 500 13px/1.3 var(--mono);
}
.public-copy {
	color: var(--text-2);
	font-size: 15px;
	line-height: 1.55;
}
.public-copy b {
	color: var(--text);
}
.public-sev {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	font: 13px var(--mono);
	color: var(--text-2);
}
.public-sev[hidden] {
	display: none;
}
.public-sev li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.public-sev b {
	color: var(--text);
	font-weight: 600;
}
.public-note {
	color: var(--text-3);
	font-size: 13px;
}
.publish-panel .verify-message {
	color: var(--text-3);
}

/* Five counters instead of the marketing page's four. */
.stats-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}
.stats-5.stats-public {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stats dd.is-exposed {
	color: var(--high);
}
.stats dd.is-fixed {
	color: var(--signal);
}

/* The map with the detail panel beside it. */
.map-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 20px;
	align-items: start;
	margin-top: 36px;
}
.map-grid .map-stage {
	margin-top: 0;
}
.map-canvas canvas {
	cursor: default;
}
.map-empty {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	text-align: center;
	color: var(--text-3);
	font-size: 14.5px;
	pointer-events: none;
}
.map-empty p {
	max-width: 28em;
}
.map-empty b {
	display: block;
	margin-bottom: 6px;
	color: var(--text-2);
	font-weight: 580;
}
.map-meta .live-dot {
	margin-right: 8px;
}
.node-untested {
	--node: transparent;
	border: 1.5px dashed var(--text-3);
}
.node-fixed {
	--node: var(--state-fixed);
	border-radius: 2px;
}

/* Snapshots: one dot per run, the current one filled. */
.timeline {
	position: absolute;
	right: 16px;
	top: 14px;
	display: flex;
	gap: 6px;
}
.timeline:empty {
	display: none;
}
.timeline button {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 1px solid var(--line-3);
	border-radius: 50%;
	background: transparent;
	cursor: help;
}
.timeline button[aria-pressed="true"] {
	border-color: var(--signal);
	background: var(--signal);
}

/* The detail panel. */
.detail {
	position: sticky;
	top: 84px;
	min-width: 0;
	min-height: 360px;
	margin-top: 0;
}
.detail-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	color: var(--text-3);
	font: 13px var(--mono);
}
.detail-top .eyebrow {
	margin: 0;
}
.detail h2 {
	margin-top: 14px;
	font-size: 22px;
	line-height: 1.25;
	letter-spacing: -0.025em;
	overflow-wrap: anywhere;
}
.detail h2 .mono {
	font-size: 15px;
	color: var(--text-3);
}
.detail-label {
	margin-top: 22px;
	color: var(--text-3);
	font: 500 12px/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.detail-label + * {
	margin-top: 10px;
}
.copy {
	color: var(--text-2);
	font-size: 14.5px;
	line-height: 1.6;
}
.copy ol {
	margin: 6px 0 0;
	padding-left: 20px;
}
.copy li + li {
	margin-top: 4px;
}
.mono {
	color: var(--text-3);
	font: 13px/1.5 var(--mono);
	overflow-wrap: anywhere;
}
.node-list {
	display: grid;
	gap: 8px;
}
.node {
	display: grid;
	gap: 6px;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--bg-2);
	color: var(--text);
	font: inherit;
	text-align: left;
	transition: border-color 0.15s, background-color 0.15s;
}
button.node {
	cursor: pointer;
}
button.node:hover {
	border-color: var(--line-3);
	background: var(--bg-3);
}
.node-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--text-3);
	font: 12.5px var(--mono);
}
.node-title {
	font-size: 14.5px;
	font-weight: 580;
	line-height: 1.35;
	overflow-wrap: anywhere;
}
.evidence-box {
	margin-top: 22px;
}
.evidence-box summary {
	cursor: pointer;
	color: var(--text-2);
	font-size: 14px;
	font-weight: 560;
}
.evidence-box summary:hover {
	color: var(--text);
}
.evidence-box .evidence {
	margin-top: 10px;
	max-height: 360px;
	overflow: auto;
}
.evidence-shot {
	margin: 10px 0 0;
}
.evidence-shot[hidden] {
	display: none;
}
.evidence-shot img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--line-2);
	border-radius: 8px;
	background: var(--bg-2);
}
.evidence-shot figcaption {
	margin-top: 6px;
	color: var(--text-3);
	font: 12px var(--mono);
}

/* The upgrade strip under the map, shown once hosts go untested. */
.upgrade {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px 32px;
	margin-top: 20px;
	padding: 22px 26px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	background: linear-gradient(180deg, rgba(234, 255, 87, 0.045), transparent 140px), var(--bg-1);
}
.upgrade h3 {
	font-size: 18px;
	letter-spacing: -0.02em;
}
.upgrade p {
	max-width: 44em;
	margin-top: 6px;
	color: var(--text-2);
	font-size: 14.5px;
}
.upgrade-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* The sign-in sheet app.js opens over the page. */
.sheet-backdrop {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(10, 11, 13, 0.72);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	animation: sheet-in 0.2s var(--ease);
}
.sheet {
	width: 100%;
	max-width: 26em;
	max-height: calc(100vh - 40px);
	margin: 0;
	overflow: auto;
	box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.sheet {
	position: relative;
}
.sheet-close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line-2);
	border-radius: 10px;
	background: none;
	color: var(--text-2);
	font: 400 22px/1 var(--sans);
	cursor: pointer;
}
.sheet-close:hover,
.sheet-close:focus-visible {
	color: var(--text);
	border-color: var(--line-3);
}
body.has-sheet {
	overflow: hidden;
}
.map-canvas canvas:focus-visible {
	outline: 2px solid var(--signal);
	outline-offset: -2px;
}
.map-help {
	position: absolute;
	left: 12px;
	bottom: 12px;
	max-width: 24em;
	margin: 0;
	padding: 6px 10px;
	border-radius: 8px;
	background: rgba(10, 11, 13, 0.8);
	color: var(--text-3);
	font-size: 12.5px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
}
.map-canvas canvas:focus-visible ~ .map-help {
	opacity: 1;
}
.detail:focus {
	outline: none;
}
.detail:focus-visible {
	outline: 2px solid var(--signal);
	outline-offset: 2px;
}
.sheet h2 {
	font-size: 26px;
	letter-spacing: -0.03em;
	line-height: 1.1;
}
.sheet > p {
	margin-top: 10px;
	color: var(--text-2);
	font-size: 15px;
}
.stack {
	display: grid;
	gap: 10px;
	margin-top: 22px;
}
.stack .or {
	margin: 8px 0;
}
.message {
	min-height: 1.4em;
	color: var(--text-3);
	font-size: 13.5px;
	line-height: 1.5;
}
.message[role="alert"] {
	color: var(--high);
}
.message:empty {
	display: none;
}
.sheet .note {
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--bg-2);
	color: var(--text-2);
	font-size: 13.5px;
}
@keyframes sheet-in {
	from {
		opacity: 0;
	}
}

@media (max-width: 1000px) {
	.map-grid {
		grid-template-columns: 1fr;
	}
	.detail {
		position: static;
		min-height: 0;
	}
	.stats-5 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.stats-5 div:nth-child(3) {
		border-top: 0;
		border-left: 1px solid var(--line);
	}
	.stats-5 div:nth-child(4) {
		border-left: 0;
	}
	.stats-5 div:nth-child(n + 4) {
		border-top: 1px solid var(--line);
	}
}
@media (max-width: 720px) {
	.header-actions .access-pill {
		display: none;
	}
	.stats-5 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.stats-5 div:nth-child(3) {
		border-left: 0;
	}
	.stats-5 div:nth-child(4) {
		border-left: 1px solid var(--line);
	}
	.stats-5 div:nth-child(5) {
		border-left: 0;
	}
	.stats-5 div:nth-child(n + 3) {
		border-top: 1px solid var(--line);
	}
	.timeline {
		display: none;
	}
	.map-actions .public-link {
		display: none;
	}
}

/* The sign-in button stays in the header on phones; theme.css hides the
   marketing page's small header button there. */
@media (max-width: 900px) {
	.header-actions .button-small.auth-button {
		display: inline-flex;
	}
	.auth-label {
		display: block;
		max-width: calc(100vw - 290px);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}


/* --- Live progress, host groups, host table, estimate ----------------------- */
/* Added for large scans: a progress card above the map (phase stepper, bar,
   current work line, allowance line, latest events), a note when the map
   groups hosts, the host table under the map, and the estimate under the
   input. Tokens from theme.css only. */

.estimate {
	margin-top: 14px;
	padding: 14px 16px;
	border: 1px solid var(--line-2);
	border-radius: 12px;
	background: var(--bg-1);
	color: var(--text-2);
	font-size: 14px;
	line-height: 1.5;
}
.estimate.is-warning {
	border-color: rgba(232, 99, 10, 0.45);
	background: linear-gradient(180deg, rgba(232, 99, 10, 0.07), transparent 120px), var(--bg-1);
}
.estimate.is-warning .estimate-copy {
	color: var(--text);
}
.estimate-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.estimate-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.estimate-chips button {
	padding: 6px 12px;
	border: 1px solid var(--line-3);
	border-radius: 999px;
	background: var(--bg-2);
	color: var(--text);
	font: 500 14px/1.2 var(--mono);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.estimate-chips button:hover,
.estimate-chips button:focus-visible {
	border-color: var(--signal);
	background: var(--bg-3);
	outline: none;
}
.estimate-chips button small {
	margin-left: 6px;
	color: var(--text-3);
	font: 400 12px/1 var(--sans);
}

.progress {
	margin-top: 28px;
	padding: 20px 24px;
}
.phases {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 0;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: phase;
}
.phases li {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding-right: 22px;
	color: var(--text-3);
	font: 500 13px var(--mono);
	letter-spacing: 0.01em;
}
.phases li::before {
	content: "";
	width: 8px;
	height: 8px;
	border: 1.5px solid var(--line-3);
	border-radius: 50%;
	transition: background-color 0.2s, border-color 0.2s;
}
.phases li.is-done {
	color: var(--text-2);
}
.phases li.is-done::before {
	border-color: var(--signal);
	background: var(--signal);
}
.phases li.is-active {
	color: var(--text);
}
.phases li.is-active::before {
	border-color: var(--signal);
	box-shadow: 0 0 0 3px rgba(234, 255, 87, 0.18);
	animation: phase-pulse 1.6s ease-in-out infinite;
}
@keyframes phase-pulse {
	50% { box-shadow: 0 0 0 5px rgba(234, 255, 87, 0.08); }
}
.progress-bar {
	position: relative;
	height: 6px;
	margin-top: 16px;
	border-radius: 3px;
	background: var(--bg-3);
	overflow: hidden;
}
.progress-bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: var(--signal);
	transition: width 0.6s var(--ease);
}
.progress-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 24px;
	margin-top: 14px;
}
.progress-now {
	color: var(--text);
	font-size: 15px;
	line-height: 1.45;
	overflow-wrap: anywhere;
}
.progress-eta {
	flex-shrink: 0;
	color: var(--text-3);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}
.progress-allowance {
	margin-top: 8px;
	color: var(--text-2);
	font-size: 14px;
	line-height: 1.5;
}
.feed {
	display: grid;
	gap: 6px;
	margin: 14px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--line);
	list-style: none;
}
.feed:empty {
	display: none;
}
.feed li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	animation: rise 0.35s var(--ease) both;
}
.feed-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--text);
	font: inherit;
	font-weight: 560;
	text-align: left;
	cursor: pointer;
}
.feed-link:hover {
	color: var(--signal);
}
.feed-host {
	color: var(--text-3);
	font-size: 12.5px;
}
.feed-note {
	color: var(--text-2);
}

.map-mode {
	position: absolute;
	left: 16px;
	top: 14px;
	max-width: 36em;
	color: var(--text-3);
	font-size: 12.5px;
	line-height: 1.45;
	pointer-events: none;
}
.node-group {
	--node: rgba(166, 172, 186, 0.3);
	border: 1.2px solid rgba(166, 172, 186, 0.7);
}
.group-list .node-title.mono {
	font-size: 13px;
	font-weight: 500;
}
#cancel-button.is-armed {
	border-color: var(--high);
	color: var(--high);
}

.hosts {
	margin-top: 20px;
	padding: 20px 24px;
}
.hosts-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
}
.hosts-head h3 {
	font-size: 18px;
	letter-spacing: -0.02em;
}
.hosts-count {
	margin-left: 8px;
	color: var(--text-3);
	font-size: 14px;
	font-weight: 500;
}
.hosts-filter {
	width: min(100%, 320px);
}
.hosts-scroll {
	margin-top: 14px;
	max-height: 480px;
	overflow: auto;
	scrollbar-gutter: stable;
	border: 1px solid var(--line);
	border-radius: 12px;
}
.hosts-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.hosts-table th {
	position: sticky;
	top: 0;
	padding: 10px 14px;
	border-bottom: 1px solid var(--line-2);
	background: var(--bg-2);
	color: var(--text-3);
	font-size: 12.5px;
	font-weight: 500;
	text-align: left;
	letter-spacing: 0.02em;
}
.hosts-table td {
	padding: 9px 14px;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
	overflow-wrap: anywhere;
}
.hosts-table td.mono {
	font-size: 13px;
}
/* The host column takes the room; a long name is cut, the title has it all.
   Counts line up on the right. */
.hosts-table .host-name {
	width: 100%;
	max-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hosts-table th:nth-child(2),
.hosts-table td:nth-child(2) {
	width: 9em;
}
.hosts-table th:nth-child(3),
.hosts-table td:nth-child(3) {
	width: 14em;
	max-width: 14em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hosts-table th:nth-child(4),
.hosts-table td:nth-child(4) {
	width: 6em;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.hosts-table tbody tr {
	cursor: pointer;
	transition: background-color 0.15s;
}
.hosts-table tbody tr:hover,
.hosts-table tbody tr:focus-visible {
	background: var(--bg-2);
	outline: none;
}
.hosts-table tbody tr[aria-selected="true"] {
	background: rgba(234, 255, 87, 0.06);
}
.hosts-table .dim {
	color: var(--text-3);
}
.hosts-table .is-exposed {
	color: var(--high);
	font-weight: 600;
}
.host-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--text-2);
	font: 12.5px var(--mono);
	white-space: nowrap;
}
.host-status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	border: 1.2px solid var(--text-2);
}
.host-scanned::before { background: var(--signal); border-color: var(--signal); }
.host-live::before { background: var(--text-2); }
.host-untested::before { border-style: dashed; border-color: var(--text-3); }
.host-dead::before { border-color: rgba(133, 139, 153, 0.5); }
.host-discovered::before { border-color: var(--text-3); }
.hosts > .button {
	margin-top: 12px;
}

@media (max-width: 720px) {
	.progress,
	.hosts {
		padding: 16px 18px;
	}
	.phases li {
		padding-right: 14px;
		font-size: 12px;
	}
	.map-mode {
		display: none;
	}
	.hosts-table th:nth-child(3),
	.hosts-table td:nth-child(3) {
		display: none;
	}
}

/* --- Motion ----------------------------------------------------------------- */
/* The marketing page's feel: things rise into place and settle. The hero copy
   rises once on load, the workspace rises when the first scan starts, the
   counters tick, and the detail panel swaps with a short rise. The theme's
   prefers-reduced-motion rule turns all of it off. */

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}
@keyframes tick {
	30% {
		transform: translateY(-3px);
		color: var(--signal);
	}
}
.hero-intro > * {
	animation: rise 0.7s var(--ease) both;
}
.hero-intro > :nth-child(2) { animation-delay: 0.06s; }
.hero-intro > :nth-child(3) { animation-delay: 0.12s; }
.hero-intro > :nth-child(4) { animation-delay: 0.18s; }
.hero-intro > :nth-child(5) { animation-delay: 0.24s; }
.hero-visual canvas {
	animation: rise 0.9s var(--ease) both;
}

/* Runs each time the section goes from hidden to shown. */
.workspace-section > * {
	animation: rise 0.6s var(--ease) both;
}
.workspace-section > :nth-child(2) { animation-delay: 0.05s; }
.workspace-section > :nth-child(3) { animation-delay: 0.1s; }
.workspace-section > .map-grid { animation-delay: 0.15s; }
.workspace-section > .upgrade { animation: rise 0.5s var(--ease) both; }
.map-grid > .detail {
	animation: rise 0.6s var(--ease) 0.25s both;
}
.stats dd {
	display: inline-block;
}
.stats dd.is-ticking {
	animation: tick 0.5s var(--ease);
}
.detail.is-fresh > * {
	animation: rise 0.4s var(--ease) both;
}
.detail.is-fresh > :nth-child(2) { animation-delay: 0.04s; }
.detail.is-fresh > :nth-child(3) { animation-delay: 0.08s; }
.detail.is-fresh > :nth-child(n + 4) { animation-delay: 0.12s; }
.map-stage {
	transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}
.map-stage:hover {
	border-color: var(--line-3);
}
.timeline button {
	transition: transform 0.2s var(--ease), background-color 0.15s, border-color 0.15s;
}
.timeline button:hover {
	transform: scale(1.3);
	border-color: var(--signal);
}

/* ---- scope attestation ---- */
.attest {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 12px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--text-2);
}
.attest input {
	margin: 3px 0 0;
	width: 14px;
	height: 14px;
	flex: none;
	accent-color: var(--signal);
}
.attest a {
	color: inherit;
}

/* --- Settings page ---------------------------------------------------------- */
.settings-page {
	padding: 48px 0 80px;
	max-width: 56em;
}
.settings-title {
	margin-top: 10px;
	font-size: clamp(30px, 4vw, 44px);
	letter-spacing: -0.035em;
	line-height: 1.06;
}
.settings-page > .message {
	margin-top: 18px;
}
.settings-section {
	margin-top: 52px;
	padding-top: 36px;
	border-top: 1px solid var(--line);
}
.settings-section:first-of-type {
	border-top: 0;
	padding-top: 0;
}
.settings-head h2 {
	font-size: 24px;
	letter-spacing: -0.02em;
}
.settings-head .copy {
	margin-top: 8px;
	color: var(--text-2);
	max-width: 44em;
}
.settings-head code,
.settings-table code,
.key-row code {
	font: 13.5px var(--mono);
	color: var(--text);
}
.settings-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 22px;
}
.settings-page .scan-note {
	margin-top: 14px;
}
.settings-table {
	margin-top: 22px;
}
.settings-table[hidden] {
	display: none;
}
.settings-table .row-actions {
	text-align: right;
	white-space: nowrap;
}
.settings-empty {
	margin-top: 22px;
	color: var(--text-3);
}
.settings-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 12px;
	margin-top: 22px;
}
.settings-inline .field {
	flex: 1 1 16em;
}
.key-reveal {
	margin-top: 22px;
	border-color: var(--line-3);
}
.key-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
}
.key-row code {
	flex: 1 1 20em;
	padding: 10px 12px;
	border: 1px solid var(--line-2);
	border-radius: 8px;
	background: var(--bg);
	overflow-wrap: anywhere;
	user-select: all;
}
.pill-inline {
	margin-left: 8px;
	padding: 2px 8px;
	font-size: 12px;
	vertical-align: middle;
}
.danger {
	margin-top: 28px;
	border-color: rgba(215, 38, 61, 0.45);
}
.danger h3 {
	font-size: 18px;
}
.danger .copy {
	margin-top: 8px;
	color: var(--text-2);
}
.button-danger {
	background: var(--critical);
	color: #fff;
	border-color: transparent;
}
.button-danger:hover {
	background: #b81f33;
	color: #fff;
}
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Tap targets: footer links and legend rows reach 44px on phones. */
@media (max-width: 900px) {
	.footer-cols a {
		display: block;
		padding: 10px 0;
	}
	.map-legend li {
		min-height: 32px;
	}
}

/* Notification settings form */
.notify-form {
	display: grid;
	gap: 14px;
	margin-top: 22px;
	max-width: 44em;
}
.notify-form .attest {
	margin-top: 0;
}
.notify-form .scan-note {
	margin-top: 0;
}
.notify-form .scan-note:empty {
	display: none;
}

/* --- Operator area (admin.html) --------------------------------------------- */

.admin-page {
	max-width: 72em;
}
.admin-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin-top: 32px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}
.admin-tabs a {
	color: var(--text-2);
	text-decoration: none;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
	transition: color 0.15s, border-color 0.15s;
}
.admin-tabs a:hover,
.admin-tabs a[aria-current="page"] {
	color: var(--text);
	border-bottom-color: var(--signal);
}
.admin-section {
	margin-top: 36px;
	padding-top: 0;
	border-top: 0;
}
.admin-table {
	font-size: 14px;
}
.admin-table td {
	vertical-align: top;
}
.admin-table tbody tr[data-user],
.admin-table tbody tr[data-workspace] {
	cursor: pointer;
}
.admin-table tbody tr[data-user]:hover,
.admin-table tbody tr[data-workspace]:hover,
.admin-table tbody tr[aria-selected="true"] {
	background: rgba(244, 246, 252, 0.04);
}
.admin-table .mono {
	font-size: 13px;
}
.admin-table .wrap-text {
	max-width: 28em;
	overflow-wrap: anywhere;
}
.admin-detail {
	margin-top: 28px;
}
.admin-detail h3 {
	font-size: 20px;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}
.admin-detail .admin-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16em, 1fr));
	gap: 24px;
	margin-top: 20px;
}
.admin-detail dl.kv {
	margin: 0;
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 14px;
	font-size: 14px;
}
.admin-detail dl.kv dt {
	color: var(--text-2);
}
.admin-detail dl.kv dd {
	margin: 0;
	overflow-wrap: anywhere;
}
.admin-detail form .field select {
	width: 100%;
}
.admin-detail .settings-inline {
	align-items: flex-end;
}
.admin-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-top: 16px;
}
.admin-form-row .field {
	flex: 1 1 10em;
	min-width: 0;
}
.admin-filters .button[aria-pressed="true"] {
	border-color: var(--signal);
	color: var(--text);
}
.admin-invite .attest {
	align-self: center;
}
.step-up {
	margin-top: 24px;
	border-color: rgba(234, 255, 87, 0.5);
}
.step-up .copy {
	margin-top: 8px;
	color: var(--text-2);
}
.status-ok {
	color: var(--state-fixed);
}
.status-warn {
	color: var(--state-still);
}
.status-bad {
	color: var(--state-returned);
}
.audit-change {
	font: 12.5px var(--mono);
	color: var(--text-2);
	white-space: pre-wrap;
	max-width: 32em;
	overflow-wrap: anywhere;
}
select.input {
	appearance: auto;
}
