/* The scan widget and the report page — layout and the neutral defaults.
 *
 * Canonical copy; vendored byte for byte with widget.mjs and render.mjs
 * (site.json → scanner.shared; `fleet audit` fails a copy that differs). A
 * site brands it by setting the variables below on `.sw` (and on `.sw-page`
 * for its report page) in its own stylesheet, and by passing its button and
 * input classes in the config — never by editing this file. Mobile first:
 * built at 375px, widened by the container's own width.
 */

.sw,
.sw-page {
  --sw-font: inherit;
  --sw-font-display: inherit;
  --sw-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sw-ink: #14171c;
  --sw-ink-2: #3b4250;
  --sw-muted: #5f6878;
  --sw-surface: #ffffff;
  --sw-surface-2: #f4f5f7;
  --sw-line: #dfe3e8;
  --sw-accent: #1f5fd6;
  --sw-accent-ink: #ffffff;
  --sw-radius: 14px;
  --sw-radius-sm: 9px;
  --sw-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(16, 24, 40, 0.07);
  --sw-input-bg: #ffffff;
  --sw-input-ink: var(--sw-ink);
  --sw-input-line: var(--sw-line);
  --sw-pass: #15803d;
  --sw-warn: #b45309;
  --sw-fail: #c42a2a;
  --sw-info: #5f6878;
  --sw-strong: #15803d;
  --sw-solid: #0f766e;
  --sw-decent: #b45309;
  --sw-weak: #c2410c;
  --sw-poor: #c42a2a;
  --sw-ring-track: var(--sw-line);
  --sw-mark-ink: #ffffff;
  font-family: var(--sw-font);
  color: var(--sw-ink);
  /* sized by its own width, not the window's, so it fits a narrow card */
  container-type: inline-size;
}

.sw *,
.sw-page * {
  box-sizing: border-box;
}

/* ---- the form ------------------------------------------------------------ */
.sw-form {
  position: relative;
  display: grid;
  gap: 12px;
}
.sw-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--sw-ink);
}
.sw-row {
  display: grid;
  gap: 10px;
}
.sw-field {
  position: relative;
}
.sw-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--sw-input-ink);
  background: var(--sw-input-bg);
  border: 1.5px solid var(--sw-input-line);
  border-radius: var(--sw-radius-sm);
}
.sw-field .sw-input {
  padding-right: 88px;
}
.sw-input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sw-accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--sw-accent);
}
.sw-paste {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  /* it sits on the field, so it takes the field's colors: a site's accent
     can be a color meant for a dark band (volt on white read 1.13:1) */
  color: var(--sw-input-ink);
  background: color-mix(in srgb, var(--sw-input-ink) 9%, transparent);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
/* the pill stays 36px; the tap target is 44px (rulebook: 44×44), inside the
   52px field and clear of the 88px it keeps for the address */
.sw-paste::before {
  content: "";
  position: absolute;
  inset: -4px;
}
.sw-paste[hidden] {
  display: none;
}
.sw-go,
.sw-send,
.sw-btn {
  min-height: 48px;
  cursor: pointer;
}
.sw-go:disabled,
.sw-send:disabled,
.sw-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
/* the widget's own buttons, when a site passes no classes of its own */
.sw-own {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--sw-radius-sm);
}
.sw-own--primary {
  color: var(--sw-accent-ink);
  background: var(--sw-accent);
  border: 0;
}
.sw-own--alt {
  color: var(--sw-ink);
  background: var(--sw-surface);
  border: 1.5px solid var(--sw-line);
}
.sw-fine {
  margin: 0;
  font-size: 0.85rem;
  color: var(--sw-muted);
}
/* the honeypot: display:none, not off-screen — browsers autofill a field they
   can focus (Chrome did on cabinetmakerpro.com, 2026-10-01, and a real lead
   was dropped); a script reading the HTML still fills it */
.sw-hp {
  display: none !important;
}
.sw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sw-progress {
  display: grid;
  gap: 8px;
}
.sw-progress[hidden] {
  display: none;
}
.sw-bar {
  height: 8px;
  overflow: hidden;
  background: var(--sw-surface-2);
  border-radius: 99px;
}
.sw-bar i {
  display: block;
  height: 100%;
  background: var(--sw-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.2s ease;
}
.sw-stage {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sw-ink-2);
}
.sw-error {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--sw-ink);
  background: color-mix(in srgb, var(--sw-fail) 9%, var(--sw-surface));
  border: 1px solid color-mix(in srgb, var(--sw-fail) 40%, transparent);
  border-radius: var(--sw-radius-sm);
}
.sw-error[hidden],
.sw-out[hidden],
.sw-follow[hidden] {
  display: none;
}

/* ---- the report ---------------------------------------------------------- */
.sw-out {
  margin-top: 24px;
  scroll-margin-top: 90px;
}
.sw-report {
  display: grid;
  gap: 16px;
}
.sw-card {
  padding: 18px;
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius);
  box-shadow: var(--sw-shadow);
}
.sw-note {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--sw-ink-2);
  background: var(--sw-surface-2);
  border-left: 4px solid var(--sw-warn);
  border-radius: 6px;
}
.sw-note--cap {
  border-left-color: var(--sw-fail);
}
.sw-summary {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}
.sw-dial {
  position: relative;
  width: 96px;
  height: 96px;
}
.sw-ring {
  width: 100%;
  height: 100%;
}
.sw-ring circle {
  fill: none;
  stroke-width: 12;
}
.sw-ring__track {
  stroke: var(--sw-ring-track);
}
.sw-ring__val {
  stroke: var(--sw-band, var(--sw-accent));
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s ease;
}
.sw-dial__n {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--sw-font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--sw-ink);
}
.sw-band--strong { --sw-band: var(--sw-strong); }
.sw-band--solid { --sw-band: var(--sw-solid); }
.sw-band--decent { --sw-band: var(--sw-decent); }
.sw-band--weak { --sw-band: var(--sw-weak); }
.sw-band--poor { --sw-band: var(--sw-poor); }
.sw-summary__text > * {
  margin: 0;
}
.sw-summary__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.sw-verdict {
  font-family: var(--sw-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sw-band, var(--sw-ink));
}
.sw-site {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sw-when {
  font-weight: 400;
  color: var(--sw-muted);
}
.sw-delta {
  font-size: 0.9rem;
  color: var(--sw-muted);
}
.sw-delta--up { color: var(--sw-pass); }
.sw-delta--down { color: var(--sw-fail); }
.sw-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.92rem;
  color: var(--sw-ink-2);
}
.sw-count--pass b { color: var(--sw-pass); }
.sw-count--warn b { color: var(--sw-warn); }
.sw-count--fail b { color: var(--sw-fail); }
.sw-cats {
  display: grid;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sw-cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  font-size: 0.9rem;
}
.sw-cat__label {
  color: var(--sw-ink-2);
}
.sw-cat__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sw-band, var(--sw-ink));
}
.sw-cat__score small {
  margin-left: 1px;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--sw-muted);
}
.sw-cat__bar {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: var(--sw-surface-2);
  border-radius: 99px;
}
.sw-cat__bar i {
  display: block;
  width: calc(var(--sw-p, 0) * 1%);
  height: 100%;
  background: var(--sw-band, var(--sw-accent));
  border-radius: inherit;
}
.sw-why {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--sw-surface-2);
  border-radius: var(--sw-radius-sm);
}
.sw-why__h {
  margin: 0;
  font-weight: 700;
  color: var(--sw-ink);
}
.sw-why__p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sw-ink-2);
}
.sw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.sw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.sw-actions__note {
  font-size: 0.88rem;
  color: var(--sw-muted);
}
.sw-actions__note.is-error {
  color: var(--sw-fail);
}
.sw-h {
  margin: 0 0 10px;
  font-family: var(--sw-font-display);
  font-size: 1.2rem;
  color: var(--sw-ink);
}
.sw-p {
  margin: 0;
  color: var(--sw-ink-2);
}
.sw-checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sw-check {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius-sm);
}
.sw-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  color: var(--sw-mark-ink);
  background: var(--sw-info);
  border-radius: 50%;
}
.sw-check--pass .sw-mark { background: var(--sw-pass); }
.sw-check--warn .sw-mark { background: var(--sw-warn); }
.sw-check--fail .sw-mark { background: var(--sw-fail); }
.sw-check__body > * {
  margin: 0;
}
.sw-check__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.sw-check__label {
  font-weight: 700;
  color: var(--sw-ink);
}
.sw-gain {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--sw-ink);
  background: var(--sw-surface-2);
  border: 1px solid var(--sw-line);
  border-radius: 99px;
  vertical-align: 1px;
}
.sw-check__finding {
  font-size: 0.93rem;
  color: var(--sw-ink-2);
  overflow-wrap: anywhere;
}
.sw-check__fix {
  font-size: 0.9rem;
  color: var(--sw-muted);
}
.sw-check__fix b {
  color: var(--sw-ink);
}
.sw-all {
  border-top: 1px solid var(--sw-line);
  padding-top: 12px;
}
.sw-all__summary {
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  cursor: pointer;
  color: var(--sw-ink);
}
.sw-all__summary::-webkit-details-marker {
  display: none;
}
.sw-all__summary::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.sw-all[open] > .sw-all__summary::before {
  transform: rotate(45deg);
}
.sw-all__n {
  font-weight: 400;
  color: var(--sw-muted);
}
.sw-group {
  margin-top: 16px;
}
.sw-group__h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--sw-ink);
}
.sw-group__score {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--sw-band, var(--sw-muted));
}
.sw-pages {
  margin: 0;
  font-size: 0.85rem;
  color: var(--sw-muted);
}
.sw-url {
  font-family: var(--sw-font-mono);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.sw-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-fail);
}
.sw-unread__finding {
  margin: 0;
  color: var(--sw-ink);
}
.sw-unread__fix {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--sw-muted);
}

/* ---- the follow-up ------------------------------------------------------- */
.sw-follow {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 18px;
  background: var(--sw-surface-2);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius);
}
.sw-follow__h {
  margin: 0;
  font-family: var(--sw-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sw-ink);
}
.sw-follow__p {
  margin: 0;
  color: var(--sw-ink-2);
}
.sw-follow__p a {
  color: inherit;
  font-weight: 700;
}
.sw-follow__row {
  display: grid;
  gap: 10px;
}
.sw-follow__go {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}
.sw-follow__alt {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 600;
  color: var(--sw-ink);
}
.sw-follow__status {
  margin: 0;
  font-size: 0.95rem;
}
.sw-follow__status.is-ok {
  color: var(--sw-pass);
}
.sw-follow__status.is-err {
  color: var(--sw-fail);
}
.sw-follow.is-sent .sw-follow__row,
.sw-follow.is-sent .sw-follow__go {
  display: none;
}

/* ---- wider ---------------------------------------------------------------- */
@container (min-width: 560px) {
  .sw-row {
    grid-template-columns: 1fr auto;
  }
  .sw-card {
    padding: 22px 24px;
  }
  .sw-summary {
    grid-template-columns: 120px 1fr;
    gap: 22px;
  }
  .sw-dial {
    width: 120px;
    height: 120px;
  }
  .sw-dial__n {
    font-size: 2.5rem;
  }
  .sw-cats {
    grid-template-columns: 1fr 1fr;
  }
  .sw-follow {
    padding: 22px 24px;
  }
}
@container (min-width: 720px) {
  .sw-follow__row {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-bar i,
  .sw-ring__val {
    transition: none;
  }
}
