.wr-ai-app {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: #14141a;
	color: #f2f0ea;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
}

.wr-screen {
	display: none;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}
.wr-screen--active {
	display: flex;
}

.wr-card {
	background: #1e1e26;
	border-radius: 16px;
	padding: 40px 32px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.wr-card--wide {
	max-width: 720px;
}

.wr-title {
	font-size: 26px;
	margin: 0 0 8px;
	font-weight: 700;
}
.wr-subtitle {
	font-size: 15px;
	color: #b3b0a8;
	margin: 0 0 24px;
}

#wr-name-input {
	width: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	border-radius: 10px;
	border: 1px solid #3a3a44;
	background: #14141a;
	color: #f2f0ea;
	font-size: 16px;
	margin-bottom: 8px;
}
#wr-name-input:focus {
	outline: none;
	border-color: #8a7cff;
}

.wr-consent-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	text-align: left;
	font-size: 12.5px;
	line-height: 1.5;
	color: #b3b0a8;
	margin: 4px 0 14px;
	cursor: pointer;
}
.wr-consent-row input[type="checkbox"] {
	margin-top: 3px;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	accent-color: #8a7cff;
	cursor: pointer;
}
.wr-consent-row a {
	color: #b9adff;
}

.wr-error {
	color: #ff8080;
	font-size: 13px;
	min-height: 18px;
	margin-bottom: 12px;
}

.wr-btn {
	border: none;
	border-radius: 10px;
	padding: 13px 24px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.1s ease, opacity 0.15s ease;
}
.wr-btn:active {
	transform: scale(0.97);
}
.wr-btn--primary {
	background: linear-gradient(135deg, #8a7cff, #6a5cff);
	color: #fff;
	width: 100%;
}
.wr-btn--primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.wr-btn--ghost {
	background: transparent;
	color: #b3b0a8;
	margin-top: 20px;
	width: 100%;
	border: 1px solid #3a3a44;
}
.wr-btn--small {
	width: auto;
	margin-top: 0;
	padding: 8px 16px;
	font-size: 13px;
}

.wr-size-options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 8px;
}
@media (max-width: 480px) {
	.wr-size-options {
		grid-template-columns: 1fr;
	}
}
.wr-size-card {
	background: #14141a;
	border: 1px solid #3a3a44;
	border-radius: 14px;
	padding: 24px 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: #f2f0ea;
	transition: border-color 0.15s ease, transform 0.1s ease;
	text-align: center;
}
.wr-size-card:hover {
	border-color: #8a7cff;
	transform: translateY(-2px);
}
.wr-size-icon {
	font-size: 32px;
}
.wr-size-label {
	font-weight: 700;
	font-size: 15px;
}
.wr-size-desc {
	font-size: 12px;
	color: #b3b0a8;
	line-height: 1.4;
}

.wr-agents {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin-bottom: 8px;
}
@media (max-width: 640px) {
	.wr-agents {
		grid-template-columns: 1fr 1fr;
	}
}
@media (max-width: 400px) {
	.wr-agents {
		grid-template-columns: 1fr;
	}
}

.wr-agent-card {
	position: relative;
	background: #14141a;
	border: 2px solid #3a3a44;
	border-radius: 14px;
	padding: 20px 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	color: #f2f0ea;
	transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
	text-align: center;
}
.wr-agent-card:hover {
	border-color: #8a7cff;
	transform: translateY(-2px);
}
.wr-agent-card--selected {
	border-color: #8a7cff;
	background: #24203f;
}
.wr-agent-emoji {
	font-size: 34px;
}
.wr-agent-name {
	font-weight: 700;
	font-size: 14px;
}
.wr-agent-desc {
	font-size: 12px;
	color: #b3b0a8;
	line-height: 1.4;
}
.wr-agent-order {
	position: absolute;
	top: 8px;
	right: 10px;
	font-size: 12px;
	font-weight: 700;
	color: #8a7cff;
	min-width: 16px;
}

/* Chat screen */
.wr-chat-shell {
	width: 100%;
	max-width: 760px;
	height: 100%;
	max-height: 900px;
	display: flex;
	flex-direction: column;
	background: #1e1e26;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.wr-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #2c2c36;
	flex-shrink: 0;
}
.wr-chat-header-info {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.wr-chat-header-agent {
	display: flex;
	align-items: center;
	gap: 6px;
}
.wr-chat-agent-emoji {
	font-size: 24px;
}
.wr-chat-agent-name {
	font-weight: 700;
	font-size: 14px;
}
.wr-chat-user-name {
	font-size: 12.5px;
	color: #b3b0a8;
}

.wr-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wr-msg {
	max-width: 78%;
	padding: 12px 16px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.wr-msg--user {
	align-self: flex-end;
	background: linear-gradient(135deg, #8a7cff, #6a5cff);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.wr-msg--agent {
	align-self: flex-start;
	background: #2c2c36;
	color: #f2f0ea;
	border-bottom-left-radius: 4px;
}
.wr-msg-label {
	font-size: 11.5px;
	font-weight: 700;
	color: #b9adff;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.wr-msg--typing {
	opacity: 0.6;
	font-style: italic;
}

.wr-chat-input-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	padding: 14px 16px;
	border-top: 1px solid #2c2c36;
	flex-shrink: 0;
}
#wr-chat-input {
	flex: 1;
	resize: none;
	max-height: 120px;
	background: #14141a;
	border: 1px solid #3a3a44;
	border-radius: 10px;
	color: #f2f0ea;
	padding: 12px 14px;
	font-size: 14.5px;
	font-family: inherit;
}
#wr-chat-input:focus {
	outline: none;
	border-color: #8a7cff;
}
.wr-chat-input-row .wr-btn {
	width: auto;
	padding: 12px 20px;
}

#wr-chat-error {
	padding: 0 16px 10px;
}
