:root {
	color-scheme: light;
	--bg: #edf2ef;
	--surface: #edf2ef;
	--text: #1c1825;
	--muted: #6f6674;
	--primary: #3e0d6b;
	--primary-dark: #29084f;
	--shadow-raised: 14px 14px 30px #cad2ce, -14px -14px 30px #ffffff;
	--shadow-soft: 8px 8px 18px #cbd3cf, -8px -8px 18px #ffffff;
	--shadow-inset: inset 6px 6px 12px #cbd3cf, inset -6px -6px 12px #ffffff;
	font-family:
		Inter,
		ui-sans-serif,
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		'Segoe UI',
		sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(
			circle at top left,
			rgba(13, 107, 82, 0.12),
			transparent 32rem
		),
		var(--bg);
	color: var(--text);
}

main {
	width: min(1320px, calc(100vw - 32px));
	margin: 0 auto;
	padding: 42px 0;
}

.app-shell {
	display: grid;
	grid-template-columns: 184px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.nav-panel {
	position: sticky;
	top: 24px;
	display: grid;
	gap: 24px;
	padding: 18px;
	border-radius: 24px;
	background: var(--surface);
	box-shadow: var(--shadow-raised);
}

.nav-brand {
	display: flex;
	gap: 12px;
	align-items: center;
	min-width: 0;
}

.nav-mark {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	flex: none;
	border-radius: 14px;
	background: linear-gradient(145deg, var(--primary), #0d6b52);
	color: #ffffff;
	font-size: 18px;
	font-weight: 900;
	box-shadow: var(--shadow-soft);
}

.nav-brand strong,
.nav-brand small {
	display: block;
	line-height: 1.15;
}

.nav-brand strong {
	font-size: 14px;
}

.nav-brand small {
	margin-top: 3px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 750;
}

.nav-menu {
	display: grid;
	gap: 8px;
}

.nav-item {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	min-height: 42px;
	padding: 0 12px;
	border-radius: 14px;
	background: var(--surface);
	color: var(--muted);
	box-shadow: none;
	font-size: 13px;
	text-align: left;
}

.nav-item:hover:not(:disabled),
.nav-item.active {
	color: var(--text);
	box-shadow: var(--shadow-soft);
}

.nav-item.active {
	background: linear-gradient(145deg, rgba(62, 13, 107, 0.12), rgba(98, 197, 164, 0.18));
}

.view-stack {
	min-width: 0;
}

.app-view {
	display: none;
}

.app-view.active {
	display: block;
}

.shell {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 24px;
	align-items: start;
}

.panel {
	border-radius: 28px;
	background: var(--surface);
	box-shadow: var(--shadow-raised);
}

.hero {
	padding: 34px;
}

.eyebrow {
	margin: 0 0 10px;
	color: var(--primary);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

h1 {
	max-width: 620px;
	margin: 0;
	font-size: clamp(34px, 5vw, 58px);
	line-height: 0.96;
	letter-spacing: 0;
}

.subhead {
	max-width: 620px;
	margin: 18px 0 0;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.6;
}

.workspace {
	display: grid;
	grid-template-columns: minmax(250px, 0.72fr) minmax(320px, 1fr);
	gap: 18px;
	align-items: start;
	margin-top: 28px;
}

.launch-column {
	display: grid;
	gap: 18px;
	min-width: 0;
}

.card {
	min-width: 0;
	padding: 22px;
	border-radius: 22px;
	background: var(--surface);
	box-shadow: var(--shadow-soft);
}

.card-header {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}

.card-header span {
	color: var(--muted);
	font-size: 12px;
	font-weight: 750;
}

h2 {
	margin: 0;
	font-size: 16px;
	line-height: 1.2;
}

h3 {
	margin: 0;
	color: var(--muted);
	font-size: 11px;
	font-weight: 850;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
}

.status-dot {
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: var(--primary);
	box-shadow: 0 0 0 7px rgba(13, 107, 82, 0.12);
}

label {
	display: grid;
	gap: 8px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 750;
}

select,
input[type='text'],
textarea,
input[type='number'] {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 0;
	border-radius: 16px;
	outline: 0;
	background: var(--surface);
	box-shadow: var(--shadow-inset);
	color: var(--text);
	font: inherit;
	appearance: none;
}

textarea {
	min-height: 84px;
	padding: 12px 14px;
	resize: vertical;
}

input[type='number'] {
	text-align: right;
	-moz-appearance: textfield;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
	margin: 0;
	appearance: none;
}

select:focus,
input[type='text']:focus,
textarea:focus,
input[type='number']:focus {
	box-shadow:
		var(--shadow-inset),
		0 0 0 3px rgba(13, 107, 82, 0.18);
}

.controls-card .behavior-fields {
	display: grid;
	gap: 12px;
}

.controls-card .settings-group {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid rgba(62, 13, 107, 0.12);
}

.controls-card .settings-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.controls-card .settings-heading span {
	flex: none;
	padding: 4px 7px;
	border-radius: 999px;
	background: linear-gradient(145deg, rgba(62, 13, 107, 0.16), rgba(98, 197, 164, 0.2));
	color: var(--primary);
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
}

.controls-card .settings-list {
	display: grid;
	gap: 2px;
}

.controls-card .setting-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 92px;
	gap: 14px;
	align-items: center;
	min-height: 62px;
	padding: 9px 0;
	border-bottom: 1px solid rgba(62, 13, 107, 0.08);
}

.controls-card .setting-row:last-child {
	border-bottom: 0;
}

.controls-card .setting-copy {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.controls-card .setting-name {
	color: var(--text);
	font-size: 12.5px;
	font-weight: 850;
	line-height: 1.2;
}

.controls-card .setting-note {
	color: var(--muted);
	font-size: 11.5px;
	font-weight: 650;
	line-height: 1.3;
}

.controls-card .number-field {
	position: relative;
	display: block;
	width: 92px;
}

.controls-card .number-field input {
	width: 92px;
	min-height: 42px;
	padding-right: 28px;
	border: 0;
	border-radius: 14px;
	outline: 0;
	background: var(--surface);
	box-shadow:
		inset 5px 5px 10px #cbd3cf,
		inset -5px -5px 10px #ffffff;
	color: var(--text);
	font-size: 13px;
	font-weight: 850;
	text-align: right;
	appearance: none;
}

.controls-card .number-field.plain input {
	padding-right: 14px;
}

.controls-card .unit {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	color: var(--muted);
	font-size: 10px;
	font-weight: 800;
	pointer-events: none;
}

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

.launcher-card .controls button.primary {
	grid-column: 1 / -1;
}

button {
	min-height: 48px;
	padding: 0 16px;
	border: 0;
	border-radius: 16px;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	transition:
		transform 140ms ease,
		box-shadow 140ms ease,
		background 140ms ease;
}

button:hover:not(:disabled) {
	transform: translateY(-1px);
}

button:active:not(:disabled) {
	transform: translateY(1px);
}

button.primary {
	background: linear-gradient(145deg, var(--primary), var(--primary-dark));
	color: #ffffff;
	box-shadow:
		7px 7px 16px #c7d0cb,
		-7px -7px 16px #ffffff;
}

button.secondary {
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-soft);
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
	transform: none;
}

#status {
	min-height: 24px;
	margin: 18px 0 0;
	color: var(--primary-dark);
	font-size: 14px;
	font-weight: 750;
}

#meter {
	height: 12px;
	margin-top: 14px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--surface);
	box-shadow: var(--shadow-inset);
}

#meter-bar {
	width: 0%;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #62c5a4, var(--primary));
	transition: width 80ms linear;
}

#audio-container audio {
	display: block;
	width: 100%;
	margin-top: 14px;
}

.caller-card {
	position: sticky;
	top: 24px;
	padding: 24px;
}

.evals-hero {
	min-height: calc(100vh - 84px);
}

.evals-topbar {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	justify-content: space-between;
}

.eval-actions {
	display: flex;
	gap: 12px;
	flex: none;
	align-items: center;
}

.eval-actions button {
	min-width: 120px;
}

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

.metric-card {
	min-width: 0;
	padding: 18px;
	border-radius: 18px;
	background: var(--surface);
	box-shadow: var(--shadow-soft);
}

.metric-card span {
	display: block;
	color: var(--muted);
	font-size: 11px;
	font-weight: 850;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.metric-card strong {
	display: block;
	margin-top: 8px;
	font-size: 24px;
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.eval-results-card,
.eval-launch-card,
.eval-details-card {
	margin-top: 18px;
}

.eval-launch-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
}

.eval-picker-grid {
	display: grid;
	grid-template-columns: minmax(150px, 0.8fr) minmax(240px, 1.4fr) minmax(140px, auto);
	gap: 14px;
	align-items: end;
	margin-bottom: 16px;
}

.eval-picker-grid button {
	width: 100%;
}

.table-wrap {
	overflow: auto;
	border-radius: 16px;
	box-shadow: var(--shadow-inset);
}

.eval-table {
	width: 100%;
	min-width: 620px;
	border-collapse: collapse;
	background: var(--surface);
	color: var(--text);
	font-size: 13px;
}

.eval-table th,
.eval-table td {
	padding: 14px 16px;
	border-bottom: 1px solid rgba(62, 13, 107, 0.1);
	text-align: left;
	white-space: nowrap;
}

.eval-table th {
	color: var(--muted);
	font-size: 11px;
	font-weight: 850;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.eval-table tr:last-child td {
	border-bottom: 0;
}

.eval-table .dimension-name {
	font-weight: 850;
}

.eval-table .score-pass {
	color: #0d6b52;
	font-weight: 900;
}

.eval-table .score-fail {
	color: #a02626;
	font-weight: 900;
}

.table-action {
	min-height: 34px;
	padding: 0 12px;
	border-radius: 12px;
	background: var(--surface);
	color: var(--primary);
	box-shadow: var(--shadow-soft);
	font-size: 12px;
	font-weight: 850;
}

.eval-details {
	display: grid;
	gap: 12px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.45;
}

.eval-detail-group {
	padding: 14px;
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow-inset);
}

.eval-detail-group strong {
	display: block;
	margin-bottom: 8px;
	color: var(--text);
	font-size: 13px;
}

.eval-case {
	display: grid;
	gap: 10px;
	margin-top: 12px;
	padding: 12px;
	border-left: 4px solid #0d6b52;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.34);
}

.eval-case.failed {
	border-left-color: #a02626;
}

.eval-case-header,
.eval-step-header {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
}

.eval-case-header span,
.eval-step-header span {
	color: var(--text);
	font-weight: 900;
}

.eval-case-header em,
.eval-step-header em {
	flex: none;
	color: var(--muted);
	font-size: 11px;
	font-style: normal;
	font-weight: 850;
	text-transform: uppercase;
}

.eval-case.passed .eval-case-header em {
	color: #0d6b52;
}

.eval-case.failed .eval-case-header em {
	color: #a02626;
}

.eval-case-reason,
.eval-step-details {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
}

.eval-steps {
	display: grid;
	gap: 10px;
}

.eval-step {
	display: grid;
	gap: 8px;
	padding: 12px;
	border-radius: 14px;
	background: var(--surface);
	box-shadow: var(--shadow-inset);
}

.eval-line-wrap {
	display: grid;
	grid-template-columns: 54px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.eval-line-wrap > span {
	color: var(--muted);
	font-size: 11px;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.eval-line {
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
	color: var(--text);
	font-size: 13px;
	line-height: 1.45;
}

.ai-line {
	color: var(--primary-dark);
}

.avatar {
	display: grid;
	width: 72px;
	height: 72px;
	place-items: center;
	margin-bottom: 18px;
	border-radius: 24px;
	background: var(--surface);
	box-shadow: var(--shadow-soft);
	color: var(--primary-dark);
	font-size: 34px;
	font-weight: 900;
}

.caller-name {
	margin: 0;
	font-size: 25px;
	line-height: 1.15;
}

.caller-meta {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.45;
}

.detail-list {
	display: grid;
	gap: 12px;
	margin-top: 22px;
}

.detail {
	min-width: 0;
	padding: 13px 14px;
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow-inset);
}

.detail span {
	display: block;
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.detail strong {
	display: block;
	margin-top: 4px;
	overflow-wrap: anywhere;
	font-size: 14px;
}

#log {
	min-height: 180px;
	max-height: 260px;
	overflow: auto;
	margin: 0;
	padding: 16px;
	border-radius: 18px;
	background: #17231f;
	color: #d9eee5;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	box-shadow:
		inset 7px 7px 14px rgba(0, 0, 0, 0.22),
		inset -5px -5px 12px rgba(255, 255, 255, 0.04);
}

.hidden {
	display: none;
}

@media (max-width: 900px) {
	main {
		padding: 24px 0;
	}

	.app-shell,
	.shell,
	.workspace {
		grid-template-columns: 1fr;
	}

	.nav-panel {
		position: static;
	}

	.nav-menu {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.caller-card {
		position: static;
	}

	.evals-topbar {
		display: grid;
	}

	.eval-actions,
	.eval-picker-grid,
	.eval-launch-grid,
	.eval-summary-grid {
		grid-template-columns: 1fr;
	}

	.eval-actions {
		display: grid;
	}
}

@media (max-width: 560px) {
	main {
		width: min(100% - 20px, 1120px);
	}

	.hero,
	.card,
	.caller-card,
	.nav-panel {
		padding: 20px;
		border-radius: 22px;
	}

	.nav-brand {
		display: none;
	}

	.controls {
		grid-template-columns: 1fr;
	}

	.setting-row {
		grid-template-columns: 1fr;
		gap: 8px;
		align-items: stretch;
		min-height: 0;
	}

	.number-field {
		width: min(100%, 180px);
	}
}
