/* usedocs.app — minimalist design system */

/* Fonts: load via <link> in HTML (preconnect + stylesheet). */

:root {
	/* Same palette as the homepage (home.css): neutral grays, black ink, violet for accents only */
	--bg: #fafafa;
	--surface: #ffffff;
	--ink: #0a0a0a;
	--ink-soft: #52525b;
	--ink-faint: #71717a;
	--line: #e4e4e7;
	--line-soft: #f4f4f5;
	--brand: #5b54f5;
	--brand-hover: #4a43e0;
	--accent-soft: rgba(91, 84, 245, 0.08);
	--accent-border: rgba(91, 84, 245, 0.22);
	--accent-glow: rgba(91, 84, 245, 0.12);
	--focus-ring: #71717a;
	--focus-ring-offset: #fafafa;
	--purple: var(--brand);
	--purple-hover: var(--brand-hover);
	--purple-border: var(--accent-border);
	--purple-soft: var(--accent-soft);
	--purple-glow: var(--accent-glow);
	--green: #00a33e;
	--green-soft: #ecfdf3;
	--amber: #c7831d;
	--amber-soft: #fffbeb;
	--red: #dc2626;
	--red-soft: #fef2f2;
	--radius: 12px;
	--radius-lg: 16px;
	--radius-xl: 20px;
	--shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 12px 32px -12px rgba(10, 10, 10, 0.1);
	--shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04), 0 8px 24px -8px rgba(10, 10, 10, 0.08);
	--font-display: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
	--font-body: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
	--font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--maxw: 1120px;
	--header-offset: 80px;
}

* { box-sizing: border-box; }
html {
	scroll-behavior: smooth;
	color-scheme: light;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
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;
	-webkit-tap-highlight-color: rgba(91, 84, 245, 0.18);
}

.label-mono {
	font-family: var(--font-mono);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-soft);
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button, input, textarea, select { font: inherit; }

/* Visible keyboard focus; suppress ring on pure pointer clicks where supported */
:where(a, button, summary, [role="button"], [role="switch"], [tabindex]:not([tabindex="-1"])):focus {
	outline: 2px solid var(--focus-ring);
	outline-offset: 2px;
}
:where(a, button, summary, [role="button"], [role="switch"], [tabindex]:not([tabindex="-1"])):focus:not(:focus-visible) {
	outline: none;
}
:where(a, button, summary, [role="button"], [role="switch"], [tabindex]:not([tabindex="-1"])):focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 2px;
}

button,
.btn,
a.btn,
[role="button"],
[role="switch"],
.nav-toggle,
input[type="submit"],
input[type="button"] {
	touch-action: manipulation;
}

.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(--ink);
	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;
}
/* Black like the homepage's buttons, violet on hover. */
.btn.primary {
	background: var(--ink);
	border: 1px solid var(--ink);
	color: #fff;
	box-shadow: none;
}
.btn.primary:hover {
	background: var(--brand);
	border-color: var(--brand);
}
.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:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 2px;
}
.btn.primary:focus-visible {
	outline-color: var(--focus-ring);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--focus-ring-offset);
}
.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-visible, textarea:focus-visible, select:focus-visible {
	border-color: var(--focus-ring);
	box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}
/* Selects look like the dashboard's shadcn Select. /ui-select.js swaps the native list for the same popover;
   without JS the native select keeps this trigger look. */
select:not([multiple]):not([size]) {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 36px;
	background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
	cursor: pointer;
}
.ui-select { position: relative; width: 100%; }
.ui-select-native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0 !important;
	padding: 0 !important;
}
.ui-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: 40px;
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04);
	color: var(--ink);
	font-size: 14px;
	line-height: 20px;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.ui-select-trigger:focus-visible,
.ui-select-trigger[aria-expanded="true"] {
	outline: none;
	border-color: var(--focus-ring);
	box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}
.ui-select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.ui-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-trigger svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--ink-faint); }
.ui-select-list {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	z-index: 40;
	max-height: 288px;
	overflow-y: auto;
	padding: 4px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	box-shadow: 0 12px 32px -12px rgba(10, 10, 10, 0.18);
	animation: ui-select-in 0.14s ease-out;
}
.ui-select-list[hidden] { display: none; }
.ui-select-list.is-up { top: auto; bottom: calc(100% + 4px); }
@keyframes ui-select-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.ui-select-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 8px;
	border-radius: 6px;
	color: var(--ink);
	font-size: 14px;
	line-height: 20px;
	cursor: pointer;
	user-select: none;
}
.ui-select-option.is-active { background: var(--line-soft); }
.ui-select-option[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.ui-select-option svg { flex-shrink: 0; width: 16px; height: 16px; visibility: hidden; }
.ui-select-option[aria-selected="true"] svg { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .ui-select-list { animation: none; } }
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;
}
