:root {
  color-scheme: dark;
  --bg: #101617;
  --panel: #182122;
  --border: #314044;
  --text: #eef4f1;
  --muted: #a8b8b4;
  --accent: #b9f28e;
  --warn: #ffd38c;
  --bad: #ffa998;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(100% - 2 * clamp(1rem, 3vw, 2.5rem), 80rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--border); }
.nav { min-height: 4.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav a { text-decoration: none; }
.nav a:last-child { color: var(--muted); font-size: .9rem; }
.brand { font-weight: 750; font-size: 1.1rem; }
.brand span { color: var(--accent); margin-right: .35rem; }
.hero { padding: clamp(3rem, 8vw, 6.4rem) 0 2.5rem; }
.eyebrow { color: var(--accent); font: 600 .78rem ui-monospace, monospace; letter-spacing: .17em; }
h1 { margin: .8rem 0 1.1rem; font-size: clamp(2.6rem, 7.7vw, 5.4rem); line-height: 1; letter-spacing: -.065em; }
h2, h3, p { margin-block: 0 .55rem; }
h2 { font-size: 1.55rem; }
.hero > p { color: var(--muted); max-width: 38rem; font-size: 1.08rem; }
form { max-width: 42rem; margin-top: 2rem; }
label { display: block; margin-bottom: .4rem; font-weight: 650; }
.input-row { display: flex; gap: .55rem; }
input { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: .45rem; background: var(--panel); padding: .8rem 1rem; color: var(--text); }
button { cursor: pointer; border: 0; border-radius: .45rem; padding: .8rem 1rem; background: var(--accent); color: #172213; font-weight: 750; white-space: nowrap; }
button:disabled { opacity: .7; cursor: wait; }
button span { margin-left: .45rem; }
#status { margin-top: .55rem; min-height: 1.5rem; }
#status.bad { color: var(--bad); }
#report { padding-bottom: 2.5rem; }
.overview { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1.2rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); overflow-wrap: anywhere; }
.grade { font-size: 2rem; font-weight: 750; min-width: 3.4rem; padding: .2rem; text-align: center; border: 1px solid currentColor; border-radius: .5rem; }
.muted, .method p { color: var(--muted); }
.good { color: var(--accent); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.metrics { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 0; }
.metric { background: var(--panel); border: 1px solid var(--border); padding: .35rem .7rem; border-radius: .35rem; font-size: .9rem; }
details { border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
summary { cursor: pointer; padding: .8rem .2rem; font-weight: 650; }
summary span { margin-left: .7rem; font-size: .85rem; font-weight: 500; }
.details-body { padding: .2rem 1rem 1rem; }
.rubric { border-bottom: 0; }
.rubric p { max-width: 70ch; padding: .2rem 0 0; }
.detail-grid { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .35rem .85rem; margin: .4rem 0 .9rem; }
dt { color: var(--muted); } dd { margin: 0; }
ul { padding-left: 1.25rem; }
.method { padding-block: 2rem; border-top: 1px solid var(--border); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.method article { padding: 1rem; background: var(--panel); border-radius: .55rem; }
.method h3 { font-size: 1rem; }
.footer { display: flex; flex-wrap: wrap; gap: .35rem 1rem; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--border); padding-block: 1.2rem 2rem; font-size: .85rem; }
@media (max-width: 37rem) {
  .method-grid { grid-template-columns: 1fr; }
  .overview { grid-template-columns: auto 1fr; }
  .overview button { grid-column: 1 / -1; }
  .input-row { flex-wrap: wrap; }
  .input-row button { width: 100%; }
}

.report-legend { margin: .6rem 0 1.2rem; padding: 1rem; background: var(--panel); border: 1px solid var(--border); border-radius: .55rem; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .65rem 1.05rem; }
.legend-grid h4 { margin: 0 0 .25rem; font-size: .95rem; }
.legend-grid p { font-size: .85rem; }
.legend-labels { color: var(--text); font-weight: 600; }
.table-scroll { overflow: auto; margin-bottom: .7rem; border: 1px solid var(--border); border-radius: .55rem; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hosts-table { border-collapse: collapse; width: 100%; font-size: .84rem; }
.hosts-table th, .hosts-table td { padding: .65rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.hosts-table thead th, .host-extra { background: var(--panel); }
.hosts-table tr:last-child > * { border-bottom: 0; }
.host-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 2rem; background: transparent; color: var(--text); padding: 0 .2rem; text-align: left; white-space: normal; }
.host-toggle::before {
  content: "";
  flex: 0 0 .6rem;
  height: .6rem;
  border: solid var(--accent);
  border-width: 0 .14rem .14rem 0;
  transform: rotate(-45deg);
}
.host-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.cell-secondary { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.protocols { display: grid; grid-template-columns: repeat(2, max-content); gap: .15rem .55rem; }
.protocols span { white-space: nowrap; }
.dns-alias { font-family: ui-monospace, monospace; font-size: .76rem; overflow-wrap: anywhere; }
.mode-control { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .75rem; font-size: .94rem; }
.secondary-submit { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); padding: .55rem .75rem; }
.mode-control small { display: inline-block; padding-left: .3rem; font-weight: 400; color: var(--muted); }
.coverage-alert { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; padding: .8rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: .55rem; }
.coverage-alert p { margin: 0; }
.report-legend > p { margin: 0; font-size: .9rem; }
.report-legend details { border-bottom: 0; }
.report-legend summary { padding: .5rem 0 0; }
.legend-grid { margin-top: .65rem; }
.hosts-table { table-layout: fixed; }
.hosts-table th, .hosts-table td { overflow-wrap: anywhere; }
.hosts-table thead th:nth-child(4) { width: 17%; }
.protocols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .12rem .45rem; font-size: .78rem; }
.protocols span { white-space: normal; }
.stack-label { display: none; }
.hosts-table .host-summary[hidden], .host-detail[hidden] { display: none; }
@media (max-width: 65rem) {
  .table-scroll { border: 0; overflow: visible; }
  .hosts-table, .hosts-table tbody { display: block; }
  .hosts-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hosts-table .host-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .7rem; border: 1px solid var(--border); border-radius: .55rem; overflow: hidden; }
  .hosts-table tbody th { grid-column: 1 / -1; background: var(--panel); }
  .hosts-table tbody td { min-width: 0; }
  .stack-label { display: block; margin-bottom: .15rem; color: var(--muted); font-size: .76rem; font-weight: 600; }
  .host-detail:not([hidden]), .host-detail td { display: block; }
  .host-detail td { margin-top: -.2rem; border: 1px solid var(--border); border-radius: 0 0 .55rem .55rem; }
}
@media (max-width: 38rem) {
  .hosts-table .host-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .detail-grid dd { margin-bottom: .45rem; }
  .mode-control small { display: block; padding-left: 0; }
}

.probe-results { list-style: none; padding: 0; }
.probe-results li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .7rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.probe-results small { grid-column: 1 / -1; }
.check-command { white-space: pre-wrap; overflow-wrap: anywhere; padding: .65rem; background: var(--bg); border-radius: .35rem; }
@media (max-width: 65rem) {
  .hosts-table .empty-alias { display: none; }
}

.scan-submit > span { margin: 0; }
.scan-submit:disabled { color: var(--text); background: var(--panel); opacity: 1; box-shadow: inset 0 0 0 1px var(--border); }
.submit-busy:not([hidden]) { display: inline-flex; gap: .45rem; align-items: center; }
.submit-busy .scan-spinner { width: .85rem; height: .85rem; margin: 0; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: scan-spin .8s linear infinite; }
@keyframes scan-spin { to { transform: rotate(1turn); } }
.scan-progress { max-width: 42rem; margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: .55rem; background: var(--panel); }
.scan-progress-heading { display: flex; justify-content: space-between; gap: .7rem; font-variant-numeric: tabular-nums; }
.scan-progress progress:not([hidden]) { display: block; height: .4rem; width: 100%; margin-block: .62rem; accent-color: var(--accent); }
.scan-progress p { margin: 0; color: var(--muted); font-size: .9rem; }
.scan-activity { color: var(--muted); margin: .55rem 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.scan-activity:empty { display: none; }
.hero > #status.good { color: var(--accent); }
.scan-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .submit-busy .scan-spinner { animation: none; }
}

.report-title { font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.035em; line-height: 1.2; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.hero[hidden] + #report { padding-top: 2rem; }
.share-control { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem; padding: .75rem 0 0; }
.share-control > p { margin: 0; font-size: .88rem; }
.share-button { color: var(--text); background: var(--panel); border: 1px solid var(--border); padding: .4rem .65rem; }
.share-output:not([hidden]) { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.share-output input { flex: 1 1 18rem; max-width: 100%; padding: .4rem .55rem; }
.share-output a { white-space: nowrap; }
.share-feedback:empty { display: none; }

.refresh-control { display: flex; align-items: flex-start; gap: .55rem; margin-top: .8rem; font-size: .9rem; }
.refresh-control input { width: 1rem; height: 1rem; margin: .2rem 0 0; accent-color: var(--accent); }
.refresh-control small { display: block; color: var(--muted); font-weight: 400; }

.host-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-bottom: .85rem; }
.host-filters label { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 0; font-size: .9rem; }
.host-filters select { max-width: 100%; padding: .4rem .55rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--panel); color: var(--text); }
.host-filter-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.host-filters p { margin: 0 0 0 auto; font-size: .85rem; }

.security-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); gap: .8rem; margin-top: .8rem; }
.security-breakdown article { padding: .85rem 1rem; border: 1px solid var(--border); border-radius: .55rem; background: var(--panel); }
.security-breakdown h3 { font-size: 1rem; }
.security-breakdown p, .security-breakdown dl { font-size: .88rem; }
.security-breakdown dl { grid-template-columns: 1fr auto; margin-bottom: 0; }
.security-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }

.nav-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem 1rem; }
.nav-links a { color: var(--muted); font-size: .9rem; }
