:root {
	--navy: #0B2C55;
	--navy-dark: #071D38;
	--red: #C8102E;
	--red-dark: #9C0C24;
	--lightblue: #E4ECF4;
	--lightred: #FBE4E7;
	--grey: #F2F2F2;
	--yellow: #FFF6C9;
	--yellow-border: #E8D65C;
	--text: #232323;
	--muted: #5b6472;
	--border: #c9d2de;
	--good: #1c7d4d;
	--warn: #a15c00;
	--bad: #b3261e;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	background: #eef1f5;
	color: var(--text);
	padding: 32px 16px 80px;
}

.uxd-worksheet {
	max-width: 900px;
	margin: 0 auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 18px rgba(20, 30, 50, 0.1);
	overflow: hidden;
}

.titleblock {
	background: var(--navy);
	color: #fff;
	padding: 28px 32px 22px;
	text-align: center;
	border-bottom: 5px solid var(--red);
}

.titleblock .eyebrow {
	font-size: 12px;
	letter-spacing: 1.5px;
	font-weight: bold;
	opacity: 0.85;
	margin-bottom: 6px;
}

.titleblock h1 {
	margin: 0 0 6px;
	font-size: 28px;
}

.titleblock .sub {
	font-size: 13px;
	font-style: italic;
	opacity: 0.85;
}

.hint-bar {
	background: var(--yellow);
	border-bottom: 1px solid var(--yellow-border);
	text-align: center;
	font-size: 12.5px;
	padding: 8px 16px;
	color: #5c4b00;
}

.content {
	padding: 8px 32px 32px;
}

.step-title {
	color: var(--red);
	font-size: 15px;
	font-weight: bold;
	text-transform: uppercase;
	margin: 28px 0 10px;
	border-bottom: 2px solid var(--navy);
	padding-bottom: 6px;
	position: relative;
}

.step-title::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 14px;
	background: var(--red);
	margin-right: 8px;
	vertical-align: middle;
	border-radius: 1px;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.table-scroll {
	overflow-x: auto;
}

th {
	background: var(--navy);
	color: #fff;
	text-align: left;
	padding: 8px 10px;
	font-size: 13px;
	white-space: nowrap;
}

th.num,
td.num {
	text-align: center;
}

td {
	padding: 7px 10px;
	border-bottom: 1px solid var(--border);
}

tr.alt td {
	background: var(--grey);
}

tr.subtotal td {
	background: var(--lightblue);
	font-weight: bold;
	border-top: 2px solid var(--navy);
}

input[type="number"] {
	width: 100%;
	max-width: 130px;
	padding: 6px 8px;
	border: 1px solid var(--yellow-border);
	background: var(--yellow);
	border-radius: 4px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	text-align: center;
	color: #1a3a1a;
}

input.benchmarkInput {
	max-width: 70px;
	background: var(--lightblue);
	border: 1px solid #9fb6d6;
	color: #0B2C55;
}

input[type="number"]:focus {
	outline: 2px solid var(--navy);
	outline-offset: 1px;
}

.readout {
	font-weight: bold;
}

.formula-box {
	background: var(--grey);
	border-left: 4px solid var(--navy);
	padding: 10px 14px;
	font-size: 13px;
	color: var(--muted);
	margin: 10px 0 4px;
}

.big-result {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--lightred);
	border: 2px solid var(--red);
	border-radius: 8px;
	padding: 16px 22px;
	margin-top: 10px;
}

.big-result.target {
	background: var(--lightblue);
	border-color: var(--navy);
}

.big-result .label {
	font-size: 14px;
	color: var(--red-dark);
	font-weight: bold;
}

.big-result .value {
	font-size: 30px;
	color: var(--red-dark);
	font-weight: bold;
}

.big-result.target .label,
.big-result.target .value {
	color: var(--navy);
}

.note {
	font-size: 12px;
	color: var(--muted);
	margin-top: 6px;
	font-style: italic;
}

.tip-wrap {
	position: relative;
	display: inline-block;
}

.tip {
	display: inline-block;
	color: var(--navy);
	font-size: 15px;
	margin-left: 4px;
	cursor: pointer;
	opacity: 0.8;
	user-select: none;
}

.tip:hover,
.tip:focus {
	opacity: 1;
}

.tip-popup {
	display: none;
	position: absolute;
	z-index: 20;
	top: 100%;
	left: 0;
	margin-top: 6px;
	width: 260px;
	max-width: 70vw;
	background: var(--navy-dark);
	color: #fff;
	font-size: 12.5px;
	font-weight: normal;
	line-height: 1.4;
	padding: 10px 12px;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	text-align: left;
	white-space: normal;
}

.tip-popup.show {
	display: block;
}

.tip-popup .close-x {
	position: absolute;
	top: 4px;
	right: 7px;
	cursor: pointer;
	opacity: 0.7;
	font-size: 12px;
}

.tip-popup .close-x:hover {
	opacity: 1;
}

.warn-banner {
	background: var(--lightred);
	border: 2px solid var(--red);
	border-radius: 8px;
	padding: 12px 16px;
	margin-top: 10px;
	font-size: 13.5px;
	color: var(--red-dark);
	font-weight: bold;
	display: none;
}

.warn-banner.show {
	display: block;
}

.benchmark-ref {
	background: var(--grey);
	border: 1px solid var(--border);
	border-left: 4px solid var(--navy);
	border-radius: 6px;
	padding: 14px 18px;
	margin-top: 14px;
}

.benchmark-ref-title {
	font-weight: bold;
	color: var(--navy);
	font-size: 14px;
	margin-bottom: 6px;
}

.actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin: 20px 0 0;
}

button {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	padding: 9px 16px;
	border-radius: 6px;
	border: 1px solid var(--navy);
	background: #fff;
	color: var(--navy);
	cursor: pointer;
}

button.primary {
	background: var(--red);
	border-color: var(--red-dark);
	color: #fff;
}

button:hover {
	opacity: 0.85;
}

.footer-note {
	text-align: center;
	font-size: 11.5px;
	color: var(--muted);
	padding: 18px 32px 26px;
	border-top: 1px solid var(--border);
}

@media print {
	body {
		background: #fff;
		padding: 0;
	}
	.uxd-worksheet {
		box-shadow: none;
		border-radius: 0;
	}
	.actions {
		display: none;
	}
}

@media (max-width: 560px) {
	.content {
		padding: 8px 14px 24px;
	}
	.titleblock {
		padding: 22px 16px 18px;
	}
	th,
	td {
		padding: 6px 5px;
		font-size: 12.5px;
	}
	input[type="number"] {
		max-width: 90px;
		font-size: 13px;
	}
	.big-result .value {
		font-size: 24px;
	}
}
