/* Signal OSX design system: the parts for holding and checking pictures and other files.
   Approved by the operator as version 0.6 on 16 November 2026 (DEC-SYS-20261116-03), with the AI Asset Store pages
   that first used them (DEC-AAM-20261116-02). Link it fifth, after signal-osx.css, signal-osx-components.css,
   signal-osx-data-and-forms.css and signal-osx-making.css, where the page uses these parts. It adds no value of its
   own: every colour, type size, weight, corner, shadow and space is a --sx- variable; plain numbers are sizes of
   single small parts only, as in the other stylesheets. Rules: ../specs/assets.md. The asset tile, the may-use mark
   and the picker are in signal-osx-making.css (version 0.5) and are not repeated here. */

/* ---------- 0. Small additions to approved parts ---------- */
/* The asset tile (signal-osx-making.css) as a link in a library, not only a button in the picker */
a.sx-asset { text-decoration: none; }
a.sx-asset:hover .sx-asset__name { text-decoration: underline; }
/* A count inside a filter chip */
.sx-chip__count { margin-left: var(--sx-space-1); color: var(--sx-muted); font-variant-numeric: tabular-nums; }
/* On a chosen chip the count takes the chip's own text colour: muted grey on the light fill measured under 4.5:1
   (the standards run of 16 November 2026, axe colour-contrast) */
.sx-chip[aria-pressed="true"] .sx-chip__count { color: inherit; }
.sx-tag:has(> svg) { display: inline-flex; align-items: center; gap: var(--sx-space-1); }

/* ---------- 1. The preview with overlays: what the model found, drawn on the picture ---------- */
.sx-preview { display: flex; flex-direction: column; gap: var(--sx-space-3); min-width: 0; }
.sx-preview__pic { position: relative; display: block; overflow: hidden; border-radius: var(--sx-radius-box); background: var(--sx-well);
  box-shadow: 0 0 0 1px var(--sx-line-box); }
.sx-preview__pic > svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
/* A stored picture (an img) fills the width at its own shape, so boxes placed in per cent of the picture land on it
   (the fresh-eyes review of pull request 141) */
.sx-preview__pic > img { display: block; width: 100%; height: auto; }
/* A box the model drew. Subjects: a thin solid line. Room for words: a dashed line, as a format's safe area.
   Text and other makers' logos: the attention colour, because each is something a person must look at. */
.sx-preview__box { position: absolute; pointer-events: none; outline: 1.5px solid var(--sx-accent); outline-offset: -1px; }
.sx-preview__box--room { outline-style: dashed; }
.sx-preview__box--text { outline-color: var(--sx-attention-mark); }
.sx-preview__label { position: absolute; left: 0; top: 0; padding: 0 var(--sx-space-1); background: var(--sx-raised);
  font-size: var(--sx-size-label); line-height: var(--sx-leading-tight); color: var(--sx-text); white-space: nowrap; }
/* The switches under the picture: each overlay on or off, with how many the model found */
.sx-preview__toggles { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sx-space-2); }
/* Not read yet, or no picture: the frame keeps its shape and says why, never a spinner over nothing */
.sx-preview__wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sx-space-2);
  padding: var(--sx-space-4); text-align: center; font-size: var(--sx-size-ui); color: var(--sx-text-2);
  background: repeating-linear-gradient(135deg, var(--sx-well) 0 10px, var(--sx-panel) 10px 20px); }

/* ---------- 2. A proposed or accepted field: what the model read, and who accepted it ---------- */
/* Proposed and accepted must never look alike (the plan, section 2): proposed is an outline with the model's mark;
   accepted is filled, with a person's name and the date. */
.sx-proposal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sx-space-1) var(--sx-space-3); align-items: start;
  padding: var(--sx-space-3); border-radius: var(--sx-radius-box); }
.sx-proposal--proposed { box-shadow: inset 0 0 0 1px var(--sx-line-field); }
.sx-proposal--accepted { background: var(--sx-raised); box-shadow: 0 0 0 1px var(--sx-line-box); }
.sx-proposal__label { font-size: var(--sx-size-label); font-weight: var(--sx-weight-medium); color: var(--sx-muted); }
.sx-proposal__value { grid-column: 1; font-size: var(--sx-size-ui); color: var(--sx-text); overflow-wrap: anywhere; }
.sx-proposal__who { grid-column: 1; display: inline-flex; align-items: center; gap: var(--sx-space-1); font-size: var(--sx-size-label); color: var(--sx-text-2); }
.sx-proposal--proposed .sx-proposal__who { color: var(--sx-attention-text); }
.sx-proposal__actions { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: var(--sx-space-1); }

/* ---------- 3. Tags to accept or reject ---------- */
.sx-tags { display: flex; flex-wrap: wrap; gap: var(--sx-space-2); margin: 0; padding: 0; list-style: none; }
.sx-tagpick { display: inline-flex; align-items: center; gap: var(--sx-space-1); min-height: var(--sx-chip-height); padding: 0 var(--sx-space-1) 0 var(--sx-space-3);
  border-radius: var(--sx-radius-pill); font-size: var(--sx-size-label); color: var(--sx-text); }
.sx-tagpick--accepted { background: var(--sx-selected); padding-right: var(--sx-space-3); }
.sx-tagpick--proposed { box-shadow: inset 0 0 0 1px var(--sx-line-field); color: var(--sx-text-2); }
.sx-tagpick button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0;
  border-radius: var(--sx-radius-pill); background: transparent; color: var(--sx-muted); cursor: pointer; }
.sx-tagpick button:hover { color: var(--sx-text); background: var(--sx-selected); }
.sx-tagpick svg { width: 14px; height: 14px; }

/* ---------- 4. The upload list: each file, its state, and what to do about a problem ---------- */
.sx-uploads { margin: 0; padding: 0; list-style: none; border-radius: var(--sx-radius-box); background: var(--sx-raised); box-shadow: 0 0 0 1px var(--sx-line-box); }
.sx-upload { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(180px, 240px); gap: var(--sx-space-1) var(--sx-space-3); align-items: center;
  padding: var(--sx-space-3) var(--sx-space-4); border-bottom: 1px solid var(--sx-line-row); font-size: var(--sx-size-ui); }
.sx-upload:last-child { border-bottom: 0; }
.sx-upload > svg { color: var(--sx-muted); }
.sx-upload__name { display: flex; flex-direction: column; min-width: 0; }
.sx-upload__name strong { font-weight: var(--sx-weight-medium); overflow-wrap: anywhere; }
.sx-upload__name span { font-size: var(--sx-size-label); color: var(--sx-muted); }
.sx-upload__state { display: flex; align-items: center; gap: var(--sx-space-2); font-size: var(--sx-size-label); color: var(--sx-text-2); }
.sx-upload__state .sx-progress__bar { flex: 1; }
.sx-upload__note { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sx-space-2) var(--sx-space-3); font-size: var(--sx-size-label); color: var(--sx-text-2); }
.sx-upload--done .sx-upload__state { color: var(--sx-text); }
.sx-upload--attention .sx-upload__state { color: var(--sx-attention-text); }
.sx-upload--failed .sx-upload__state { color: var(--sx-danger); }
.sx-upload--failed > svg { color: var(--sx-danger); }

/* ---------- 5. Facts in two columns: a label and its value, for rights, people and a file ---------- */
.sx-facts { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: var(--sx-space-2) var(--sx-space-5); margin: 0; font-size: var(--sx-size-data); }
.sx-facts dt { padding-top: var(--sx-space-1); font-size: var(--sx-size-label); color: var(--sx-muted); }
.sx-facts dd { margin: 0; color: var(--sx-text); overflow-wrap: anywhere; }
/* Who set a value, and when: under the facts a person is answerable for */
.sx-setby { display: inline-flex; align-items: center; gap: var(--sx-space-1); font-size: var(--sx-size-label); color: var(--sx-text-2); }

@media (max-width: 767px) {
  .sx-upload { grid-template-columns: 20px minmax(0, 1fr); }
  .sx-upload__state { grid-column: 2; }
  .sx-facts { grid-template-columns: minmax(0, 1fr); gap: var(--sx-space-1); }
  .sx-facts dd { padding-bottom: var(--sx-space-2); }
}
