:root {
	--bg: #070a10;
	--bg-elev: #0d131f;
	--panel: #111927;
	--panel-soft: #162133;
	--line: #1f2b3f;
	--line-bright: #2e405c;
	--text: #e6edf7;
	--muted: #93a4bd;
	--dim: #64748b;
	--accent: #34d399;
	--accent-dim: rgba(52, 211, 153, 0.14);
	--blue: #38bdf8;
	--blue-dim: rgba(56, 189, 248, 0.14);
	--warn: #fbbf24;
	--warn-dim: rgba(251, 191, 36, 0.14);
	--danger: #f87171;
	--danger-dim: rgba(248, 113, 113, 0.14);
	--radius: 12px;
	--radius-sm: 8px;
	--mono:
		"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--blue);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

button,
input,
select,
textarea {
	font-family: inherit;
	font-size: 13px;
}

input,
select,
textarea {
	background: #080c14;
	border: 1px solid var(--line);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 8px 11px;
	outline: none;
	transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--blue);
}

button {
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	padding: 8px 14px;
	font-weight: 600;
	transition:
		transform 0.08s ease,
		background 0.15s ease,
		border-color 0.15s ease,
		opacity 0.15s ease;
}

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

.btn-primary {
	background: var(--accent);
	color: #032619;
}
.btn-primary:hover:not(:disabled) {
	background: #4ade80;
}

.btn-blue {
	background: var(--blue);
	color: #041d2e;
}
.btn-blue:hover:not(:disabled) {
	background: #67d3ff;
}

.btn-ghost {
	background: var(--panel-soft);
	color: var(--text);
	border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) {
	border-color: var(--line-bright);
	background: #1b283d;
}

.btn-danger {
	background: var(--danger-dim);
	color: #fecaca;
	border-color: rgba(248, 113, 113, 0.35);
}

.btn-sm {
	padding: 5px 10px;
	font-size: 12px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	border: 1px solid var(--line);
	background: var(--bg-elev);
	color: var(--muted);
}

.pill-green {
	background: var(--accent-dim);
	color: var(--accent);
	border-color: rgba(52, 211, 153, 0.35);
}

.pill-blue {
	background: var(--blue-dim);
	color: var(--blue);
	border-color: rgba(56, 189, 248, 0.35);
}

.pill-warn {
	background: var(--warn-dim);
	color: var(--warn);
	border-color: rgba(251, 191, 36, 0.35);
}

.pill-danger {
	background: var(--danger-dim);
	color: var(--danger);
	border-color: rgba(248, 113, 113, 0.35);
}

.mono {
	font-family: var(--mono);
}

.hidden {
	display: none !important;
}

/* ---------- Landing Page ---------- */
.landing-nav {
	position: sticky;
	top: 0;
	z-index: 40;
	backdrop-filter: blur(12px);
	background: rgba(7, 10, 16, 0.85);
	border-bottom: 1px solid var(--line);
}

.landing-nav-inner {
	max-width: 1220px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.brand-mark {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.02em;
	color: var(--text);
}

.brand-logo {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: linear-gradient(135deg, #34d399, #38bdf8);
	color: #03221a;
	display: grid;
	place-items: center;
	font-family: var(--mono);
	font-weight: 800;
	font-size: 13px;
}

.container {
	max-width: 1220px;
	margin: 0 auto;
	padding: 0 20px;
}

.hero {
	padding: 58px 0 42px;
	display: grid;
	grid-template-columns: 1.25fr 0.95fr;
	gap: 28px;
	align-items: center;
}

.hero h1 {
	font-size: clamp(28px, 4.2vw, 46px);
	line-height: 1.12;
	margin: 14px 0 16px;
	letter-spacing: -0.02em;
}

.hero p.lead {
	font-size: 16px;
	color: var(--muted);
	margin: 0 0 24px;
	max-width: 60ch;
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
}

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

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

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

.section {
	padding: 36px 0;
	border-top: 1px solid var(--line);
}

.section-title {
	font-size: 22px;
	margin: 0 0 8px;
}

.section-sub {
	color: var(--muted);
	margin: 0 0 22px;
}

.suite-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.suite-tab {
	background: var(--panel);
	color: var(--muted);
	border: 1px solid var(--line);
	padding: 9px 14px;
	border-radius: 10px;
}

.suite-tab.active {
	background: var(--blue-dim);
	color: var(--text);
	border-color: var(--blue);
}

.tier-card.featured {
	border-color: var(--accent);
	background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), var(--panel));
}

.price-tag {
	font-size: 26px;
	font-weight: 700;
	font-family: var(--mono);
	margin: 8px 0 12px;
}

ul.clean {
	margin: 0;
	padding-left: 18px;
	color: var(--muted);
	display: grid;
	gap: 7px;
}

/* ---------- Auth Page ---------- */
.auth-shell {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px 16px;
	background:
		radial-gradient(
			600px 300px at 20% 10%,
			rgba(52, 211, 153, 0.1),
			transparent
		),
		radial-gradient(
			600px 300px at 85% 90%,
			rgba(56, 189, 248, 0.1),
			transparent
		),
		var(--bg);
}

.auth-card {
	width: 100%;
	max-width: 460px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 24px;
}

.tab-bar {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	background: #080c14;
	padding: 4px;
	border-radius: 10px;
	border: 1px solid var(--line);
	margin-bottom: 18px;
}

.tab-btn {
	background: transparent;
	color: var(--muted);
	padding: 8px;
	border-radius: 7px;
}

.tab-btn.active {
	background: var(--panel-soft);
	color: var(--text);
}

.form-stack {
	display: grid;
	gap: 12px;
}

.field {
	display: grid;
	gap: 5px;
}

.field label {
	font-size: 12px;
	color: var(--muted);
	font-weight: 500;
}

.alert {
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	font-size: 13px;
	border: 1px solid;
}

.alert-error {
	background: var(--danger-dim);
	border-color: rgba(248, 113, 113, 0.4);
	color: #fecaca;
}

.alert-ok {
	background: var(--accent-dim);
	border-color: rgba(52, 211, 153, 0.4);
	color: #bbf7d0;
}

/* ---------- Workbench App Layout ---------- */
.wb-root {
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wb-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 16px;
	background: var(--bg-elev);
	border-bottom: 1px solid var(--line);
	flex-shrink: 0;
	flex-wrap: wrap;
}

.wb-top-group {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.wb-mobile-tabs {
	display: none;
	background: var(--bg-elev);
	border-bottom: 1px solid var(--line);
	padding: 6px 10px;
	gap: 6px;
}

.wb-main {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: 330px minmax(360px, 1fr) 430px;
	background: var(--bg);
}

.wb-pane {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 1px solid var(--line);
}

.wb-pane:last-child {
	border-right: 0;
}

.wb-pane-head {
	padding: 10px 14px;
	border-bottom: 1px solid var(--line);
	background: rgba(17, 25, 39, 0.65);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-shrink: 0;
}

.wb-scroll {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.side-tabs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
	padding: 8px;
	border-bottom: 1px solid var(--line);
	background: var(--bg-elev);
}

.side-tab-btn {
	padding: 6px 4px;
	font-size: 11px;
	background: transparent;
	color: var(--muted);
	border: 1px solid transparent;
	border-radius: 6px;
}

.side-tab-btn.active {
	background: var(--panel-soft);
	color: var(--text);
	border-color: var(--line);
}

.playbook-card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 12px;
	display: grid;
	gap: 8px;
}

.playbook-card.selected {
	border-color: var(--blue);
}

.msg {
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--panel);
	display: grid;
	gap: 8px;
}

.msg-user {
	background: #142236;
	border-color: #253b5c;
	align-self: flex-end;
	max-width: 90%;
}

.msg-assistant {
	background: var(--panel);
	border-color: var(--line);
}

.msg-role {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.tool-trace {
	background: #080d16;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 12px;
}

.tool-trace summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--accent);
}

.tool-trace pre {
	margin: 8px 0 0;
	white-space: pre-wrap;
	word-break: break-word;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--muted);
	max-height: 220px;
	overflow-y: auto;
}

.composer {
	padding: 12px 14px;
	border-top: 1px solid var(--line);
	background: var(--bg-elev);
	display: grid;
	gap: 8px;
	flex-shrink: 0;
}

.composer-row {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.composer-row textarea {
	flex: 1;
	min-height: 54px;
	max-height: 180px;
	resize: vertical;
}

.canvas-editor {
	flex: 1;
	min-height: 240px;
	width: 100%;
	resize: none;
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.55;
	padding: 12px;
}

.md-view {
	font-size: 13.5px;
	line-height: 1.6;
	word-break: break-word;
}

.md-view h1,
.md-view h2,
.md-view h3 {
	margin: 12px 0 6px;
	color: var(--text);
}

.md-view h2 {
	font-size: 16px;
	border-bottom: 1px solid var(--line);
	padding-bottom: 4px;
}

.md-view table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
	font-size: 12.5px;
}

.md-view th,
.md-view td {
	border: 1px solid var(--line);
	padding: 6px 8px;
	text-align: left;
}

.md-view th {
	background: var(--panel-soft);
}

.md-view pre {
	background: #080c14;
	border: 1px solid var(--line);
	padding: 10px;
	border-radius: 8px;
	overflow-x: auto;
	font-family: var(--mono);
	font-size: 12px;
}

.md-view code {
	font-family: var(--mono);
	background: #080c14;
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 12px;
}

.provenance-foot {
	padding: 10px 14px;
	border-top: 1px solid var(--line);
	background: var(--bg-elev);
	font-size: 11.5px;
	color: var(--muted);
	display: grid;
	gap: 4px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(2, 6, 12, 0.78);
	backdrop-filter: blur(4px);
	display: grid;
	place-items: center;
	padding: 16px;
	z-index: 100;
}

.modal-card {
	width: 100%;
	max-width: 680px;
	max-height: 90vh;
	overflow-y: auto;
	background: var(--panel);
	border: 1px solid var(--line-bright);
	border-radius: 14px;
	padding: 20px;
	display: grid;
	gap: 14px;
}

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

.provider-tile {
	text-align: left;
	background: #080d16;
	border: 1px solid var(--line);
	color: var(--text);
	padding: 10px 12px;
	border-radius: 10px;
	display: grid;
	gap: 4px;
}

.provider-tile.active {
	border-color: var(--accent);
	background: rgba(52, 211, 153, 0.08);
}

.toast {
	position: fixed;
	bottom: 18px;
	right: 18px;
	background: var(--panel);
	border: 1px solid var(--accent);
	color: var(--text);
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	z-index: 120;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ---------- Responsive ---------- */
@media (max-width: 1140px) {
	.wb-main {
		grid-template-columns: 290px 1fr 340px;
	}
}

@media (max-width: 920px) {
	.hero {
		grid-template-columns: 1fr;
		padding: 32px 0;
	}
	.grid-2,
	.grid-3,
	.grid-4 {
		grid-template-columns: 1fr;
	}
	.wb-mobile-tabs {
		display: flex;
	}
	.wb-main {
		grid-template-columns: 1fr;
	}
	.wb-pane {
		display: none;
		border-right: 0;
	}
	.wb-pane.mobile-active {
		display: flex;
	}
}

/* ---------- Print / PDF Export ---------- */
#printableDeliverable {
	display: none;
}

@media print {
	body {
		background: #ffffff !important;
		color: #0f172a !important;
	}
	.wb-root,
	.modal-backdrop,
	.toast,
	.landing-nav,
	main {
		display: none !important;
	}
	#printableDeliverable {
		display: block !important;
		padding: 20px 28px;
		font-family: Georgia, "Times New Roman", serif;
		color: #0f172a;
	}
	#printableDeliverable h1,
	#printableDeliverable h2,
	#printableDeliverable h3 {
		color: #0f172a;
		border-color: #cbd5e1;
	}
	#printableDeliverable th {
		background: #f1f5f9 !important;
	}
	#printableDeliverable th,
	#printableDeliverable td {
		border: 1px solid #cbd5e1 !important;
	}
	.print-meta {
		margin-top: 24px;
		padding-top: 10px;
		border-top: 1px solid #cbd5e1;
		font-size: 11px;
		color: #475569;
		font-family: var(--sans);
	}
}
