/* Enquiry Response Trainer: front end */
.ert-app {
	--ert-accent: #2f6f62;
	--ert-accent-dark: #22524a;
	--ert-bg: #ffffff;
	--ert-soft: #f4f7f6;
	--ert-border: #d7e0dd;
	--ert-text: #1f2a28;
	--ert-muted: #5b6b67;
	--ert-pass: #1e7a46;
	--ert-fail: #b3261e;
	--ert-warn: #8a5a00;
	max-width: 960px;
	margin: 0 auto;
	color: var(--ert-text);
	font-size: 17px;
	line-height: 1.55;
	box-sizing: border-box;
}
.ert-app *, .ert-app *::before, .ert-app *::after { box-sizing: inherit; }
.ert-app [hidden] { display: none !important; }

.ert-header { margin: 0 0 16px; }
.ert-title { margin: 0 0 4px; font-size: 1.6em; line-height: 1.25; }
.ert-sub { margin: 0; color: var(--ert-muted); }

.ert-card {
	background: var(--ert-bg);
	border: 1px solid var(--ert-border);
	border-radius: 10px;
	padding: 20px;
	margin: 0 0 16px;
}
.ert-card h3, .ert-card h4 { margin-top: 0; }
.ert-card h4 { font-size: 1em; text-transform: uppercase; letter-spacing: .04em; color: var(--ert-muted); margin: 16px 0 6px; }
.ert-card h4:first-child { margin-top: 0; }

.ert-form label, .ert-label { display: block; font-weight: 600; margin: 12px 0 4px; }
.ert-app input[type="text"], .ert-app input[type="email"], .ert-app input[type="search"], .ert-app textarea, .ert-app select {
	width: 100%;
	max-width: 100%;
	padding: 10px 12px;
	border: 1px solid #b8c6c2;
	border-radius: 8px;
	font: inherit;
	background: #fff;
	color: inherit;
}
.ert-app textarea { resize: vertical; min-height: 120px; }
.ert-app input:focus, .ert-app textarea:focus, .ert-app select:focus { outline: 3px solid rgba(47, 111, 98, .3); border-color: var(--ert-accent); }

.ert-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.ert-row-end { justify-content: space-between; }

.ert-btn {
	display: inline-block;
	padding: 11px 20px;
	border-radius: 8px;
	border: 1px solid var(--ert-accent);
	background: #fff;
	color: var(--ert-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	line-height: 1.2;
}
.ert-btn:hover { background: var(--ert-soft); }
.ert-btn-primary { background: var(--ert-accent); color: #fff; }
.ert-btn-primary:hover { background: var(--ert-accent-dark); }
.ert-btn:disabled { opacity: .5; cursor: not-allowed; }
.ert-form .ert-btn { margin-top: 16px; }
.ert-mic.is-recording { background: var(--ert-fail); border-color: var(--ert-fail); color: #fff; animation: ert-pulse 1.4s infinite; }
@keyframes ert-pulse { 50% { box-shadow: 0 0 0 8px rgba(179, 38, 30, .15); } }

.ert-link { background: none; border: 0; padding: 0; color: var(--ert-accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: .95em; }

.ert-help, .ert-note { color: var(--ert-muted); font-size: .95em; margin: 4px 0 8px; }
.ert-note { color: var(--ert-warn); }
.ert-interim { min-height: 1.4em; color: var(--ert-muted); font-style: italic; margin-top: 6px; }
.ert-error { background: #fdecea; color: var(--ert-fail); border: 1px solid #f3c2bd; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.ert-loading { color: var(--ert-muted); }

.ert-status { border-radius: 10px; padding: 16px 20px; margin: 0 0 16px; border-left: 6px solid var(--ert-accent); background: var(--ert-soft); }
.ert-status p { margin: 6px 0 0; }
.ert-status-retake, .ert-status-overdue { border-left-color: var(--ert-fail); background: #fdf1f0; }
.ert-status-due, .ert-status-retake_soon { border-left-color: #c58a00; background: #fff8e6; }
.ert-status-ok { border-left-color: var(--ert-pass); background: #eef8f2; }

.ert-badge { display: inline-block; font-size: .78em; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--ert-soft); color: var(--ert-accent-dark); border: 1px solid var(--ert-border); vertical-align: middle; }
.ert-ch-phone, .ert-ch-face { background: #eef0fb; color: #3b3f8f; border-color: #d5d8f3; }
.ert-ch-text { background: #eaf6ee; color: #1e6b3a; border-color: #cde8d6; }

.ert-situation-title { margin: 8px 0; font-size: 1.2em; }
.ert-situation p, .ert-reply-text p { margin: 0 0 10px; }
.ert-situation p:last-child, .ert-reply-text p:last-child { margin-bottom: 0; }
.ert-details summary { cursor: pointer; color: var(--ert-accent); }
.ert-details .ert-situation { margin-top: 10px; }

.ert-progress { margin: 0 0 14px; }
.ert-progress-label { font-weight: 600; color: var(--ert-muted); margin-bottom: 6px; }
.ert-progress-bar { height: 8px; background: var(--ert-soft); border-radius: 999px; overflow: hidden; }
.ert-progress-bar span { display: block; height: 100%; background: var(--ert-accent); transition: width .3s; }

.ert-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ert-compare .ert-card { margin: 0 0 16px; }
.ert-mine { border-top: 4px solid #7a8a86; }
.ert-suggested { border-top: 4px solid var(--ert-accent); }
.ert-tip { margin: 12px 0 0; padding: 10px 12px; background: #fff8e6; border-radius: 8px; font-size: .95em; }

.ert-app fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.ert-app legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.ert-option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--ert-border); border-radius: 8px; margin: 0 0 6px; cursor: pointer; font-weight: 400; }
.ert-option:hover { background: var(--ert-soft); }
.ert-option input { margin-top: 5px; flex: 0 0 auto; }
.ert-sub-block { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--ert-border); }

.ert-score-card { text-align: center; }
.ert-big-score { font-size: 3.2em; font-weight: 700; line-height: 1.1; }
.ert-big-score.is-pass, .is-pass { color: var(--ert-pass); }
.ert-big-score.is-fail, .is-fail { color: var(--ert-fail); }
.ert-result-list { list-style: none; margin: 0; padding: 0; }
.ert-result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--ert-border); }
.ert-result-list li:last-child { border-bottom: 0; }
.ert-result-score { font-weight: 600; white-space: nowrap; }

.ert-history { width: 100%; border-collapse: collapse; }
.ert-history th, .ert-history td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--ert-border); }

.ert-filters input[type="search"] { flex: 1 1 260px; width: auto; }
.ert-filters select { flex: 0 1 200px; width: auto; }
.ert-lib-item summary { cursor: pointer; font-weight: 600; }
.ert-lib-item[open] summary { margin-bottom: 8px; }
.ert-suggested-text { background: var(--ert-soft); padding: 12px 14px; border-radius: 8px; }
.ert-points { margin: 0; padding-left: 20px; }
.ert-guidance summary { cursor: pointer; font-weight: 600; }
.ert-guidance table { width: 100%; border-collapse: collapse; font-size: .95em; }
.ert-guidance th, .ert-guidance td { border: 1px solid var(--ert-border); padding: 6px 8px; text-align: left; vertical-align: top; }

@media (max-width: 700px) {
	.ert-app { font-size: 16px; }
	.ert-card { padding: 16px; }
	.ert-compare { grid-template-columns: 1fr; gap: 0; }
	.ert-row .ert-btn { flex: 1 1 100%; text-align: center; }
	.ert-row-end { flex-direction: column-reverse; align-items: stretch; }
	.ert-guidance table { display: block; overflow-x: auto; }
}
