/* Matchdesk sample sandbox: page-local layout on the desk.css tokens.
   Sections: 1 shell · 2 folders and lanes · 3 case list · 4 case head and actions
   5 the 3 panes · 6 sample documents · 7 ERP checks · 8 rules, export, audit · 9 phone */

/* 1. Shell */
.ms-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dk .ms-honest { margin-top: 22px; }
.dk-sample-banner .ms-date { font: 600 12.5px/1.4 var(--dk-mono); color: #453a11; }
.dk .dk-sample-banner .ms-reset { margin-left: auto; min-height: 40px; padding: 7px 14px; font-size: 14px; }
.ms-app { display: grid; gap: 14px; min-width: 0; }
.dk .ms-app p { max-width: none; }
.dk .ms-buyer { margin: 0; font-size: 14px; color: var(--dk-muted); }
.ms-app button { font-family: var(--dk-sans); }
.ms-app :focus-visible { outline: 3px solid #807021; outline-offset: 2px; border-radius: 6px; }
.ms-code { font: 500 .93em/1.3 var(--dk-mono); letter-spacing: -.01em; white-space: nowrap; }
.ms-sub { display: block; font-size: 12px; line-height: 1.4; color: var(--dk-muted); }
.dk .ms-empty { margin: 0; padding: 18px; background: var(--dk-panel); border: 1px dashed #c3c9bd; border-radius: var(--dk-radius); font-size: 14.5px; color: var(--dk-muted); }

/* 2. Folders (tabs) and lane chips */
.ms-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; border-bottom: 1px solid var(--dk-line); }
.ms-tabs { display: flex; gap: 4px; min-width: 0; }
.ms-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; margin-bottom: -1px; padding: 8px 16px; background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: var(--dk-radius-sm) var(--dk-radius-sm) 0 0; color: var(--dk-muted); font-size: 15px; font-weight: 650; cursor: pointer; }
.ms-tabs button:hover { color: var(--dk-ink); background: var(--dk-surface); }
.ms-tabs button[aria-selected="true"] { background: var(--dk-panel); border-color: var(--dk-line); color: var(--dk-ink); box-shadow: inset 0 3px 0 var(--dk-accent); }
.ms-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e9e9e0; color: var(--dk-ink-2); font: 700 12.5px/1 var(--dk-sans); font-variant-numeric: tabular-nums; }
.ms-tabs button[aria-selected="true"] .ms-count { background: var(--dk-ink); color: #fff; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.ms-chips button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 12px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: 999px; color: var(--dk-ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ms-chips button:hover { background: var(--dk-surface); }
.ms-chips button[aria-pressed="true"] { background: var(--dk-ink); border-color: var(--dk-ink); color: #fff; }
.ms-chips button[aria-pressed="true"] .ms-count { background: #fff; color: var(--dk-ink); }

/* 3. Case list */
.ms-list { margin: 0; }
.ms-list table { table-layout: auto; }
.ms-list tbody tr { cursor: pointer; }
.ms-list tbody tr:hover > * { background: #fbfaf6; }
.ms-list tbody tr.is-selected > * { background: var(--dk-accent-soft); }
.ms-list tbody tr.is-selected > th { box-shadow: inset 3px 0 0 var(--dk-accent); }
.ms-list .dk-data th, .ms-list .dk-data td { vertical-align: middle; padding-block: 8px; }
.ms-open { min-height: 36px; padding: 4px 2px; background: none; border: 0; color: var(--dk-ink); font: 650 14px/1.3 var(--dk-mono); text-decoration: underline; text-decoration-color: #b9bfb2; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.ms-open:hover { text-decoration-color: var(--dk-ink); }
.ms-c-sup { white-space: nowrap; }
.ms-c-reason { color: var(--dk-ink-2); font-size: 14px; }
.dk .ms-status { margin: 0; min-height: 0; font-size: 14.5px; font-weight: 600; color: var(--dk-good); }
.dk .ms-status:not(:empty) { padding: 10px 14px; background: var(--dk-good-soft); border: 1px solid #c5dfcd; border-radius: var(--dk-radius-sm); }

/* 4. Case head and actions */
.ms-case { min-width: 0; padding: 18px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); box-shadow: var(--dk-shadow); scroll-margin-top: 96px; }
.ms-case-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.dk .ms-case-title h3 { font: 700 20px/1.3 var(--dk-mono); letter-spacing: -.02em; }
.dk .ms-case-title h3:focus { outline: none; }
.ms-case-sup { font: 600 16px/1.3 var(--dk-sans); color: var(--dk-muted); letter-spacing: 0; }
.dk .ms-case-reason { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--dk-ink); }
.dk .ms-case-meta { margin: 2px 0 0; font-size: 13.5px; color: var(--dk-muted); }
.ms-actions { display: grid; gap: 12px; margin: 14px 0 0; padding: 14px; background: var(--dk-paper); border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); }
.dk .ms-actions-note { margin: 0; font-size: 14.5px; color: var(--dk-ink-2); }
.ms-btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.dk .ms-btnrow .btn { min-height: 42px; padding: 8px 15px; font-size: 14.5px; }
.ms-sim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; background: var(--dk-accent-soft); border: 1px dashed #d8c779; border-radius: var(--dk-radius-sm); }
.ms-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14.5px; font-weight: 650; color: var(--dk-ink); cursor: pointer; }
.ms-switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 999px; background: #b9bfb2; cursor: pointer; }
.ms-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.ms-switch input:checked { background: var(--dk-good); }
.ms-switch input:checked::after { transform: translateX(18px); }
.ms-sim-hint { font-size: 13px; color: #5c5020; }
.ms-notefield { display: grid; gap: 5px; }
.ms-notefield label { font-size: 13.5px; font-weight: 600; color: var(--dk-ink-2); }
.ms-notefield input { width: 100%; max-width: 560px; min-height: 42px; padding: 8px 12px; background: var(--dk-panel); border: 1px solid #c3c9bd; border-radius: var(--dk-radius-sm); color: var(--dk-ink); font: 15px/1.4 var(--dk-sans); }
.ms-notefield input[aria-invalid="true"] { border-color: var(--dk-bad); box-shadow: 0 0 0 2px var(--dk-bad-soft); }
.dk .ms-error { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--dk-bad); }

/* 5. The 3 panes */
.ms-paneswitch { display: none; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.ms-paneswitch button { flex: 1 1 auto; min-height: 40px; padding: 6px 12px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); color: var(--dk-ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ms-paneswitch button[aria-pressed="true"] { background: var(--dk-ink); border-color: var(--dk-ink); color: #fff; }
.ms-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; margin: 14px 0 0; align-items: start; }
.ms-pane { min-width: 0; background: var(--dk-surface); border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); }
.ms-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--dk-line); font-size: 12.5px; color: var(--dk-muted); }
.dk .ms-pane-head h4 { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.ms-pane-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--dk-ink); color: #fff; font: 700 11.5px/1 var(--dk-sans); }
.ms-pane-body { padding: 10px; }
.ms-stack { display: grid; gap: 10px; }

/* 6. Sample documents (the paper) */
.ms-doc { padding: 14px; background: #fff; border: 1px solid #cfd4c9; border-radius: 4px; box-shadow: 0 1px 0 #e3e6dc, 0 6px 14px rgba(23, 32, 28, .05); font-size: 13px; line-height: 1.45; color: var(--dk-ink); }
.ms-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--dk-ink); }
.ms-doc-head strong { display: block; font-size: 14.5px; }
.ms-doc-kind { font: 700 11px/1.5 var(--dk-mono); letter-spacing: .1em; color: var(--dk-ink-2); white-space: nowrap; }
.ms-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 10px 0 12px; }
.ms-meta-row { min-width: 0; }
.ms-meta dt { font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--dk-muted); }
.ms-meta dd { margin: 0; overflow-wrap: anywhere; }
.ms-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ms-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ms-table th, .ms-table td { padding: 6px 6px; border-bottom: 1px solid #e6e8e0; text-align: left; vertical-align: top; }
.ms-table th:first-child, .ms-table td:first-child { padding-left: 0; }
.ms-table th:last-child, .ms-table td:last-child { padding-right: 0; }
.ms-table thead th { border-bottom: 1px solid var(--dk-ink-2); font-size: 10.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--dk-muted); white-space: nowrap; }
.ms-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms-table tfoot th { font-weight: 500; color: var(--dk-ink-2); text-align: right; }
.ms-table tfoot tr.ms-total > * { border-top: 2px solid var(--dk-ink); border-bottom: 0; font-weight: 700; color: var(--dk-ink); }
.ms-unit { font-size: 11px; color: var(--dk-muted); }
.ms-absent { font-style: italic; }
.dk .ms-doc-foot { margin: 10px 0 0; font-size: 12px; color: var(--dk-muted); }
.ms-doc-missing { display: grid; gap: 10px; justify-items: start; background: #fbfaf6; border-style: dashed; }
.ms-doc-missing strong { font-size: 15px; }
.dk .ms-doc-missing p { margin: 0; font-size: 13.5px; }

/* Difference marks: the same mark in every pane */
.ms-diff { display: inline-block; padding: 0 5px; border-radius: 4px; font-weight: 700; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ms-diff-soft { background: var(--dk-warn-soft); color: #6b4500; box-shadow: inset 0 0 0 1.5px #d9a83a; }
.ms-diff-stop, .ms-diff-wait { background: var(--dk-bad-soft); color: var(--dk-bad); box-shadow: inset 0 0 0 1.5px #d98778; }
.ms-diff.ms-unit, .ms-diff.ms-absent { font-size: 11.5px; color: inherit; }
.dk .ms-legend { margin: 12px 0 0; font-size: 12.5px; color: var(--dk-muted); }
.ms-legend .ms-diff { font-size: 12px; }

/* 7. ERP checks */
.ms-erpwrap { display: grid; gap: 10px; }
.ms-block { min-width: 0; padding: 11px 12px; background: #fff; border: 1px solid var(--dk-line); border-radius: 6px; font-size: 13px; }
.dk .ms-block h5 { margin: 0 0 8px; font: 700 11px/1.5 var(--dk-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--dk-muted); }
.ms-h-sub { margin-left: 4px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--dk-ink-2); }
.ms-allpass { background: var(--dk-good-soft); border-color: #c5dfcd; color: var(--dk-good); }
.dk .ms-allpass strong { color: var(--dk-good); }
.ms-diffs, .ms-axes, .ms-findings, .ms-rules, .ms-audit { list-style: none; margin: 0; padding: 0; }
.ms-diffs { display: grid; gap: 8px; }
.ms-diffcard { padding: 9px 10px; border-radius: 6px; border: 1px solid #ecd9a4; border-left: 4px solid #c98a12; background: #fffaf0; }
.ms-diffcard-stop, .ms-diffcard-wait { border-color: #efc9c1; border-left-color: var(--dk-bad); background: #fff7f5; }
.dk .ms-difflabel { margin: 0 0 7px; font-size: 13.5px; font-weight: 650; color: var(--dk-ink); }
.ms-versus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ms-vs-k { display: block; font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--dk-muted); }
.ms-vs-v { display: inline-block; margin-top: 2px; font: 600 14px/1.4 var(--dk-mono); overflow-wrap: anywhere; }
.ms-erp td:first-child { white-space: nowrap; }
.ms-erp th, .ms-erp td { padding-inline: 4px; }
.ms-erp thead th { letter-spacing: .02em; }
.dk .ms-line { margin: 0; font-size: 13px; }
.ms-axis { border-top: 1px solid #e6e8e0; }
.ms-axis:first-child { border-top: 0; }
.ms-axis details { padding: 0; border: 0; }
.ms-axis summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 0; list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--dk-ink); }
.ms-axis summary::-webkit-details-marker { display: none; }
.ms-axis-name::before { content: "▸"; display: inline-block; width: 14px; color: var(--dk-muted); font-size: 11px; }
.ms-axis details[open] .ms-axis-name::before { content: "▾"; }
.ms-axis .dk-badge { font-size: 11.5px; padding: 2px 8px; }
.ms-findings { display: grid; gap: 4px; padding: 0 0 10px 14px; }
.ms-f { position: relative; padding-left: 16px; font-size: 12.5px; line-height: 1.45; color: var(--dk-ink-2); }
.ms-f::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: #3d8c62; }
.ms-f-soft { color: #6b4500; font-weight: 600; }
.ms-f-soft::before { background: #c98a12; }
.ms-f-stop, .ms-f-wait { color: var(--dk-bad); font-weight: 600; }
.ms-f-stop::before, .ms-f-wait::before { background: var(--dk-bad); }
.ms-f-note { color: var(--dk-muted); }
.ms-f-note::before { background: #c3c9bd; }

/* 8. Supplier rules, audit trail, Finance export */
.ms-lower { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.ms-panel { min-width: 0; padding: 18px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); }
.dk .ms-panel > h3 { margin-bottom: 4px; }
.dk .ms-panel > h4 { margin: 20px 0 8px; font-size: 15px; }
.dk .ms-panel .dk-note { margin-bottom: 12px; }
.dk .ms-panel .dk-table-wrap { margin-bottom: 12px; }
.ms-panel .dk-data { font-size: 13.5px; }
.ms-panel .dk-data th, .ms-panel .dk-data td { padding: 8px 12px; }
.ms-export table { min-width: 760px; }
.ms-export th, .ms-export td, .ms-waiting th, .ms-waiting td { white-space: nowrap; }
.ms-export td:last-child { min-width: 200px; white-space: normal; }
.ms-waiting table { min-width: 520px; }
.dk .ms-none { margin: 0; padding: 12px 14px; background: var(--dk-paper); border: 1px dashed #c3c9bd; border-radius: var(--dk-radius-sm); font-size: 14px; color: var(--dk-muted); }
.ms-rules li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--dk-line); font-size: 14px; }
.ms-rules li:first-child { border-top: 0; }
.ms-rule-text { display: block; color: var(--dk-ink-2); }
.ms-linkbtn { min-height: 40px; padding: 6px 12px; background: var(--dk-panel); border: 1px solid #c3c9bd; border-radius: var(--dk-radius-sm); color: var(--dk-bad); font-size: 13.5px; font-weight: 650; cursor: pointer; }
.ms-linkbtn:hover { background: var(--dk-bad-soft); }
.ms-audit { max-height: 340px; overflow-y: auto; border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); }
.ms-audit:empty { display: none; }
.ms-audit li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 2px 12px; padding: 9px 12px; border-top: 1px solid var(--dk-line); font-size: 13.5px; }
.ms-audit li:first-child { border-top: 0; }
.ms-audit-n { grid-row: span 3; font: 500 12px/1.6 var(--dk-mono); color: var(--dk-muted); }
.ms-audit-lanes { color: var(--dk-ink-2); }
.ms-audit-note { color: var(--dk-muted); overflow-wrap: anywhere; }
.ms-audit-what, .ms-audit-lanes, .ms-audit-note { grid-column: 2; }
.ms-exporthead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.dk .ms-exporthead p { margin: 0; font-size: 14.5px; }
.dk .ms-held { margin: 0 0 12px; font-size: 13.5px; color: var(--dk-muted); }
.dk .ms-panel .btn { min-height: 42px; padding: 8px 15px; font-size: 14.5px; }

/* The comparison table under the tool */
.ms-adds table { min-width: 640px; }

/* 9. Tablet and phone */
@media (max-width: 980px) {
  .ms-paneswitch { display: flex; }
  .ms-panes { grid-template-columns: minmax(0, 1fr); }
  .ms-panes[data-show="invoice"] .ms-pane:not([data-pane="invoice"]),
  .ms-panes[data-show="do"] .ms-pane:not([data-pane="do"]),
  .ms-panes[data-show="erp"] .ms-pane:not([data-pane="erp"]) { display: none; }
  .ms-lower { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dk .dk-sample-banner .ms-reset { margin-left: 0; }
  .ms-top { border-bottom: 0; }
  .ms-tabs { width: 100%; gap: 0; border-bottom: 1px solid var(--dk-line); }
  .ms-tabs button { flex: 1 1 0; flex-direction: column; gap: 3px; min-width: 0; padding: 8px 4px; font-size: 12.5px; line-height: 1.25; text-align: center; }
  .ms-chips { padding-bottom: 0; }
  .ms-list.dk-table-wrap { background: none; border: 0; overflow: visible; }
  .ms-list table, .ms-list tbody { display: block; }
  .ms-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ms-list tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; margin-bottom: 8px; padding: 10px 12px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); }
  .ms-list tbody tr.is-selected { background: var(--dk-accent-soft); border-color: #dcc978; box-shadow: inset 3px 0 0 var(--dk-accent); }
  .ms-list tbody tr > *, .ms-list tbody tr.is-selected > *, .ms-list tbody tr:hover > * { display: block; padding: 0; border: 0; background: none; box-shadow: none; }
  .ms-list .dk-data tbody th, .ms-list .dk-data tbody td { padding: 0; }
  .ms-list .ms-c-lane { grid-column: 2; grid-row: 1; align-self: center; }
  .ms-list .ms-c-sup { grid-column: 1; grid-row: 2; font-size: 13.5px; }
  .ms-list .ms-c-total { grid-column: 2; grid-row: 2; font-size: 13.5px; }
  .ms-list .ms-c-reason { grid-column: 1 / -1; font-size: 13.5px; }
  .ms-open { min-height: 40px; font-size: 15px; }
  .ms-case, .ms-panel { padding: 14px; }
  .ms-case-sup { display: block; }
  .dk .ms-case-title h3 { font-size: 18px; }
  .ms-btnrow .btn { flex: 1 1 100%; }
  .ms-pane-body { padding: 8px; }
  .ms-doc { padding: 12px; }
  .ms-audit li { grid-template-columns: minmax(0, 1fr); }
  .ms-audit-n { grid-row: auto; }
  .ms-audit-what, .ms-audit-lanes, .ms-audit-note { grid-column: 1; }
  .ms-rules li { align-items: flex-start; flex-direction: column; }
  /* The comparison table becomes one card per topic, so no column sits off-screen. */
  .ms-adds.dk-table-wrap { background: none; border: 0; overflow: visible; }
  .ms-adds table { min-width: 0; }
  .ms-adds table, .ms-adds tbody { display: block; }
  .ms-adds thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ms-adds tbody tr { display: block; margin-bottom: 8px; padding: 12px 14px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); }
  .ms-adds tbody tr > *, .ms-adds tbody tr:hover > * { display: block; padding: 0; border: 0; background: none; }
  .ms-adds .dk-data tbody th { margin-bottom: 6px; font-size: 15.5px; }
  .ms-adds .dk-data tbody td { margin-top: 8px; font-size: 14.5px; }
  .ms-adds td::before { content: attr(data-label); display: block; font: 600 11.5px/1.5 var(--dk-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--dk-muted); }
}
@media print {
  .ms-actions, .ms-paneswitch, .ms-chips, .ms-reset { display: none !important; }
  .ms-panes { grid-template-columns: 1fr; }
}
