/* 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 { 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: 13px; font-weight: 600; 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; }
/* A section's title: a soft band (not black: lighter on screen and on the printer), with a strip under it in the
   colours of the specifications its lines use. */
.mx-sechead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 16px 12px; background: color-mix(in srgb, var(--band, #e5e5ea) 55%, var(--surface, #fff)); color: var(--ink, #15181c); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-sechead h3 { margin: 0; flex: 1; min-width: 0; color: inherit; font-size: 17px; font-weight: 600; }
.mx-secref { font-size: 17px; font-weight: 600; color: var(--muted, #5a626c); font-variant-numeric: tabular-nums; }
.mx-secn { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-strip { flex-basis: 100%; display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; }
.mx-strip i { display: block; height: 100%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-stripkey { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted, #5a626c); }
.mx-stripkey span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.mx-stripkey i { width: 9px; height: 9px; border-radius: 3px; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mx-cols, .mx-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr) minmax(0, 1.1fr); }
.mx-cols { border-top: 1px solid var(--line, #d3d8dd); font-size: 13px; font-weight: 500; color: var(--muted, #5a626c); }
.mx-cols > span { padding: 7px 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; }
/* A link's drawing viewer: the whole page full screen on dark, zoomed to the item's take off, with Download. */
html.mxv-open, html.mxv-open body { overflow: hidden; }
.mxv { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #1c1f23; color: #fff; }
.mxv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(28,31,35,.92); border-bottom: 1px solid rgba(255,255,255,.08); }
.mxv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mxv-title b, .mxv-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mxv-title b { font-size: 15px; font-weight: 600; }
.mxv-title span { font-size: 13px; color: rgba(255,255,255,.65); }
.mxv-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; font-weight: 600; color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.mxv-btn:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.mxv-btn:disabled { opacity: .55; cursor: default; }
.mxv-x { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.mxv-x:hover { background: rgba(255,255,255,.2); }
.mxv-stage { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; padding: 12px; touch-action: pan-x pan-y; cursor: grab; overscroll-behavior: contain; }
.mxv-stage.mxv-grab { cursor: grabbing; }
.mxv-pic { flex: none; margin: auto; display: block; height: auto; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,.4); user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.mxv-wait { margin: auto; font-size: 15px; color: rgba(255,255,255,.7); }
.mxv-zoom { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(40,44,49,.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.mxv-zoom button { white-space: nowrap; font: inherit; font-size: 14px; font-weight: 600; min-width: 38px; height: 34px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: none; color: #fff; cursor: pointer; }
.mxv-zoom button:hover { background: rgba(255,255,255,.14); }
@media (max-width: 560px) { .mxv-btn span { display: none; } .mxv-btn { padding: 8px 10px; } }
@media print { .mxv { display: none !important; } }
@media print {
  .mx-prep { display: none !important; }
  .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; }
}
/* Why it couldn't be shown, in the browser's words. */
.mx-why { display: block; margin-top: 4px; font-size: 11px; color: #a0a6ad; max-width: 32em; overflow-wrap: anywhere; }
