/*!*************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../../node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************************/
:root {
	--bg: #0b0c10;
	--panel: #15171f;
	--panel-2: #1d212b;
	--border: #2a2f3a;
	--text: #e7e9ee;
	--muted: #9aa3b2;
	--accent: #6c8cff;
	--accent-2: #8b5cf6;
	--green: #34d399;
	--red: #f87171;
	--yellow: #fbbf24;
	--blue: #60a5fa;
	--radius: 12px;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
}

body {
	background: radial-gradient(1200px 600px at 70% -10%, #1a1d2b 0%, var(--bg) 55%);
	color: var(--text);
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	line-height: 1.55;
	min-height: 100vh;
}

a {
	color: inherit;
	text-decoration: none;
}

.site-header {
	border-bottom: 1px solid var(--border);
	background: rgba(11, 12, 16, 0.7);
	-webkit-backdrop-filter: blur(8px);
	        backdrop-filter: blur(8px);
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 10;
}

.site-header__inner {
	max-width: 1220px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.brand {
	font-weight: 700;
	letter-spacing: -0.01em;
}

.nav {
	display: flex;
	gap: 18px;
}

.nav a {
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
}

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

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

h1 {
	font-size: 24px;
	letter-spacing: -0.02em;
	margin: 0 0 4px;
}

.subtitle {
	color: var(--muted);
	margin: 0 0 24px;
	font-size: 14px;
}

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

.field-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

textarea {
	width: 100%;
	min-height: 110px;
	background: var(--panel-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	resize: vertical;
}

textarea:focus {
	outline: none;
	border-color: var(--accent);
}

.text-input {
	width: 100%;
	height: 42px;
	background: var(--panel-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	padding: 10px 12px;
	font: inherit;
}

.text-input:focus {
	outline: none;
	border-color: var(--accent);
}

.tag-list {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.tag-chip {
	display: inline-flex;
	align-items: center;
	max-width: 180px;
	padding: 2px 8px;
	border: 1px solid rgba(108, 140, 255, 0.35);
	border-radius: 999px;
	background: rgba(108, 140, 255, 0.1);
	color: #b9c6ff;
	font-size: 12px;
	overflow-wrap: anywhere;
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(4, 5, 8, 0.72);
	-webkit-backdrop-filter: blur(4px);
	        backdrop-filter: blur(4px);
}

.modal {
	width: min(520px, 100%);
	max-height: calc(100vh - 40px);
	margin: 0;
	overflow: auto;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	padding: 22px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal h2 {
	margin: 0 0 6px;
	font-size: 18px;
	overflow-wrap: anywhere;
}

.modal form {
	margin-top: 18px;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

.providers {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.provider-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--panel-2);
	cursor: pointer;
	font-size: 14px;
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	transition: border-color 0.15s, background 0.15s;
}

.provider-chip[data-checked="true"] {
	border-color: var(--accent);
	background: rgba(108, 140, 255, 0.12);
}

.provider-chip input {
	accent-color: var(--accent);
}

.row {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-top: 18px;
	flex-wrap: wrap;
}

button.primary {
	background: linear-gradient(180deg, var(--accent) 0%, #5a78f0 100%);
	color: white;
	border: none;
	padding: 11px 20px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

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

.hint {
	color: var(--muted);
	font-size: 13px;
}

.section-title {
	margin: 32px 0 14px;
	font-size: 15px;
	font-weight: 600;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 10px;
}

.prompt-panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 18px;
	margin-bottom: 18px;
}

.prompt-text {
	margin: 6px 0 0;
	color: var(--text);
	font-size: 15px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.prompt-text:first-of-type {
	margin-top: 0;
}

.prompt-index {
	color: var(--muted);
	margin-right: 8px;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
}

.results {
	display: grid;
	grid-gap: 14px;
	gap: 14px;
}

.result {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
}

.result__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.provider-name {
	font-weight: 600;
	font-size: 15px;
}

.badge {
	display: inline-flex;
	max-width: 100%;
	align-items: center;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 999px;
	border: 1px solid transparent;
	text-transform: capitalize;
	white-space: normal;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.badge--queued {
	color: var(--muted);
	background: #20242e;
}
.badge--running {
	color: var(--blue);
	background: rgba(96, 165, 250, 0.12);
}
.badge--completed {
	color: var(--green);
	background: rgba(52, 211, 153, 0.12);
}
.badge--failed {
	color: var(--red);
	background: rgba(248, 113, 113, 0.12);
}
.badge--partial {
	color: var(--yellow);
	background: rgba(251, 191, 36, 0.12);
}
.badge--pending {
	color: var(--muted);
	background: #20242e;
}
.badge--stopped {
	color: var(--muted);
	background: #20242e;
}

.head-badges {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.auth-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	border: 1px solid var(--border);
}

.auth-badge--on {
	color: var(--green);
	background: rgba(52, 211, 153, 0.1);
	border-color: rgba(52, 211, 153, 0.3);
}

.auth-badge--off {
	color: var(--muted);
	background: #20242e;
}

.badge--needsauth {
	color: var(--yellow);
	background: rgba(251, 191, 36, 0.12);
	border-color: rgba(251, 191, 36, 0.3);
}

.needs-auth-note {
	margin-top: 12px;
	color: var(--muted);
	font-size: 13px;
	background: rgba(251, 191, 36, 0.06);
	border: 1px solid rgba(251, 191, 36, 0.22);
	border-radius: 10px;
	padding: 10px 12px;
}

.needs-auth-note a {
	color: var(--blue);
	font-weight: 600;
	white-space: nowrap;
}

.response-controls {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.ghost-btn {
	background: var(--panel-2);
	border: 1px solid var(--border);
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
	padding: 5px 12px;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
	white-space: nowrap;
}

.ghost-btn:hover {
	color: var(--text);
	border-color: var(--accent);
}

.response {
	margin-top: 12px;
	background: var(--panel-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 12px 14px;
	white-space: pre-wrap;
	font-size: 14px;
	color: #d7dbe4;
}

.error-text {
	margin-top: 12px;
	color: var(--red);
	font-size: 13px;
	background: rgba(248, 113, 113, 0.08);
	border: 1px solid rgba(248, 113, 113, 0.25);
	border-radius: 10px;
	padding: 10px 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.sources {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sources a {
	color: var(--blue);
	font-size: 13px;
	word-break: break-all;
}

.prompt-quote {
	color: var(--muted);
	font-size: 13px;
	margin: 4px 0 0;
}

.spinner {
	width: 14px;
	height: 14px;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	display: inline-block;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* History table */
.history-toolbar {
	display: grid;
	grid-gap: 18px;
	gap: 18px;
}

.history-filters {
	display: grid;
	grid-gap: 16px;
	gap: 16px;
}

.history-filter-search-row {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) auto;
	grid-gap: 16px;
	gap: 16px;
	align-items: end;
}

.history-search {
	max-width: 560px;
}

.history-dropdowns {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-gap: 12px;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}

.history-filter {
	display: grid;
	grid-gap: 6px;
	gap: 6px;
	min-width: 0;
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.history-filter select {
	width: 100%;
	height: 42px;
	min-width: 0;
	background: var(--panel-2);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text);
	padding: 0 10px;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.history-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	color: var(--muted);
	font-size: 13px;
	white-space: nowrap;
}

.history-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.history-table-card {
	padding: 0;
	overflow: hidden;
	margin-top: 14px;
}

.history-table-scroll {
	max-width: 100%;
	overflow-x: auto;
}

.history-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px;
	border-top: 1px solid var(--border);
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.history-table {
	table-layout: fixed;
	min-width: 980px;
}

.history-table th:nth-child(1) {
	width: 150px;
}

.history-table th:nth-child(2) {
	width: 34%;
}

.history-table th:nth-child(3) {
	width: 150px;
}

.history-table th:nth-child(4) {
	width: 130px;
}

.history-table th:nth-child(5) {
	width: 16%;
}

.history-table th:nth-child(6) {
	width: 64px;
}

.history-table th:nth-child(7) {
	width: 148px;
}

.history-table td {
	overflow-wrap: anywhere;
}

.history-table .history-when {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.history-table .tag-chip {
	max-width: 120px;
}

/* Run history (/history): fix the layout so a long prompt ellipsizes in its
   column instead of expanding the table and clipping the columns to its right. */
.runs-table {
	table-layout: fixed;
}

.runs-table th:nth-child(1) {
	width: 130px;
}

.runs-table th:nth-child(3) {
	width: 220px;
}

.runs-table th:nth-child(4) {
	width: 130px;
}

/* The run status is a single word — keep it on one line instead of wrapping. */
.runs-table td:nth-child(4) .badge {
	white-space: nowrap;
}

.table th {
	text-align: left;
	color: var(--muted);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
}

.table td {
	padding: 12px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}

.table tr:hover td {
	background: var(--panel-2);
}

.provider-pills {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.prompt-cell {
	display: block;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Keeps the prompt text truncating while the prompt-count pill stays visible. */
.prompt-cell-wrap {
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

.prompt-cell-wrap .prompt-cell {
	flex: 1 1 auto;
}

.prompt-count {
	flex: 0 0 auto;
	white-space: nowrap;
	font-size: 12px;
	color: var(--muted);
	background: var(--panel-2);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 2px 8px;
}

.empty {
	color: var(--muted);
	text-align: center;
	padding: 48px 0;
}

.back-link {
	color: var(--muted);
	font-size: 13px;
	display: inline-block;
	margin-bottom: 14px;
}
.back-link:hover {
	color: var(--text);
}

.mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	color: var(--muted);
}

@media (max-width: 760px) {
	.history-dropdowns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.history-filter-search-row {
		grid-template-columns: 1fr;
	}

	.history-search {
		max-width: none;
	}

	.history-actions {
		justify-content: flex-start;
	}

	.result__head {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (max-width: 520px) {
	.history-dropdowns {
		grid-template-columns: 1fr;
	}

	.history-pagination {
		align-items: stretch;
		flex-direction: column;
	}

	.history-actions .ghost-btn {
		flex: 1 1 auto;
	}

	.modal-actions {
		flex-direction: column-reverse;
	}

	.modal-actions button {
		width: 100%;
	}
}

