@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700;800&family=Mulish:wght@400;500;600;700;800&display=swap");

/* Audits — the audit list, the new-audit dialog, and the audit workspace.
   Ported from the Audit-redesign design components into the suite's class idiom
   (Lexend + Mulish, 90% container, shared header/footer chrome). */

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #33404F;
  --muted: #8791A0;
  --muted2: #5B6675;
  --muted3: #5F6A79;
  --line: #EAEDF3;
  --line2: #EFF2F7;
  --line3: #E4E9F1;
  --wash: #F7F9FC;
  --red: #E8402A;

  /* The four outcomes. Each is a letter AND a colour — outcome is never conveyed
     by colour alone. */
  --pass-ink: #14795A; --pass-tint: #E7F7F1; --pass-bd: #CDEDE1; --pass-dot: #1FA97A;
  --fail-ink: #C0392B; --fail-tint: #FCECEC; --fail-bd: #F5D5D5; --fail-dot: #D14545;
  --na-ink:   #5B6675; --na-tint:   #F1F4FA; --na-bd:   #E4E9F1; --na-dot:   #98A2B0;
  --cant-ink: #95530D; --cant-tint: #FCF3E8; --cant-bd: #F1E2C8; --cant-dot: #E0A21E;
  --part-ink: #1E56C0; --part-tint: #EAF1FC; --part-bd: #D6E4FB; --part-dot: #3C7CE0;
  --todo-ink: #5B6675; --todo-tint: #F7F9FC; --todo-bd: #E4E9F1; --todo-dot: #C2CBD8;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: #F3F5FA;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
a { color: #1E56C0; text-decoration: none; }
a:hover { color: #16418F; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }
body.au-modal-open { overflow: hidden; }

.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

:where(button, a, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid #2F6FE0; outline-offset: 2px; border-radius: 10px;
}

@keyframes auFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auPop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===================================================================== */
/* Shared bits                                                            */
/* ===================================================================== */

.au-card, .ad-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
}
.au-card { overflow: hidden; animation: auFadeUp .35s ease both; }

.au-cell-stack, .ad-cell-stack {
  min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left;
}

/* Search field, shared by the picker and the criteria filter. */
.au-search, .ad-search {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1.5px solid var(--line3); border-radius: 12px;
  padding: 10px 14px; color: var(--muted3);
}
.au-search { background: var(--wash); margin-bottom: 10px; }
.ad-search { flex: 1; min-width: 230px; }
.au-search input, .ad-search input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font: inherit; font-size: 14.5px; color: var(--ink);
}

/* ===================================================================== */
/* Audit list                                                             */
/* ===================================================================== */

.au-hero { background: #fff; border-bottom: 1px solid var(--line); }
.au-hero-inner {
  max-width: 90%; margin: 0 auto; padding: 26px 32px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.au-title {
  font-family: "Lexend", sans-serif; font-weight: 800; font-size: 32px;
  line-height: 1.08; letter-spacing: -0.6px; color: var(--ink); margin: 0 0 6px;
}
.au-subtitle { font-size: 15px; color: var(--muted3); }
.au-new-btn {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15px; color: #fff;
  background: #C9331D; border: none; border-radius: 13px; padding: 13px 22px;
  box-shadow: 0 6px 18px rgba(201, 51, 29, 0.28);
}
.au-new-btn:hover { background: #B02D19; }

.au-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 24px 32px 56px; }
.au-empty { padding: 56px 24px; text-align: center; font-size: 14.5px; color: var(--muted3); }

/* Track widths measured against their content, not `auto`: `auto` sizes to
   max-content, which lets one long audit name starve every column after it. */
.au-list-head, .au-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 2.2fr) minmax(110px, auto) 128px 90px minmax(110px, 1fr) 100px;
  gap: 15px; align-items: center; padding: 14px 24px;
}
.au-list-head {
  background: var(--wash); border-bottom: 1px solid var(--line);
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted3);
}
.au-list-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-list-row { border-bottom: 1px solid #F4F6FA; }
.au-list-row:last-of-type { border-bottom: none; }

.au-row-name {
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.au-row-sub { font-size: 12.5px; color: var(--muted3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-row-standard { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--body); }
.au-row-progress { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.au-row-none { color: var(--muted); font-weight: 600; }
.au-row-auditor { font-size: 13px; color: var(--muted3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-row-actions { text-align: right; }

/* `justify-self: start` because an inline-flex pill blockifies to flex as a grid
   item and would otherwise stretch across its whole track. */
.au-status {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.au-status .au-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.au-status.blue  { color: var(--part-ink); background: var(--part-tint); border: 1px solid var(--part-bd); }
.au-status.blue .au-dot  { background: var(--part-dot); }
.au-status.green { color: var(--pass-ink); background: var(--pass-tint); border: 1px solid var(--pass-bd); }
.au-status.green .au-dot { background: var(--pass-dot); }
.au-status.muted { color: var(--na-ink); background: var(--na-tint); border: 1px solid var(--na-bd); }
.au-status.muted .au-dot { background: var(--na-dot); }

.au-open, .ad-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--line3); border-radius: 10px; padding: 8px 15px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13px; color: #3B4757; white-space: nowrap;
}
.au-open:hover, .ad-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ===================================================================== */
/* New-audit dialog                                                       */
/* ===================================================================== */

.au-modal-backdrop {
  position: fixed; inset: 0; z-index: 78; background: rgba(14, 24, 38, 0.6);
  backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 24px;
}
.au-modal-backdrop[hidden] { display: none; }
.au-modal {
  width: 640px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 22px; box-shadow: 0 40px 100px rgba(8, 16, 28, 0.44);
  padding: 28px 30px; animation: auPop .24s ease both;
}
.au-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.au-modal-head h2 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 23px; color: var(--ink); margin: 0; }
.au-modal-close {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px;
  background: #F4F6FA; border: 1px solid #E4E8EF; color: var(--muted2);
  display: flex; align-items: center; justify-content: center;
}
.au-modal-lede { font-size: 14.5px; color: var(--muted3); margin: 6px 0 22px; line-height: 1.55; }

.au-modes { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.au-mode {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 14px 16px;
  border-radius: 13px; background: #fff; border: 1.6px solid #E9ECF2; text-align: left;
}
.au-mode.on { background: #F5F8FE; border-color: #B9CEF0; }
.au-radio {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 1.6px solid #CBD4E0;
  display: flex; align-items: center; justify-content: center;
}
.au-mode.on .au-radio { background: #2F6FE0; border-color: #2F6FE0; }
.au-mode.on .au-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.au-mode-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.au-mode-label { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.au-mode-note { font-size: 12.5px; color: var(--muted3); line-height: 1.5; }

.au-pick-label {
  display: block; font-family: "Lexend", sans-serif; font-weight: 700;
  font-size: 12.5px; color: var(--muted2); margin-bottom: 8px;
}
.au-pick-list { border: 1px solid var(--line2); border-radius: 12px; max-height: 230px; overflow-y: auto; }
.au-pick {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 14px;
  border: none; border-bottom: 1px solid #F4F6FA; background: #fff; text-align: left;
}
.au-pick:last-child { border-bottom: none; }
.au-pick.on { background: #F5F8FE; }
.au-mark {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px;
  background: #fff; border: 1.5px solid #CBD4E0;
  display: flex; align-items: center; justify-content: center;
}
.au-mark.round { border-radius: 50%; }
.au-mark svg { opacity: 0; }
.au-pick.on .au-mark { background: #2F6FE0; border-color: #2F6FE0; }
.au-pick.on .au-mark svg { opacity: 1; }
.au-pick-title { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-pick-path { font-size: 12px; color: var(--muted3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-pick-empty { padding: 26px 18px; text-align: center; font-size: 13.5px; color: var(--muted3); }
.au-pick-empty.boxed { border: 1px dashed #DCE4F0; border-radius: 12px; background: var(--wash); }
.au-pick-note { font-size: 12px; color: var(--muted3); margin-top: 8px; }

.au-modal-error {
  margin-top: 14px; padding: 11px 14px; border-radius: 11px;
  background: var(--fail-tint); border: 1px solid var(--fail-bd); color: var(--fail-ink); font-size: 13.5px;
}
.au-modal-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line2);
}
.au-start {
  background: #C9331D; color: #fff; border: none; border-radius: 12px; padding: 13px 22px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15px;
}
.au-start:hover:not(:disabled) { background: #B02D19; }
.au-start:disabled { background: #EDF0F5; color: var(--muted2); border: 1px solid #DCE1E9; cursor: default; }
.au-cancel {
  background: #fff; border: 1px solid #DCE1E9; border-radius: 12px; padding: 12px 20px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14px; color: var(--muted2);
}
.au-modal-hint { font-size: 12.5px; color: var(--muted3); }

/* ===================================================================== */
/* Audit workspace — header                                               */
/* ===================================================================== */

.ad-head { background: #fff; border-bottom: 1px solid var(--line); animation: auFadeUp .3s ease both; }
.ad-head-inner { max-width: 90%; margin: 0 auto; padding: 20px 32px 0; }

.ad-back-link {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none; padding: 0 0 14px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--muted3);
}
.ad-back-link:hover { color: var(--ink); }

.ad-head-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; padding-bottom: 18px;
}
.ad-head-copy { min-width: 0; }
.ad-title {
  font-family: "Lexend", sans-serif; font-weight: 800; font-size: 27px;
  line-height: 1.1; letter-spacing: -0.5px; color: var(--ink); margin: 0 0 6px;
}
.ad-title.sm { font-size: 26px; }
.ad-meta {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted3);
}
.ad-meta strong { font-family: "Lexend", sans-serif; font-weight: 700; color: var(--ink); }
.ad-sep { width: 3px; height: 3px; border-radius: 50%; background: #C2CBD8; flex: 0 0 auto; }

.ad-stats { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ad-stat { display: flex; flex-direction: column; gap: 3px; }
.ad-stat-value { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 19px; color: var(--ink); line-height: 1; }
.ad-stat-value.bad { color: var(--fail-ink); }
.ad-stat-label { font-size: 11.5px; color: var(--muted3); white-space: nowrap; }

.ad-head-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ad-tabs { display: flex; gap: 30px; flex-wrap: wrap; }
.ad-tab {
  display: flex; align-items: center; gap: 9px; background: none; border: none;
  padding: 15px 2px; border-bottom: 3px solid transparent;
  font-family: "Lexend", sans-serif; font-size: 15.5px; font-weight: 600; color: var(--muted3);
}
.ad-tab.on { font-weight: 700; color: var(--ink); border-bottom-color: var(--red); }
.ad-tab-count {
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px;
  color: var(--muted3); background: var(--na-tint); border: 1px solid var(--na-bd);
  border-radius: 999px; padding: 2px 8px;
}
.ad-tab.on .ad-tab-count { color: var(--fail-ink); background: var(--fail-tint); border-color: var(--fail-bd); }

.ad-complete {
  margin-bottom: 10px; background: var(--ink); color: #fff; border: none; border-radius: 12px;
  padding: 11px 20px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13.5px;
}
.ad-complete:hover { background: #0F1D31; }
.ad-complete.done { background: #fff; color: var(--muted2); border: 1.5px solid var(--line3); }
.ad-complete.done:hover { border-color: var(--ink); color: var(--ink); }

.ad-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 24px 32px 56px; }
.ad-notice { padding: 48px 24px; text-align: center; font-size: 14.5px; color: var(--muted3); }
.ad-notice p { margin: 0 0 14px; }
.ad-error {
  max-width: 90%; margin: 16px auto 0; padding: 12px 16px; border-radius: 12px;
  background: var(--fail-tint); border: 1px solid var(--fail-bd); color: var(--fail-ink); font-size: 13.5px;
}

/* ===================================================================== */
/* Criteria view                                                          */
/* ===================================================================== */

.ad-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ad-filters.compact { margin: 2px 0 10px; }
.ad-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ad-chip-sep { width: 1px; height: 22px; background: #E2E6ED; }
.ad-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--line3); border-radius: 999px; padding: 9px 14px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13px; color: var(--muted2);
}
.ad-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ad-chip-count { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11px; color: var(--muted3); }
.ad-chip.on .ad-chip-count { color: rgba(255, 255, 255, 0.78); }

.ad-count-line { font-size: 13px; color: var(--muted3); padding-left: 2px; margin-bottom: 12px; }
.ad-filters.compact .ad-count-line { margin: 0 0 0 auto; }

.ad-vdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--todo-dot); }
.ad-vdot.pass { background: var(--pass-dot); }
.ad-vdot.fail { background: var(--fail-dot); }
.ad-vdot.na   { background: var(--na-dot); }
.ad-vdot.cant { background: var(--cant-dot); }
.ad-vdot.part { background: var(--part-dot); }
.ad-vdot.todo, .ad-vdot.unset { background: var(--todo-dot); }

.ad-empty { padding: 52px 24px; text-align: center; }
.ad-empty-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.ad-empty p { font-size: 14px; color: var(--muted3); max-width: 420px; margin: 0 auto 18px; line-height: 1.6; }

.ad-crit { margin-bottom: 12px; overflow: hidden; animation: auFadeUp .3s ease both; }
.ad-crit-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: none; border: none; padding: 17px 20px; text-align: left;
}
.ad-crit-head:hover { background: #FCFDFE; }
.ad-crit-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ad-crit-name { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15.5px; color: var(--ink); }
.ad-crit-sub { font-size: 12.5px; color: var(--muted3); }

.ad-num {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 5px 10px;
  font-family: "Lexend", sans-serif; font-weight: 800; font-size: 12.5px; letter-spacing: 0.02em;
}
.ad-num.lg { padding: 6px 12px; font-size: 14px; }

.ad-level {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  background: var(--na-tint); border: 1px solid var(--na-bd); color: var(--na-ink);
  border-radius: 999px; padding: 4px 11px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11px; white-space: nowrap;
}

.ad-verdict {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px;
}
.ad-verdict.pass { color: var(--pass-ink); background: var(--pass-tint); border: 1px solid var(--pass-bd); }
.ad-verdict.fail { color: var(--fail-ink); background: var(--fail-tint); border: 1px solid var(--fail-bd); }
.ad-verdict.na   { color: var(--na-ink);   background: var(--na-tint);   border: 1px solid var(--na-bd); }
.ad-verdict.cant { color: var(--cant-ink); background: var(--cant-tint); border: 1px solid var(--cant-bd); }
.ad-verdict.part { color: var(--part-ink); background: var(--part-tint); border: 1px solid var(--part-bd); }
.ad-verdict.todo { color: var(--todo-ink); background: var(--todo-tint); border: 1px solid var(--todo-bd); }

.ad-chevron {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: #F4F6FA;
  display: flex; align-items: center; justify-content: center; color: var(--muted2);
  transition: transform .2s ease;
}
.ad-crit-head[aria-expanded="true"] .ad-chevron { transform: rotate(180deg); }

.ad-crit-body { border-top: 1px solid var(--line2); }
.ad-crit-desc { font-size: 14px; color: var(--body); line-height: 1.7; margin: 0; padding: 18px 20px 14px; }

/* Grid tracks MEASURED IN THE BROWSER against their widest content, never `auto`.
   `auto` sizes to max-content, which lets the Set and Test cells claim more than
   the row has and wraps the last cell underneath.

   Measured in Lexend (NOT the design's Poppins — the metrics differ, and taking
   the design's numbers on trust squashed the Set buttons by 23px):
     Page      minmax(140px,2fr) — the only track that should absorb slack
     Result    130px — "Not applicable" pill measures 125px
     Findings   80px — "12 findings" measures 72px
     Set       208px — the four buttons plus their 3x6px gaps measure 201px
     Test      136px — "Test" plus a findings badge and a failures badge measures 129px
   Total 694px + 4x12px gaps = 742px.

   If those buttons or their labels change, RE-MEASURE these tracks. */
.ad-pgrid {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) 130px 80px 208px 136px;
  gap: 12px; align-items: center;
}
.ad-pgrid-head {
  padding: 11px 20px; background: var(--wash);
  border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted3);
}
.ad-pgrid-row { padding: 12px 20px; border-bottom: 1px solid #F4F6FA; }
.ad-pgrid-row:last-child { border-bottom: none; }

.ad-page-title {
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad-page-path { font-size: 12px; color: var(--muted3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ad-result {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11.5px;
  color: var(--todo-ink); background: var(--todo-tint); border: 1px solid var(--todo-bd);
}
.ad-result.pass { color: var(--pass-ink); background: var(--pass-tint); border-color: var(--pass-bd); }
.ad-result.fail { color: var(--fail-ink); background: var(--fail-tint); border-color: var(--fail-bd); }
.ad-result.na   { color: var(--na-ink);   background: var(--na-tint);   border-color: var(--na-bd); }
.ad-result.cant { color: var(--cant-ink); background: var(--cant-tint); border-color: var(--cant-bd); }

/* Red for findings, amber for automated failures: one is a recorded human
   judgement, the other is machine evidence still to be dealt with. A single
   number could not say which. */
.ad-find-cell { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13px; color: var(--muted3); white-space: nowrap; }
.ad-find-cell.has { font-weight: 700; color: var(--fail-ink); }

.ad-set { display: flex; gap: 6px; flex-wrap: nowrap; }
.ad-opt {
  flex: 0 0 auto; min-width: 34px; padding: 6px 9px; border-radius: 8px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12px;
  background: #fff; color: var(--muted3); border: 1.5px solid var(--line3);
}
.ad-opt:hover { border-color: var(--muted2); }
.ad-opt.check { border-color: #E9DCC0; }
.ad-opt.on { color: #fff; }
.ad-opt.pass.on { background: var(--pass-ink); border-color: var(--pass-ink); }
.ad-opt.fail.on { background: var(--fail-ink); border-color: var(--fail-ink); }
.ad-opt.na.on   { background: var(--na-ink);   border-color: var(--na-ink); }
.ad-opt.cant.on { background: var(--cant-ink); border-color: var(--cant-ink); }

.ad-test-cell { text-align: right; }
.ad-test {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--line3); border-radius: 9px; padding: 7px 13px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 12.5px; color: #3B4757; white-space: nowrap;
}
.ad-test:hover { border-color: var(--ink); color: var(--ink); }

.ad-badge {
  flex: 0 0 auto; border-radius: 999px; padding: 1px 7px;
  font-family: "Lexend", sans-serif; font-weight: 800; font-size: 10.5px;
}
.ad-badge.red   { background: var(--fail-tint); border: 1px solid var(--fail-bd); color: var(--fail-ink); }
.ad-badge.amber { background: var(--cant-tint); border: 1px solid var(--cant-bd); color: var(--cant-ink); }

/* ===================================================================== */
/* Pages view                                                             */
/* ===================================================================== */

.ad-pages { display: grid; grid-template-columns: minmax(240px, 0.85fr) minmax(420px, 2.4fr); gap: 18px; align-items: start; }
@media (max-width: 1080px) { .ad-pages { grid-template-columns: 1fr; } }

.ad-page-list { overflow: hidden; }
.ad-page-list-head { padding: 15px 18px; border-bottom: 1px solid var(--line2); }
.ad-page-list-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.ad-page-list-sub { font-size: 12.5px; color: var(--muted3); margin-top: 2px; }
.ad-page-row {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px 18px;
  border: none; border-bottom: 1px solid #F4F6FA; border-left: 3px solid transparent; background: #fff;
}
.ad-page-row:last-child { border-bottom: none; }
.ad-page-row.on { background: var(--wash); border-left-color: var(--red); }
.ad-page-row .ad-cell-stack { flex: 1; }

.ad-page-work { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ad-page-bar { padding: 18px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ad-page-bar .ad-cell-stack { flex: 1; gap: 3px; }
.ad-page-bar-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); }
.ad-page-bar-sub { font-size: 13px; color: var(--muted3); }
.ad-open-page {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--ink); border-radius: 11px; padding: 10px 17px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13.5px; color: #fff;
}
.ad-open-page:hover { background: #0F1D31; color: #fff; }

.ad-crow {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-radius: 13px; box-shadow: 0 2px 8px rgba(18, 38, 63, 0.035); flex-wrap: wrap;
}
.ad-crow.failing { border-color: var(--fail-bd); }
/* The Test button grows when it carries a badge, and in a flex row that shunts the
   Set buttons and the level pill sideways row by row. Pinning it to the same 136px
   the criterion table measured keeps the controls in a straight column. */
.ad-crow .ad-test { min-width: 136px; justify-content: center; }
.ad-crow-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-crow-name { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink); }
.ad-crow-note { font-size: 12px; color: var(--cant-ink); }

/* ===================================================================== */
/* Test view                                                              */
/* ===================================================================== */

.ad-test-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.ad-test-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.ad-nav {
  width: 42px; height: 42px; border-radius: 12px; background: #fff;
  border: 1.5px solid #E4E8EF; color: #3B4757;
  display: flex; align-items: center; justify-content: center;
}
.ad-nav:disabled { color: #C3CBD6; cursor: default; }

.ad-test-main { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 0.95fr); gap: 20px; align-items: start; }
@media (max-width: 1080px) { .ad-test-main { grid-template-columns: 1fr; } }
.ad-test-left { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* Sticky, because the right column is what the left column exists to inform —
   scrolling the guidance should not lose the control. */
.ad-test-right { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1080px) { .ad-test-right { position: static; } }

.ad-panel { padding: 22px 24px; }
.ad-panel.tight { padding: 20px; }
.ad-panel h2 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); margin: 0 0 4px; }
.ad-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.ad-panel-head h2 { margin: 0; }
.ad-panel-note { font-size: 13px; color: var(--muted3); }
.ad-rule { height: 2px; background: var(--red); margin-bottom: 14px; }
.ad-panel.tight .ad-rule { display: none; }
.ad-prose { font-size: 14.5px; color: var(--body); line-height: 1.7; margin: 0; }

.ad-kicker {
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted3);
}
.ad-steps { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 11px; }
.ad-steps li { font-size: 14px; color: var(--body); line-height: 1.65; }
.ad-failwhen { background: var(--wash); border: 1px solid var(--line2); border-radius: 12px; padding: 15px 17px; }
.ad-failwhen .ad-kicker { display: block; margin-bottom: 8px; }
.ad-failwhen p { font-size: 13.5px; color: var(--body); line-height: 1.65; margin: 0; }
.ad-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.ad-tool {
  display: inline-flex; align-items: center; background: var(--na-tint); border: 1px solid var(--na-bd);
  border-radius: 999px; padding: 4px 11px;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 12px; color: var(--body);
}

.ad-auto-fail {
  display: flex; align-items: flex-start; gap: 11px; margin-bottom: 14px;
  background: var(--fail-tint); border: 1px solid var(--fail-bd); border-radius: 12px; padding: 14px 16px;
  font-size: 13.5px; color: var(--body); line-height: 1.6;
}
.ad-auto-fail strong { color: var(--fail-ink); }
.ad-inline-note {
  display: block; background: var(--wash); border: 1px solid var(--line2); border-radius: 12px;
  padding: 16px 18px; font-size: 13.5px; color: var(--muted3); line-height: 1.6;
}
.ad-inline-note.dashed { border-style: dashed; border-color: #DCE4F0; }

.ad-checks { display: flex; flex-direction: column; gap: 12px; }
.ad-check { background: #FDF9F0; border: 1px solid var(--cant-bd); border-radius: 13px; padding: 16px 18px; }
.ad-check-top { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-bottom: 11px; }
.ad-check-code {
  display: inline-flex; align-items: center; background: #F6EAD2; border: 1px solid #E9D5AE; color: #8A5A0B;
  border-radius: 7px; padding: 3px 9px; font-family: "Lexend", sans-serif; font-weight: 800; font-size: 12px;
}
.ad-check-pages { margin-left: auto; font-size: 12.5px; color: var(--cant-ink); }
.ad-check-what { font-size: 14px; color: var(--body); line-height: 1.65; margin: 0 0 10px; }
.ad-check-fix { font-size: 14px; color: var(--cant-ink); line-height: 1.65; margin: 0 0 12px; }
.ad-check-sel {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--muted3); overflow-x: auto; white-space: pre;
}
.ad-check-verify {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--cant-bd);
}
.ad-check-verify .ad-kicker { color: #8A5A0B; font-size: 10.5px; }

.ad-verdict-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ad-verdict-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border-radius: 12px; background: #fff; border: 1.5px solid var(--line2); text-align: left;
}
.ad-verdict-opt.pass.on { background: var(--pass-tint); border-color: var(--pass-bd); }
.ad-verdict-opt.fail.on { background: var(--fail-tint); border-color: var(--fail-bd); }
.ad-verdict-opt.na.on   { background: var(--na-tint);   border-color: var(--na-bd); }
.ad-verdict-opt.cant.on { background: var(--cant-tint); border-color: var(--cant-bd); }
.ad-mark {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  background: #fff; border: 1.5px solid #CBD4E0;
  display: flex; align-items: center; justify-content: center;
}
.ad-mark svg { opacity: 0; }
.ad-verdict-opt.on .ad-mark svg { opacity: 1; }
.ad-verdict-opt.pass.on .ad-mark { background: var(--pass-ink); border-color: var(--pass-ink); }
.ad-verdict-opt.fail.on .ad-mark { background: var(--fail-ink); border-color: var(--fail-ink); }
.ad-verdict-opt.na.on   .ad-mark { background: var(--na-ink);   border-color: var(--na-ink); }
.ad-verdict-opt.cant.on .ad-mark { background: var(--cant-ink); border-color: var(--cant-ink); }
.ad-verdict-opt .ad-cell-stack { flex: 1; }
.ad-verdict-label { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); }
.ad-verdict-note { font-size: 12px; color: var(--muted3); line-height: 1.45; }

.ad-finding {
  display: flex; align-items: flex-start; gap: 10px;
  background: #FBFCFE; border: 1px solid var(--line2); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 9px;
}
.ad-finding .ad-cell-stack { flex: 1; gap: 4px; }
.ad-from-check {
  align-self: flex-start; display: inline-flex; align-items: center;
  background: #F6EAD2; border: 1px solid #E9D5AE; color: #8A5A0B; border-radius: 6px; padding: 2px 7px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 10px; letter-spacing: 0.04em;
}
.ad-finding-where { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13px; color: var(--ink); word-break: break-word; }
.ad-finding-what { font-size: 12.5px; color: var(--body); line-height: 1.55; }
.ad-finding-x {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line3); color: var(--muted3);
  display: flex; align-items: center; justify-content: center;
}
.ad-finding-x:hover { border-color: var(--fail-ink); color: var(--fail-ink); }

.ad-find-note { font-size: 13px; color: var(--muted3); line-height: 1.6; margin: 12px 0; }
.ad-input {
  width: 100%; background: #fff; border: 1.5px solid var(--line3); border-radius: 10px;
  padding: 10px 12px; font-family: "Mulish", sans-serif; font-size: 13.5px; color: var(--ink);
  outline: none; margin-bottom: 8px;
}
.ad-input:focus { border-color: #2F6FE0; box-shadow: 0 0 0 4px rgba(47, 111, 224, 0.12); }
.ad-textarea { min-height: 70px; resize: vertical; line-height: 1.55; margin-bottom: 0; }
.ad-find-actions { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }
.ad-add {
  background: var(--ink); color: #fff; border: none; border-radius: 11px; padding: 11px 18px;
  font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13.5px;
}
.ad-add:disabled { background: #EDF0F5; color: var(--muted2); border: 1px solid #DCE1E9; cursor: default; }
.ad-find-hint { font-size: 12px; color: var(--muted3); }

/* ===================================================================== */
/* Narrow screens                                                         */
/* ===================================================================== */

@media (max-width: 900px) {
  .au-list-head { display: none; }
  .au-list-row { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .au-row-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .ad-pgrid { grid-template-columns: 1fr; gap: 8px; }
  .ad-pgrid-head { display: none; }
  .ad-test-cell { text-align: left; }
}
