:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1c2330;
  --muted: #6b7482;
  --accent: #173229;
  --accent-dark: #0e221b;
  --accent-soft: #edf5ee;
  --secondary: #6aaf70;
  --secondary-dark: #579a5d;
  --ok: #1f8f4e;    --ok-soft: #e4f5ea;
  --warn: #b9760c;  --warn-soft: #fdf1dc;
  --bad: #c43a31;   --bad-soft: #fbe6e4;
  --none-soft: #eceef1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --topbar-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.45; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 15px; letter-spacing: .01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* topbar */
.topbar { height: var(--topbar-h); display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 32px; background: var(--accent); color: #fff; position: sticky; top: 0; z-index: 5; box-shadow: inset 0 -3px 0 var(--secondary); }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { width: 40px; height: 40px; border-radius: 9px; display: block; object-fit: cover; }
.topbar h1 { font-size: 18px; }
.topbar h1 .muted { font-weight: 400; margin-left: 6px; color: rgba(255,255,255,.75); }
.topbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.topbar .btn:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* buttons */
.btn { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer; transition: all .12s; }
.btn:hover { border-color: #b8c0cb; background: #f7f8fa; }
.btn.big { padding: 11px 18px; font-size: 14.5px; width: 100%; background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.big:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.icon { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; border-radius: 50%; }
.btn:disabled { opacity: .5; cursor: default; }

/* intake */
.intake { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 32px; }
.intake-card { width: min(520px, 100%); }
.card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.dropzone { border: 1.5px dashed #c7cdd6; border-radius: 10px; padding: 40px 18px; text-align: center; cursor: pointer; color: var(--muted); transition: all .15s ease; background: #fafbfc; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.dropzone:hover, .dropzone:focus, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); outline: none; }
.dropzone strong { color: var(--text); font-size: 15.5px; }
.dropzone span { font-size: 13px; }
.dz-icon { margin-bottom: 6px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 16px 0; text-transform: uppercase; letter-spacing: .06em; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* work view */
.work { display: grid; grid-template-columns: minmax(360px, 42%) minmax(0, 1fr); gap: 20px; padding: 20px 24px 40px; max-width: 1800px; margin: 0 auto; align-items: start; }
@media (max-width: 1000px) { .work { grid-template-columns: 1fr; } .preview { position: static !important; height: 60vh !important; } }
.preview { position: sticky; top: calc(var(--topbar-h) + 20px); height: calc(100vh - var(--topbar-h) - 40px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.preview-head { padding: 10px 16px; border-bottom: 1px solid var(--border); border-top: 3px solid var(--accent); font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-body { flex: 1; min-height: 0; background: #eef1ef; display: grid; place-items: center; }
.preview-body iframe, .preview-body img { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; }
.preview-body .noprev { text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.preview-body .noprev .ftype { font-size: 12px; }
.results { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* busy / error */
.steps { list-style: none; margin: 0; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; font-size: 16px; color: #aab1bb; }
.steps li { display: flex; align-items: center; gap: 14px; width: 220px; transition: color .3s; }
.steps li.running { color: var(--text); }
.steps li.done { color: var(--accent); }
.steps .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d7dce3; display: grid; place-items: center; transition: all .3s; }
.steps li.running .mark { border-color: #d7dce3; border-top-color: var(--secondary); animation: spin .9s linear infinite; }
.steps li.done .mark { background: var(--secondary); border-color: var(--secondary); animation: bump .4s cubic-bezier(.3,1.6,.5,1); }
.steps li.done .mark::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.error { border: 1px solid #f1c1bd; background: var(--bad-soft); color: #7d2a24; border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

/* header */
.doc-type { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--none-soft); color: var(--muted); white-space: nowrap; }
.doc-type.order, .doc-type.inquiry { background: var(--accent-soft); color: var(--accent); }
.head-tags { display: flex; gap: 6px; align-items: center; }
.lang { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--none-soft); color: var(--muted); }
.hgroup + .hgroup { margin-top: 18px; }
.hgroup h3 { font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; margin: 0; }
.kv > div { border-top: 1px solid var(--border); padding-top: 8px; min-width: 0; }
.kv dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.kv dd { margin: 0; word-break: break-word; }
.kv > div.wide { grid-column: 1 / -1; }
.kv.addrs { grid-template-columns: 1fr 1fr; margin-top: 12px; }
@media (max-width: 700px) { .kv.addrs { grid-template-columns: 1fr; } }
.kv dd ul { margin: 0; padding-left: 16px; } .kv dd ul li { margin: 1px 0; }
.kv .ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.kv .src { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle; background: var(--none-soft); color: var(--muted); }
.pill.warn { background: #fef3c7; color: #92400e; }
.flags { margin-top: 14px; padding: 10px 14px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; font-size: 13px; }
.flags b { display: block; margin-bottom: 4px; }
.flags ul { margin: 0 0 0 18px; padding: 0; } .flags li { margin: 2px 0; }

/* lines table */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.lines th, table.lines td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.lines th { font-size: 11.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; white-space: nowrap; background: var(--accent-soft); padding: 9px 10px; }
table.lines th.num, table.lines td.num { text-align: right; white-space: nowrap; }
table.lines td.pos { color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }
table.lines td.qty { width: 1%; font-variant-numeric: tabular-nums; }
table.lines td.desc { min-width: 280px; }
table.lines td.desc .raw { font-weight: 500; }
.attrs, .proc { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.attr { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: 6px; background: #f1f3f6; font-size: 12.5px; line-height: 1.5; }
.attr i { font-style: normal; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.attr.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.proc .attr { background: var(--accent-soft); color: var(--accent-dark); }
.proc .attr i { color: var(--accent); }
td.desc .rem { margin-top: 6px; font-size: 12.5px; color: #4b5563; }
.mara { margin-top: 8px; font-size: 12.5px; color: var(--ok); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mara b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.mara span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre; }
.mara.alt { color: var(--warn); }
.qty-alt { display: block; font-size: 11.5px; color: #b45309; margin-top: 2px; white-space: nowrap; }

/* actions (demo only) */
.card.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.btn.sap, .btn.save { position: relative; overflow: hidden; color: #fff; font-weight: 600; transition: transform .15s, background .3s, border-color .3s; }
.btn.sap { background: var(--secondary); border-color: var(--secondary); padding: 12px 28px; font-size: 15px; }
.btn.sap:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); }
.btn.save { background: var(--accent); border-color: var(--accent); padding: 9px 16px; }
.btn.save:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.sap .done, .btn.save .done { display: none; }
.btn.sap.busy, .btn.save.busy { transform: scale(.96); }
.btn.sap.busy::after, .btn.save.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%); animation: sweep .55s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.btn.sap.done, .btn.save.done { background: #14532d; border-color: #14532d; animation: bump .5s cubic-bezier(.3,1.6,.5,1); }
.btn.sap.done .label, .btn.save.done .label { display: none; }
.btn.sap.done .done, .btn.save.done .done { display: inline; }
.btn.sap.done .done::before, .btn.save.done .done::before { content: "✓"; margin-right: 8px; }
@keyframes bump { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.feedback { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 320px; justify-content: flex-end; }
.feedback input { flex: 1; max-width: 360px; min-width: 140px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13.5px; }
.feedback input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thumb { appearance: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.thumb:hover { border-color: #b8c0cb; color: var(--text); }
.thumb.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.thumb.down.on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.thumb.pop { animation: pop .4s cubic-bezier(.3,1.8,.5,1); }
@keyframes pop { 0% { transform: scale(.8); } 50% { transform: scale(1.3) rotate(-8deg); } 100% { transform: scale(1); } }

/* excluded */
.excluded { list-style: none; margin: 0; padding: 0; }
.excluded li { padding: 7px 0; border-bottom: 1px solid #eee; font-size: 13px; display: flex; gap: 12px; }
.excluded li:last-child { border-bottom: 0; }
.excluded .num { color: var(--muted); min-width: 24px; text-align: right; }
.excluded .why { color: var(--muted); margin-left: auto; text-align: right; white-space: nowrap; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; z-index: 20; padding: 24px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 48px); background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); border-top: 4px solid var(--accent); }
.samples { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.samples li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.samples li:hover { background: var(--accent-soft); }
.samples li.muted { cursor: default; }
.samples .ftype { flex: none; width: 40px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 0; border-radius: 5px; background: var(--none-soft); color: var(--muted); text-transform: uppercase; }
.ftype.pdf { background: #fdeceb; color: #b3372f; } .ftype.xls, .ftype.xlsx { background: #e4f5ea; color: #1f7a45; }
.samples .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 30; }
.top-actions { display: flex; gap: 10px; align-items: center; }

/* document preview: pdf.js pages on canvases (app.js) with an overlay for source boxes (anchors.js) */
.preview-body.pages { display: block; overflow-y: auto; overflow-x: hidden; padding: 14px; scrollbar-gutter: stable; position: relative; }
.page { position: relative; width: 100%; margin: 0 0 14px; background: #fff; border-radius: 3px; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.08); }
.page:last-child { margin-bottom: 0; }
.page:not(.ready) { background: linear-gradient(100deg, #fff 30%, #f3f4f7 50%, #fff 70%) 0 0 / 300% 100%; animation: pv-shimmer 1.4s linear infinite; }
.page canvas { display: block; width: 100% !important; height: 100% !important; border-radius: 3px; }
.page .ov { position: absolute; inset: 0; pointer-events: none; }
@keyframes pv-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.pv-loading { height: 100%; display: grid; place-items: center; }
.pv-loading span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #d7dce3; border-top-color: var(--accent); animation: spin .9s linear infinite; }

/* source boxes */
.tbox { position: absolute; border: 2px solid var(--c); background: var(--c-fill); border-radius: 5px;
  box-shadow: 0 0 0 3px var(--c-soft), 0 2px 14px var(--c-glow);
  animation: tbox-in .26s cubic-bezier(.2,.9,.3,1.2) both; transition: opacity .18s, border-width .15s, box-shadow .18s, background .18s; }
.tbox.part { border-width: 1.5px; box-shadow: none; background: color-mix(in srgb, var(--c) 7%, transparent); }
.tbox.faint { border-width: 1.5px; box-shadow: none; background: transparent; opacity: .38; }
.tbox.out { opacity: 0; animation: none; }
@keyframes tbox-in { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: scale(1); } }
.tlabel { position: absolute; left: -2px; bottom: calc(100% + 5px); background: var(--c); color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; line-height: 1; padding: 4px 7px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(16,24,40,.18);
  animation: tlabel-in .3s .08s cubic-bezier(.2,.9,.3,1.2) both; }
.tbox.label-below .tlabel { bottom: auto; top: calc(100% + 5px); }
@keyframes tlabel-in { from { opacity: 0; transform: translateY(4px); } }

/* arrow from the hovered value to its box */
.trace-arrow { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 4; overflow: visible; opacity: 0; transition: opacity .16s; }
.trace-arrow.on { opacity: 1; }
.trace-arrow .ta-line { fill: none; stroke: var(--c); stroke-width: 1.75; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 1px 2px rgba(16,24,40,.18)); }
.trace-arrow .ta-head, .trace-arrow .ta-dot { fill: var(--c); }
.trace-arrow .ta-dot { stroke: #fff; stroke-width: 1.5; }
.trace-arrow.draw .ta-line { animation: ta-draw .42s cubic-bezier(.4,0,.2,1) both; }
.trace-arrow.draw .ta-head { animation: ta-fade .2s .3s both; }
@keyframes ta-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ta-fade { from { opacity: 0; } }

/* the hovered value, tinted in its field colour */
.traced [data-anchor] { transition: background-color .15s, box-shadow .15s; }
.kv > div[data-anchor] { border-radius: 2px; }
.kv > div.anchor-on { background: color-mix(in srgb, var(--hl) 8%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--hl) 8%, transparent); border-top-color: var(--hl); }
.kv > div.anchor-on dt { color: var(--hl); }
.kv dd li[data-anchor] { border-radius: 4px; }
.kv dd li.anchor-on, .excluded li.anchor-on { background: color-mix(in srgb, var(--hl) 10%, transparent); box-shadow: -4px 0 0 color-mix(in srgb, var(--hl) 10%, transparent), 4px 0 0 color-mix(in srgb, var(--hl) 10%, transparent); }
.excluded li.anchor-on { box-shadow: inset 3px 0 0 var(--hl); padding-left: 8px; }
.doc-type.anchor-on { box-shadow: 0 0 0 2px var(--hl); }
table.lines tr.anchor-on > td { background: color-mix(in srgb, var(--hl) 5%, transparent); }
table.lines tr.anchor-on > td:first-child, table.lines tr.anchor-tint > td:first-child { box-shadow: inset 3px 0 0 var(--hl); }
table.lines tr.anchor-tint > td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--hl) 40%, transparent); }
.attr.anchor-tint { background: color-mix(in srgb, var(--hl) 11%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hl) 35%, transparent); }
.attr.anchor-tint i, .attr.anchor-on i { color: var(--hl); }
.attr.anchor-on { background: color-mix(in srgb, var(--hl) 16%, #fff); box-shadow: inset 0 0 0 1.5px var(--hl), 0 1px 4px color-mix(in srgb, var(--hl) 30%, transparent); }
table.lines td.qty[data-anchor] { border-radius: 0; }
table.lines td.qty.anchor-on, table.lines td.qty.anchor-tint { color: var(--hl); }
table.lines td.qty.anchor-on { background: color-mix(in srgb, var(--hl) 10%, transparent) !important; }
.attr .dflt { font-size: 10.5px; color: var(--muted); margin-left: 2px; }

/* ---------------------------------------------------------------- NewPort additions */
.preview-head { display: flex; align-items: center; gap: 10px; }
.preview-head .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.preview-head .parts { display: flex; gap: 4px; flex: none; }
.ftype { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 6px; border-radius: 5px; background: var(--none-soft); color: var(--muted); text-transform: uppercase; }
.ftype.email, .ftype.eml { background: #e6eef8; color: #2b5797; }
.ftype.pdf { background: #fdeceb; color: #b3372f; }
.ftype.word { background: #e7edf7; color: #2b579a; }
.ftype.image { background: #efe8f7; color: #5c2d91; }
.samples li { align-items: center; }
.samples .fname { display: flex; flex-direction: column; gap: 1px; }
.samples .fname b { font-weight: 600; }
.samples .fname small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.samples .badges { display: flex; gap: 4px; flex: none; }
.samples .ftype.eml { width: 40px; text-align: center; flex: none; }

/* dossier part tab above its first page */
.page .ptab { position: absolute; left: 10px; top: -1px; transform: translateY(-50%); z-index: 2; font-size: 11px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px 2px 3px; box-shadow: var(--shadow); color: var(--muted); max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page .ptab b { display: inline-block; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 7px; margin-right: 6px; font-size: 10.5px; }
.page .ptab.pdf b { background: #b3372f; } .page .ptab.word b { background: #2b579a; } .page .ptab.image b { background: #5c2d91; }
.preview-body.pages { padding-top: 22px; }
.page + .page { margin-top: 22px; }

/* header */
.doc-type.known { background: var(--accent-soft); color: var(--accent); }
.doc-type.unknown { background: var(--warn-soft); color: var(--warn); }
.kv.parties { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.blk { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; background: #f7f8fa; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; margin-top: 3px; white-space: normal; word-break: break-word; }
.kv .pill { margin: 6px 0 0; }
ul.refs { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px 18px; }
ul.refs li { margin: 0 !important; }
ul.refs .rl { color: var(--muted); font-size: 12.5px; }
.kv dd b { font-weight: 600; }

/* checks */
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 12.5px; background: var(--ok-soft); color: #14532d; border: 1px solid #bfe5cc; }
.chk i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--ok); color: #fff; }
.chk small { font-size: 11.5px; opacity: .75; margin-left: 2px; }
.chk.tms { background: #f1f4f8; color: #475569; border-color: #dde3ea; }
.chk.tms i { background: #94a3b8; }
.chk.missing { background: var(--bad-soft); color: #8a241d; border-color: #f1c1bd; }
.chk.missing i { background: var(--bad); }

/* cargo */
.cargo-desc { font-size: 13px; padding: 10px 12px; }
#cargo .attrs { margin-top: 10px; }
.attr.dg { background: #fdecef; } .attr.dg i { color: #be123c; }
.marks { margin-top: 14px; }
.marks h3, .two h2 { font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.marks ul, .rlist { margin: 0; padding-left: 18px; font-size: 13.5px; }
.marks li, .rlist li { margin: 3px 0; border-radius: 4px; }
.marks li.anchor-on, .rlist li.anchor-on { background: color-mix(in srgb, var(--hl) 10%, transparent); }

/* tanks */
table.lines .cno { font-size: 13.5px; margin-right: 8px; }
table.lines td.desc { min-width: 200px; }
table.lines td.desc .attr { margin-top: 0; }
.crefs { margin-top: 6px; font-size: 12px; color: var(--muted); }
.seal { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f1f3f6; border-radius: 4px; padding: 1px 6px; margin: 0 4px 4px 0; }
table.lines td small { color: var(--muted); }
table.lines.empty thead { display: none; }
table.lines tr.none td { color: var(--muted); border-bottom: 0; padding: 4px 0; }
table.lines tr.none .chk { margin-right: 8px; }
table.lines td.anchor-on, table.lines td.anchor-tint { background: color-mix(in srgb, var(--hl) 8%, transparent) !important; }
.crefs.anchor-on { color: var(--hl); }

/* remarks */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
#result { display: flex; flex-direction: column; gap: 18px; }
