/* The scope matrix (public/matrix.js), in the app and on the pages links open. It takes the app's colours where it has
   them, and plain ones on a page of its own. */
/* The key stays in view at the top while the sections scroll under it. */
.mx-key { position: sticky; top: 0; z-index: 3; box-shadow: 0 6px 12px -10px rgba(0,0,0,.35); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; padding: 12px 16px; background: var(--surface, #fff); border: 1px solid var(--line, #d3d8dd); border-radius: var(--r, 12px); font-size: 14px; }
.mx-keyhead { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #5a626c); margin-right: 2px; }
.mx-keyitem { display: inline-flex; align-items: center; gap: 6px; }
.mx-keyitem i { width: 16px; height: 16px; border-radius: 4px; flex: none; border: 1px solid rgba(0,0,0,.08); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-keytotal { margin-left: auto; font-variant-numeric: tabular-nums; }
.mx-keyn { color: var(--muted, #5a626c); font-size: 12px; font-variant-numeric: tabular-nums; }
.mx-sec { margin-top: 12px; background: var(--surface, #fff); border: 1px solid var(--line, #d3d8dd); border-radius: var(--r, 12px); overflow: hidden; }
.mx-sechead { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; background: var(--head-bg, #15181c); color: var(--head-fg, #fff); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-sechead h3 { margin: 0; flex: 1; color: inherit; font-size: 18px; }
.mx-secref { font-size: 16px; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.mx-secn { opacity: .8; font-variant-numeric: tabular-nums; font-size: 14px; }
.mx-cols, .mx-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr) minmax(0, 1.1fr); }
.mx-cols { background: var(--band, #eef0f2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5a626c); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-cols > span { padding: 8px 16px; }
.mx-row { border-top: 1px solid var(--line, #d3d8dd); }
.mx-row > * { padding: 14px 16px; min-width: 0; }
.mx-row > * + * { border-left: 1px solid var(--line, #d3d8dd); }
.mx-item { display: flex; gap: 10px; align-items: flex-start; }
.mx-ref { color: var(--muted, #5a626c); font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.2em; }
.mx-desc { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mx-ml { white-space: pre-line; overflow-wrap: anywhere; }
.mx-qty { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-price { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted, #5a626c); }
.mx-price b { color: var(--ink, #15181c); }
.mx-to { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #5a626c); min-width: 0; }
.mx-to i { width: 12px; height: 12px; border-radius: 3px; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-fig { display: flex; flex-direction: column; gap: 6px; }
.mx-draw { display: flex; align-items: center; justify-content: center; height: 220px; padding: 0; border: 1px solid var(--line, #d3d8dd); border-radius: 8px; background: #fff; overflow: hidden; font: inherit; color: #5a626c; }
.mx-draw img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mx-open { cursor: zoom-in; }
.mx-open:hover { border-color: var(--tint, #007aff); }
.mx-wait { font-size: 13px; color: #8a9098; }
.mx-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted, #5a626c); }
.mx-pager { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.mx-pager button { font: inherit; font-size: 16px; line-height: 1; border: 0; background: none; color: var(--tint, #007aff); padding: 4px 8px; cursor: pointer; border-radius: 6px; }
.mx-pager button:disabled { color: var(--muted, #5a626c); opacity: .4; cursor: default; }
.mx-none { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 80px; font-size: 14px; color: var(--muted, #5a626c); }
.mx-spec { padding: 0 !important; display: flex; flex-direction: column; }
.mx-spechead { padding: 10px 16px; color: #15181c; font-weight: 600; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-mats { list-style: none; margin: 0; padding: 6px 0; }
.mx-mats li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 16px; font-size: 14px; }
.mx-mats li + li { border-top: 1px dashed var(--line, #d3d8dd); }
.mx-need { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-muted { color: var(--muted, #5a626c); }
.mx-pad { padding: 12px 16px; font-size: 14px; }
.mx-empty { margin-top: 12px; padding: 24px; text-align: center; color: var(--muted, #5a626c); }
@media (max-width: 760px) {
  .mx-cols { display: none; }
  .mx-row { grid-template-columns: 1fr; }
  .mx-row > * + * { border-left: 0; border-top: 1px solid var(--line, #d3d8dd); }
  .mx-draw { height: 200px; }
}
/* Getting the drawings ready to print: a card over the page with how far it's got. */
.mx-prep { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.35); }
.mx-prepcard { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; padding: 20px; background: var(--surface, #fff); color: var(--ink, #15181c); border-radius: var(--r, 12px); box-shadow: 0 12px 32px rgba(0,0,0,.25); text-align: center; }
.mx-prepn { font-variant-numeric: tabular-nums; color: var(--muted, #5a626c); }
.mx-prepbar { height: 6px; border-radius: 999px; background: var(--track, #e5e7ea); overflow: hidden; }
.mx-prepbar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--tint, #007aff); transition: width .2s; }
.mx-prephint { font-size: 13px; color: var(--muted, #5a626c); }
.mx-prepbtns { display: flex; justify-content: center; gap: 8px; }
.mx-prepgo { font: inherit; font-weight: 600; border: 0; background: var(--tint, #007aff); color: #fff; padding: 8px 20px; border-radius: 999px; cursor: pointer; }
.mx-prepstop { font: inherit; border: 0; background: none; color: var(--tint, #007aff); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
@media print {
  .mx-prep { display: none !important; }
  .mx-key { position: static; box-shadow: none; }
  .mx-noprint { display: none !important; }
  .mx-sec { break-inside: auto; box-shadow: none; }
  .mx-row { break-inside: avoid; }
  .mx-sechead, .mx-cols { break-after: avoid; }
}
