/* MatchMyDocs: review desk. Design "Quiet": neutral surfaces, hairline borders, colour only where
   something needs attention. Light and dark follow the Mac's appearance. System fonts only: nothing
   is fetched from the internet. */
:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --head: #fcfcfc;
  --line: #e4e4e7;
  --line-2: #f0f0f2;
  --ink: #09090b;
  --ink-2: #3f3f46;
  --muted: #6b6b75;
  --faint: #b4b4bb;
  --focus: #2563eb;
  --primary: #09090b;
  --on-primary: #ffffff;
  --red: #e5484d;
  --red-ink: #c4302b;
  --red-bg: #fff5f5;
  --red-line: #f6cdcb;
  --amber: #f5a524;
  --amber-ink: #9a4b00;
  --amber-bg: #fffaeb;
  --amber-line: #f3dca8;
  --blue: #3b82f6;
  --blue-ink: #1d5fd1;
  --blue-bg: #f2f7ff;
  --blue-line: #c9dcfb;
  --green: #18794e;
  --green-ink: #18794e;
  --green-bg: #f1faf5;
  --green-line: #c3e6d3;
  --canvas: #f0f0f2;
  --topbar: rgba(255, 255, 255, 0.82);
  --page-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  --raised: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --page-filter: none;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #131315;
    --surface-2: #1c1c1f;
    --head: #161618;
    --line: #27272b;
    --line-2: #1f1f23;
    --ink: #ededef;
    --ink-2: #c7c7cc;
    --muted: #9a9aa3;
    --faint: #4f4f57;
    --focus: #6ea8ff;
    --primary: #ededef;
    --on-primary: #0b0b0c;
    --red: #ff6369;
    --red-ink: #ff8a8f;
    --red-bg: rgba(255, 99, 105, 0.1);
    --red-line: rgba(255, 99, 105, 0.32);
    --amber: #ffb224;
    --amber-ink: #ffc65c;
    --amber-bg: rgba(255, 178, 36, 0.09);
    --amber-line: rgba(255, 178, 36, 0.3);
    --blue: #70b8ff;
    --blue-ink: #9ccbff;
    --blue-bg: rgba(112, 184, 255, 0.1);
    --blue-line: rgba(112, 184, 255, 0.3);
    --green: #3dd68c;
    --green-ink: #4ce39c;
    --green-bg: rgba(61, 214, 140, 0.09);
    --green-line: rgba(61, 214, 140, 0.28);
    --canvas: #08080a;
    --topbar: rgba(11, 11, 12, 0.8);
    --page-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.55);
    --raised: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.5);
    --page-filter: brightness(0.93);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
       -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.022em; }
h2 { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 14.5px; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--focus) 25%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Pinned to its container's corner: left where it is, it can widen a scrolled strip or table past the screen. */
.sr-only { position: absolute !important; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12px; }
[dir="auto"] { unicode-bidi: isolate; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; padding: 6px 10px; border-radius: 8px; background: var(--surface);
        box-shadow: var(--raised); text-decoration: none; }
.skip:focus { left: 8px; }
.icon { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
        stroke-linejoin: round; vertical-align: -0.2em; }
.icon.big { width: 22px; height: 22px; stroke-width: 1.6; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; margin-right: 3px; border: 1px solid var(--line); border-bottom-width: 2px;
      border-radius: 5px; background: var(--surface); font: 500 11px/16px var(--mono); text-align: center; color: var(--ink-2); }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
       border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px;
       font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
       transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease; }
.btn:hover { background: var(--surface-2); }
.btn .icon { width: 14px; height: 14px; }
.btn-primary { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary); opacity: 0.86; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; }
.btn-lg { height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline;
            text-decoration-color: var(--line); text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }
.label { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.opt { margin-left: 4px; color: var(--muted); font-weight: 400; }
.input { display: block; width: 100%; margin: 0 0 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
         background: var(--surface); color: var(--ink); font-size: 13.5px;
         transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea.input { min-height: 12rem; font: 12.5px/1.65 var(--mono); resize: vertical; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.empty { color: var(--muted); }
.alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--amber-line);
         border-radius: 10px; background: var(--amber-bg); font-size: 13px; }
.alert .icon { margin-top: 1px; }
.alert-error { border-color: var(--red-line); background: var(--red-bg); color: var(--red-ink); }
.alert-error p { color: var(--ink); }

/* ---------- top bar */
.top { position: sticky; top: 0; z-index: 10; height: 56px; display: flex; align-items: center; justify-content: space-between;
       gap: 16px; padding: 0 24px; background: var(--topbar); border-bottom: 1px solid var(--line);
       -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none;
         white-space: nowrap; }
.logo { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--primary);
        color: var(--on-primary); }
.logo .icon { width: 13px; height: 13px; stroke-width: 2; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; white-space: nowrap; transition: color 0.15s ease; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- shared pieces */
.pill { display: inline-flex; flex: none; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px;
        font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-error { background: var(--red-bg); color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red-line); }
.pill-warning { background: var(--amber-bg); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.pill-clear { background: var(--green-bg); color: var(--green-ink); box-shadow: inset 0 0 0 1px var(--green-line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 34px 0 12px; }
.section-head .muted { font-size: 13px; }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table thead th { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--head); color: var(--muted);
                  font-size: 11px; font-weight: 500; letter-spacing: 0.055em; text-align: left; text-transform: uppercase;
                  white-space: nowrap; }
.table td, .table tbody th { padding: 10px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table tbody tr:last-child > * { border-bottom: 0; }

/* ---------- home */
.home { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 40px; align-items: start; max-width: 1240px;
        margin: 0 auto; padding: 36px 32px 72px; }
.new { position: sticky; top: 80px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.new h1 { font-size: 20px; }
.lede { margin: 6px 0 20px; color: var(--muted); font-size: 13.5px; }
.drop { position: relative; margin: 4px 0 12px; border: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 12px;
        background: var(--bg); transition: border-color 0.15s ease, background-color 0.15s ease; }
.drop:hover, .drop.is-over { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 6%, var(--surface)); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; text-align: center; cursor: pointer; }
.drop-icon { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 4px; border: 1px solid var(--line);
             border-radius: 10px; background: var(--surface); color: var(--ink-2); }
.drop-title { font-weight: 500; }
.link { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.drop small { color: var(--muted); font-size: 12px; }
.chosen { list-style: none; display: grid; gap: 6px; margin: 0 0 12px; padding: 0; }
.chosen li { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; border: 1px solid var(--line); border-radius: 9px;
             background: var(--surface); font-size: 13px; }
.fname { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ftype, .fsize { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.fsize { font-variant-numeric: tabular-nums; }
.chosen .is-bad { border-color: var(--red-line); background: var(--red-bg); }
.chosen .is-bad .ftype { color: var(--red-ink); }
.remove { padding: 2px 7px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; }
.remove:hover { background: var(--red-bg); color: var(--red-ink); }
.field-error { margin: 0 0 12px; color: var(--red-ink); font-size: 13px; }
.new .btn-primary { width: 100%; }
.how { margin: 20px 0 0; padding: 16px 0 0 18px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; }
.how li { margin: 3px 0; }
.how strong { color: var(--ink-2); font-weight: 500; }
.shipments .section-head { margin-top: 2px; }
.shipments-table tbody tr { cursor: pointer; }
.shipments-table tbody tr > * { transition: background-color 0.12s ease; }
.shipments-table tbody tr:hover > * { background: var(--bg); }
.ship-cell { max-width: 24rem; }
.ship-cell a { color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.ship-cell a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ship-cell .sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.findings { font-size: 13px; white-space: nowrap; }
.findings .sep { color: var(--muted); }
.f-error { color: var(--red-ink); }
.f-warning { color: var(--amber-ink); }
.f-check { color: var(--blue-ink); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.state .icon { width: 13px; height: 13px; }
.state-done { color: var(--green-ink); }
.state-open { color: var(--muted); }
.empty-state { padding: 48px 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-state .icon { margin-bottom: 8px; color: var(--faint); }
.empty-state b { color: var(--ink-2); font-weight: 500; }

/* ---------- job progress */
.job { max-width: 560px; margin: 0 auto; padding: 64px 24px; }
.job-card { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.eyebrow { color: var(--muted); font-size: 12.5px; }
.job h1 { margin-top: 2px; font-size: 20px; overflow-wrap: anywhere; }
.job .lede { margin: 6px 0 22px; }
progress { display: block; width: 100%; height: 4px; margin: 0 0 20px; border: 0; border-radius: 4px; overflow: hidden;
           background: var(--surface-2); color: var(--primary); -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 4px; transition: width 0.4s ease; }
progress::-moz-progress-bar { background: var(--primary); }
.steps { list-style: none; margin: 0 0 16px; padding: 0; }
.step { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.step b { font-weight: 500; }
.step-mark { position: relative; flex: none; width: 16px; height: 16px; border: 1.5px solid var(--line); border-radius: 50%; }
.step.is-active { color: var(--ink); }
.step.is-active .step-mark { border-color: var(--ink); border-right-color: transparent; animation: spin 0.8s linear infinite; }
.step.is-done { color: var(--ink-2); }
.step.is-done .step-mark { border-color: var(--green); background: var(--green); }
.step.is-done .step-mark::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
                                  border: solid var(--surface); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shipment */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 45%); min-height: calc(100vh - 56px); }
.work { width: 100%; max-width: 880px; min-width: 0; padding: 28px 40px 72px; }
.crumbs { display: flex; align-items: baseline; gap: 6px; min-width: 0; margin-bottom: 8px; color: var(--muted); font-size: 12.5px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumb-current { min-width: 0; overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.head-text { min-width: 0; }
.head h1 { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.meta { display: -webkit-box; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 13px; overflow-wrap: anywhere;
        -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.overview { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); margin-top: 22px;
            border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.overview > div { min-width: 0; padding: 16px 18px; border-left: 1px solid var(--line-2); }
.overview > div:first-child { border-left: 0; }
.lead { font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: -0.012em; }
.lead em { font-style: normal; }
.overview-error .lead em { color: var(--red-ink); }
.overview-warning .lead em { color: var(--amber-ink); }
.overview-clear .lead em { color: var(--green-ink); }
.sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.stat .k { display: block; color: var(--muted); font-size: 12px; }
.stat .v { display: block; margin-top: 1px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .v.is-error { color: var(--red-ink); }
.stat .v.is-warning { color: var(--amber-ink); }
.stat .v.is-check { color: var(--blue-ink); }

/* findings */
.issues { list-style: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
          background: var(--surface); }
.issue { position: relative; padding: 18px 20px 18px 22px; border-top: 1px solid var(--line-2); scroll-margin-top: 72px;
         transition: opacity 0.15s ease; }
.issue:first-child { border-top: 0; }
.issue:focus { outline: none; }
.issue::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px;
                 background: var(--ink); opacity: 0; transition: opacity 0.15s ease; }
.issue.is-selected::before { opacity: 1; }
.issue-head { display: flex; align-items: center; gap: 10px; }
.issue-head h3 { display: -webkit-box; flex: 1; min-width: 0; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical;
                 -webkit-line-clamp: 3; }
.sev-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }
.sev-error .sev-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.sev-warning .sev-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.sev-check .sev-dot { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.tags { display: inline-flex; flex: none; align-items: baseline; gap: 8px; font-size: 12px; }
.sev-word { font-weight: 500; }
.sev-error .sev-word { color: var(--red-ink); }
.sev-warning .sev-word { color: var(--amber-ink); }
.sev-check .sev-word { color: var(--blue-ink); }
.rule { color: var(--muted); font: 11.5px var(--mono); }
.issue-body { margin-left: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 136px; max-width: 100%;
        padding: 9px 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left;
        transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.chip:hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.chip-doc { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 500;
            letter-spacing: 0.045em; text-transform: uppercase; }
.chip-doc .icon { width: 12px; height: 12px; stroke-width: 2; }
.chip-agrees .chip-doc .icon { color: var(--green); }
.chip-value { max-width: 22rem; overflow: hidden; color: var(--ink); font: 500 14px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.chip-differs { border-color: var(--red-line); background: var(--red-bg); }
.chip-differs:hover { border-color: var(--red); }
.chip-differs .chip-doc, .chip-differs .chip-value { color: var(--red-ink); }
.chip-differs .chip-value { font-weight: 600; }
.chip-missing { border-style: dashed; cursor: default; }
.chip-missing .chip-doc { color: var(--amber-ink); }
.chip-missing .chip-value { color: var(--muted); font-family: var(--font); font-style: italic; font-weight: 400; }
.chip.is-shown { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.msg { margin-top: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.msg + .msg { margin-top: 4px; }
.tech { margin-top: 2px; color: var(--muted); font: 11.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.calc { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg);
        color: var(--ink-2); font: 12.5px/1.75 var(--mono); overflow-wrap: anywhere; }
.calc .bad { color: var(--red-ink); font-weight: 600; }
.advice { margin-top: 12px; color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.advice b { color: var(--ink); font: 600 13px var(--mono); }
.issue-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-top: 14px; }
.decide { display: inline-flex; gap: 2px; margin: 0; padding: 2px; border: 0; border-radius: 9px; background: var(--surface-2);
          box-shadow: inset 0 0 0 1px var(--line-2); }
.seg { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 7px;
       color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; user-select: none;
       transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg .icon { display: none; width: 13px; height: 13px; stroke-width: 2.2; }
.seg:hover { color: var(--ink); }
.seg:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--raised); }
.seg:has(input:checked) .icon { display: inline-block; }
.seg-yes:has(input:checked) { color: var(--red-ink); }
.seg:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.ev-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--muted);
             font-size: 12.5px; }
.ev-toggle:hover, .ev-toggle[aria-expanded="true"] { color: var(--ink); }
.ev-toggle .icon { width: 14px; height: 14px; }
.evidence { list-style: none; margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); }
.evidence li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 4px 0; overflow-wrap: anywhere; }
.ev-src { padding: 0; border: 0; background: none; color: var(--ink); font-size: 12.5px; font-weight: 500; text-decoration: underline;
          text-decoration-color: var(--faint); text-underline-offset: 3px; }
.ev-src:hover { text-decoration-color: currentColor; }
.ev-src.is-static { text-decoration: none; }
.evidence q { min-width: 0; color: var(--ink-2); font: 12.5px var(--mono); quotes: "\201C" "\201D"; }
.where { color: var(--muted); font-size: 12px; }
.issue.is-dismissed { opacity: 0.55; }
.issue.is-dismissed h3 { text-decoration: line-through; text-decoration-color: var(--muted); text-decoration-thickness: 1.5px; }
.issues-empty { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: var(--green-ink); font-weight: 500; }
.notes { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.notes ul { list-style: none; margin: 0; padding: 0; }
.notes summary { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: var(--muted); font-size: 13px;
                 list-style: none; cursor: pointer; }
.notes summary::-webkit-details-marker { display: none; }
.notes summary b { color: var(--ink-2); font-weight: 500; }
.notes[open] summary { border-bottom: 1px solid var(--line-2); }
.note-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; color: var(--muted); font-size: 13px; }
.note-row + .note-row { border-top: 1px solid var(--line-2); }
.note-row .icon { margin-top: 2px; }
.note-row p { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note-row b { color: var(--ink-2); font-weight: 500; }
.note-row .sep { color: var(--faint); }
.keys { margin-top: 10px; color: var(--muted); font-size: 12px; }

/* fields */
.fields tbody th { color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.val { display: -webkit-box; max-width: 18rem; padding: 0; overflow: hidden; border: 0; background: none; color: var(--ink-2);
       font: 12.5px/1.5 var(--mono); text-align: left; text-decoration: underline dotted var(--faint); text-underline-offset: 3px;
       overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.val:hover { color: var(--ink); }
.val-check { color: var(--blue-ink); }
.val.is-wrong { color: var(--red-ink); font-weight: 600; text-decoration-color: currentColor; }
.na { color: var(--muted); font-size: 12.5px; font-style: italic; }
.status { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.status .dot { margin: 0 7px 1px 0; vertical-align: middle; }
.dot-error { background: var(--red); }
.dot-warning { background: var(--amber); }
.dot-check { background: var(--blue); }
.st-mismatch > * { background: color-mix(in srgb, var(--red-bg) 55%, var(--surface)); }
.st-mismatch .status { color: var(--red-ink); font-weight: 500; }
.st-missing .status { color: var(--amber-ink); font-weight: 500; }
.st-check .status { color: var(--blue-ink); font-weight: 500; }
.fields.only-diff .is-quiet { display: none; }

/* emails, approval, files */
.draft { margin-bottom: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.draft-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.to { color: var(--ink-2); font-weight: 500; }
.hint { color: var(--blue-ink); font-size: 12px; }
.approve { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; margin-top: 34px;
           padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.approve h2 { font-size: 14px; }
.gate { margin-top: 2px; color: var(--muted); font-size: 13px; }
.gate.is-open { color: var(--amber-ink); }
.gate.is-done { color: var(--green-ink); }
.approve-form { display: flex; align-items: center; gap: 8px; }
.approve-form .input { width: 12rem; height: 32px; margin: 0; padding: 0 10px; }
.label-inline { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
#status { grid-column: 1 / -1; color: var(--ink-2); font-size: 12.5px; }
#status:empty { display: none; }
#status.is-error { color: var(--red-ink); }
.files { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.files a { display: inline-flex; align-items: center; gap: 6px; max-width: 22rem; height: 30px; padding: 0 10px; border: 1px solid var(--line);
           border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 12.5px; text-decoration: none;
           transition: border-color 0.15s ease, color 0.15s ease; }
.files a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files a:hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); color: var(--ink); }
.files .icon { width: 14px; height: 14px; color: var(--muted); }

/* ---------- page viewer */
.viewer { position: sticky; top: 56px; height: calc(100vh - 56px); display: flex; flex-direction: column; min-width: 0;
          border-left: 1px solid var(--line); background: var(--canvas); }
.tabs { position: relative; display: flex; flex: none; gap: 22px; height: 46px; padding: 0 24px; overflow-x: auto; border-bottom: 1px solid var(--line);
        background: var(--surface); scrollbar-width: none; }
.tab { display: inline-flex; flex: none; align-items: center; gap: 7px; max-width: 14rem; height: 100%; margin-bottom: -1px; padding: 0;
       border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; white-space: nowrap;
       transition: color 0.15s ease, border-color 0.15s ease; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 500; }
.tab:focus-visible { outline-offset: -2px; }
.tab-label { overflow: hidden; text-overflow: ellipsis; }
.count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red-bg);
         color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red-line); font-size: 10.5px; font-weight: 600; }
.canvas { flex: 1; margin: 0; padding: 28px 40px; overflow: auto; }
.page-sheet { position: relative; max-width: 54rem; margin: 0 auto; border-radius: 3px; background: #fff; box-shadow: var(--page-shadow); }
.page-sheet img { display: block; width: 100%; height: auto; min-height: 4rem; border-radius: 3px; filter: var(--page-filter); }
.marks { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; border: 1.5px solid var(--red); border-radius: 3px; background: color-mix(in srgb, var(--red) 9%, transparent); }
.mark.is-agrees { border-color: var(--green); background: color-mix(in srgb, var(--green) 9%, transparent); }
.mark.is-focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }
.mark.is-agrees.is-focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.mark-label { position: absolute; left: -1.5px; bottom: calc(100% + 5px); max-width: 18rem; overflow: hidden; padding: 2px 7px;
              border-radius: 6px; background: var(--red-ink); color: #fff; font: 600 11px/1.4 var(--mono); text-overflow: ellipsis;
              white-space: nowrap; box-shadow: 0 2px 6px color-mix(in srgb, var(--red) 30%, transparent); }
.mark.is-agrees .mark-label { background: var(--green-ink); }
.mark.flash { animation: flash 0.9s ease-out 1; }
@keyframes flash { from { box-shadow: 0 0 0 12px color-mix(in srgb, var(--red) 28%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
.pager { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 8px;
         border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12.5px; }
.pager .btn { height: 30px; padding: 0 8px; }
#page-no { flex: 1; min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.canvas .empty { margin-top: 3rem; text-align: center; }
@media (prefers-color-scheme: dark) {
  .mark-label { background: var(--red); color: #0b0b0c; }
  .mark.is-agrees .mark-label { background: var(--green); }
}

/* ---------- smaller screens */
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .new { position: static; }
  .desk { grid-template-columns: minmax(0, 1fr); }
  .work { max-width: none; padding: 24px 20px 40px; }
  .viewer { position: static; height: 78vh; border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 640px) {
  .top { padding: 0 14px; }
  .nav { gap: 14px; }
  .hide-sm { display: none; }
  .home { padding: 20px 14px 48px; }
  .new { padding: 18px; }
  .head { flex-direction: column; gap: 10px; }
  .overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview > .ov-lead { grid-column: 1 / -1; border-bottom: 1px solid var(--line-2); }
  .overview > .stat:nth-child(2) { border-left: 0; }
  .issue { padding: 16px 16px 16px 18px; }
  .issue-body { margin-left: 0; }
  .chip { flex: 1 1 40%; min-width: 0; }
  .approve { grid-template-columns: 1fr; }
  .approve-form { flex-wrap: wrap; }
  .approve-form .input { flex: 1 1 100%; width: auto; }
  .canvas { padding: 16px; }
  .keys { display: none; }
  .shipments-table thead { display: none; }
  .shipments-table tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .shipments-table tbody tr:last-child { border-bottom: 0; }
  .shipments-table td { padding: 2px 0; border: 0; }
  .shipments-table td:nth-child(2) { grid-row: 1; grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .chip, .issues, .overview, .mark, .pill, .count { border: 1px solid CanvasText; }
  .seg:has(input:checked) { outline: 2px solid Highlight; }
  .dot, .sev-dot { forced-color-adjust: none; }
}
.head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.print-only { display: none; }
@media print {
  .top, .viewer, .approve, .decide, .issue-foot, .keys, .files, .draft .row, .skip, .delete, #print,
  .sample-banner .btn, .draft textarea, .draft .label, .draft .subject { display: none !important; }
  .desk { display: block; }
  .work { max-width: none; padding: 0; }
  .fields.only-diff .is-quiet { display: table-row; }
  .issue, .overview, .docstates { break-inside: avoid; }
  .print-only { display: block; }
  .draft-print { white-space: pre-wrap; font: 11.5px/1.5 var(--mono); margin: 8px 0 0; }
}

/* ---- website: sign-out in the header, delete a shipment, sign-in form */
form.inline { display: inline-flex; margin: 0; }
.btn-danger { color: var(--red-ink); }
.btn-danger:hover { background: var(--red-bg); color: var(--red-ink); }
.delete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 28px 0 0; }
.page-login .job-card { max-width: 420px; margin: 0 auto; }
.page-login .job-card form { margin-top: 18px; }

/* the website's plan line under the upload form, and the legal links under sign-in */
.usage { margin: 6px 0 18px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--blue-line);
  background: var(--blue-bg); color: var(--blue-ink); font-size: 13.5px; line-height: 1.5; }
.legal-links { max-width: 420px; margin: 18px auto 0; text-align: center; font-size: 13px; color: var(--muted); }
.legal-links a { color: var(--muted); }

/* each document's state under the summary, and the checks that ran */
.docstates { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.docstate { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; line-height: 1.3; }
.docstate .icon { width: 14px; height: 14px; flex: none; }
.docstate b { font-weight: 600; }
.docstate span { color: var(--muted); }
.docstate-error { border-color: var(--red-line); background: var(--red-bg); }
.docstate-error .icon, .docstate-error span { color: var(--red-ink); }
.docstate-warning { border-color: var(--amber-line); background: var(--amber-bg); }
.docstate-warning .icon, .docstate-warning span { color: var(--amber-ink); }
.docstate-clear .icon { color: var(--green); }
.checks-line { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* the website's public sample shipment */
.sample-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
  margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--blue-line); border-radius: 12px; background: var(--blue-bg); }
.sample-banner p { margin: 0; flex: 1 1 360px; font-size: 13.5px; line-height: 1.55; color: var(--blue-ink); }

/* the shipment list's filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.filter { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px; color: var(--muted); text-decoration: none; background: var(--surface); }
.filter:hover { color: var(--ink); }
.filter[aria-current="true"] { color: var(--ink); border-color: var(--ink); }
.filter .n { font-variant-numeric: tabular-nums; color: var(--faint); }
.filter[aria-current="true"] .n { color: var(--muted); }

/* check a shipment again with a corrected document */
.recheck { margin: 18px 0 0; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 12px; }
.recheck h3 { font-size: 14px; margin: 0 0 4px; }
.recheck p { margin: 0; }
.recheck-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.recheck-row select { flex: 1 1 240px; width: auto; height: 36px; }
.recheck-row input[type="file"] { flex: 1 1 220px; height: 36px; padding: 6px 8px; font-size: 13px; }
@media print { .recheck { display: none !important; } }
