/* Header Security Checker. Scoped to .hsc so it fits any theme. */
.hsc, .hsc *, .hsc *::before, .hsc *::after { box-sizing: border-box; }
.hsc {
	--hsc-accent: #2563eb;
	--hsc-line: rgba(127, 127, 127, .28);
	--hsc-soft: rgba(127, 127, 127, .09);
	--hsc-pass: #15803d;
	--hsc-warn: #b45309;
	--hsc-fail: #c62828;
	width: 100%;
	max-width: 100%;
	margin: 1.5em 0;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.55;
	color: inherit;
}
.hsc-card {
	width: 100%;
	max-width: 880px;
	margin: 0 auto;
	padding: clamp(16px, 4vw, 32px);
	border: 1px solid var(--hsc-line);
	border-radius: 14px;
}
.hsc .hsc-title { margin: 0 0 .25em; font-size: clamp(1.35rem, 3.4vw, 1.9rem); line-height: 1.2; color: inherit; }
.hsc .hsc-sub { margin: 0 0 1.25em; opacity: .75; }

/* Scan form */
.hsc .hsc-scan { display: flex; gap: 10px; flex-wrap: wrap; }
.hsc .hsc-input {
	flex: 1 1 240px; min-width: 0; height: 48px; margin: 0; padding: 0 14px;
	font: inherit; color: inherit; background: transparent;
	border: 1px solid var(--hsc-line); border-radius: 10px; box-shadow: none;
}
.hsc .hsc-input:focus, .hsc .hsc-field input:focus, .hsc .hsc-field textarea:focus {
	outline: 2px solid var(--hsc-accent); outline-offset: 1px; border-color: var(--hsc-accent);
}
.hsc .hsc-btn {
	flex: 0 0 auto; height: 48px; padding: 0 22px; margin: 0;
	font: inherit; font-weight: 600; line-height: 1; cursor: pointer;
	color: #fff; background: var(--hsc-accent);
	border: 0; border-radius: 10px; text-decoration: none; text-shadow: none;
	transition: filter .15s;
}
.hsc .hsc-btn:hover { filter: brightness(1.1); }
.hsc .hsc-btn:focus-visible, .hsc .hsc-close:focus-visible { outline: 3px solid var(--hsc-accent); outline-offset: 2px; }
.hsc .hsc-btn[disabled] { opacity: .6; cursor: not-allowed; }
.hsc .hsc-btn-block { width: 100%; }
.hsc .hsc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hsc .hsc-status { min-height: 1.5em; margin: 12px 0 0; font-size: .95rem; }
.hsc .hsc-status.is-error { color: var(--hsc-fail); font-weight: 600; }
.hsc .hsc-status.is-busy::before {
	content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
	border: 2px solid var(--hsc-line); border-top-color: var(--hsc-accent); border-radius: 50%;
	animation: hsc-spin .8s linear infinite;
}
@keyframes hsc-spin { to { transform: rotate(360deg); } }

/* Result summary: the grade is the one loud element */
.hsc .hsc-result { margin-top: 8px; }
.hsc .hsc-summary { display: flex; gap: clamp(14px, 3vw, 28px); align-items: center; padding: 18px 0; border-top: 1px solid var(--hsc-line); }
.hsc .hsc-grade {
	flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
	width: clamp(84px, 20vw, 124px); aspect-ratio: 1; border-radius: 22px;
	font-size: clamp(2.6rem, 9vw, 4.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff;
	background: #6b7280;
}
.hsc [data-grade="A+"] { background: #0f7a3d; }
.hsc [data-grade="A"]  { background: #1a9a4b; }
.hsc [data-grade="B"]  { background: #6f9a12; }
.hsc [data-grade="C"]  { background: #c79a00; }
.hsc [data-grade="D"]  { background: #e07b00; }
.hsc [data-grade="E"]  { background: #e0560c; }
.hsc [data-grade="F"]  { background: #c62828; }
.hsc .hsc-info { flex: 1 1 auto; min-width: 0; }
.hsc .hsc-host { margin: 0; font-size: 1.15rem; word-break: break-all; color: inherit; }
.hsc .hsc-score { margin: .15em 0 .6em; opacity: .8; }
.hsc .hsc-bar { height: 8px; border-radius: 99px; background: var(--hsc-soft); overflow: hidden; }
.hsc .hsc-fill { display: block; height: 100%; border-radius: 99px; }
.hsc .hsc-counts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.hsc .hsc-counts li { margin: 0; padding: 0; }
.hsc .hsc-counts b { font-weight: 700; }

/* Banner */
.hsc .hsc-banner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--hsc-line); background: var(--hsc-soft);
}
.hsc .hsc-banner p { margin: 0; flex: 1 1 260px; }
.hsc .hsc-banner.is-warn { border-color: var(--hsc-fail); }
.hsc .hsc-banner.is-good { border-color: var(--hsc-pass); }
.hsc .hsc-banner .hsc-btn { height: 42px; }

/* Header checks */
.hsc .hsc-checks { margin: 0; padding: 0; list-style: none; border: 1px solid var(--hsc-line); border-radius: 10px; overflow: hidden; }
.hsc .hsc-check { margin: 0; padding: 0; border-top: 1px solid var(--hsc-line); }
.hsc .hsc-check:first-child { border-top: 0; }
.hsc .hsc-check summary {
	display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none;
}
.hsc .hsc-check summary::-webkit-details-marker { display: none; }
.hsc .hsc-check summary:focus-visible { outline: 2px solid var(--hsc-accent); outline-offset: -2px; }
.hsc .hsc-mark {
	flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: .8rem; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
}
.hsc .hsc-pass .hsc-mark { background: var(--hsc-pass); }
.hsc .hsc-warn .hsc-mark { background: var(--hsc-warn); }
.hsc .hsc-fail .hsc-mark { background: var(--hsc-fail); }
.hsc .hsc-name { flex: 1 1 auto; min-width: 0; font-weight: 600; word-break: break-word; }
.hsc .hsc-pts { flex: 0 0 auto; font-size: .85rem; opacity: .7; font-variant-numeric: tabular-nums; }
.hsc .hsc-body { padding: 0 14px 14px 50px; font-size: .94rem; }
.hsc .hsc-body p { margin: 0 0 .6em; }
.hsc .hsc-body small { display: block; margin-bottom: 2px; opacity: .7; }
.hsc .hsc-body code {
	display: block; padding: 8px 10px; margin: 0 0 .7em; border-radius: 8px; background: var(--hsc-soft);
	font-size: .85rem; white-space: pre-wrap; word-break: break-all; color: inherit;
}

/* Registration dialog */
.hsc-lock { overflow: hidden; }
.hsc.hsc-modal {
	position: fixed; inset: 0; z-index: 999999; margin: 0; max-width: none; width: auto;
	display: flex; align-items: center; justify-content: center; padding: 16px;
	background: rgba(10, 12, 20, .62); overflow-y: auto; -webkit-overflow-scrolling: touch;
	animation: hsc-fade .18s ease-out;
}
@keyframes hsc-fade { from { opacity: 0; } to { opacity: 1; } }
.hsc .hsc-dialog {
	position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
	padding: clamp(20px, 5vw, 32px); border-radius: 16px;
	color: #14171f; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.hsc .hsc-close {
	position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; padding: 0; margin: 0;
	font-size: 1.6rem; line-height: 1; color: inherit; background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.hsc .hsc-close:hover { background: rgba(127, 127, 127, .18); }
.hsc .hsc-lead-title { margin: 0 36px .3em 0; font-size: clamp(1.25rem, 4vw, 1.55rem); line-height: 1.25; color: inherit; }
.hsc .hsc-lead-text { margin: 0 0 .6em; opacity: .8; }
.hsc .hsc-lead-grade { margin: 0 0 1em; font-weight: 600; }
.hsc .hsc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.hsc .hsc-field { display: block; margin: 0 0 14px; }
.hsc .hsc-field span { display: block; margin-bottom: 4px; font-size: .9rem; font-weight: 600; }
.hsc .hsc-field input, .hsc .hsc-field textarea {
	display: block; width: 100%; margin: 0; padding: 10px 12px; font: inherit; color: inherit; background: transparent;
	border: 1px solid rgba(127, 127, 127, .45); border-radius: 8px; box-shadow: none;
}
.hsc .hsc-field input[readonly] { opacity: .7; background: rgba(127, 127, 127, .1); }
.hsc .hsc-field [aria-invalid="true"] { border-color: var(--hsc-fail); }
.hsc .hsc-field input { height: 44px; }
.hsc label.hsc-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: .92rem; cursor: pointer; }
.hsc label.hsc-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--hsc-accent); }
.hsc .hsc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hsc .hsc-form-msg { min-height: 1.3em; margin: 0 0 8px; font-size: .92rem; color: var(--hsc-fail); font-weight: 600; }
.hsc .hsc-form-msg.is-ok { color: var(--hsc-pass); }
.hsc .hsc-thanks { padding: 12px 0 4px; text-align: center; }
.hsc .hsc-thanks h3 { margin: 0 0 .4em; font-size: 1.4rem; color: inherit; }
.hsc .hsc-thanks .hsc-tick {
	width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--hsc-pass); color: #fff; font-size: 1.8rem;
	display: flex; align-items: center; justify-content: center;
}
.hsc .hsc-thanks .hsc-btn { margin-top: 12px; }

@media (prefers-color-scheme: dark) {
	.hsc .hsc-dialog { color: #f1f3f8; background: #1d2029; }
}

/* Small screens */
@media (max-width: 600px) {
	.hsc .hsc-scan .hsc-btn { width: 100%; }
	.hsc .hsc-summary { flex-direction: column; align-items: flex-start; }
	.hsc .hsc-grid { grid-template-columns: 1fr; }
	.hsc .hsc-banner .hsc-btn { width: 100%; }
	.hsc .hsc-body { padding-left: 14px; }
	.hsc.hsc-modal { align-items: flex-end; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.hsc *, .hsc.hsc-modal { animation: none !important; transition: none !important; }
}
