/* ==========================================================================
   23-apprules.css — THE APPLICATION'S RULES SCREEN

   A reading screen, not a working one: nothing here can be pressed except
   the search box. So it is set wider and quieter than the editing screens —
   long measure, plenty of leading, and the file reference held back in the
   margin where it is there if you want it and invisible if you do not.
   ========================================================================== */

.ar-intro {
  font-size: 11px; line-height: 1.6; color: var(--muted);
  margin-bottom: 12px;
}

.ar-tools { margin-bottom: 14px; }

.ar-search {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; font: inherit; font-size: 12px;
  border-radius: 7px;
  border: 1px solid var(--c-border);
  background: var(--navy2); color: inherit;
}
.ar-search:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.ar-count {
  font-size: 10px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 14px;
}

.ar-sec { margin-bottom: 26px; }

.ar-sec-head {
  font-size: 12px; font-weight: 900; letter-spacing: .5px;
  text-transform: uppercase;
  margin: 0 0 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--c-border);
  color: var(--brand);
}

.ar-sec-note {
  font-size: 10.5px; line-height: 1.6; color: var(--muted);
  margin: 0 0 10px;
}

.ar-list { list-style: none; margin: 0; padding: 0; }

/* One rule per row: the words take the room, the file reference sits at the
   end in the margin. They are a grid rather than a float so a long rule and
   a long filename cannot overlap. */
.ar-item {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 55%, transparent);
}
.ar-item:last-child { border-bottom: none; }

.ar-words { font-size: 11.5px; line-height: 1.65; }

.ar-where {
  font-size: 9.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); opacity: .62; text-align: right;
  word-break: break-word;
}
.ar-item:hover .ar-where { opacity: 1; }

.ar-empty {
  font-size: 11px; color: var(--muted);
  padding: 18px 0; text-align: center;
}

/* ---- the permissions table, which is the rules rather than about them --- */

.ar-tablewrap { overflow-x: auto; margin: 4px 0 14px; }

.ar-table { width: 100%; border-collapse: collapse; font-size: 11px; }

.ar-table th {
  font-size: 9.5px; font-weight: 900; letter-spacing: .4px;
  text-transform: uppercase; text-align: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--c-border);
  color: var(--muted);
  white-space: nowrap;
}
.ar-table th.ar-th-rule { text-align: left; width: auto; }

.ar-table td {
  padding: 8px 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 45%, transparent);
  vertical-align: top;
}

/* The group heading inside the table. A row rather than a second table, so
   every column stays in the same place down the whole matrix. */
.ar-table tr.ar-group td {
  font-size: 9.5px; font-weight: 900; letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--brand);
  padding-top: 16px;
  border-bottom: 1px solid var(--c-border);
}

.ar-rule-cell { line-height: 1.5; }
.ar-rule-name { display: block; }
.ar-rule-note {
  display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px;
  line-height: 1.55;
}

.ar-pin {
  display: inline-block; margin-top: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: .3px;
  color: var(--brand);
}

/* The yes and the no. The tick carries the colour; the dash is deliberately
   quiet, because "not allowed" is the ordinary case and should not shout. */
.ar-yn { text-align: center; font-weight: 900; font-size: 13px; width: 92px; }
.ar-yn.is-yes { color: var(--green, #35c08b); }
.ar-yn.is-no  { color: var(--muted); opacity: .45; }

/* ---- a phone ---- */
@media screen and (max-width: 640px) {
  .ar-item { grid-template-columns: 1fr; gap: 3px; }
  .ar-where { text-align: left; opacity: 1; }
  .ar-yn { width: 56px; font-size: 12px; }
}

/* On paper the search box is not a thing, and the file references are. */
@media print {
  .ar-tools { display: none !important; }
  .ar-where { opacity: 1 !important; }
  .ar-sec { break-inside: avoid; }
}
