/* 7.4 Cybersecurity architecture and design (`ui/pages/clauses/architecture/`).
   C1, the documented design with clause 5 read out and the due diligence
   line; C2, the elements with the threat model line and what 7.3 asks of the
   page at its top. The register, the strip, the band and the document line
   reuse 7.3's classes (`pages_requirements.css`), loaded before this sheet.
   Narrow rules follow the region panel's container (`aucra-region`), never
   the viewport, so the assistant drawer switches them too. */

.aucra-arch-muted {
  font-size: 12.5px;
  color: var(--muted);
}
.aucra-arch-id {
  font-size: 13px;
  color: var(--muted);
}
.aucra-arch-none {
  font-size: 13px;
}
/* A notice: the muted style, never a gap's gold (plan D3, D6, D7). */
.aucra-arch-notices {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aucra-arch-notice {
  font-size: 12px;
  line-height: 1.4;
  font-style: italic;
  color: var(--muted);
}
/* A notice fixed on another page: its words, then a short Open link at
   their end, which wraps under them when the line is full (#159). */
.aucra-notice-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
}
/* A read only box: clause 5's texts, the boundary read from the diagram and
   what an element reads through its requirements. */
.aucra-arch-read {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash-head);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.aucra-arch-read-empty {
  font-size: 13px;
}

/* ---------- C1 (plan D3, D5, D6) ---------- */

/* In line with the lettered blocks' fields: the 18px inset, the 34px letter
   track and its 12px gap. */
.aucra-arch-principles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px 16px 64px;
  border-top: 1px solid var(--line);
}
.aucra-arch-principles-head,
.aucra-arch-line-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
/* A field head inside a line of its own takes its words' width, so the link
   after it stays on the line. */
.aucra-arch-principles-head > .aucra-field-head,
.aucra-arch-asks-head > .aucra-field-head,
.aucra-arch-line-row > .aucra-field-head {
  width: auto;
}
.aucra-arch-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px 14px;
  background: var(--wash-head);
  border-bottom: 1px solid var(--line);
}
.aucra-arch-line-words {
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
/* Beside its link the line takes the width; alone in the column it is one line. */
.aucra-arch-line-row > .aucra-arch-line-words {
  flex: 1 1 320px;
}
.aucra-arch-gaps {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
}
.aucra-arch-gap {
  font-size: 12.5px;
  color: var(--gold-deep);
}
.aucra-arch-third {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.aucra-arch-third-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 13px;
}
.aucra-arch-document {
  margin-top: 0;
}

/* ---------- C2 (plan D4, D7, D14) ---------- */

.aucra-arch-lines > .aucra-arch-line:last-child {
  border-bottom: 1px solid var(--line);
}
.aucra-arch-asks-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.aucra-arch-asks-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  min-height: 30px;
}
.aucra-arch-asks-words {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.aucra-arch-asks-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.aucra-arch-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.aucra-arch-aside-title {
  font-size: 13px;
  font-weight: var(--weight-bold);
}
.aucra-arch-aside-box {
  grid-column: 2 / -1;
}
/* C2's head holds its note, Suggest rows and Add element: the name keeps its
   line and the right hand group wraps under it rather than squeezing it. */
.aucra-region-head.aucra-arch-c2-head:has(.aucra-head-right) {
  flex-wrap: wrap;
}
.aucra-arch-c2-head .aucra-region-name {
  white-space: nowrap;
}
.aucra-arch-c2-head .aucra-head-right {
  flex-shrink: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}
/* The register: Id, Element, Kind, Trust boundary, Requirements. Its rows
   need 604px; the register scrolls in its own box below the widest page's
   least width (`pages_requirements.css`). */
.aucra-arch-register {
  --aucra-reg-min: 604px;
}
.aucra-arch-register.aucra-req-register .aucra-register-head,
.aucra-arch-register.aucra-req-register .aucra-register-line,
.aucra-arch-register.aucra-req-register .aucra-register-under {
  --aucra-cols-narrow: 20px 60px minmax(0, 1fr) 150px 170px 150px;
}
.aucra-arch-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.aucra-arch-cell {
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.aucra-arch-register .aucra-req-cut.aucra-arch-cell {
  font-size: 13.5px;
}
.aucra-arch-under {
  font-size: 12px;
}
.aucra-arch-strip {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
}
.aucra-arch-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.aucra-arch-choice .aucra-chip-set {
  gap: 6px 8px;
}
.aucra-arch-rdps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash-head);
  font-size: 13px;
}
.aucra-arch-rdps-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.aucra-arch-derived {
  font-size: 13px;
}
/* The sign off (D9, D5 of the 7.4 fix pass): the box's 18px edge flush with
   the fields under it and level with the first line, the (i) at the top
   right. The 36px around the box stays the target. */
.aucra-arch-attest .aucra-attest > .aucra-field-head {
  align-items: flex-start;
}
.aucra-arch-attest .aucra-attest .q-checkbox__inner {
  margin: -8px 0 -9px -9px;
}
.aucra-arch-attest .aucra-attest > .aucra-field-head > .aucra-info {
  margin-top: -1px;
}
/* Criterion 1's note, its placement part as a paragraph of its own (D7). */
.aucra-arch-note-more {
  margin-top: 6px;
}

/* ---------- narrow: the region panel's own width ---------- */

@container aucra-region (max-width: 759px) {
  .aucra-arch-register.aucra-req-register .aucra-register-head,
  .aucra-arch-register.aucra-req-register .aucra-register-line,
  .aucra-arch-register.aucra-req-register .aucra-register-under {
    --aucra-cols-narrow: 20px 56px minmax(120px, 1fr) 110px 120px 110px;
  }
}
@container aucra-region (max-width: 559px) {
  .aucra-arch-principles {
    padding-left: 18px;
  }
  .aucra-arch-asks-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  .aucra-arch-asks-acts,
  .aucra-arch-aside-box {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .aucra-arch-pair,
  .aucra-arch-rdps-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Under 640px the rows scroll (`pages_requirements.css`): the strip under a
   row takes the box's one column, so its notices wrap there and are never
   cut. Here, after the 7.4 column rules above, which outrank 7.3's. */
@container aucra-req-register (max-width: 639px) {
  .aucra-arch-register.aucra-req-register .aucra-register-under {
    --aucra-cols-narrow: minmax(0, 1fr);
  }
}

/* A kind or an origin whose label wraps at a phone's width (the RDPS one)
   reads as a left aligned block in a rounded box, not a centred oval. */
.aucra-arch-choice .aucra-chip-toggle {
  text-align: left;
}
@media (max-width: 639px) {
  .aucra-arch-choice .aucra-chip-toggle {
    border-radius: 14px;
  }
}
