/*
	Styles for the dashboard domain pages (happs.vip).

	The design system comes first: colours, type, spacing, radius, shadows and
	motion, as custom properties. Every rule below uses these tokens, so the
	look can be adjusted in one place. Light colours are the default; dark
	colours replace them when the visitor's system prefers a dark theme.

	The signature "glow" (tangerine to hot pink) is used sparingly: the landing
	hero, the main call-to-action, the drop zone while dragging, step numbers,
	the progress bar and the logo. Text on the glow is always dark ink.

	Sections: design system, base, layout (header, footer), buttons and forms,
	badges and messages, landing page, dashboard (usage, upload, success,
	site cards), other pages (confirm, domains, DNS guide, tokens, admin, AI
	instructions, legal), motion preferences.
*/

/* ---------- Design system ---------- */

@font-face {
	font-family: "Bricolage Grotesque";
	src: url("/static/fonts/bricolage-grotesque-latin.woff2") format("woff2");
	font-weight: 500 800;
	font-style: normal;
	font-display: swap;
}

:root {
	color-scheme: light;

	/* Colours: calm, slightly blue-violet neutrals */
	--color-background: #f6f6fb;
	--color-surface: #ffffff;
	--color-surface-sunken: #efeff6;
	--color-text: #14142b;
	--color-muted: #55556f;
	--color-border: #e2e2ee;
	--color-border-strong: #c9c9da;

	/* Accent: links, focus rings and small highlights */
	--color-accent: #c2185b;
	--color-accent-soft: #fde7ef;

	/* The signature glow, and the dark ink used on top of it */
	--glow-start: #ff8a1f;
	--glow-end: #ff3d7f;
	--glow: linear-gradient(120deg, var(--glow-start), var(--glow-end));
	--color-on-glow: #1a0712;

	/* Primary buttons are ink: dark in light mode, light in dark mode */
	--color-primary: #14142b;
	--color-on-primary: #ffffff;

	/* States, separate from the accent */
	--color-good: #17663a;
	--color-good-background: #e3f6ea;
	--color-warning: #8a5200;
	--color-warning-background: #fff1d6;
	--color-danger: #b42318;
	--color-danger-background: #fdecea;
	--color-on-danger: #ffffff;

	/* Type */
	--font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
	--text-small: 0.875rem;
	--text-base: 1rem;
	--text-large: 1.125rem;
	--text-heading-3: 1.2rem;
	--text-heading-2: 1.55rem;
	--text-heading-1: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
	--text-display: clamp(2.5rem, 1.6rem + 4.5vw, 4.4rem);

	/* Spacing scale */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: 4.5rem;

	/* Radius */
	--radius-small: 0.5rem;
	--radius-medium: 0.8rem;
	--radius-large: 1.25rem;
	--radius-pill: 999px;

	/* Shadows */
	--shadow-small: 0 1px 2px rgba(20, 20, 43, 0.06);
	--shadow-medium: 0 1px 2px rgba(20, 20, 43, 0.06), 0 8px 24px rgba(20, 20, 43, 0.08);
	--shadow-glow: 0 8px 24px -8px rgba(255, 61, 127, 0.6);

	/* Motion */
	--duration-fast: 150ms;
	--duration-medium: 300ms;
	--easing: cubic-bezier(0.2, 0.7, 0.2, 1);

	/* Layout */
	--content-width: 68rem;
	--wide-content-width: 96rem;
	--reading-width: 44rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--color-background: #0e0e1a;
		--color-surface: #171728;
		--color-surface-sunken: #12121f;
		--color-text: #ededf7;
		--color-muted: #a8a8c2;
		--color-border: #2b2b42;
		--color-border-strong: #3d3d5a;
		--color-accent: #ff7aa8;
		--color-accent-soft: #3a1527;
		--color-primary: #ededf7;
		--color-on-primary: #0e0e1a;
		--color-good: #8fe0ad;
		--color-good-background: #123322;
		--color-warning: #f5c26b;
		--color-warning-background: #3a2a0c;
		--color-danger: #ff8a80;
		--color-danger-background: #3b1714;
		--color-on-danger: #1a0705;
		--shadow-small: 0 1px 2px rgba(0, 0, 0, 0.4);
		--shadow-medium: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
	}
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

/* Elements hidden by the hidden attribute (for example by upload.js) stay hidden, whatever display a rule gives them */
[hidden] {
	display: none !important;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: 1.6;
	background: var(--color-background);
	color: var(--color-text);
	overflow-wrap: break-word;
}

h1,
h2,
h3 {
	font-family: var(--font-display);
	line-height: 1.15;
	letter-spacing: -0.015em;
	text-wrap: balance;
	margin: 0 0 var(--space-3);
}

h1 {
	font-size: var(--text-heading-1);
	font-weight: 800;
	letter-spacing: -0.03em;
}

h2 {
	font-size: var(--text-heading-2);
	font-weight: 700;
}

h3 {
	font-size: var(--text-heading-3);
	font-weight: 700;
}

p {
	margin: 0 0 var(--space-4);
}

a {
	color: var(--color-accent);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

code {
	font-family: var(--font-mono);
	font-size: 0.92em;
}

:focus-visible {
	outline: 3px solid var(--color-accent);
	outline-offset: 2px;
	border-radius: 0.3rem;
}

::selection {
	background: var(--color-accent-soft);
	color: var(--color-text);
}

/* Read by screen readers, not shown */
.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;
}

.skip-link {
	position: absolute;
	left: var(--space-4);
	top: -10rem;
	z-index: 10;
	padding: var(--space-2) var(--space-4);
	border-radius: var(--radius-small);
	background: var(--color-primary);
	color: var(--color-on-primary);
}

.skip-link:focus {
	top: var(--space-4);
}

main {
	flex: 1;
	width: 100%;
	max-width: var(--content-width);
	margin: 0 auto;
	padding: var(--space-6) var(--space-4) var(--space-7);
}

/* Pages with wide tables, such as the admin page */
main.main-wide {
	max-width: var(--wide-content-width);
}

.hint {
	color: var(--color-muted);
	font-size: var(--text-small);
}

/* ---------- Header ---------- */

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3) var(--space-5);
	padding: var(--space-3) var(--space-4);
	background: color-mix(in srgb, var(--color-surface) 88%, transparent);
	border-bottom: 1px solid var(--color-border);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-family: var(--font-display);
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--color-text);
	text-decoration: none;
}

.brand img {
	width: 32px;
	height: 32px;
	transition: transform var(--duration-medium) var(--easing);
}

.brand:hover img {
	transform: translateY(-2px) rotate(-6deg);
}

.header-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	margin-right: auto;
}

.header-links a {
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-pill);
	color: var(--color-muted);
	font-weight: 600;
	font-size: var(--text-small);
	text-decoration: none;
}

.header-links a:hover {
	color: var(--color-text);
	background: var(--color-surface-sunken);
}

.header-links a[aria-current="page"] {
	color: var(--color-text);
	background: var(--color-surface-sunken);
	box-shadow: inset 0 0 0 1px var(--color-border);
}

.header-form {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	margin: 0;
}

.signed-in-as {
	color: var(--color-muted);
	font-size: var(--text-small);
}

/* Landing page header: only the brand, plus a sign-in link */
.header-sign-in {
	margin-left: auto;
}

/*
	Shown on every page while an administrator is viewing as another user. It
	takes a full row of the header and must be unmistakable: warning stripes,
	a strong border and bold text.
*/
.viewing-as-banner {
	flex-basis: 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
	border: 2px solid var(--color-danger);
	border-radius: var(--radius-medium);
	background:
		repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--color-danger) 10%, transparent) 14px 28px),
		var(--color-danger-background);
	color: var(--color-danger);
	font-weight: 700;
}

.viewing-as-banner > span {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	min-width: 0;
}

.viewing-as-banner svg {
	flex: none;
	width: 1.4rem;
	height: 1.4rem;
}

.viewing-as-banner form {
	margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--space-2) var(--space-5);
	padding: var(--space-5) var(--space-4) var(--space-6);
	border-top: 1px solid var(--color-border);
	font-size: var(--text-small);
	color: var(--color-muted);
}

.site-footer a {
	color: var(--color-muted);
}

.site-footer a:hover {
	color: var(--color-text);
}

.footer-owner {
	flex-basis: 100%;
	text-align: center;
}

/* ---------- Buttons ---------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: 2.6rem;
	padding: var(--space-2) var(--space-4);
	border: 1px solid var(--color-primary);
	border-radius: var(--radius-pill);
	background: var(--color-primary);
	color: var(--color-on-primary);
	font: 600 var(--text-small) / 1.2 var(--font-body);
	text-decoration: none;
	cursor: pointer;
	transition:
		transform var(--duration-fast) var(--easing),
		box-shadow var(--duration-fast) var(--easing),
		background-color var(--duration-fast) var(--easing),
		border-color var(--duration-fast) var(--easing);
}

.button:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-medium);
}

.button:active {
	transform: translateY(0) scale(0.98);
}

.button-secondary {
	background: var(--color-surface);
	border-color: var(--color-border-strong);
	color: var(--color-text);
}

.button-secondary:hover {
	border-color: var(--color-text);
	box-shadow: var(--shadow-small);
}

.button-danger {
	background: var(--color-surface);
	border-color: color-mix(in srgb, var(--color-danger) 45%, transparent);
	color: var(--color-danger);
}

.button-danger:hover {
	border-color: var(--color-danger);
	background: var(--color-danger-background);
	box-shadow: none;
}

/* A destructive confirmation (for example "Delete site") is filled */
.confirm-actions .button-danger {
	background: var(--color-danger);
	border-color: var(--color-danger);
	color: var(--color-on-danger);
}

/* The main call to action, in the signature glow */
.button-glow {
	min-height: 3.1rem;
	padding: var(--space-3) var(--space-5);
	border: 0;
	background: var(--glow);
	color: var(--color-on-glow);
	font-size: var(--text-base);
	font-weight: 700;
	box-shadow: var(--shadow-glow);
}

.button-glow:hover {
	box-shadow: 0 12px 28px -8px rgba(255, 61, 127, 0.75);
}

.button-small {
	min-height: 2.1rem;
	padding: var(--space-1) var(--space-3);
}

.google-mark {
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: #ffffff;
}

.google-mark svg {
	width: 1rem;
	height: 1rem;
}

/* ---------- Forms ---------- */

.settings-form label,
.admin-search label {
	display: block;
	margin-bottom: var(--space-1);
	font-weight: 600;
}

input[type="text"],
input[type="search"],
input[type="number"],
select {
	width: 100%;
	min-height: 2.75rem;
	padding: var(--space-2) var(--space-3);
	font: inherit;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-small);
	transition: border-color var(--duration-fast) var(--easing), box-shadow var(--duration-fast) var(--easing);
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
select:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.settings-form {
	display: grid;
	gap: var(--space-2);
}

.settings-form .hint {
	margin: 0;
}

.confirm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-top: var(--space-3);
}

.admin-search-row {
	display: flex;
	gap: var(--space-2);
}

.admin-search-row input {
	flex: 1;
	min-width: 0;
}

/* ---------- Badges and messages ---------- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.15rem 0.6rem;
	border-radius: var(--radius-pill);
	border: 1px solid var(--color-border);
	color: var(--color-muted);
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.badge::before {
	content: "";
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: currentColor;
}

.badge-good {
	border-color: transparent;
	background: var(--color-good-background);
	color: var(--color-good);
}

.badge-warning {
	border-color: transparent;
	background: var(--color-danger-background);
	color: var(--color-danger);
}

.badge-caution {
	border-color: transparent;
	background: var(--color-warning-background);
	color: var(--color-warning);
}

.badge-locked {
	border-color: transparent;
	background: var(--color-accent-soft);
	color: var(--color-accent);
}

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

.message {
	display: flex;
	gap: var(--space-3);
	align-items: flex-start;
	padding: var(--space-3) var(--space-4);
	border-radius: var(--radius-medium);
	border: 1px solid transparent;
}

.message::before {
	flex: none;
	width: 1.4rem;
	height: 1.4rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font-weight: 800;
	font-size: 0.85rem;
	line-height: 1;
}

.message-error {
	background: var(--color-danger-background);
	border-color: color-mix(in srgb, var(--color-danger) 30%, transparent);
	color: var(--color-danger);
}

.message-error::before {
	content: "!";
	background: var(--color-danger);
	color: var(--color-on-danger);
}

.message-success {
	background: var(--color-good-background);
	border-color: color-mix(in srgb, var(--color-good) 25%, transparent);
	color: var(--color-good);
}

.message-success::before {
	content: "\2713";
	background: var(--color-good);
	color: var(--color-good-background);
}

.message-warning {
	background: var(--color-warning-background);
	border-color: color-mix(in srgb, var(--color-warning) 30%, transparent);
	color: var(--color-warning);
}

.message-warning::before {
	content: "!";
	background: var(--color-warning);
	color: var(--color-warning-background);
}

.message a {
	color: inherit;
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* ---------- Page headings ---------- */

.page-heading {
	margin-bottom: var(--space-5);
}

.page-heading h1 {
	margin-bottom: var(--space-2);
	overflow-wrap: anywhere;
}

.page-heading h1 a {
	color: inherit;
	text-decoration-color: var(--color-accent);
}

.account-summary {
	color: var(--color-muted);
	margin: 0 0 var(--space-1);
	max-width: var(--reading-width);
}

.account-summary code {
	color: var(--color-text);
	font-weight: 600;
}

section > * + .message,
section > .message + * {
	margin-top: var(--space-4);
}

/* ---------- Landing page ---------- */

.hero {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	align-items: center;
	gap: var(--space-7);
	padding: var(--space-6) 0 var(--space-7);
}

/* A soft glow that drifts slowly behind the headline */
.hero::before {
	content: "";
	position: absolute;
	z-index: -1;
	width: min(44rem, 100%);
	aspect-ratio: 1;
	right: 0;
	top: -16rem;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(255, 61, 127, 0.2), rgba(255, 138, 31, 0.1) 55%, transparent 72%);
	animation: hero-drift 14s ease-in-out infinite alternate;
	pointer-events: none;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin-bottom: var(--space-4);
	padding: var(--space-1) var(--space-3);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	color: var(--color-muted);
	font-size: var(--text-small);
	font-weight: 600;
}

.eyebrow::before {
	content: "";
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: var(--glow);
}

.hero h1 {
	font-size: var(--text-display);
	line-height: 0.98;
	letter-spacing: -0.04em;
	margin-bottom: var(--space-5);
}

.glow-text {
	background: var(--glow);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hero-lead {
	font-size: var(--text-large);
	color: var(--color-muted);
	max-width: 36rem;
	margin-bottom: var(--space-5);
}

.sign-in-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
}

.hero .hint {
	margin: var(--space-3) 0 0;
}

.hero .message {
	margin-bottom: var(--space-4);
}

/* Hero illustration: a folder drops into a zone, then its live address appears */
.drop-demo {
	position: relative;
	display: grid;
	align-content: end;
	justify-items: center;
	gap: var(--space-3);
	min-height: 12.5rem;
	padding: var(--space-5);
	border: 2px dashed var(--color-border-strong);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	box-shadow: var(--shadow-medium);
	text-align: center;
	overflow: hidden;
}

.drop-demo-file {
	position: absolute;
	left: 50%;
	top: 2.4rem;
	translate: -50% 0;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-small);
	border: 1px solid var(--color-border);
	background: var(--color-surface-sunken);
	box-shadow: var(--shadow-small);
	font: 600 var(--text-small) var(--font-mono);
	animation: demo-drop 5s var(--easing) infinite;
}

.drop-demo-file svg {
	width: 1.1rem;
	height: 1.1rem;
	color: var(--color-accent);
}

.drop-demo-live {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	max-width: 100%;
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-pill);
	background: var(--color-good-background);
	color: var(--color-good);
	font: 600 0.8rem var(--font-mono);
	overflow-wrap: anywhere;
	animation: demo-live 5s ease infinite;
}

.drop-demo-live::before {
	content: "";
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
}

.drop-demo-caption {
	margin: 0;
	color: var(--color-muted);
	font-size: var(--text-small);
}

.landing-section {
	padding: var(--space-7) 0 0;
}

.landing-section > h2 {
	margin-bottom: var(--space-5);
}

.landing-section > .hint {
	margin-top: var(--space-4);
}

.steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	gap: var(--space-5);
	counter-reset: step;
}

.steps li {
	counter-increment: step;
	display: grid;
	gap: var(--space-1);
	align-content: start;
}

.steps li::before {
	content: counter(step);
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	margin-bottom: var(--space-2);
	border-radius: 50%;
	background: var(--glow);
	color: var(--color-on-glow);
	font: 800 1.05rem var(--font-display);
}

.steps h3 {
	margin: 0;
}

.steps p {
	margin: 0;
	color: var(--color-muted);
}

.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	gap: var(--space-4);
}

.feature {
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	transition: transform var(--duration-medium) var(--easing), box-shadow var(--duration-medium) var(--easing);
}

.feature:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-medium);
}

.feature-icon {
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	margin-bottom: var(--space-3);
	border-radius: var(--radius-medium);
	background: var(--color-accent-soft);
	color: var(--color-accent);
}

.feature-icon svg {
	width: 1.35rem;
	height: 1.35rem;
}

.feature h3 {
	font-size: var(--text-large);
	margin-bottom: var(--space-1);
}

.feature p {
	margin: 0;
	color: var(--color-muted);
	font-size: var(--text-small);
}

/* Landing page: publishing with an AI assistant. Text on the left, an
   example conversation on the right; stacked on narrow screens. */
.ai-showcase {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: var(--space-6);
	align-items: center;
}

.ai-showcase-text h2 {
	margin: var(--space-2) 0 var(--space-3);
}

.ai-showcase-lead {
	margin: 0 0 var(--space-4);
	color: var(--color-muted);
	font-size: var(--text-large);
}

.ai-steps {
	display: grid;
	gap: var(--space-2);
	margin: 0;
	padding-left: var(--space-5);
	color: var(--color-muted);
}

.ai-steps strong {
	color: var(--color-text);
}

.ai-chat {
	display: grid;
	gap: var(--space-2);
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background:
		radial-gradient(circle at 100% 0%, rgba(255, 61, 127, 0.1), transparent 55%),
		var(--color-surface);
	box-shadow: var(--shadow-medium);
	font-size: var(--text-small);
}

.ai-chat p {
	margin: 0;
}

/* What the person asks */
.ai-chat-you {
	justify-self: end;
	max-width: 85%;
	margin-top: var(--space-2) !important;
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-medium) var(--radius-medium) var(--radius-small) var(--radius-medium);
	background: var(--color-accent-soft);
	color: var(--color-text);
}

.ai-chat-you:first-child {
	margin-top: 0 !important;
}

/* What the assistant does, then its answer */
.ai-chat-step,
.ai-chat-done {
	font-family: var(--font-mono);
	font-size: 0.8rem;
}

.ai-chat-step {
	color: var(--color-muted);
}

.ai-chat-step::before {
	content: "\25CF  ";
	color: var(--color-border-strong);
}

.ai-chat-done {
	color: var(--color-good);
	font-weight: 600;
}

.ai-chat-done::before {
	content: "\2713  ";
}

.ai-chat-done span {
	color: var(--color-accent);
}

@media (max-width: 52rem) {
	.ai-showcase {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Pricing page (pricing.html) ---------- */

.pricing-plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	gap: var(--space-5);
	margin-top: var(--space-5);
}

.pricing-plan {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	padding: var(--space-6) var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

.pricing-plan h2 {
	margin: 0;
}

/* The Paid plan carries the signature glow, like the main actions. */
.pricing-plan-paid {
	border: 2px solid transparent;
	background:
		linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
		var(--glow) border-box;
	box-shadow: var(--shadow-glow);
}

.pricing-plan-current {
	outline: 2px solid var(--color-good);
	outline-offset: 3px;
}

.pricing-badge {
	position: absolute;
	top: calc(-1 * var(--space-3));
	right: var(--space-5);
	margin: 0;
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-pill);
	background: var(--glow);
	color: var(--color-on-glow);
	font-size: var(--text-small);
	font-weight: 700;
}

.pricing-price {
	margin: 0;
	color: var(--color-muted);
}

.pricing-price strong {
	font-family: var(--font-display);
	font-size: var(--text-heading-2);
	color: var(--color-text);
}

.pricing-features {
	flex: 1;
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	align-content: start;
	gap: var(--space-2);
}

/* A feature that wraps lines up under its text, not under the tick */
.pricing-features li {
	padding-left: 1.4rem;
	text-indent: -1.4rem;
}

.pricing-features li::before {
	content: "\2713";
	display: inline-block;
	width: 1.4rem;
	text-indent: 0;
	color: var(--color-good);
	font-weight: 800;
}

.pricing-features .pricing-feature-missing {
	color: var(--color-muted);
	text-decoration: line-through;
}

.pricing-features .pricing-feature-missing::before {
	content: "\2013";
	color: var(--color-muted);
}

.pricing-current {
	margin: 0;
	font-weight: 700;
	color: var(--color-good);
}

/* "VIP" on the button of a feature that is part of the VIP plan */
.vip-mark {
	display: inline-block;
	margin-left: var(--space-1);
	padding: 0 var(--space-2);
	border-radius: var(--radius-pill);
	background: var(--glow);
	color: var(--color-on-glow);
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.5;
}

/* The invitation to the VIP plan on a Free user's dashboard */
.upgrade-offer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4) var(--space-6);
	margin-bottom: var(--space-5);
	padding: var(--space-5) var(--space-6);
	border: 2px solid transparent;
	border-radius: var(--radius-large);
	background:
		radial-gradient(circle at 100% 0%, rgba(255, 61, 127, 0.14), transparent 55%),
		radial-gradient(circle at 0% 100%, rgba(255, 138, 31, 0.12), transparent 55%),
		linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
		var(--glow) border-box;
	box-shadow: var(--shadow-glow);
}

.upgrade-offer-text {
	flex: 1 1 26rem;
}

.upgrade-offer h2 {
	margin: var(--space-1) 0 var(--space-3);
}

.upgrade-offer-badge {
	display: inline-block;
	margin: 0;
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-pill);
	background: var(--glow);
	color: var(--color-on-glow);
	font-size: var(--text-small);
	font-weight: 800;
	letter-spacing: 0.06em;
}

.upgrade-offer-summary {
	margin: 0;
}

.upgrade-offer-actions {
	display: grid;
	justify-items: center;
	gap: var(--space-2);
	text-align: center;
}

.upgrade-offer-actions form,
.upgrade-offer-actions .hint {
	margin: 0;
}

.upgrade-offer-price {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-heading-3);
	font-weight: 700;
}

/* The plan's actions on the dashboard, under the usage: the renewal date,
   "Manage subscription" and "Buy extra traffic" */
.plan-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2) var(--space-4);
	margin-bottom: var(--space-4);
}

.plan-actions .hint {
	margin: 0;
}

/* A button inside a notice keeps its size and sits at the end; on a narrow
   screen it moves under the text */
.message:has(> form, > .button) {
	flex-wrap: wrap;
}

.message:has(> form, > .button) > span {
	flex: 1 1 16rem;
}

.message form,
.message > .button {
	flex: none;
	margin: 0 0 0 auto;
	white-space: nowrap;
}

/* The Upgrade and Manage buttons fill the card, like the sign-in link */
.pricing-action {
	width: 100%;
}

/* While payments are off, the Paid button is shown but does nothing. */
.pricing-coming-soon {
	cursor: default;
	opacity: 0.75;
}

.pricing-notes {
	margin-top: var(--space-7);
	max-width: var(--reading-width);
}

.pricing-notes ul {
	display: grid;
	gap: var(--space-2);
	padding-left: var(--space-5);
}

.landing-closing {
	margin-top: var(--space-7);
	padding: var(--space-6) var(--space-5);
	border-radius: var(--radius-large);
	border: 1px solid var(--color-border);
	background:
		radial-gradient(circle at 100% 0%, rgba(255, 61, 127, 0.14), transparent 55%),
		radial-gradient(circle at 0% 100%, rgba(255, 138, 31, 0.12), transparent 55%),
		var(--color-surface);
	text-align: center;
	display: grid;
	justify-items: center;
	gap: var(--space-3);
}

.landing-closing h2,
.landing-closing p {
	margin: 0;
}

.landing-closing p {
	color: var(--color-muted);
	max-width: 34rem;
}

.page-footer {
	margin-top: var(--space-6);
	text-align: center;
	color: var(--color-muted);
	font-size: var(--text-small);
}

/* ---------- Dashboard: usage ---------- */

.dashboard-heading {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--space-4) var(--space-6);
}

.dashboard-heading > div {
	min-width: 0;
}

.usage {
	display: grid;
	grid-template-columns: repeat(3, minmax(9rem, 1fr));
	gap: var(--space-4);
	min-width: min(100%, 33rem);
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-medium);
	background: var(--color-surface);
}

.usage-item {
	display: grid;
	align-content: start;
	gap: var(--space-1);
	min-width: 0;
}

.usage-label {
	display: flex;
	justify-content: space-between;
	gap: var(--space-2);
	font-size: 0.8rem;
	color: var(--color-muted);
}

.usage-label strong {
	color: var(--color-text);
	font-variant-numeric: tabular-nums;
}

/* Under the traffic meter: extra traffic packs (Stage 20) */
.usage-note {
	font-size: 0.75rem;
	color: var(--color-muted);
}

.traffic-pack-form {
	flex: none;
	white-space: nowrap;
}

.usage meter {
	width: 100%;
	height: 0.5rem;
	appearance: none;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-surface-sunken);
}

.usage meter::-webkit-meter-bar {
	height: 0.5rem;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-surface-sunken);
}

.usage meter::-webkit-meter-optimum-value,
.usage meter::-webkit-meter-suboptimum-value {
	border-radius: var(--radius-pill);
	background: var(--glow);
}

.usage meter::-webkit-meter-even-less-good-value {
	border-radius: var(--radius-pill);
	background: var(--color-danger);
}

.usage meter::-moz-meter-bar {
	border-radius: var(--radius-pill);
	background: var(--glow);
}

.usage meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
	background: var(--color-danger);
}

/* ---------- Dashboard: upload panel ---------- */

.upload-panel {
	margin: var(--space-5) 0 var(--space-6);
}

.drop-zone {
	position: relative;
	display: grid;
	justify-items: center;
	gap: var(--space-2);
	padding: var(--space-7) var(--space-5);
	border: 2px dashed var(--color-border-strong);
	border-radius: var(--radius-large);
	background:
		radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--glow-end) 7%, transparent), transparent 60%),
		var(--color-surface);
	text-align: center;
	transition:
		transform var(--duration-medium) var(--easing),
		border-color var(--duration-medium) var(--easing),
		box-shadow var(--duration-medium) var(--easing);
}

.drop-zone:hover {
	border-color: var(--color-accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow-medium);
}

/* While files are dragged over it (class set by upload.js) */
.drop-zone-active {
	border-style: solid;
	border-color: transparent;
	transform: scale(1.01);
	background:
		linear-gradient(color-mix(in srgb, var(--color-surface) 92%, var(--glow-end)), color-mix(in srgb, var(--color-surface) 92%, var(--glow-end))) padding-box,
		var(--glow) border-box;
	box-shadow: var(--shadow-glow);
}

/* While an upload is running (class set by upload.js) */
.drop-zone-busy {
	opacity: 0.6;
	pointer-events: none;
}

.drop-zone-icon {
	display: grid;
	place-items: center;
	width: 3.75rem;
	height: 3.75rem;
	margin-bottom: var(--space-2);
	border-radius: 50%;
	background: var(--glow);
	color: var(--color-on-glow);
	box-shadow: var(--shadow-glow);
	transition: transform var(--duration-medium) var(--easing);
}

.drop-zone-icon svg {
	width: 1.75rem;
	height: 1.75rem;
}

.drop-zone:hover .drop-zone-icon {
	transform: translateY(-3px);
}

.drop-zone-active .drop-zone-icon {
	animation: icon-bounce 0.9s var(--easing) infinite;
}

.drop-zone-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-heading-3);
	font-weight: 700;
	text-wrap: balance;
}

/* "Release to publish" replaces the title while files are dragged over */
.drop-zone-release {
	display: none;
}

.drop-zone-active .drop-zone-title {
	display: none;
}

.drop-zone-active .drop-zone-release {
	display: block;
}

.drop-zone .hint {
	margin: 0 0 var(--space-2);
	max-width: 34rem;
}

.upload-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-2);
}

.upload-status {
	margin-top: var(--space-4);
	padding: var(--space-4);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-medium);
	background: var(--color-surface);
}

.upload-message {
	margin: 0 0 var(--space-2);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.upload-message-error {
	color: var(--color-danger);
}

.upload-status progress {
	display: block;
	width: 100%;
	height: 0.6rem;
	appearance: none;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-surface-sunken);
	overflow: hidden;
}

.upload-status progress::-webkit-progress-bar {
	border-radius: var(--radius-pill);
	background: var(--color-surface-sunken);
}

.upload-status progress::-webkit-progress-value {
	border-radius: var(--radius-pill);
	background: var(--glow);
	transition: width var(--duration-medium) var(--easing);
}

.upload-status progress::-moz-progress-bar {
	border-radius: var(--radius-pill);
	background: var(--glow);
}

/* No known percentage (reading, checking, unpacking): a moving shimmer */
.upload-status progress:indeterminate {
	background:
		linear-gradient(90deg, transparent, color-mix(in srgb, var(--glow-end) 55%, transparent), transparent) 0 0 / 40% 100% no-repeat,
		var(--color-surface-sunken);
	animation: progress-shimmer 1.2s linear infinite;
}

.upload-status progress:indeterminate::-webkit-progress-bar {
	background: transparent;
}

.upload-status progress:indeterminate::-moz-progress-bar {
	background: transparent;
}

/* ---------- Dashboard: a new site is live ---------- */

.celebration {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-4);
	padding: var(--space-5);
	border: 2px solid transparent;
	border-radius: var(--radius-large);
	background:
		linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
		var(--glow) border-box;
	box-shadow: var(--shadow-glow);
	animation: celebration-in 0.5s var(--easing) both;
}

.celebration-check {
	flex: none;
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 50%;
	background: var(--glow);
	color: var(--color-on-glow);
}

.celebration-check svg {
	width: 1.75rem;
	height: 1.75rem;
}

.celebration-check path {
	stroke-dasharray: 30;
	stroke-dashoffset: 30;
	animation: draw-check 0.5s 0.25s var(--easing) forwards;
}

.celebration-text {
	flex: 1 1 16rem;
	min-width: 0;
}

.celebration-text h2 {
	margin: 0 0 var(--space-1);
	font-size: var(--text-heading-3);
}

.celebration-text p {
	margin: 0;
	color: var(--color-muted);
	overflow-wrap: anywhere;
}

.celebration-text a {
	font-family: var(--font-mono);
	font-weight: 600;
}

.celebration-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
}

/* A short, one-time burst of sparks from the check mark */
.sparks {
	position: absolute;
	left: calc(var(--space-5) + 1.6rem);
	top: 50%;
	pointer-events: none;
}

.sparks span {
	position: absolute;
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--glow);
	opacity: 0;
	animation: spark 0.9s 0.35s var(--easing) forwards;
}

.sparks span:nth-child(1) { --spark-x: -3.2rem; --spark-y: -2.4rem; }
.sparks span:nth-child(2) { --spark-x: 0.4rem; --spark-y: -3.4rem; }
.sparks span:nth-child(3) { --spark-x: 3.4rem; --spark-y: -2.2rem; }
.sparks span:nth-child(4) { --spark-x: 3.8rem; --spark-y: 1.4rem; }
.sparks span:nth-child(5) { --spark-x: 0.8rem; --spark-y: 3.3rem; }
.sparks span:nth-child(6) { --spark-x: -2.8rem; --spark-y: 2.6rem; }
.sparks span:nth-child(7) { --spark-x: -4rem; --spark-y: 0.2rem; }
.sparks span:nth-child(8) { --spark-x: 2rem; --spark-y: -3.8rem; }

/* ---------- Dashboard: site cards ---------- */

.site-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
	gap: var(--space-4);
}

.site-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	min-width: 0;
	padding: var(--space-4);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	box-shadow: var(--shadow-small);
	transition: transform var(--duration-medium) var(--easing), box-shadow var(--duration-medium) var(--easing), border-color var(--duration-medium) var(--easing);
	animation: card-in 0.45s var(--easing) both;
	animation-delay: calc(var(--card-index, 0) * 50ms);
}

.site-card:hover {
	transform: translateY(-2px);
	border-color: var(--color-border-strong);
	box-shadow: var(--shadow-medium);
}

.site-card-top {
	display: grid;
	gap: var(--space-1);
}

.site-link {
	font-family: var(--font-mono);
	font-weight: 700;
	font-size: 1.02rem;
	color: var(--color-text);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.site-link::after {
	content: " \2197";
	color: var(--color-accent);
	font-family: var(--font-body);
}

.site-link:hover {
	color: var(--color-accent);
	text-decoration: underline;
}

.site-original-name {
	margin: 0;
	color: var(--color-muted);
	font-size: var(--text-small);
	overflow-wrap: anywhere;
}

.site-badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
}

.site-details {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: var(--space-1) var(--space-3);
	margin: 0;
	padding: var(--space-3);
	border-radius: var(--radius-medium);
	background: var(--color-surface-sunken);
	font-size: var(--text-small);
}

.site-details dt {
	color: var(--color-muted);
}

.site-details dd {
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
	font-variant-numeric: tabular-nums;
}

.site-password {
	padding: 0.05rem 0.4rem;
	border-radius: 0.3rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
}

.site-domains {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The bottom of a site card: the settings button, which opens the menu of
   the site's actions */
.site-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: auto;
	padding-top: var(--space-3);
	border-top: 1px solid var(--color-border);
}

.site-menu-button {
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	background: var(--color-surface);
	color: var(--color-muted);
	cursor: pointer;
	transition: color var(--duration-fast) var(--easing), border-color var(--duration-fast) var(--easing), transform var(--duration-medium) var(--easing);
}

.site-menu-button:hover,
.site-menu-button[aria-expanded="true"] {
	color: var(--color-text);
	border-color: var(--color-border-strong);
}

.site-menu-button[aria-expanded="true"] svg {
	transform: rotate(45deg);
}

.site-menu-button svg {
	transition: transform var(--duration-medium) var(--easing);
}

/* The menu itself. effects.js places it under the button (or above it,
   near the bottom of the window); without JavaScript the browser shows it
   in the middle of the window. */
.site-menu {
	min-width: 12rem;
	margin: 0;
	padding: var(--space-2);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-medium);
	background: var(--color-surface);
	color: var(--color-text);
	box-shadow: var(--shadow-medium);
}

.site-menu:popover-open {
	display: grid;
	gap: 1px;
	animation: site-menu-in var(--duration-fast) var(--easing);
}

.site-menu form {
	margin: 0;
}

.site-menu-item {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	width: 100%;
	padding: var(--space-2) var(--space-3);
	border: 0;
	border-radius: var(--radius-small);
	background: none;
	color: var(--color-text);
	font: inherit;
	font-size: var(--text-small);
	font-weight: 600;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.site-menu-item:hover,
.site-menu-item:focus-visible {
	background: var(--color-surface-sunken);
}

.site-menu-separator {
	margin: var(--space-1) 0;
	border: 0;
	border-top: 1px solid var(--color-border);
}

/* Delete sits apart from the everyday actions */
.site-menu-danger {
	color: var(--color-danger);
}

.site-menu-danger:hover,
.site-menu-danger:focus-visible {
	background: var(--color-danger-background);
}

@keyframes site-menu-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

.empty-state {
	display: grid;
	justify-items: center;
	gap: var(--space-2);
	padding: var(--space-7) var(--space-5);
	border: 1px dashed var(--color-border-strong);
	border-radius: var(--radius-large);
	text-align: center;
}

.empty-state p {
	margin: 0;
}

.empty-state .empty-state-title {
	font-family: var(--font-display);
	font-size: var(--text-heading-3);
	font-weight: 700;
}

/* ---------- Confirm, lock and replace pages ---------- */

.confirm-box {
	max-width: 36rem;
	margin: var(--space-4) auto 0;
	padding: var(--space-6);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	box-shadow: var(--shadow-medium);
}

.confirm-box h1 {
	font-size: var(--text-heading-2);
	overflow-wrap: anywhere;
}

.confirm-box-danger {
	border-top: 4px solid var(--color-danger);
}

.site-chip {
	display: inline-flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	align-items: baseline;
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-medium);
	background: var(--color-surface-sunken);
	max-width: 100%;
}

.site-chip a {
	font-family: var(--font-mono);
	font-weight: 700;
	overflow-wrap: anywhere;
}

.back-link {
	margin-top: var(--space-5);
}

/* ---------- Custom domains ---------- */

.domain-card {
	margin-bottom: var(--space-4);
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	box-shadow: var(--shadow-small);
	overflow-wrap: anywhere;
}

.domain-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	margin-bottom: var(--space-3);
}

.domain-heading h2 {
	margin: 0;
	font-size: var(--text-heading-3);
	font-family: var(--font-mono);
	letter-spacing: 0;
	min-width: 0;
}

.domain-remove {
	margin: 0 0 0 auto;
}

.dns-steps {
	display: grid;
	gap: var(--space-4);
	margin: 0 0 var(--space-4);
	padding: 0;
	list-style: none;
	counter-reset: dns-step;
}

.dns-steps > li {
	counter-increment: dns-step;
	position: relative;
	padding-left: 2.6rem;
	min-width: 0;
}

.dns-steps > li::before {
	content: counter(dns-step);
	position: absolute;
	left: 0;
	top: 0;
	display: grid;
	place-items: center;
	width: 1.8rem;
	height: 1.8rem;
	border-radius: 50%;
	background: var(--color-primary);
	color: var(--color-on-primary);
	font: 800 var(--text-small) var(--font-display);
}

.dns-steps p {
	margin-bottom: var(--space-2);
}

.dns-record {
	display: block;
	width: max-content;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin: var(--space-2) 0;
	font-size: var(--text-small);
	border-radius: var(--radius-small);
	border: 1px solid var(--color-border);
}

.dns-record th,
.dns-record td {
	padding: var(--space-2) var(--space-3);
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--color-border);
}

.dns-record tr:last-child th,
.dns-record tr:last-child td {
	border-bottom: 0;
}

.dns-record th {
	color: var(--color-muted);
	font-weight: 600;
	background: var(--color-surface-sunken);
}

.dns-record code {
	overflow-wrap: anywhere;
	user-select: all;
}

.domain-add {
	margin: var(--space-6) 0 var(--space-4);
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

/* ---------- DNS guide ---------- */

.dns-guide {
	margin: var(--space-5) 0;
	padding: 0 var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	overflow-wrap: anywhere;
}

.dns-guide summary {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	margin: 0 calc(-1 * var(--space-5));
	padding: var(--space-4) var(--space-5);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--text-large);
	cursor: pointer;
	list-style: none;
}

.dns-guide summary::-webkit-details-marker {
	display: none;
}

.dns-guide summary::before {
	content: "";
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid var(--color-accent);
	border-bottom: 2px solid var(--color-accent);
	transform: rotate(-45deg);
	transition: transform var(--duration-fast) var(--easing);
}

.dns-guide[open] summary::before {
	transform: rotate(45deg);
}

.dns-guide[open] summary {
	border-bottom: 1px solid var(--color-border);
}

.dns-guide[open] {
	padding-bottom: var(--space-3);
}

.dns-guide h3 {
	margin-top: var(--space-5);
	font-size: var(--text-base);
}

/* ---------- Access tokens ---------- */

.new-token {
	margin-bottom: var(--space-5);
	padding: var(--space-5);
	border: 2px solid transparent;
	border-radius: var(--radius-large);
	background:
		linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
		var(--glow) border-box;
}

.new-token h2 {
	font-size: var(--text-heading-3);
}

.token-value-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	align-items: stretch;
	margin-bottom: var(--space-4);
}

.token-value {
	flex: 1 1 18rem;
	min-width: 0;
	display: block;
	padding: var(--space-3);
	font-size: var(--text-base);
	background: var(--color-surface-sunken);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-small);
	overflow-wrap: anywhere;
	user-select: all;
}

.token-form {
	max-width: 32rem;
	margin-bottom: var(--space-6);
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

.token-form h2 {
	font-size: var(--text-heading-3);
}

/* ---------- Tables: admin lists and tokens ---------- */

/* position: relative keeps hidden table labels (.visually-hidden) inside the scrolling box */
.table-wrapper,
.admin-result {
	position: relative;
	overflow-x: auto;
}

.admin-sites {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--text-small);
}

.admin-sites th,
.admin-sites td {
	padding: var(--space-2) var(--space-3);
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid var(--color-border);
}

.admin-sites thead th {
	color: var(--color-muted);
	font-weight: 600;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.admin-sites tbody tr:hover {
	background: var(--color-surface-sunken);
}

/* Short values such as dates and sizes stay on one line */
.admin-sites .admin-nowrap {
	white-space: nowrap;
}

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

.admin-sites td {
	font-variant-numeric: tabular-nums;
}

.admin-sites form {
	margin: 0;
}

.admin-sites .button {
	min-height: 2rem;
	padding: var(--space-1) var(--space-3);
	white-space: nowrap;
}

.token-list {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

/* ---------- Admin ---------- */

.admin-search {
	margin-bottom: var(--space-5);
}

.admin-result {
	margin-top: var(--space-4);
	padding: var(--space-4);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

.admin-user {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-3);
	margin-bottom: var(--space-3);
}

.admin-user > div {
	min-width: 0;
}

.admin-user h2 {
	margin: 0 0 var(--space-1);
	font-size: var(--text-heading-3);
}

.admin-user .hint {
	margin: 0;
	overflow-wrap: anywhere;
}

.admin-user-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
}

.admin-user-actions form {
	margin: 0;
}

/* Buttons that change a user's rights (admin.html, "user-rights") */
.admin-rights {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	margin-top: var(--space-1);
}

.admin-rights form {
	margin: 0;
}

/* The choice of address type (site_address.html) */
.address-type {
	display: grid;
	gap: var(--space-2);
	margin: var(--space-2) 0 0;
	padding: 0;
	border: 0;
}

.address-type label {
	font-weight: 400;
}

/* The plan and upload limits form (admin_settings.html) */
.admin-settings {
	max-width: 44rem;
}

.settings-group {
	margin: 0 0 var(--space-4);
	padding: var(--space-4);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-medium);
}

.settings-group legend {
	padding: 0 var(--space-2);
	font-weight: 700;
}

/* The prices read from Stripe, above the settings form (admin_prices.go) */
.admin-prices {
	display: grid;
	gap: var(--space-3);
}

.admin-prices h2 {
	margin: 0;
	font-size: var(--text-base);
	font-weight: 700;
}

.admin-prices .hint,
.admin-prices .message {
	margin: 0;
}

.price-list {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: var(--space-2) var(--space-5);
	margin: 0;
}

.price-list dt {
	color: var(--color-muted);
}

.price-list dd {
	margin: 0;
}

.price-problem {
	color: var(--color-danger);
}

.settings-field + .settings-field {
	margin-top: var(--space-3);
}

.settings-value {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.settings-value input {
	max-width: 12rem;
}

/* A feature switch on the settings page: Everyone or VIP only */
.settings-group > .hint {
	margin: 0 0 var(--space-3);
}

.settings-feature-label {
	display: block;
	margin-bottom: var(--space-1);
	font-weight: 600;
}

.feature-choice {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-5);
}

.feature-choice label {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	font-weight: 400;
}

.section-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2);
	margin-top: var(--space-6);
}

.section-heading h2 {
	margin: 0;
}

/* ---------- Instructions for AI assistants ---------- */

.ai-instructions {
	margin: 0;
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	font: var(--text-small) / 1.6 var(--font-mono);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	box-shadow: var(--shadow-small);
}

/* ---------- Privacy policy and terms of service ---------- */

.legal {
	max-width: var(--reading-width);
	margin: 0 auto;
	font-size: 1.02rem;
	line-height: 1.75;
	overflow-wrap: anywhere;
}

.legal h1 {
	margin-bottom: var(--space-2);
}

.legal > .hint:first-of-type {
	display: inline-block;
	margin-bottom: var(--space-6);
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-pill);
	background: var(--color-surface-sunken);
}

.legal h2 {
	margin-top: var(--space-7);
	padding-top: var(--space-4);
	border-top: 1px solid var(--color-border);
	font-size: var(--text-heading-3);
}

.legal h3 {
	margin-top: var(--space-5);
	margin-bottom: var(--space-1);
	font-size: var(--text-base);
}

.legal ul {
	padding-left: 1.25rem;
}

.legal li {
	margin-bottom: var(--space-2);
}

.legal li::marker {
	color: var(--color-accent);
}

.legal-table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: var(--text-small);
	line-height: 1.5;
	margin-bottom: var(--space-4);
}

.legal-table th,
.legal-table td {
	padding: var(--space-2) var(--space-3);
	text-align: left;
	vertical-align: top;
	border: 1px solid var(--color-border);
}

.legal-table th {
	color: var(--color-muted);
	background: var(--color-surface-sunken);
}

/* ---------- Small screens ---------- */

@media (max-width: 52rem) {
	.hero {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-6);
		padding-top: var(--space-4);
	}
}

@media (max-width: 30rem) {
	main {
		padding-top: var(--space-5);
	}

	.usage {
		width: 100%;
		grid-template-columns: minmax(0, 1fr);
	}

	.drop-zone {
		padding: var(--space-6) var(--space-4);
	}

	.confirm-box {
		padding: var(--space-5) var(--space-4);
	}

	.signed-in-as {
		display: none;
	}
}

/* ---------- Animations ---------- */

@keyframes hero-drift {
	from { transform: translate(0, 0) scale(1); }
	to { transform: translate(-3rem, 2rem) scale(1.08); }
}

@keyframes demo-drop {
	0% { top: -3rem; opacity: 0; }
	10% { opacity: 1; }
	24% { top: 2.9rem; }
	30% { top: 2.1rem; }
	36%, 100% { top: 2.4rem; }
}

@keyframes demo-live {
	0%, 30% { opacity: 0; transform: translateY(6px); }
	40%, 100% { opacity: 1; transform: none; }
}

@keyframes icon-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(5px); }
}

@keyframes progress-shimmer {
	from { background-position: -40% 0, 0 0; }
	to { background-position: 140% 0, 0 0; }
}

@keyframes celebration-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

@keyframes draw-check {
	to { stroke-dashoffset: 0; }
}

@keyframes spark {
	0% { opacity: 1; transform: translate(0, 0) scale(1); }
	100% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scale(0.4); }
}

@keyframes card-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

/*
	Visitors who ask for less motion get none: every animation and transition
	is switched off, and animated pieces show their finished state.
*/
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		animation-delay: 0s !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.hero::before,
	.drop-demo-file,
	.drop-demo-live,
	.upload-status progress:indeterminate,
	.drop-zone-active .drop-zone-icon {
		animation: none !important;
	}

	.drop-demo-live {
		opacity: 1;
	}

	.sparks {
		display: none;
	}

	.button:hover,
	.drop-zone:hover,
	.feature:hover,
	.site-card:hover {
		transform: none;
	}
}
