/* ==========================================================================
   WSE Fund Applicant Portal
   ========================================================================== */

.hse {
	--hse-navy: #1b2f7a;
	--hse-navy-ink: #14204f;
	--hse-blue: #1f5fa8;
	--hse-teal: #0f7377; /* 5.6:1 with white (WCAG AA) */
	--hse-gold: #e9c33f;
	--hse-ink: #1f2a44;
	--hse-muted: #5a6580;
	--hse-line: #d9e1ee;
	--hse-control: #7d8aa1; /* Form-control and status-marker outlines: 3.5:1 on white (WCAG 2.1 1.4.11). */
	--hse-soft: #f4f7fb;
	--hse-green: #1f7a40; /* 5.4:1 with white */
	--hse-red: #b42f2f; /* 5.4:1 on #fdeaea */
	--hse-radius: 16px;
	--hse-shadow: 0 1px 2px rgba(20, 32, 79, .06), 0 8px 24px rgba(20, 32, 79, .07);
	color: var(--hse-ink);
	font-size: 16px;
	line-height: 1.55;
}
.hse *, .hse *::before, .hse *::after { box-sizing: border-box; }
.hse a { color: var(--hse-navy); }
.hse :focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; box-shadow: 0 0 0 2px #14204f; } /* Dark inner ring + yellow outline: visible on light and dark. */
.hse [hidden] { display: none !important; }

.hse-icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }

/* Type */
.hse-eyebrow { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--hse-teal); }
.hse-h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.15; font-weight: 800; letter-spacing: -.015em; color: var(--hse-navy); }
.hse-h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1.25rem; line-height: 1.3; font-weight: 700; color: var(--hse-navy-ink); }
.hse-h3 { margin: 24px 0 8px; font-size: 1rem; color: var(--hse-navy-ink); }
.hse-muted { color: var(--hse-muted); margin: 0; }
.hse p { margin: 0 0 12px; }

/* Card */
.hse-card {
	background: #fff;
	border: 1px solid var(--hse-line);
	border-radius: var(--hse-radius);
	box-shadow: var(--hse-shadow);
	padding: clamp(20px, 3.5vw, 32px);
	margin-bottom: 20px;
}
.hse-narrow { max-width: 640px; margin-inline: auto; }

/* Buttons */
.hse-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 44px;
	padding: .65em 1.25em;
	border-radius: 999px;
	border: 1.5px solid var(--hse-navy);
	background: #fff;
	color: var(--hse-navy) !important;
	font: inherit; font-weight: 600; line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, color .15s, transform .15s;
}
.hse-btn:hover { background: #eef2fb; }
.hse-btn--primary { background: var(--hse-navy); color: #fff !important; }
.hse-btn--primary:hover { background: var(--hse-navy-ink); }
.hse-btn--block { width: 100%; }
.hse-btn--sm { min-height: 36px; padding: .4em 1em; font-size: .9rem; }
.hse-btn[disabled] { opacity: .45; cursor: not-allowed; }
.hse-link-btn { background: none; border: 0; padding: 0 0 0 6px; color: var(--hse-red); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; }

.hse-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hse-row--between { justify-content: space-between; }
.hse-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hse-line); }

/* Forms */
.hse-form { display: grid; gap: 18px; }
.hse-form > .hse-actions { margin-top: 6px; }
.hse-field { display: grid; gap: 6px; }
.hse-field fieldset { border: 0; margin: 0; padding: 0; min-width: 0; } /* Browsers size a fieldset to its widest content; let it shrink. */
.hse-form > * { min-width: 0; }
.hse-label { font-weight: 600; font-size: .95rem; color: var(--hse-navy-ink); }
.hse-req { color: var(--hse-red); }
.hse-help { margin: 0; font-size: .85rem; color: var(--hse-muted); }
.hse input[type="text"], .hse input[type="email"], .hse input[type="password"], .hse input[type="tel"],
.hse input[type="number"], .hse input[type="date"], .hse select, .hse textarea {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1.5px solid var(--hse-control);
	border-radius: 10px;
	background: #fff;
	color: var(--hse-ink);
	font: inherit;
	transition: border-color .15s, box-shadow .15s;
}
.hse textarea { resize: vertical; min-height: 120px; }
.hse input:focus, .hse select:focus, .hse textarea:focus { outline: 3px solid #f2b705; outline-offset: 2px; box-shadow: 0 0 0 2px #14204f; border-color: var(--hse-blue); }
.hse-field--invalid input, .hse-field--invalid select, .hse-field--invalid textarea { border-color: var(--hse-red); background: #fffafa; }
.hse-field--invalid .hse-label, .hse-field--invalid legend { color: var(--hse-red); }
.hse-radios { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hse-radio, .hse-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.hse-radio { padding: 10px 16px; border: 1.5px solid var(--hse-control); border-radius: 10px; }
.hse-radio:has(input:checked) { border-color: var(--hse-navy); background: #eef2fb; }
.hse-radio input, .hse-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--hse-navy); flex: none; }
.hse-check span { font-size: .92rem; }
.hse-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hse-counter.is-near { color: #a35a00; }
.hse-counter.is-over { color: var(--hse-red); font-weight: 700; }
.hse-help p { margin: 0 0 4px; }
.hse-help__list { margin: 4px 0 8px 1.2em; padding: 0; }
.hse-help__list li { margin: 2px 0; }
.hse-table-input select { width: 100%; min-height: 40px; border: 1.5px solid var(--hse-control); border-radius: 8px; background: #fff; }
.hse-budget th[scope="row"] { text-align: left; font-weight: 600; padding-right: 8px; white-space: nowrap; }

/* Notices */
.hse-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; border: 1.5px solid; }
.hse-notice p { margin: 0; }
.hse-notice ul { margin: 6px 0 0; padding-left: 18px; }
.hse-notice .hse-icon { margin-top: 2px; }
.hse-notice--ok { background: #f1faf4; border-color: #a6d8b6; color: #1d5e35; }
.hse-notice--error { background: #fff4f4; border-color: #f0b4b4; color: #8e2424; }
.hse-notice--info { background: #f3f7ff; border-color: #bccdf0; color: var(--hse-navy-ink); }

.hse-deadline { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 20px; border-radius: 12px; background: #fffbea; border: 1.5px solid var(--hse-gold); }
.hse-deadline p { margin: 0; }
.hse-deadline .hse-icon { color: #7a5b00; width: 22px; height: 22px; }
.hse-deadline--urgent { background: #fff4f4; border-color: #e99; }
.hse-deadline--urgent .hse-icon { color: var(--hse-red); }

/* ---- Login / register ------------------------------------------------- */
.hse-auth {
	display: grid;
	grid-template-columns: 1.05fr 1fr;
	gap: clamp(24px, 5vw, 64px);
	align-items: center;
	min-height: min(720px, calc(100vh - 220px));
	padding-block: clamp(8px, 3vw, 32px);
}
.hse-auth__intro {
	position: relative;
	padding: clamp(28px, 4vw, 48px);
	border-radius: 24px;
	color: #fff;
	background:
		radial-gradient(circle at 85% 15%, rgba(233, 195, 63, .18), transparent 40%),
		linear-gradient(150deg, var(--hse-navy), var(--hse-navy-ink)); /* Gold and white text both pass AA everywhere on this. */
	overflow: hidden;
}
.hse-auth__intro::after {
	content: "";
	position: absolute; right: -60px; bottom: -60px;
	width: 220px; height: 220px;
	border-radius: 50%;
	border: 28px solid rgba(255, 255, 255, .06);
}
.hse-auth__intro .hse-eyebrow { color: var(--hse-gold); }
.hse-auth__title { margin: 0 0 12px; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.hse-auth__lead { font-size: 1.08rem; opacity: .92; max-width: 34ch; }
.hse-auth__facts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.hse-auth__facts li { display: flex; gap: 12px; align-items: flex-start; }
.hse-auth__facts .hse-icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.hse-auth__facts span { padding-top: 6px; }
.hse-auth__facts strong { color: var(--hse-gold); }
.hse-auth__card { margin: 0; max-width: 480px; width: 100%; justify-self: center; }

.hse-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 999px; background: var(--hse-soft); }
.hse-tabs button {
	min-height: 42px; border: 0; border-radius: 999px; background: transparent;
	font: inherit; font-weight: 600; color: var(--hse-muted); cursor: pointer;
}
.hse-tabs button[aria-selected="true"] { background: #fff; color: var(--hse-navy); box-shadow: 0 1px 4px rgba(20, 32, 79, .15); }

/* MFA code screen */
.hse-auth--single { grid-template-columns: 1fr; justify-items: center; }
.hse-mfa { text-align: center; }
.hse-mfa .hse-form { text-align: left; margin-top: 18px; }
.hse-mfa__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; background: #e7eefb; color: var(--hse-navy); }
.hse-mfa__icon .hse-icon { width: 28px; height: 28px; }
.hse .hse-code { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: .5em; padding-left: .5em; font-variant-numeric: tabular-nums; }
.hse-mfa__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 18px 0 10px; }
.hse-link { background: none; border: 0; padding: 4px; color: var(--hse-navy); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---- Dashboard ---------------------------------------------------------- */
.hse-dash, .hse-page { max-width: 960px; margin-inline: auto; }
.hse-dash__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.hse-pill { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: #e7eefb; color: var(--hse-navy); font-weight: 700; font-size: .88rem; }
.hse-pill--neg { background: #fdeaea; color: var(--hse-red); }

.hse-tracker {
	list-style: none; margin: 0 0 22px; padding: 22px 12px 18px;
	display: grid; grid-template-columns: repeat(7, 1fr);
	background: #fff; border: 1px solid var(--hse-line); border-radius: var(--hse-radius);
	box-shadow: var(--hse-shadow);
}
.hse-tracker__item { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; }
.hse-tracker__item + .hse-tracker__item::before {
	content: ""; position: absolute; top: 17px; right: 50%; width: 100%; height: 4px;
	background: var(--hse-line); z-index: 0;
}
.hse-tracker__item.is-done + .hse-tracker__item::before,
.hse-tracker__item.is-done::before { background: var(--hse-teal); }
.hse-tracker__dot {
	position: relative; z-index: 1;
	display: grid; place-items: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: #fff; border: 3px solid var(--hse-control);
	font-weight: 800; color: var(--hse-muted);
}
.hse-tracker__dot .hse-icon { width: 18px; height: 18px; stroke-width: 3; }
.hse-tracker__label { font-size: .82rem; font-weight: 600; color: var(--hse-muted); line-height: 1.25; padding-inline: 4px; }
.is-done .hse-tracker__dot { background: var(--hse-teal); border-color: var(--hse-teal); color: #fff; }
.is-current .hse-tracker__dot { background: var(--hse-navy); border-color: var(--hse-navy); color: #fff; box-shadow: 0 0 0 5px rgba(27, 47, 122, .15); }
.is-current .hse-tracker__label { color: var(--hse-navy); }
.is-stopped .hse-tracker__dot { background: var(--hse-red); border-color: var(--hse-red); color: #fff; }
.is-stopped .hse-tracker__label { color: var(--hse-red); }

.hse-next .hse-btn--primary { margin-top: 4px; }
.hse-state { display: flex; gap: 18px; align-items: flex-start; }
.hse-state__icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: #e7eefb; color: var(--hse-navy); }
.hse-state__icon .hse-icon { width: 28px; height: 28px; }
.hse-state--good .hse-state__icon { background: #e3f4e9; color: var(--hse-green); }
.hse-state--neg .hse-state__icon { background: #fdeaea; color: var(--hse-red); }

.hse-tasks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.hse-task { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1.5px solid var(--hse-line); border-radius: 14px; }
.hse-task__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: #e7eefb; color: var(--hse-navy); }
.hse-task__text { display: grid; gap: 2px; flex: 1; }
.hse-task__text .hse-muted { font-size: .9rem; }
.hse-task__lock { color: var(--hse-muted); }
.hse-task.is-done { background: #f6fbf8; border-color: #bfe2cb; }
.hse-task.is-done .hse-task__icon { background: var(--hse-green); color: #fff; }

.hse-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hse-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hse-report-form { padding: 18px; border-radius: 12px; background: var(--hse-soft); margin-top: 12px; }

/* ---- Form pages --------------------------------------------------------- */
.hse-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-weight: 600; text-decoration: none; }
.hse-back:hover { text-decoration: underline; }
.hse-page__head { margin-bottom: 20px; }

.hse-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hse-steps__item { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--hse-line); font-size: .9rem; font-weight: 600; color: var(--hse-muted); }
.hse-steps__num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--hse-soft); font-size: .85rem; }
.hse-steps__item.is-current { border-color: var(--hse-navy); color: var(--hse-navy); }
.hse-steps__item.is-current .hse-steps__num { background: var(--hse-navy); color: #fff; }
.hse-steps__item.is-done .hse-steps__num { background: var(--hse-teal); color: #fff; }

.hse-split { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.hse-split .hse-card { margin: 0; }
.hse-split > * { min-width: 0; }
.hse-sections { position: sticky; top: 96px; }
.hse-sections ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } /* relative: keeps hidden labels inside the strip (no sideways page scroll on phones) */
.hse-sections a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--hse-muted); }
.hse-sections a:hover { background: #fff; }
.hse-sections a.is-current { background: #fff; color: var(--hse-navy); box-shadow: var(--hse-shadow); }
.hse-sections__mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--hse-control); flex: none; }
.hse-sections__mark .hse-icon { width: 13px; height: 13px; stroke-width: 3.5; }
.is-done .hse-sections__mark { background: var(--hse-green); border-color: var(--hse-green); color: #fff; }
.hse-sections__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hse-sections__note { font-size: .8125rem; font-weight: 600; color: var(--hse-muted); }
.is-missing .hse-sections__mark { background: var(--hse-red); border-color: var(--hse-red); color: #fff; font-size: 14px; font-weight: 800; line-height: 1; }
.is-missing .hse-sections__note { color: var(--hse-red); }

.hse-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hse-doc { display: grid; grid-template-columns: auto 1fr minmax(0, 260px); align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--hse-control); border-radius: 14px; }
.hse-doc.is-done { border-style: solid; border-color: #bfe2cb; background: #f6fbf8; }
.hse-doc__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #e7eefb; color: var(--hse-navy); }
.hse-doc.is-done .hse-doc__icon { background: var(--hse-green); color: #fff; }
.hse-doc__text { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hse-doc__file { flex-basis: 100%; font-size: .9rem; }
.hse-doc__input { font-size: .88rem; max-width: 100%; }
.hse-tag { padding: 2px 8px; border-radius: 6px; background: #fdeaea; color: var(--hse-red); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.hse-tag--opt { background: var(--hse-soft); color: var(--hse-muted); }

.hse-review__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hse-dl { display: grid; grid-template-columns: minmax(160px, 38%) 1fr; gap: 10px 20px; margin: 8px 0 0; }
.hse-dl dt { font-weight: 600; color: var(--hse-muted); font-size: .92rem; }
.hse-dl dd { margin: 0; word-break: break-word; }
.hse-sign { border: 2px solid var(--hse-navy); }
.hse-sign__name { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.25rem !important; }

/* ---- v2: intake form, agreement, reporting ------------------------------ */
.screen-reader-text:not(:focus) { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hse-page--wide { max-width: 1120px; }
.hse-field fieldset legend { padding: 0; margin-bottom: 4px; }
.hse-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hse-choices--multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hse-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1.5px solid var(--hse-control); border-radius: 10px; cursor: pointer; background: #fff; }
.hse-choice:has(input:checked) { border-color: var(--hse-navy); background: #eef2fb; }
.hse-choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--hse-navy); flex: none; }
.hse-choice__file { grid-column: 1 / -1; margin: -4px 0 4px 28px; padding: 10px 12px; border-left: 3px solid var(--hse-teal); background: var(--hse-soft); border-radius: 0 8px 8px 0; }
.hse-field--invalid fieldset .hse-choice { border-color: var(--hse-red); }
.hse-check--declaration { padding: 14px 16px; border: 1.5px solid var(--hse-control); border-radius: 10px; }
.hse-check--declaration:has(input:checked) { border-color: var(--hse-green); background: #f6fbf8; }
.hse-field--invalid .hse-check--declaration { border-color: var(--hse-red); }
.hse-money { display: flex; align-items: center; border: 1.5px solid var(--hse-control); border-radius: 10px; background: #fff; max-width: 280px; }
.hse-money span { padding: 0 4px 0 14px; color: var(--hse-muted); font-weight: 600; }
.hse .hse-money input { border: 0; min-height: 44px; box-shadow: none; }
.hse .hse-money input:focus { outline: none; } /* The wrapper draws the focus outline. */
.hse-money:focus-within { border-color: var(--hse-blue); outline: 3px solid #f2b705; outline-offset: 2px; box-shadow: 0 0 0 2px #14204f; }
.hse-file { display: grid; gap: 6px; }
.hse-file__current { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .92rem; }
.hse-file__current .hse-icon { color: var(--hse-green); }
.hse-file input[type="file"] { font-size: .9rem; max-width: 100%; }
.hse-file + .hse-file { margin-top: 12px; }
.hse-file__slot { font-size: .8125rem; font-weight: 700; color: var(--hse-muted); }
.hse-file__replace summary { cursor: pointer; font-size: .9rem; color: var(--hse-blue); text-decoration: underline; width: fit-content; }
.hse-file__replace[open] summary { margin-bottom: 6px; }
.hse input[readonly] { background: var(--hse-soft); color: var(--hse-muted); cursor: not-allowed; }
.hse-table-input th.hse-table-date,
.hse-table-input td.hse-table-date {
	width: 190px;
	min-width: 190px;
	max-width: 190px;
}

.hse-table-input td.hse-table-date input[type="date"] {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* Do not apply the budget-table last-column sizing to generic input tables. */
.hse-budget.hse-table-input td:last-child {
	width: 190px;
	min-width: 190px;
	max-width: 190px;
}
.hse-budget { width: 100%; border-collapse: collapse; margin-top: 6px; }
/* Repeating cards (C5 Project Milestones). */
.hse-cards { display: grid; gap: 14px; margin-top: 8px; }
.hse-card-row { border: 1px solid var(--hse-line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 14px; }
.hse-card-row__title { margin: 0; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hse-muted); }
.hse-card-row__field textarea, .hse-card-row__field input { width: 100%; box-sizing: border-box; }
.hse-card-row .hse-label--sub { margin-bottom: 2px; }
.hse-card-row .hse-help { margin: 0 0 6px; }
.hse-add-card { margin-top: 12px; padding: 10px 16px; border: 1.5px dashed var(--hse-blue); border-radius: 8px; background: transparent; color: var(--hse-blue); font: inherit; font-weight: 600; cursor: pointer; }
.hse-add-card:hover, .hse-add-card:focus-visible { background: var(--hse-soft); }
.hse-card-view { border: 1px solid var(--hse-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.hse-card-view dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.hse-card-view dt { font-weight: 600; color: var(--hse-muted); }
.hse-card-view dd { margin: 0; }
.hse-budget th, .hse-budget td { padding: 6px; text-align: left; border-bottom: 1px solid var(--hse-line); }
.hse-budget th { font-size: .85rem; color: var(--hse-muted); }
.hse-budget td:last-child { width: 34%; }
.hse-budget tfoot th, .hse-budget tfoot td { font-weight: 700; color: var(--hse-navy-ink); border-bottom: 0; }
.hse-budget--view td:last-child { text-align: right; }
.hse-progress { height: 10px; border-radius: 6px; background: var(--hse-soft); overflow: hidden; margin: 4px 0 16px; }
.hse-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--hse-teal), var(--hse-blue)); }
.hse-next .hse-sections { position: static; margin-top: 20px; }
.hse-next .hse-sections ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hse-sections__key { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; background: var(--hse-soft); color: var(--hse-navy); font-size: .78rem; font-weight: 800; }
.hse-h2 .hse-sections__key { font-size: .85rem; height: 26px; min-width: 26px; }
.hse-review.is-incomplete { border-color: #f0b4b4; }
.hse-answer-list { margin: 0; padding-left: 18px; }
.hse-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.hse-table th, .hse-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--hse-line); }
.hse-table th { font-size: .85rem; color: var(--hse-muted); }
.hse-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--hse-soft); color: var(--hse-muted); }
.hse-status--due, .hse-status--submitted { background: #fff6d6; color: #7a5b00; }
.hse-status--overdue, .hse-status--flagged, .hse-status--audit { background: #fdeaea; color: var(--hse-red); }
.hse-status--accepted { background: #e3f4e9; color: var(--hse-green); }
.hse-agreement { font-family: Georgia, "Times New Roman", serif; line-height: 1.7; }
.hse-agreement p { margin: 0 0 14px; }
.hse-agreement__att { font-family: var(--hse-font, inherit); display: flex; gap: 8px; align-items: center; }
.hse-signed { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #f1faf4; color: #1d5e35; font-family: system-ui, sans-serif; }
.hse-signed p { margin: 0; }
.hse-auth__top { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.hse-auth__top .hse-tabs { flex: 1; margin: 0; }
.hse-lang { font-weight: 600; text-decoration: none; }
.hse-lang--pill { padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--hse-line); font-size: .9rem; white-space: nowrap; }
.hse-lang--pill:hover { border-color: var(--hse-navy); }
.hse-submit { border: 2px solid var(--hse-navy); }

@media print {
	.hse-back, .hse-sections, .hse-actions, .hse-btn, .hse-link, .hse-lang, .site-header, .site-footer { display: none !important; }
	.hse-card { box-shadow: none; border: 0; padding: 0; }
	.hse-split { display: block; }
}

/* Malware-scan badges */
.hse-scan { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #fff6d6; color: #7a5b00; }
.hse-scan--pending::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; animation: hse-pulse 1.2s infinite; }
.hse-scan--malicious, .hse-scan--unscanned { background: #fdeaea; color: var(--hse-red); }
@keyframes hse-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .hse-scan--pending::before { animation: none; } }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
	.hse-auth { grid-template-columns: 1fr; min-height: 0; }
	.hse-auth__card { max-width: none; order: -1; }
	.hse-auth__facts { margin-top: 18px; }
	.hse-split { grid-template-columns: 1fr; }
	.hse-sections { position: static; }
	.hse-sections ol { display: flex; overflow-x: auto; padding-bottom: 4px; }
	.hse-sections a { white-space: nowrap; }
	.hse-doc { grid-template-columns: auto 1fr; }
	.hse-doc__input { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	.hse-grid-2, .hse-dl { grid-template-columns: 1fr; }
	.hse-dl dd { margin-bottom: 8px; }
	.hse-tracker { grid-template-columns: repeat(4, 1fr); row-gap: 18px; }
	.hse-tracker__item:nth-child(5)::before { display: none; }
	.hse-auth__top { flex-wrap: wrap; }
	.hse-choices--multi { grid-template-columns: 1fr; }
	.hse-task { flex-wrap: wrap; }
	.hse-task__text { flex: 1 1 calc(100% - 60px); }
	.hse-task .hse-btn, .hse-task__lock { margin-left: 60px; }
	.hse-actions { justify-content: stretch; }
	.hse-actions .hse-btn { flex: 1 1 100%; }
	.hse-state { flex-direction: column; }
	/* Input tables (C project commitments etc.): each row becomes a card, each box labelled with its column. */
	.hse-table-input thead { display: none; }
	.hse-table-input, .hse-table-input tbody, .hse-table-input tr, .hse-table-input td { display: block; width: 100%; }
	.hse-table-input tr { border: 1px solid var(--hse-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
	.hse-table-input td,
	.hse-table-input td.hse-table-date,
	.hse-budget.hse-table-input td:last-child { width: 100%; min-width: 0; max-width: none; border-bottom: 0; padding: 4px 0; }
	.hse-table-input td[data-label]::before { content: attr(data-label); display: block; font-size: .8125rem; font-weight: 600; color: var(--hse-muted); margin-bottom: 2px; }
	.hse-table-input input, .hse-table-input select { width: 100%; box-sizing: border-box; }
}
