/* ---- risk scheme: the level ramp, the scales, the matrix, the threshold ---- */

/* Six steps, least to most severe. The rank picks the class, never the
   manufacturer, so two schemes of different sizes read the same way. */
.aucra-level-0 {
  --level-wash: var(--pass-wash);
  /* The same green as the PASS chip's ink: one token for one pairing, dark
     enough that both read 4.77:1 on this wash. */
  --level-ink: var(--pass);
}
.aucra-level-1 {
  --level-wash: #eaf3d9;
  /* Darkened from #4d7a1e, which sat at 4.45:1 on this wash and was the one
     pairing Lighthouse still flagged on the register; this reads 5.10:1. */
  --level-ink: #467019;
}
.aucra-level-2 {
  --level-wash: #fdf3d6;
  --level-ink: #7c630f;
}
.aucra-level-3 {
  --level-wash: #fdf1e3;
  --level-ink: #b45309;
}
.aucra-level-4 {
  --level-wash: #fbe4e1;
  --level-ink: #b3261e;
}
.aucra-level-5 {
  --level-wash: #f3d9d9;
  --level-ink: #7f1d1d;
}
.aucra-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--level-ink);
  flex: 0 0 10px;
}

.aucra-scale-row {
  display: grid;
  grid-template-columns: 18px 120px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}
.aucra-scale-index {
  font-size: 0.72rem;
  color: var(--muted);
}
/* On a phone the description drops under the label rather than squeezing both. */
@media (max-width: 700px) {
  .aucra-scale-row {
    grid-template-columns: 18px minmax(0, 1fr) auto;
  }
  .aucra-scale-row > .aucra-field:last-of-type {
    grid-area: 2 / 2 / auto / -1;
  }
}

.aucra-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.aucra-level-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
/* The name field is as wide as the name in it, set in `ch` by kit/fields.py, so
   a row of chips and the Add button after them stay on one line. */
.aucra-level-chip .aucra-field {
  width: auto;
  min-width: 0;
}
/* The chip is the frame, so the name field inside it draws none of its own. */
.aucra-level-chip .aucra-control .q-field__control {
  min-height: 22px;
  height: 22px;
  padding: 0;
}
.aucra-level-chip .aucra-control .q-field__control:before,
.aucra-level-chip .aucra-control .q-field__control:after {
  border: none;
}
.aucra-level-chip .q-field__marginal {
  height: 22px;
}
.aucra-level-chip .q-btn.aucra-icon-btn {
  width: 22px;
  height: 22px;
  /* Quasar's own min-width on a dense round button is 31px, so the chip sets
     both ends of the box. */
  min-width: 22px;
  min-height: 22px;
}

/* A six column matrix is wider than the content column on a phone, so the grid
   scrolls inside its own box rather than pushing the page sideways. */
.aucra-matrix-scroll {
  overflow-x: auto;
}
.aucra-matrix {
  display: grid;
  gap: 6px;
  align-items: center;
  min-width: 420px;
}
.aucra-matrix-head,
.aucra-matrix-side {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}
.aucra-matrix-head {
  text-align: center;
}
.aucra-matrix-cell .q-field__control {
  min-height: 34px;
  height: 34px;
  background: var(--level-wash);
  color: var(--level-ink);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
}
.aucra-matrix-cell .q-field__control:before {
  border: 1px solid var(--line);
  border-radius: 6px;
}
.aucra-matrix-cell .q-field__native {
  color: var(--level-ink);
  font-size: 12.5px;
  font-weight: 500;
}
.aucra-matrix-cell .q-field__marginal {
  height: 34px;
}
.aucra-matrix-cell .q-field__append .q-icon {
  font-size: 16px;
  color: var(--muted);
}

.aucra-threshold {
  gap: 12px;
}
.aucra-threshold-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.aucra-threshold-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
}
.aucra-threshold-chip:hover {
  border-color: var(--line-strong);
}
.aucra-threshold-chip:active {
  border-color: var(--ink);
}
/* The picked chip is already the ink, so its press goes to the softer ink
   rather than back towards the line. */
.aucra-threshold-on:active {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}
/* The opt out reads quieter than the levels until it is the one chosen. */
.aucra-threshold-none:not(.aucra-threshold-on) {
  color: var(--muted);
}
.aucra-threshold-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  font-weight: 500;
}
.aucra-threshold-line {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- clause pages: the shared chrome of 6.2 and 6.3 ---- */

.aucra-block {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 18px 0;
  border-top: 1px solid var(--line);
}
.aucra-block-letter {
  font-size: 0.75rem;
  color: var(--gold-deep);
  padding-top: 3px;
}
.aucra-block-body {
  width: 100%;
  min-width: 0;
  gap: 8px;
  padding-bottom: 14px;
}
.aucra-attest-inset {
  padding: 0 18px 14px 50px;
}
/* From the width the criterion rows keep their note column, the attestation
   sits in the criterion's own text column: 18px gutter, the 250px note column
   and its 14px gap on the right. */
@media (min-width: 900px) {
  .aucra-attest-inset {
    padding: 0 282px 14px 50px;
  }
}
@media (max-width: 700px) {
  .aucra-attest-inset {
    padding: 0 18px 14px;
  }
}
.aucra-result {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}
.aucra-result-pass {
  font-size: 13px;
  color: var(--pass);
}
.aucra-result-tick {
  font-size: 15px;
}
.aucra-gap {
  font-size: 0.78rem;
  color: var(--muted);
}
/* A link to a region head on the same page: it reads as the text around it
   until it is hovered or reached by the keyboard. */
.aucra-jump {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.aucra-jump:hover {
  text-decoration: underline;
}
.aucra-jump:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}
.aucra-footnote {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--wash-head);
  color: var(--muted);
}
.aucra-footnote .aucra-para,
.aucra-footnote .aucra-list {
  font-size: 0.8rem;
}
.aucra-clause-tabs .aucra-tabs {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
}
.aucra-clause-tabs .q-tab {
  font-weight: 500;
}
.aucra-clause-tabs .q-tab--active {
  font-weight: 600;
}
/* The label is the kit's own element inside the tab, so the weight is set on it. */
.aucra-clause-tabs .q-tab--active .aucra-tab-label {
  font-weight: 600;
}
.aucra-clause-tabs .aucra-tab-panels {
  padding: 0;
  background: transparent;
}
.aucra-clause-tabs .q-tab-panel {
  padding: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* The two bands of the 6.3 output regions: the risk scheme and the acceptance
   threshold, each a ruled strip inside its panel. */
.aucra-scheme-band,
.aucra-threshold-band {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--wash-band);
}
.aucra-band-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.aucra-band-title {
  font-size: 0.84rem;
  font-weight: 500;
  flex: 1;
}
.aucra-band-note {
  font-size: 0.78rem;
  color: var(--muted);
}
.aucra-scheme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 12px;
  align-items: start;
}
@media (max-width: 700px) {
  .aucra-scheme-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
