:root {
	--background-primary: #202124;
	--background-primary-alt: #191a1d;
	--background-secondary: #292b30;
	--background-secondary-alt: #32353b;
	--background-modifier-border: #41454d;
	--background-modifier-border-hover: #555b65;
	--background-modifier-hover: rgba(255, 255, 255, 0.08);
	--background-modifier-success: rgba(82, 183, 136, 0.16);
	--background-modifier-error: rgba(224, 86, 86, 0.16);
	--background-modifier-error-hover: rgba(224, 86, 86, 0.25);
	--interactive-normal: #353941;
	--interactive-hover: #404650;
	--interactive-accent: #7c9cff;
	--interactive-accent-hover: #91adff;
	--interactive-accent-rgb: 124, 156, 255;
	--text-normal: #e6e8ed;
	--text-muted: #a7adba;
	--text-faint: #7c8493;
	--text-on-accent: #10131a;
	--text-accent: #9db5ff;
	--text-success: #78d49f;
	--text-warning: #f2c46d;
	--text-error: #ff8c8c;
	--font-interface:
		Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	--font-text: var(--font-interface);
	--font-monospace: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html,
body,
#app {
	width: 100%;
	min-height: 100%;
	margin: 0;
}

body {
	background: #15171b;
	color: var(--text-normal);
	font-family: var(--font-interface);
	font-size: 14px;
	line-height: 1.45;
}

button,
input,
select,
textarea {
	font: inherit;
}

button,
.clickable-icon {
	min-height: 30px;
	border: 1px solid var(--background-modifier-border);
	border-radius: 6px;
	background: var(--interactive-normal);
	color: var(--text-normal);
	padding: 4px 10px;
	cursor: pointer;
}

button:hover:not(:disabled) {
	background: var(--interactive-hover);
	border-color: var(--background-modifier-border-hover);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

button.mod-cta {
	background: var(--interactive-accent);
	border-color: var(--interactive-accent);
	color: var(--text-on-accent);
	font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
	min-height: 32px;
	border: 1px solid var(--background-modifier-border);
	border-radius: 6px;
	background: var(--background-primary-alt);
	color: var(--text-normal);
	padding: 5px 8px;
}

select {
	max-width: 260px;
}

.preview-shell {
	min-height: 100vh;
	padding: 24px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 200px),
		#15171b;
}

.preview-frame {
	display: flex;
	flex-direction: column;
	width: min(1220px, 100%);
	height: calc(100vh - 48px);
	margin: 0 auto;
	overflow: hidden;
	border: 1px solid var(--background-modifier-border);
	border-radius: 8px;
	background: var(--background-secondary);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.view-header {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 42px;
	padding: 8px 14px;
	border-bottom: 1px solid var(--background-modifier-border);
	background: var(--background-primary-alt);
}

.view-header-title {
	font-weight: 700;
}

.view-header-subtitle {
	color: var(--text-muted);
	font-size: 0.86em;
}

.preview-content {
	flex: 1 1 auto;
	height: auto;
	min-height: 0;
	padding: 16px;
	overflow: auto;
	background: var(--background-secondary);
}

.preview-chat-content {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0;
}

.preview-chat-content .ai-assistant-chat-panel-chat {
	height: 100%;
	min-height: 0;
}

.preview-chat-content .chat-modern-layout {
	padding: 10px 10px 0;
}

.setting-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-top: 1px solid var(--background-modifier-border);
}

.setting-item:first-child {
	border-top: 0;
	padding-top: 0;
}

.setting-item-info {
	min-width: 0;
	flex: 1 1 auto;
}

.setting-item-name {
	color: var(--text-normal);
	font-weight: 650;
}

.setting-item-description {
	margin-top: 3px;
	color: var(--text-muted);
	font-size: 0.9em;
}

.setting-item-control {
	display: flex;
	flex: 0 1 auto;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	min-width: 160px;
}

.checkbox-container {
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 42px;
	height: 24px;
}

.checkbox-container input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.checkbox-track {
	position: relative;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: var(--background-secondary-alt);
	border: 1px solid var(--background-modifier-border);
}

.checkbox-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 999px;
	background: var(--text-muted);
	transition:
		left 120ms ease,
		background 120ms ease;
}

.checkbox-container input:checked + .checkbox-track {
	background: color-mix(in srgb, var(--interactive-accent) 42%, transparent);
	border-color: var(--interactive-accent);
}

.checkbox-container input:checked + .checkbox-track::after {
	left: 21px;
	background: var(--interactive-accent-hover);
}

.notice-container {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 50;
	display: grid;
	gap: 8px;
	width: min(360px, calc(100vw - 32px));
}

.notice {
	border: 1px solid var(--background-modifier-border);
	border-radius: 8px;
	background: var(--background-primary);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	padding: 10px 12px;
}

.preview-error {
	margin: 24px;
	padding: 16px;
	white-space: pre-wrap;
	color: var(--text-error);
	background: var(--background-primary);
	border: 1px solid var(--text-error);
	border-radius: 8px;
}

.preview-openrouter-calls-content .openrouter-call-explorer-modal-el {
	width: 100%;
	max-width: 100%;
	height: 100%;
	margin: 0;
	box-shadow: none;
}

@media (max-width: 720px) {
	.preview-shell {
		padding: 0;
	}

	.preview-frame {
		width: 100%;
		height: 100vh;
		border: 0;
		border-radius: 0;
	}

	.view-header {
		align-items: flex-start;
		flex-direction: column;
		gap: 2px;
	}

	.preview-content {
		flex: 1 1 auto;
		height: auto;
		min-height: 0;
		padding: 12px;
	}

	.setting-item {
		flex-direction: column;
		gap: 8px;
	}

	.setting-item-control {
		justify-content: flex-start;
		width: 100%;
	}

	select,
	input[type="text"] {
		max-width: 100%;
		width: 100%;
	}
}
