/* Design System Auditor app (auditor.html). Loads after brand.css and reuses its app shell
   (header, stepper, cards, form controls, buttons, action bar), so both flows look and behave the same.
   This file only adds what the auditor needs. Colors come from the brand.css tokens. */

:root {
  --high: #b42318;
  --high-bg: #fef3f2;
  --med: #b54708;
  --med-bg: #fffaeb;
  --low: #475467;
  --low-bg: #f2f4f7;
}

/* ---------- shared bits ---------- */
.ax-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.ax-pill--sample {
  background: var(--brand-tint);
  color: var(--brand-hover);
}
.ax-pill--warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.ax-alert--info {
  background: var(--brand-tint);
  border-color: #c7d7fe;
  color: var(--ink);
}
.ax-alert--info > .bc-ico {
  color: var(--brand);
}
.ax-alert--info p {
  margin-top: 2px;
  color: var(--ink-2);
}
.bc-alert .bc-btn {
  margin-top: 12px;
}
#connect-notice:not(:empty) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.bc-btn--danger {
  background: var(--bad);
  color: #fff;
  box-shadow: var(--sh-xs);
}
.bc-btn--danger:hover {
  background: #912018;
}
.ax-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.ax-x:hover {
  background: #f2f4f7;
  color: var(--ink);
}
html.ax-lock {
  overflow: hidden;
}
.ax-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--ink-3);
}

/* ---------- Step 1: connect ---------- */
.ax-connect {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.ax-url {
  position: relative;
}
.ax-url .bc-ico {
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--ink-3);
  pointer-events: none;
}
.ax-url .bc-input {
  height: 44px;
  padding-left: 40px;
  font-size: 15px;
}
.ax-check {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
}
.ax-check:hover {
  background: #f9fafb;
}
.ax-check input {
  position: absolute;
  opacity: 0;
}
.ax-check__box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}
.ax-check input:checked + .ax-check__box {
  border-color: var(--brand);
  background: var(--brand)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.ax-check input:focus-visible + .ax-check__box {
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.ax-check:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.ax-check b {
  display: block;
  font-weight: 500;
}
.ax-check small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
}
.ax-sample-link {
  font-size: 13px;
  color: var(--ink-3);
}
.ax-sample-link:empty {
  display: none;
}
.ax-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ax-side .bc-card {
  gap: 16px;
}
.ax-checks,
.ax-scopes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ax-checks li,
.ax-scopes li {
  display: flex;
  gap: 10px;
}
.ax-checks .bc-ico,
.ax-scopes .bc-ico {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--brand);
}
.ax-checks b,
.ax-scopes b {
  display: block;
  font-weight: 500;
}
.ax-checks small,
.ax-scopes small {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
}
.ax-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
  list-style: disc;
  color: var(--ink-2);
}
.ax-privacy .bc-card__title .bc-ico {
  color: var(--ok);
}

/* ---------- Steps 2 and 3: centered panel ---------- */
.ax-panel {
  width: 100%;
  max-width: 600px;
  margin-top: 24px;
  align-items: center;
  gap: 24px;
  padding: 40px 32px;
  text-align: center;
}
.ax-panel > .bc-gen__text {
  align-items: center;
}
.ax-scopes,
.ax-steps,
.ax-panel .bc-alert,
.ax-panel .bc-note {
  width: 100%;
  text-align: left;
}
.ax-scopes {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.ax-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  list-style: decimal;
  color: var(--ink-2);
}
.ax-fine {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
  text-align: left;
}
.ax-fine .bc-ico {
  flex: none;
  color: var(--ok);
}
.bc-gen__steps li > span:last-child {
  display: flex;
  flex-direction: column;
}
.bc-gen__steps small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}
.ax-wait,
.ax-code {
  font-size: 13px;
  color: var(--ink-3);
}
.ax-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Step 4: report ---------- */
.ax-rhead {
  align-items: flex-start;
}
.ax-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--ink-3);
}
.ax-dl {
  display: flex;
  gap: 8px;
  flex: none;
}
.ax-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.ax-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.ax-stat small {
  font-size: 13px;
  color: var(--ink-3);
}
.ax-stat b {
  font-size: 30px;
  line-height: 38px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ax-stat span {
  font-size: 12px;
  color: var(--ink-3);
}
.ax-stat--high b {
  color: var(--high);
}
.ax-skipped {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  color: var(--ink-2);
}
.ax-skipped b {
  display: inline;
  font-weight: 500;
  color: var(--ink);
}
#report > .bc-alert {
  margin-bottom: 16px;
}
.ax-a11y {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--ink-2);
}
.ax-a11y .bc-ico {
  flex: none;
  margin-top: 2px;
  color: var(--ink-3);
}
.ax-a11y b {
  margin-right: 6px;
  font-weight: 500;
  color: var(--ink);
}
.ax-toolbar {
  position: sticky;
  top: calc(var(--top-h) + var(--steps-h));
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 0;
  margin-bottom: 4px;
  background: var(--page);
}
.ax-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ax-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}
.ax-chip span {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.ax-chip:hover {
  background: #f9fafb;
}
.ax-chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.ax-chip[aria-pressed='true'] span {
  color: #d0d5dd;
}
.ax-chip--high::before,
.ax-chip--medium::before,
.ax-chip--low::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ax-chip--high::before {
  background: var(--high);
}
.ax-chip--medium::before {
  background: #f79009;
}
.ax-chip--low::before {
  background: #98a2b3;
}
.ax-select {
  width: auto;
  min-width: 220px;
  height: 36px;
}
.ax-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.ax-switch input {
  position: absolute;
  opacity: 0;
}
.ax-switch span {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background var(--t);
}
.ax-switch span::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-xs);
  transition: transform var(--t);
}
.ax-switch input:checked + span {
  background: var(--brand);
}
.ax-switch input:checked + span::after {
  transform: translateX(16px);
}
.ax-switch input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.ax-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ax-find {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color var(--t),
    box-shadow var(--t);
}
.ax-find:hover {
  border-color: #c7d7fe;
  box-shadow: var(--sh-md);
}
.ax-find__main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.ax-find__main > b {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink);
}
.ax-find__cat {
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-3);
}
.ax-find__sum {
  color: var(--ink-2);
}
.ax-find__go {
  flex: none;
  align-self: center;
  color: var(--ink-4);
}
.ax-sev {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ax-find > .ax-sev {
  min-width: 76px;
  justify-content: center;
  margin-top: 2px;
}
.ax-sev--high {
  background: var(--high-bg);
  color: var(--high);
}
.ax-sev--medium {
  background: var(--med-bg);
  color: var(--med);
}
.ax-sev--low {
  background: var(--low-bg);
  color: var(--low);
}
.ax-sev--review {
  border: 1px dashed #98a2b3;
  background: var(--surface);
  color: var(--ink-3);
}
.ax-ev {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ax-ev span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: #f2f4f7;
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ax-sw {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.15);
}
.ax-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 48px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--ink-3);
  text-align: center;
}
.ax-empty .bc-ico {
  color: var(--ok);
}
.ax-empty b {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- finding details: slide-over ---------- */
.ax-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.ax-sheet__scrim,
.ax-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  opacity: 0;
  transition: opacity 200ms;
}
.ax-sheet__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--surface);
  box-shadow: -8px 0 32px rgba(16, 24, 40, 0.16);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 220ms var(--ease);
  outline: none;
}
.ax-sheet.is-open .ax-sheet__scrim {
  opacity: 1;
}
.ax-sheet.is-open .ax-sheet__panel {
  transform: none;
}
.ax-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 28px 40px;
}
.ax-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -8px -4px 0;
}
.ax-sheet__title {
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  text-wrap: balance;
}
.ax-sheet__sum {
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-2);
}
.ax-sheet__body section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ax-sheet__body h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.ax-sheet__body h3 span {
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.ax-evidence {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.ax-evidence li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.ax-evidence li + li {
  border-top: 1px solid var(--line);
}
.ax-evidence b {
  font-weight: 500;
  word-break: break-word;
}
.ax-evidence span {
  margin-left: auto;
  padding-left: 12px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: right;
}
.ax-fix p {
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--ok-bg);
  color: #05603a;
}
.ax-nodes {
  display: flex;
  flex-direction: column;
}
.ax-nodes li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ax-nodes li > div {
  min-width: 0;
}
.ax-nodes b {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ax-nodes small {
  font-size: 12px;
  color: var(--ink-3);
}
.ax-nodes .bc-btn {
  flex: none;
}
.ax-conf {
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- modal: contact, delete ---------- */
.ax-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ax-modal__scrim {
  opacity: 1;
}
.ax-modal__box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 48px rgba(16, 24, 40, 0.18);
  outline: none;
}
.ax-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px -8px -8px 0;
}
.ax-modal__head h2,
.ax-sent h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ax-prefill {
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #f9fafb;
}
.ax-textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
}
.ax-modal__btns {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.ax-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 4px;
  text-align: center;
}
.ax-sent p {
  color: var(--ink-2);
}
.ax-sent .bc-btn {
  margin-top: 8px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ax-connect {
    grid-template-columns: 1fr;
  }
  .ax-rhead {
    flex-direction: column;
  }
  .ax-switch {
    margin-left: 0;
  }
}
@media (max-width: 640px) {
  .ax-panel {
    padding: 28px 20px;
    margin-top: 0;
  }
  .ax-find {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }
  .ax-find__go {
    display: none;
  }
  .ax-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .ax-stat {
    padding: 16px;
  }
  .ax-stat b {
    font-size: 24px;
    line-height: 32px;
  }
  .ax-select {
    width: 100%;
  }
  .ax-toolbar {
    position: static;
  }
  .ax-sheet__body {
    padding: 16px 20px 32px;
  }
  .ax-dl {
    flex-wrap: wrap;
  }
  .ax-modal__btns .bc-btn {
    flex: 1;
  }
}
