/* Addons, Settings and About: the installed Addons and adding one, the Web2 parts, the cache, muted addresses, export and import, and how the site works.
   Colours are the roles of theme.css. Every rule is under a class of these pages (ad-, st-, ab-), so a shared name here never restyles another page. */

.ad-body, .ad-result, .st-cards, .ab-cards { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ad-body p, .ad-result p, .st-cards p, .ab-cards p, .ad-body ul, .ad-result ul, .st-cards ul, .ab-cards ul { margin: 0; }
.ad-about { max-width: 78ch; }
/* About is one column of one measure: the prose and the rows under it share the cards' width, so no card holds a line of two lengths */
.ab-cards { max-width: 56rem; }
.ab-link { white-space: nowrap; }

/* a line of facts: a name and what it holds */
.ad-body .kv, .ad-result .kv, .ab-cards .kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.kv dt { color: var(--dim); font-size: 12px; font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* a field and what is said under it */
.ad-find { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-find .in { flex: 1 1 280px; }
.ad-find .in, .ad-result .in, .st-cards .in { min-width: 0; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.st-cards .in.mono, .ad-find .in.mono, .ad-result .in.mono { font-family: var(--mono); font-size: 12px; }
.ad-find .in:focus, .ad-result .in:focus, .st-cards .in:focus { border-color: var(--acc); }
/* the preferences file's control: the input is hidden but still the control (it keeps focus and the keyboard), and its label is drawn as a button */
.st-pick { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.st-file { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-file:focus-visible + .st-choose { outline: 2px solid var(--acc); outline-offset: 2px; }
.st-choose { cursor: pointer; }
.st-chosen { min-width: 0; overflow-wrap: anywhere; }
.ad-body .note, .ad-result .note, .st-cards .note { padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--head); overflow-wrap: anywhere; }
.ad-body .note.is-bad, .ad-result .note.is-bad, .st-cards .note.is-bad { border-color: var(--cau-b); background: var(--cau-bg); color: var(--cau-t); }
/* a live line with nothing said yet takes no room: it stays in the page so that what it later says is announced */
.ad-body .note:empty, .ad-result .note:empty, .st-cards .note:empty { padding: 0; border: 0; background: none; margin: 0; }

/* the Addons: one row each, what it may do, what it adds */
.ad-items { display: flex; flex-direction: column; }
.ad-item { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.ad-item:first-child { padding-top: 0; }
.ad-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ad-item .st { white-space: normal; }
.ad-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ad-top .cell { flex: 1 1 260px; }
.ad-top .mono, .ad-name { overflow-wrap: anywhere; }
.ad-who { flex-wrap: wrap; }
.ad-who .two { flex: 1 1 140px; }
.ad-mark { display: inline-flex; align-items: center; gap: 6px; }
.ad-adds { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ad-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ad-choice > b { min-width: 120px; }
.ad-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-name-box { flex: 1 1 240px; padding: 6px 10px; border: 1px dashed var(--line2); border-radius: 8px; background: var(--head); overflow-wrap: anywhere; }

/* the Web2 parts, the cache, the muted addresses and the preferences' file */
.st-part { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.st-part:first-child { padding-top: 0; }
.st-part:last-child { border-bottom: 0; padding-bottom: 0; }
.st-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.st-state { font-weight: 600; overflow-wrap: anywhere; }
.st-fine { font-size: 11.5px; }
.st-counter, .st-body, .st-out, .st-preview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-out:empty, .st-preview:empty { display: none; }
.st-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.st-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-row:last-child { border-bottom: 0; }
.st-row .two { flex: 1 1 260px; }
.st-addr { overflow-wrap: anywhere; word-break: break-all; }
.st-refused { padding-left: 18px; margin: 6px 0 0; }

/* About: the labels, what each fact is, the Web2 parts and the contract */
.ab-labels, .ab-rows { display: flex; flex-direction: column; }
.ab-label, .ab-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ab-label:first-child, .ab-row:first-child { padding-top: 0; }
.ab-label:last-child, .ab-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ab-label { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; align-items: start; justify-items: start; }
.ab-label .dim { justify-self: stretch; }
.ab-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) 150px minmax(220px, 2fr); gap: 6px 14px; align-items: start; }
.ab-what { font-weight: 600; overflow-wrap: anywhere; }
.ab-parts { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ab-parts li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ab-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ab-code .st { white-space: normal; }

@media (max-width: 799px) {
  .ab-row, .ab-label { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599px) {
  .ad-body .kv, .ad-result .kv, .ab-cards .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .ad-find .in { flex-basis: 100%; }
  .ad-find .btn { flex: 1 1 100%; min-height: 44px; }
  /* what an Addon may do fits the screen instead of scrolling: a row is what the browser asks, what it does and its risk, then how it stands against the interface; the header stays for a screen reader */
  .ad-may .tb { min-width: 0 !important; }
  .ad-may .tr.h { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ad-may .tr.r { --cols: minmax(0, 1fr) auto auto !important; gap: 2px 12px; padding: 10px 14px; }
  .ad-may .tr.r > * { padding: 0; }
  .ad-may .tr.r > :nth-child(3)::before { content: "Risk "; color: var(--dim); }
  .ad-may .tr.r > :nth-child(4) { grid-column: 1 / -1; color: var(--dim); font-size: 12px; }
  .ad-choice > b { min-width: 0; flex-basis: 100%; }
}

/* what applying a preferences file removes and adds, entry by entry: a list longer than a screen scrolls in its own box */
.st-changes { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-change { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--head); }
.st-diff { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-diff.removed > b { color: var(--bad); }
.st-diff.added > b { color: var(--ok); }
.st-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 14rem; overflow: auto; font-size: 13px; }
.st-lines li { min-width: 0; overflow-wrap: anywhere; }
