/*
 * Styling for the QRG simulator control panel.
 *
 * Deliberately nothing like the Highlander console. The two are open side by
 * side while testing, and mistaking the test harness for the real system — or
 * the reverse — is exactly the sort of confusion that ends with someone
 * answering a live tender from the wrong window. Dark chrome, amber accent, and
 * a banner that never goes away.
 *
 * No QVC or Qurate branding is used anywhere. This stands in for their gateway;
 * it must never look like it IS their gateway.
 */

:root {
	--sim: #d97706;
	--sim-dark: #b45309;
	--ink: #0f172a;
	--slate: #334155;
	--muted: #64748b;
	--line: #e2e8f0;
	--bg: #f1f5f9;
	--danger: #b91c1c;
	--ok: #15803d;
}

* { box-sizing: border-box; }

body.sim {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.sim-warn {
	background: repeating-linear-gradient(45deg, #fef3c7, #fef3c7 12px, #fde68a 12px, #fde68a 24px);
	color: #78350f;
	text-align: center;
	padding: 7px 16px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-bottom: 1px solid #fcd34d;
}

.sim-bar { background: var(--ink); color: #e2e8f0; }
.sim-bar-in {
	max-width: 1000px;
	margin: 0 auto;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.sim-bar strong { font-size: 16px; letter-spacing: -0.01em; color: #fff; }
.sim-bar .tag {
	background: var(--sim);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	padding: 3px 8px;
	border-radius: 5px;
	letter-spacing: .08em;
}
.sim-bar nav { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 14px; }
.sim-bar nav a { color: #94a3b8; text-decoration: none; font-weight: 600; }
.sim-bar nav a:hover, .sim-bar nav a.on { color: #fff; }

.sim-wrap { max-width: 1000px; margin: 0 auto; padding: 22px 16px 60px; }

h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 13px; margin: 30px 0 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 18px;
	margin-bottom: 14px;
}

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

input[type=text], input[type=number], select, textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--line);
	border-radius: 7px;
	font: inherit;
	font-size: 14px;
	background: #fff;
	color: var(--ink);
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sim); outline-offset: -1px; border-color: var(--sim); }

.row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.row > div { flex: 1 1 180px; min-width: 0; }

.btn {
	padding: 11px 20px;
	border: 0;
	border-radius: 7px;
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	background: var(--sim);
	color: #fff;
}
.btn:hover { background: var(--sim-dark); }
.btn.dark { background: var(--slate); }
.btn.dark:hover { background: var(--ink); }
.btn.bad { background: #fff; color: var(--danger); border: 1px solid #fca5a5; }
.btn.bad:hover { background: #fef2f2; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.note { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.note.ok { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
.note.bad { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.note.info { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); color: var(--muted); }
.pill.ok { background: #dcfce7; color: var(--ok); }
.pill.bad { background: #fee2e2; color: var(--danger); }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t code { font-size: 12px; color: var(--slate); }

pre.x12 {
	background: var(--ink);
	color: #cbd5e1;
	padding: 14px;
	border-radius: 8px;
	overflow-x: auto;
	font-size: 11.5px;
	line-height: 1.55;
	margin: 0;
}
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }

.login { max-width: 370px; margin: 10vh auto; padding: 0 16px; }
.login .card { padding: 26px; }

@media (max-width: 620px) {
	.sim-bar-in { gap: 10px; }
	.sim-bar nav { width: 100%; margin-left: 0; }
}

/* ---- received messages -------------------------------------------------
 *
 * One expandable block per message rather than a table: the point of this
 * section is reading one interchange, not comparing twenty-five.
 */
details.msg { padding: 0; margin-bottom: 8px; }

details.msg > summary {
	cursor: pointer;
	padding: 12px 14px;
	display: flex;
	gap: 12px;
	align-items: baseline;
	flex-wrap: wrap;
	list-style: none;
}
details.msg > summary::-webkit-details-marker { display: none; }
details.msg > summary::before {
	content: "▸";
	opacity: .5;
	font-size: 12px;
}
details.msg[open] > summary::before { content: "▾"; }
details.msg[open] > summary { border-bottom: 1px solid var(--line); }

details.msg .when { opacity: .65; font-size: 13px; font-variant-numeric: tabular-nums; }
details.msg .subj { font-weight: 600; }

/* The one fact the harness exists to check: what the message actually said. */
details.msg .verdict {
	margin-left: auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--sim-dark);
}

details.msg .kv { margin: 12px 14px 0; width: auto; }
details.msg .kv th { text-align: left; opacity: .65; font-weight: 500; padding-right: 14px; white-space: nowrap; }
details.msg .kv .hint { opacity: .55; font-size: 12px; display: block; }

/* Reuses pre.x12 from above — the interchange looks the same wherever it is
   shown, which is the point of showing it. */
details.msg pre.x12 { margin: 12px 14px 14px; }

/* Answering one message rather than all of them. */
.ackbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 12px 14px 0;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.ackbar form { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.ackbar .sub { margin: 0; font-size: 12.5px; }
.ackbar .btn { padding: 6px 14px; font-size: 13px; }
.ackbar .pill {
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
}
.ackbar .pill.ok  { background: #dcfce7; color: var(--ok); }
.ackbar .pill.bad { background: #fee2e2; color: var(--danger); }
