/**
 * HTC Live Chat — agent console.
 *
 * Lives on a public page inside the site's own theme, so every rule is scoped
 * and every inherited property that matters is stated outright. Themes set
 * min-heights on textareas and line-heights on everything; we learned that the
 * hard way.
 */

.htc-console,
.htc-console-signin {
	--htc-brand: #144d90;
	--htc-accent: #e96c24;
	--htc-ink: #1d2733;
	--htc-muted: #63748a;
	--htc-line: #e3e8ee;
	--htc-surface: #ffffff;
	--htc-ground: #f4f6f8;

	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--htc-ink);
}

.htc-console *,
.htc-console-signin * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- Sign in */

.htc-console-signin {
	display: flex;
	justify-content: center;
	padding: 24px 16px;
}

.htc-c-card {
	width: 100%;
	max-width: 420px;
	background: var(--htc-surface);
	border: 1px solid var(--htc-line);
	border-radius: 12px;
	padding: 26px 24px;
	box-shadow: 0 10px 30px rgba(18, 35, 58, 0.08);
}

.htc-c-title {
	margin: 0 0 8px;
	font-size: 21px;
	line-height: 1.2;
	color: var(--htc-ink);
}

.htc-c-lede {
	margin: 0 0 18px;
	font-size: 14px;
	color: var(--htc-muted);
}

.htc-c-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.htc-c-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--htc-ink);
}

.htc-c-input {
	width: 100%;
	min-height: 0;
	height: 46px;
	padding: 11px 13px;
	border: 1px solid var(--htc-line);
	border-radius: 9px;
	font: inherit;
	color: var(--htc-ink);
	background: var(--htc-surface);
}

.htc-c-input:focus {
	outline: none;
	border-color: var(--htc-brand);
	box-shadow: 0 0 0 3px rgba(20, 77, 144, 0.15);
}

.htc-c-button {
	margin-top: 4px;
	min-height: 0;
	padding: 13px 18px;
	border: 0;
	border-radius: 9px;
	background: var(--htc-brand);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.htc-c-button:hover { background: var(--htc-accent); }
.htc-c-button:disabled { opacity: 0.6; cursor: progress; }

.htc-c-msg { margin: 6px 0 0; font-size: 13.5px; color: var(--htc-muted); }
.htc-c-msg:empty { display: none; }
.htc-c-msg.is-good { color: #1a7f4b; }
.htc-c-msg.is-bad { color: #c0392b; }

.htc-console-notice {
	max-width: 420px;
	margin: 0 auto 14px;
	padding: 11px 14px;
	border-radius: 9px;
	background: #fdf0e3;
	color: #a6540d;
	font-size: 13.5px;
}

/* ---------------------------------------------------------------- Console */

.htc-c-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--htc-brand);
	color: #fff;
	border-radius: 10px 10px 0 0;
}

.htc-c-who { display: flex; flex-direction: column; line-height: 1.25; }
.htc-c-email { font-size: 12px; opacity: 0.8; }

.htc-c-signout {
	min-height: 0;
	padding: 8px 14px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.htc-c-banner {
	padding: 10px 16px;
	background: #c0392b;
	color: #fff;
	font-size: 13.5px;
}

.htc-c-banner[hidden] { display: none !important; }

.htc-c-grid {
	display: grid;
	grid-template-columns: 300px 1fr;
	border: 1px solid var(--htc-line);
	border-top: 0;
	border-radius: 0 0 10px 10px;
	overflow: hidden;
	background: var(--htc-surface);
	min-height: 520px;
}

.htc-c-list-pane { border-right: 1px solid var(--htc-line); background: var(--htc-surface); }

.htc-c-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	padding: 10px;
	border-bottom: 1px solid var(--htc-line);
	background: var(--htc-ground);
}

.htc-c-filter {
	min-height: 0;
	padding: 5px 11px;
	border: 1px solid var(--htc-line);
	border-radius: 999px;
	background: var(--htc-surface);
	font: inherit;
	font-size: 12px;
	color: var(--htc-muted);
	cursor: pointer;
}

.htc-c-filter.is-active { background: var(--htc-brand); border-color: var(--htc-brand); color: #fff; }

.htc-c-list { margin: 0; padding: 0; list-style: none; max-height: 560px; overflow-y: auto; }

.htc-c-item {
	margin: 0;
	padding: 12px 14px;
	border-bottom: 1px solid var(--htc-line);
	cursor: pointer;
	list-style: none;
}

.htc-c-item:hover { background: var(--htc-ground); }
.htc-c-item.is-active { background: #eef4fb; box-shadow: inset 3px 0 0 var(--htc-brand); }

.htc-c-item.is-waiting strong::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-left: 6px;
	border-radius: 50%;
	background: var(--htc-accent);
	vertical-align: middle;
}

.htc-c-item-top { display: flex; justify-content: space-between; gap: 8px; }
.htc-c-time, .htc-c-topic, .htc-c-with { font-size: 12px; color: var(--htc-muted); }
.htc-c-meta { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.htc-c-badge {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: 11px;
	text-transform: capitalize;
	background: var(--htc-ground);
	color: var(--htc-muted);
}

.htc-c-badge-open { background: #e6f4ea; color: #1a7f4b; }
.htc-c-badge-offline { background: #fdf0e3; color: #a6540d; }
.htc-c-badge-waiting { background: var(--htc-accent); color: #fff; }

.htc-c-list-empty, .htc-c-empty { padding: 24px 16px; color: var(--htc-muted); margin: 0; list-style: none; }

.htc-c-thread-pane { display: flex; flex-direction: column; min-height: 520px; }

.htc-c-thread-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 14px;
	border-bottom: 1px solid var(--htc-line);
}

.htc-c-thread-title { flex: 1; font-weight: 600; font-size: 15px; }

.htc-c-back {
	display: none;
	min-height: 0;
	padding: 6px 10px;
	border: 1px solid var(--htc-line);
	border-radius: 8px;
	background: var(--htc-surface);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.htc-c-close {
	min-height: 0;
	padding: 7px 13px;
	border: 1px solid var(--htc-line);
	border-radius: 8px;
	background: var(--htc-surface);
	font: inherit;
	font-size: 13px;
	color: var(--htc-muted);
	cursor: pointer;
}

.htc-c-thread-meta {
	padding: 9px 14px;
	font-size: 12.5px;
	color: var(--htc-muted);
	background: var(--htc-ground);
	border-bottom: 1px solid var(--htc-line);
	word-break: break-word;
}

.htc-c-page { color: var(--htc-brand); }

.htc-c-messages {
	flex: 1;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 9px;
	overflow-y: auto;
	max-height: 420px;
	min-height: 240px;
}

.htc-c-msg {
	max-width: 80%;
	padding: 8px 12px;
	border-radius: 11px;
	font-size: 14px;
	background: var(--htc-ground);
	align-self: flex-start;
}

.htc-c-msg-agent { align-self: flex-end; background: var(--htc-brand); color: #fff; }

.htc-c-msg-system {
	align-self: center;
	max-width: 100%;
	background: transparent;
	color: var(--htc-muted);
	font-size: 12.5px;
	text-align: center;
}

.htc-c-msg-name { display: block; font-size: 11px; opacity: 0.75; margin-bottom: 2px; }
.htc-c-msg-body { white-space: pre-wrap; word-break: break-word; }

.htc-c-reply {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--htc-line);
}

.htc-c-reply-input {
	flex: 1;
	min-height: 0;
	height: 60px;
	max-height: 160px;
	padding: 10px 12px;
	border: 1px solid var(--htc-line);
	border-radius: 9px;
	font: inherit;
	font-size: 14px;
	color: var(--htc-ink);
	background: var(--htc-surface);
	resize: vertical;
}

.htc-c-send {
	align-self: stretch;
	min-height: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 9px;
	background: var(--htc-brand);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.htc-c-send:hover { background: var(--htc-accent); }

/* ----------------------------------------------------------------- Phone */

@media (max-width: 782px) {
	.htc-c-grid { grid-template-columns: 1fr; min-height: 0; }
	.htc-c-list-pane { border-right: 0; }
	.htc-c-thread-pane { display: none; min-height: 0; }
	.htc-c-back { display: inline-block; }

	.htc-console.is-viewing-thread .htc-c-list-pane { display: none; }
	.htc-console.is-viewing-thread .htc-c-thread-pane { display: flex; }

	.htc-c-messages { max-height: none; }
	.htc-c-msg { max-width: 90%; }
}
