/* usedocs.app — minimalist design system */

@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@8..144,400;8..144,500;8..144,600;8..144,700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
	--bg: #fafafa;
	--surface: #ffffff;
	--ink: #18181b;
	--ink-soft: #52525b;
	--ink-faint: #a1a1aa;
	--line: #e4e4e7;
	--line-soft: #f4f4f5;
	--brand: #5249e8;
	--brand-hover: #4338ca;
	--accent-soft: #eef2ff;
	--accent-border: #c7d2fe;
	--accent-glow: rgba(82, 73, 232, 0.12);
	--purple: var(--brand);
	--purple-hover: var(--brand-hover);
	--purple-border: var(--accent-border);
	--purple-soft: var(--accent-soft);
	--purple-glow: var(--accent-glow);
	--green: #16a34a;
	--green-soft: #f0fdf4;
	--amber: #d97706;
	--amber-soft: #fffbeb;
	--red: #dc2626;
	--red-soft: #fef2f2;
	--radius: 10px;
	--radius-lg: 14px;
	--radius-xl: 18px;
	--shadow: 0 24px 48px rgba(24, 24, 27, 0.06);
	--shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px rgba(24, 24, 27, 0.04);
	--font-display: "Inter", ui-sans-serif, system-ui, sans-serif;
	--font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, monospace;
	--maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 15px;
	letter-spacing: -0.02em;
}
.mark {
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	background: var(--brand);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	flex-shrink: 0;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 16px;
	border-radius: var(--radius);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
	white-space: nowrap;
}
.btn.primary {
	background: var(--brand);
	border: 1px solid var(--brand);
	color: #fff;
	box-shadow: none;
}
.btn.primary:hover {
	background: var(--brand-hover);
	border-color: var(--brand-hover);
}
.btn.secondary,
.btn.ghost {
	background: var(--surface);
	color: var(--ink);
	border: 1px solid var(--line);
}
.btn.secondary:hover,
.btn.ghost:hover {
	background: var(--line-soft);
	border-color: #d4d4d8;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.full { width: 100%; }
.btn.lg {
	min-height: 42px;
	padding: 0 20px;
	font-size: 15px;
}

label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--ink-soft);
	margin: 14px 0 6px;
}
label:first-child { margin-top: 0; }
input:not(.sr-only):not([hidden]), textarea, select {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--line);
	color: var(--ink);
	border-radius: var(--radius);
	padding: 9px 12px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
	border-color: var(--accent-border);
	box-shadow: 0 0 0 3px var(--accent-glow);
}
input[type="color"] { padding: 4px; height: 40px; }
input[readonly] { background: var(--bg); color: var(--ink-soft); }

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 24px;
	margin-bottom: 16px;
	box-shadow: var(--shadow-sm);
}
.card h2 {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-faint);
}
.eyebrow .dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--brand);
}

.muted { color: var(--ink-soft); font-size: 13px; }
.empty { color: var(--ink-soft); font-size: 13px; padding: 16px 0; }
.code {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 12px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--ink-soft);
	white-space: pre-wrap;
	word-break: break-all;
}
.row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; max-width: 100%; }
.row > * { flex: 1; min-width: 0; }
.row > .btn { flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--line-soft);
	vertical-align: top;
}
th {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius);
	padding: 7px 12px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	color: var(--ink-soft);
	transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); background: var(--line-soft); }
.tab.active {
	color: var(--brand);
	background: var(--accent-soft);
	border-color: var(--accent-border);
}

.pill {
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 500;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--bg);
	border: 1px solid var(--line);
}
.pill.bad { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.pill.warn { color: var(--amber); border-color: #fde68a; background: var(--amber-soft); }

.toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--ink);
	padding: 10px 16px;
	border-radius: var(--radius);
	font-size: 13px;
	color: #fff;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 100;
	box-shadow: var(--shadow);
}
.toast.show { opacity: 1; }

#chatlog {
	max-height: 320px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 12px;
}
.msg {
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.5;
	max-width: 90%;
}
.msg.u {
	align-self: flex-end;
	background: var(--brand);
	color: #fff;
	border-radius: 12px 12px 4px 12px;
}
.msg.a {
	align-self: flex-start;
	background: var(--surface);
	border: 1px solid var(--line);
	color: var(--ink);
}
.cite { font-size: 11px; color: var(--ink-faint); margin-top: 6px; }
.cite a { color: var(--brand); }

.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-actions .btn { font-size: 13px; padding: 8px 14px; cursor: pointer; }

.lead-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}
.lead-form-title { margin: 0; font-size: 13px; color: var(--ink-soft); }
.lead-form input { width: 100%; min-width: 0; }
.lead-form .lead-submit { width: 100%; cursor: pointer; }

.dash-page {
	height: 100vh;
	min-height: 100vh;
	background: var(--bg);
	overflow-x: clip;
	max-width: 100%;
}
.status-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ink-faint);
}
.status-dot.on { background: var(--green); }

.dash-stat {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 16px;
}
.dash-stat .n {
	font-size: 26px;
	font-weight: 600;
	letter-spacing: -0.03em;
	color: var(--ink);
	line-height: 1;
}
.dash-stat .l { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.preset-label {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-faint);
}
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.preset-row .preset.active {
	color: var(--brand);
	background: var(--accent-soft);
	border-color: var(--accent-border);
}
.preset-hint { margin: 0 0 14px; font-size: 12px; color: var(--ink-soft); min-height: 18px; }
.cap-block {
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 16px;
	background: var(--bg);
}
.cap-block-title {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--ink);
}
.cap-toggle {
	display: flex !important;
	align-items: flex-start;
	gap: 8px;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: var(--ink) !important;
	margin: 0 0 10px !important;
	line-height: 1.4 !important;
	overflow-wrap: anywhere;
}
.cap-toggle input {
	width: auto;
	min-width: 16px;
	margin: 2px 0 0;
	flex-shrink: 0;
}
