/* FLW Ads Manager — shipped as a root-absolute static stylesheet so nested routes and Cloudflare cannot drop styles. */

/* FLW App Bar + Application Header. Canon: docs/app-standards.md */

:root {
	--flw-app-bar-height: 32px;
}

.flw-app-bar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	height: var(--flw-app-bar-height);
	padding: 0;
	width: 100%;
	background: #fff;
	color: #111;
	border-bottom: 1px solid #e5e5e5;
	font-family: "Source Sans 3", system-ui, sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1;
	position: sticky;
	top: 0;
	z-index: 40;
	overflow: visible;
}

.flw-app-switcher {
	position: relative;
	display: flex;
	align-items: stretch;
	margin: 0;
}

.flw-app-bar-toggle {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	height: var(--flw-app-bar-height);
	padding: 0 0.85rem;
	margin: 0;
	cursor: pointer;
	list-style: none;
	user-select: none;
	color: inherit;
	background: transparent;
	border: 0;
	font: inherit;
	font-weight: 600;
}

.flw-app-bar-toggle::-webkit-details-marker {
	display: none;
}

.flw-app-bar-toggle::marker {
	content: "";
	display: none;
}

.flw-app-bar-toggle:hover,
.flw-app-bar-toggle:focus-visible {
	text-decoration: none;
	color: inherit;
}

.flw-app-bar-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.flw-app-bar-label {
	white-space: nowrap;
}

.flw-app-bar-caret {
	width: 10px;
	height: 10px;
	flex-shrink: 0;
	display: block;
	transition: transform 0.12s ease;
}

.flw-app-switcher[open] .flw-app-bar-caret {
	transform: rotate(180deg);
}

.flw-app-switcher-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 50;
	box-sizing: border-box;
	min-width: 220px;
	max-width: min(320px, calc(100vw - 0.5rem));
	max-height: min(70vh, 420px);
	overflow-y: auto;
	padding: 0.35rem 0;
	background: #fff;
	color: #111;
	border: 1px solid #e5e5e5;
	border-top: 0;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.flw-app-switcher-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 44px;
	padding: 0.45rem 0.85rem;
	color: inherit;
	text-decoration: none;
	font: inherit;
	font-weight: 600;
}

.flw-app-switcher-item:hover,
.flw-app-switcher-item:focus-visible {
	text-decoration: none;
	color: inherit;
	background: #f5f5f5;
}

.flw-app-switcher-item[aria-current="page"] {
	background: #f5f5f5;
}

.flw-app-switcher-tag {
	font-size: 11px;
	font-weight: 600;
	color: #737373;
	letter-spacing: 0.02em;
}

.flw-app-switcher-sep {
	height: 1px;
	margin: 0.25rem 0;
	background: #e5e5e5;
}

.flw-app-bar-mark {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	display: block;
	fill: currentColor;
}

.dark .flw-app-bar,
html.dark .flw-app-bar {
	background: #000;
	color: #fff;
	border-bottom-color: #222;
}

.dark .flw-app-switcher-panel,
html.dark .flw-app-switcher-panel {
	background: #000;
	color: #fff;
	border-color: #222;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.dark .flw-app-switcher-item:hover,
.dark .flw-app-switcher-item:focus-visible,
.dark .flw-app-switcher-item[aria-current="page"],
html.dark .flw-app-switcher-item:hover,
html.dark .flw-app-switcher-item:focus-visible,
html.dark .flw-app-switcher-item[aria-current="page"] {
	background: #1a1a1a;
}

.dark .flw-app-switcher-tag,
html.dark .flw-app-switcher-tag {
	color: #a3a3a3;
}

.dark .flw-app-switcher-sep,
html.dark .flw-app-switcher-sep {
	background: #222;
}

@media (prefers-color-scheme: dark) {
	html:not(.light) .flw-app-bar {
		background: #000;
		color: #fff;
		border-bottom-color: #222;
	}

	html:not(.light) .flw-app-switcher-panel {
		background: #000;
		color: #fff;
		border-color: #222;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	}

	html:not(.light) .flw-app-switcher-item:hover,
	html:not(.light) .flw-app-switcher-item:focus-visible,
	html:not(.light) .flw-app-switcher-item[aria-current="page"] {
		background: #1a1a1a;
	}

	html:not(.light) .flw-app-switcher-tag {
		color: #a3a3a3;
	}

	html:not(.light) .flw-app-switcher-sep {
		background: #222;
	}
}

.flw-app-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid var(--line, #e7e5e4);
	background: color-mix(in srgb, #fff 88%, transparent);
	backdrop-filter: blur(8px);
	position: sticky;
	top: 0;
	z-index: 30;
}

.flw-chrome--with-app-bar.shell {
	grid-template-rows: auto auto 1fr auto;
}

.flw-chrome--with-app-bar .flw-app-header,
.flw-chrome--with-app-bar .topbar {
	top: var(--flw-app-bar-height);
}

.flw-app-header-brand {
	font-family: "Fraunces", Georgia, serif;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--ink, #1c1917);
	text-decoration: none;
	line-height: 1.1;
}

.flw-app-header-brand:hover {
	text-decoration: none;
	color: var(--ink, #1c1917);
}

.flw-app-header-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.85rem;
	flex: 1;
}

.flw-app-header-nav a {
	color: var(--muted, #57534e);
	font-weight: 600;
	text-decoration: none;
	padding: 0.5rem 0.75rem;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	font-family: "Source Sans 3", system-ui, sans-serif;
	font-size: 0.95rem;
}

.flw-app-header-nav a[aria-current="page"],
.flw-app-header-nav a:hover {
	color: var(--ink, #1c1917);
	text-decoration: none;
}

.flw-app-header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.flw-app-header-actions form {
	margin: 0;
}

.flw-app-header .flw-app-header-btn,
.flw-app-header-actions button,
.flw-app-header-actions .btn {
	appearance: none;
	border: 1px solid var(--line, #e7e5e4);
	background: var(--panel, #fff);
	color: var(--ink, #1c1917);
	border-radius: 999px;
	padding: 0.55rem 1rem;
	font: inherit;
	font-family: "Source Sans 3", system-ui, sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	min-height: 44px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.flw-app-header .flw-app-header-btn:hover,
.flw-app-header-actions button:hover {
	text-decoration: none;
	color: var(--ink, #1c1917);
}

.dark .flw-app-header,
html.dark .flw-app-header {
	background: color-mix(in srgb, var(--background, #1c1917) 88%, transparent);
	border-bottom-color: var(--border, #333);
}

.dark .flw-app-header-brand,
.dark .flw-app-header-brand:hover,
html.dark .flw-app-header-brand,
html.dark .flw-app-header-brand:hover {
	color: var(--foreground, #fafaf9);
}

.dark .flw-app-header-nav a,
html.dark .flw-app-header-nav a {
	color: var(--muted-foreground, #a8a29e);
}

.dark .flw-app-header-nav a[aria-current="page"],
.dark .flw-app-header-nav a:hover,
html.dark .flw-app-header-nav a[aria-current="page"],
html.dark .flw-app-header-nav a:hover {
	color: var(--foreground, #fafaf9);
}

.dark .flw-app-header .flw-app-header-btn,
.dark .flw-app-header-actions button,
html.dark .flw-app-header .flw-app-header-btn,
html.dark .flw-app-header-actions button {
	background: var(--card, #292524);
	border-color: var(--border, #444);
	color: var(--foreground, #fafaf9);
}

@media (max-width: 720px) {
	.flw-app-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.flw-app-header-nav {
		width: 100%;
	}
}

:root {
	--ink: #1c1917;
	--muted: #57534e;
	--surface: #fafaf9;
	--panel: #ffffff;
	--line: #e7e5e4;
	--accent: #0f766e;
	--accent-soft: #ccfbf1;
	--danger: #b91c1c;
	--warn: #b45309;
	--live: #0f766e;
	--radius: 12px;
	--font-brand: "Fraunces", Georgia, serif;
	--font-body: "Source Sans 3", system-ui, sans-serif;
	--font-brand-settings: "SOFT" 50, "WONK" 1;
	--mono: "IBM Plex Mono", ui-monospace, monospace;
	color-scheme: light;
}

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

html,
body {
	margin: 0;
	min-height: 100%;
	background:
		radial-gradient(1200px 500px at 8% -12%, #ccfbf1 0%, transparent 55%),
		radial-gradient(900px 420px at 100% 0%, #e7e5e4 0%, transparent 50%),
		var(--surface);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.45;
}

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

a:hover {
	text-decoration: underline;
}

:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

button,
.btn {
	appearance: none;
	border: 1px solid var(--line);
	background: var(--panel);
	color: var(--ink);
	border-radius: 999px;
	padding: 0.55rem 1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	text-decoration: none;
}

a.btn:hover {
	text-decoration: none;
	color: var(--ink);
}

button.primary,
.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

a.btn.primary:hover {
	color: #fff;
}

button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

input,
select,
textarea {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0.65rem 0.75rem;
	font: inherit;
	background: #fff;
	color: var(--ink);
}

label {
	display: grid;
	gap: 0.35rem;
	font-weight: 600;
	color: var(--ink);
}

.field {
	margin-bottom: 1rem;
}

.shell {
	min-height: 100dvh;
	display: grid;
	grid-template-rows: auto 1fr auto;
}

.flw-chrome--with-app-bar.shell {
	grid-template-rows: auto auto 1fr auto;
}

.main {
	width: min(1080px, 100%);
	margin: 0 auto;
	padding: 1.25rem 1.1rem 5rem;
}

.footer {
	padding: 1rem 1.1rem 1.4rem;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.9rem;
	text-align: center;
}

.footer .brand-mark {
	font-family: var(--font-brand);
	font-optical-sizing: auto;
	font-variation-settings: var(--font-brand-settings);
	font-weight: 700;
}

h1,
h2,
h3 {
	font-family: var(--font-brand);
	font-optical-sizing: auto;
	font-variation-settings: var(--font-brand-settings);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0 0 0.6rem;
}

h1 {
	font-size: clamp(2.05rem, 3.8vw, 2.75rem);
	line-height: 1.08;
}

h2 {
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

h3 {
	font-size: 1.25rem;
}

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

.stack {
	display: grid;
	gap: 0.85rem;
}

.row {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	align-items: center;
}

.panel,
.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 1.15rem 1.2rem 1.25rem;
	box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.page-hero {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1rem;
	flex-wrap: wrap;
}

.page-hero h1 {
	margin-bottom: 0.25rem;
}

.page-hero p {
	margin: 0;
	max-width: 40rem;
}

.context-bar {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.1rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: color-mix(in srgb, #fff 88%, transparent);
}

.context-bar select {
	width: min(320px, 100%);
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
}

a.stat-tile,
.stat-tile {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1rem 1.05rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
	color: inherit;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
	min-height: 88px;
}

a.stat-tile:hover {
	text-decoration: none;
	border-color: #99f6e4;
	box-shadow: 0 6px 18px rgba(15, 118, 110, 0.1);
}

.stat-tile-value {
	font-family: var(--font-brand);
	font-optical-sizing: auto;
	font-variation-settings: var(--font-brand-settings);
	font-size: 1.85rem;
	font-weight: 700;
	line-height: 1.1;
}

.stat-tile-label {
	color: var(--muted);
	font-weight: 600;
	font-size: 0.9rem;
}

.package-grid {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: 1rem;
}

.package-card {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.15rem 1.15rem 1.2rem;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--panel);
	min-height: 220px;
}

.package-card h2 {
	font-size: 1.35rem;
	margin: 0;
}

.package-card .price {
	font-family: var(--font-brand);
	font-weight: 700;
	font-size: 1.45rem;
}

.package-card .placements {
	margin: 0;
	padding-left: 1.1rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.package-card .btn {
	margin-top: auto;
	align-self: flex-start;
}

.table-wrap {
	overflow-x: auto;
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.table th,
.table td {
	text-align: left;
	padding: 0.7rem 0.5rem;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}

.table th {
	font-size: 0.82rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--muted);
}

.table th.sortable {
	padding: 0;
}

.table th.sortable button {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	width: 100%;
	min-height: 44px;
	min-width: 0;
	padding: 0.7rem 0.5rem;
	border: 0;
	background: transparent;
	border-radius: 0;
	font: inherit;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--muted);
	text-align: left;
}

.table tbody tr:hover td {
	background: color-mix(in srgb, var(--accent-soft) 45%, #fff);
}

.badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: #f5f5f4;
	color: #44403c;
	font-size: 0.78rem;
	font-weight: 700;
	font-family: var(--mono);
}

.badge.live {
	background: var(--accent-soft);
	color: #115e59;
}

.sandbox-banner {
	margin: 0 0 0.85rem;
	padding: 0.75rem 0.95rem;
	border: 1px solid #fbbf24;
	border-radius: 10px;
	background: linear-gradient(180deg, #fffbeb, #fefce8);
	color: #92400e;
	font-size: 0.92rem;
}

.aspen-draft {
	border: 1px dashed var(--accent);
	border-radius: 12px;
	padding: 0.9rem;
	background: color-mix(in srgb, var(--accent-soft) 55%, #fff);
}

.empty-state {
	padding: 1.5rem 1.2rem;
	border: 1px dashed var(--line);
	border-radius: 16px;
	background: color-mix(in srgb, #fff 70%, transparent);
}

.empty-state h2 {
	font-size: 1.35rem;
	margin-bottom: 0.35rem;
}

.error {
	border: 1px solid #fecaca;
	background: #fef2f2;
	color: var(--danger);
	padding: 0.75rem 1rem;
	border-radius: var(--radius);
}

.settings-page {
	gap: 1.1rem;
}

.settings-card .lede {
	margin: 0 0 0.85rem;
	max-width: 38rem;
}

.checkbox-row {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	font-weight: 600;
	color: var(--ink);
}

.checkbox-row input {
	width: auto;
	margin-top: 0.2rem;
}

.login-hero {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 2rem 1rem;
}

.login-card {
	width: min(440px, 100%);
	padding: 2rem 1.5rem;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: color-mix(in srgb, #fff 92%, transparent);
	box-shadow: 0 18px 50px rgba(28, 25, 23, 0.06);
}

.login-card h1 {
	font-size: 2.4rem;
	margin-bottom: 0.35rem;
}

.eyebrow {
	margin: 0;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--accent);
}

.creative-card img {
	max-width: min(320px, 100%);
	border-radius: 10px;
	border: 1px solid var(--line);
}

.section-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.skip-link {
	position: absolute;
	left: 0.75rem;
	top: -3rem;
	z-index: 60;
	padding: 0.5rem 0.85rem;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 8px;
}

.skip-link:focus {
	top: 0.5rem;
}

.wizard-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.1rem;
	margin: 0;
	padding: 0.85rem 1rem;
	list-style: none;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: color-mix(in srgb, #fff 88%, transparent);
}

.wizard-steps li {
	color: var(--muted);
	font-weight: 600;
	font-size: 0.92rem;
}

.wizard-steps li.current,
.wizard-steps li.current a {
	color: var(--ink);
	font-weight: 700;
}

.wizard-steps a {
	color: var(--accent);
}

.wizard-list {
	margin: 0;
	padding-left: 1.2rem;
	display: grid;
	gap: 0.45rem;
}

.package-pick {
	display: grid;
	gap: 0.4rem;
	font-weight: 600;
	cursor: pointer;
}

.package-pick input {
	width: auto;
}

.package-pick .muted {
	font-weight: 400;
}

@media (max-width: 720px) {
	.stat-grid {
		grid-template-columns: 1fr;
	}

	.flw-app-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.flw-app-header-nav {
		width: 100%;
	}
}
