/* E-Invoicing Master Data Portal: one stylesheet for the public form and the Finance workspace.
   No inline styles anywhere (the Content-Security-Policy refuses them), so everything visual is a class here. */
:root {
  --brand: #1955a6; --brand-dark: #123f7c; --brand-wash: #eaf1fb; --brand-line: #b9cfee;
  --ink: #152033; --quiet: #5b6779; --faint: #8a94a6; --line: #dde3ec; --line-strong: #c2cbd8; --paper: #ffffff; --wash: #f3f5f9;
  --accent: var(--brand); --accent-ink: #ffffff;
  --good: #187a45; --good-wash: #e6f5ec; --good-line: #a9d9bd;
  --warn: #8a5a00; --warn-wash: #fff6dd; --warn-line: #ecd28a;
  --bad: #b3261e; --bad-wash: #fdecea; --bad-line: #f0b4ae;
  --radius: 12px; --radius-s: 8px;
  --shadow: 0 1px 2px rgba(21, 32, 51, .05), 0 2px 8px rgba(21, 32, 51, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--wash); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.staff .wrap { max-width: 1320px; }      /* the workspace has wide tables */
.staff main.narrow { max-width: 720px; }
main.wrap { flex: 1 0 auto; width: 100%; padding-top: 28px; padding-bottom: 64px; }
main.narrow { max-width: 720px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--paper); padding: 8px 12px; border-radius: var(--radius-s); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { flex: none; vertical-align: -4px; }

/* ---------------------------------------------------------------- page top */
.envbar { background: #8a3b00; color: #ffffff; text-align: center; padding: 6px 16px; font-size: 14px; }   /* UAT copy only */
.top { background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(21, 32, 51, .02); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 68px; padding-top: 6px; padding-bottom: 6px; }
.brand { color: var(--ink); text-decoration: none; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.brand img { display: block; height: 72px; width: auto; max-width: 100%; }   /* large enough to read the company name under the mark */
.brand span { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.2; }
/* Wide screens: logo and title share one row with whatever sits on the right. */
@media (min-width: 1180px) {
  .top .wrap, .brand { flex-wrap: nowrap; }
  .brand img, .who { flex: none; }
  .brand span { text-wrap: balance; min-width: 118px; }
}
/* Workspace: who is signed in, then the menu as tabs under the logo row */
.who { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.who form { margin: 0; }
.person { text-align: right; line-height: 1.25; max-width: 260px; }
.person strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { color: var(--quiet); font-size: 13px; }
button.quiet { min-height: 36px; padding: 5px 14px; font-size: 14px; }
.tabs { border-top: 1px solid var(--line); background: var(--paper); }
.tabs .wrap { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 4px; min-height: 0; padding-top: 0; padding-bottom: 0; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 12px 14px 10px; font-size: 15px; font-weight: 600; color: #36435a; text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--brand-dark); background: var(--wash); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.exports { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.exports .hint { margin-right: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.exports a { font-weight: 500; font-size: 14px; padding: 12px 10px 10px; }
.foot { border-top: 1px solid var(--line); color: var(--quiet); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-top: 18px; padding-bottom: 28px; }

/* ---------------------------------------------------------------- text */
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 19px; line-height: 1.3; margin: 24px 0 8px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
h4 { font-size: 15px; margin: 0; }
.card h2 { margin-top: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
p { margin: 0 0 12px; }
code, .mono { font: 14px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
code { font-size: 13px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, Consolas, monospace; margin: 8px 0 0; }
.hint { color: var(--quiet); font-size: 14px; font-weight: 400; }
.lead { font-size: 17px; color: #36435a; max-width: 68ch; margin-bottom: 20px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--quiet); margin: 0 0 6px; }
.account { color: var(--quiet); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
.notice { background: var(--paper); border: 1px solid var(--brand-line); border-left: 4px solid var(--accent); border-radius: var(--radius-s); padding: 12px 16px; margin: 0 0 16px; }
.notice.flag { display: flex; gap: 12px; }      /* an icon, then the text in one block */
.notice > .icon { margin-top: 2px; color: var(--accent); }
.notice.flag > div { min-width: 0; flex: 1; }
.notice.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-wash); }
.notice.warn > .icon { color: var(--warn); }
.notice.bad { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-wash); }
.notice.bad > .icon { color: var(--bad); }
.notice ul { margin: 6px 0; padding-left: 20px; }
.notice p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- form controls */
.field { margin: 0 0 18px; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
label, .label, legend.label { display: block; font-weight: 600; margin-bottom: 4px; padding: 0; }
.opt { font-weight: 400; font-size: 13px; color: var(--quiet); background: var(--wash); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: 4px; white-space: nowrap; }
label.choice { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }
label.choice input { margin-top: 5px; flex: none; }
.field .hint { margin: 0 0 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 9px 12px;
  transition: border-color .12s, box-shadow .12s; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #9aa7ba; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(25, 85, 166, .22); }
button:focus-visible, a:focus-visible, .pick:focus-within { outline: 3px solid rgba(25, 85, 166, .45); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); }
input[type=file] { font: inherit; font-size: 14px; color: var(--quiet); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 7px 12px; margin-right: 10px; cursor: pointer; }
.field.bad input, .field.bad select { border-color: var(--bad); background: #fffafa; }
.error { color: var(--bad); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.fixed { margin: 0; min-height: 44px; padding: 9px 12px; background: var(--wash); border: 1px solid var(--line); border-radius: var(--radius-s); color: #36435a; }
button, .button { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: var(--radius-s); padding: 9px 16px; min-height: 44px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .12s, border-color .12s; }
button:hover, .button:hover { background: var(--wash); border-color: #9aa7ba; color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--accent-ink); }
button[disabled] { opacity: .55; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--accent); padding: 4px 0; min-height: 0; font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { background: none; color: var(--brand-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; align-items: center; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
form.inline label { margin: 0; }
form.inline input { width: auto; flex: 1 1 160px; }
.upload { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.upload select { width: auto; flex: 1 1 220px; } .upload input { flex: 2 1 240px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 170px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
[hidden] { display: none !important; }

/* Radio buttons drawn as cards */
.cardset { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 6px; }
.cardset.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; font-weight: 400; cursor: pointer; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 10px; transition: border-color .12s, background .12s; }
.pick:hover { border-color: var(--brand); }
.pick input { margin: 3px 0 0; flex: none; }
.pick strong { display: block; line-height: 1.35; }
.pick small { display: block; color: var(--quiet); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.pick:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); box-shadow: inset 0 0 0 1px var(--brand); }
.field.bad .pick { border-color: var(--bad-line); }

/* ---------------------------------------------------------------- the counterparty's pages */
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 20px; }
.pagehead h1 { margin: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.primary { min-width: 0; }
.side { position: sticky; top: 20px; display: grid; gap: 16px; }
.side .card { margin: 0; }
.sidecard .eyebrow { margin-bottom: 10px; }
.sidecard .who { font-size: 17px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.sidecard .line { display: flex; gap: 10px; color: #36435a; font-size: 14px; margin: 0 0 8px; }
.sidecard .line .icon { color: var(--faint); margin-top: 1px; }
.sidecard .line:last-child { margin-bottom: 0; }
.sidecard .line a { overflow-wrap: anywhere; }
.kv { margin: 12px 0 0; }
.kv div { padding: 10px 0; border-top: 1px solid var(--line); }
.kv dt { font-size: 12px; color: var(--quiet); font-weight: 600; letter-spacing: .02em; }
.kv dd { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.kv dd .mono { font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.kv dd small { flex-basis: 100%; color: var(--quiet); font-size: 13px; }
.copy { min-height: 0; padding: 1px 9px; font-size: 12px; font-weight: 600; color: var(--brand); border-color: var(--brand-line); border-radius: 999px; }
.copy.copied { color: var(--good); border-color: var(--good-line); background: var(--good-wash); }
.downloads, .ready { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.kv + .downloads { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 0; }
.download { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; color: var(--ink); background: var(--brand-wash); border: 1px solid var(--brand-line); border-radius: 10px; transition: background .12s, border-color .12s; }
.download:hover { background: #dde9f9; border-color: var(--brand); color: var(--ink); }
.download > .icon { color: var(--brand); }
.download span { flex: 1; min-width: 0; line-height: 1.3; }
.download strong, .ready strong { display: block; font-size: 14px; }
.download small, .ready small { color: var(--quiet); font-size: 13px; }
.ready li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.3; }
.ready .icon { color: var(--brand); margin-top: 2px; }
.ready + .hint { margin: 14px 0 0; }
.assure { display: flex; gap: 12px; padding: 12px 14px; background: var(--good-wash); border: 1px solid var(--good-line); border-radius: var(--radius); color: #145f37; font-size: 13.5px; line-height: 1.45; }
.assure p { margin: 0; }
.assure .icon { margin-top: 1px; }

/* Progress bar: a numbered dot per step, joined by a line */
.stepper { list-style: none; display: flex; margin: 0 0 16px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stepper li { flex: 1 1 0; display: flex; align-items: center; min-width: 0; }
.stepper li:last-child { flex: none; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; min-width: 12px; margin: 0 12px; background: var(--line); border-radius: 2px; }
.stepper li.done:not(:last-child)::after { background: var(--brand); }
.stepper a, .stepper .here { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--quiet); font-weight: 600; font-size: 15px; white-space: nowrap; border-radius: 999px; }
.stepper a:hover .name { text-decoration: underline; }
.dot { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-weight: 700; background: var(--paper); color: var(--quiet); border: 2px solid var(--line-strong); }
.dot .icon { vertical-align: 0; stroke-width: 2.6; }
.stepper .current .dot { background: var(--brand); border-color: var(--brand); color: #ffffff; box-shadow: 0 0 0 4px var(--brand-wash); }
.stepper .current .here { color: var(--ink); }
.stepper .done .dot { background: var(--brand-wash); border-color: var(--brand); color: var(--brand); }
.stepper .done a { color: var(--ink); }
.stepper .attention .dot { background: var(--warn-wash); border-color: #c98a00; color: var(--warn); }

/* One step */
.step { padding: 24px 28px 28px; }
.stephead { margin-bottom: 4px; }
.stephead .count { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.stephead h2 { font-size: 22px; margin: 0 0 6px; }
.stephead p:last-child { color: #36435a; max-width: 68ch; margin-bottom: 0; }
.part { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--quiet); margin: 28px 0 16px; }
.part::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.part.first { margin-top: 0; }
.step .actions { justify-content: space-between; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Landing: the one-time code */
.cardhead { display: flex; gap: 14px; align-items: flex-start; }
.cardhead > .icon { color: var(--brand); background: var(--brand-wash); border-radius: 10px; padding: 9px; width: 42px; height: 42px; }
.cardhead h2 { margin: 0 0 4px; }
.verify form { margin-left: 56px; }
.codeform label { margin-bottom: 6px; }
.coderow { display: flex; flex-wrap: wrap; gap: 10px; }
input.code { width: 190px !important; font: 600 22px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3em; text-align: center; padding-left: 16px !important; }
input.code::placeholder { color: #c2cbd8; }
.resend { margin-top: 12px; }
.plan { list-style: none; counter-reset: plan; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan li { counter-increment: plan; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 12px 14px; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; line-height: 1.35; }
.plan li::before { content: counter(plan); grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 1px solid var(--brand-line); color: var(--brand); font-weight: 700; font-size: 14px; }
.plan span { color: var(--quiet); font-size: 14px; }

/* Documents step */
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.slot { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.slot.need { border-style: dashed; border-color: var(--line-strong); background: #fbfcfe; }
.slot.have { border-color: var(--good-line); background: #f7fcf9; }
.sloticon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--wash); color: var(--quiet); }
.slot.have .sloticon { background: var(--good-wash); color: var(--good); }
.slotbody { flex: 1; min-width: 0; }
.slotname { margin: 0 0 4px; }
.slotbody .hint { margin: 0; }
.tag { font-size: 12px; font-weight: 600; color: var(--quiet); background: var(--wash); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.tag.req { color: var(--brand); background: var(--brand-wash); border-color: var(--brand-line); }
.filerow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.filerow form { margin: 0 0 0 auto; }
.filename { font-weight: 600; overflow-wrap: anywhere; }
.slot .upload { margin-top: 10px; }
.slot .upload input { flex: 1 1 200px; min-width: 0; width: 100%; }
.slot .upload button { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.asked { white-space: pre-line; margin: 4px 0 0; }
.drafted { margin: 8px 0 0; }
/* drag and drop (app.js adds .drops, .dragging, .over, .sending; without scripts the boxes work as before) */
.slot { position: relative; }
.slotbody .drophint { display: none; margin-top: 8px; }
@media (hover: hover) and (pointer: fine) { .drops .slotbody .drophint { display: block; } }
.slotbody .dropnote { margin: 8px 0 0; overflow-wrap: anywhere; }
.slots.dragging .slot { border-style: dashed; border-color: var(--brand); }
.slots.dragging .slot.over { box-shadow: 0 0 0 3px var(--brand-line); }
.slots.dragging .slot.over::after { content: attr(data-drop); position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
  background: rgba(234, 241, 251, .94); color: var(--brand-dark); font-weight: 600; border-radius: 9px; pointer-events: none; }
.slots.busy .slot { pointer-events: none; } .slots.busy .slot:not(.sending) { opacity: .55; }
.summary { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.summaryhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--wash); border-bottom: 1px solid var(--line); }
.summaryhead a { font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pairs { margin: 0; }
.pairs div { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.pairs div:first-child { border-top: 0; }
.pairs dt { color: var(--quiet); }
.pairs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.card > .pairs div { padding-left: 0; padding-right: 0; }
.declare { padding: 14px 16px; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; }
.field.bad .declare { border-color: var(--bad-line); background: var(--bad-wash); }
.finished { display: flex; gap: 16px; align-items: flex-start; border-color: var(--good-line); background: #f7fcf9; }
.donemark { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--good); color: #ffffff; }
.donemark .icon { vertical-align: 0; stroke-width: 2.6; }
.finished h2 { margin-bottom: 6px; }
.finished p { margin: 0; }
.message { margin-top: 24px; padding: 28px; }
.message h1 { font-size: 24px; }

/* ---------------------------------------------------------------- workspace */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; counter-reset: step; font-size: 14px; }
.steps li { counter-increment: step; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--quiet); }
.steps li::before { content: counter(step) ". "; }
table { border-collapse: collapse; width: 100%; }
main { overflow-x: auto; }      /* a wide table scrolls inside the page instead of stretching it */
.public main { overflow-x: visible; }      /* the form has no wide tables, and its side panel must be able to stick */
.grid { background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.grid a { font-weight: 600; text-decoration: none; }
.grid a:hover { text-decoration: underline; }
.grid th, .grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid thead th { background: #f7f9fc; white-space: nowrap; color: #36435a; font-size: 13px; }
.grid tbody tr:hover td { background: #fafbfd; }
.grid .num, .plain .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid tr.total th, .grid tr.total td { font-weight: 600; border-top: 2px solid var(--line); }
.grid tr.changed td, .grid tr.changed th { background: var(--warn-wash); }
.compare th { width: 24%; font-weight: 600; }
.plain th, .plain td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.plain th { width: 40%; font-weight: 600; }
.plain form { margin: 0; }
.status { display: inline-block; font-size: 12px; line-height: 1.5; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--wash); white-space: nowrap; vertical-align: middle; }
.status.big { font-size: 13px; padding: 5px 12px; }
.s-not_invited { color: var(--quiet); }
.s-invited { background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand-dark); }
.s-opened { background: #e9e7fb; border-color: #c4bdf0; color: #40359a; }
.s-submitted { background: #fde8d4; border-color: #f2bd8c; color: #8a3f00; }
.s-verified { background: var(--good-wash); border-color: var(--good-line); color: var(--good); }
.s-returned { background: var(--warn-wash); border-color: var(--warn-line); color: var(--warn); }
.columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.columns section h2:first-child { margin-top: 0; }
.docs, .history { list-style: none; padding: 0; margin: 0; }
.docs li, .history li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mail summary { cursor: pointer; }
.link-text { user-select: all; }
.switch { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin: 0; }
.switch small { display: block; font-weight: 400; color: var(--quiet); font-size: 14px; }
.cardtitle { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 4px; }
.cardtitle h2 { margin: 0; }
.wide { grid-column: 1 / -1; }
.fold > summary { cursor: pointer; list-style-position: outside; margin-left: 18px; }
.fold[open] > summary { margin-bottom: 10px; }
.fold:not([open]) { padding-top: 12px; padding-bottom: 12px; }
.cols2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 28px; align-items: start; }

/* Cards that hold a table edge to edge */
.card.flush { padding: 0; overflow: hidden; }
.card.flush .grid { border: 0; }
.card.flush .grid tr:last-child td, .card.flush .grid tr:last-child th { border-bottom: 0; }
.cardtitle.pad { padding: 14px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.crumb { margin: 0 0 10px; font-size: 14px; }
.crumb a { text-decoration: none; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; }
.tag.hold { color: var(--warn); background: var(--warn-wash); border-color: var(--warn-line); font-weight: 600; }
.empty { text-align: center !important; color: var(--quiet); padding: 28px 12px !important; }
button.wide, .button.wide { width: 100%; grid-column: auto; }
.plainlist { margin: 0; padding-left: 20px; }

/* Accounts: progress band */
.overview { padding: 22px 24px; }
.headline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 14px; }
.headline .big { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.02em; margin: 0 0 6px; color: var(--ink); }
.headline .big small { font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--quiet); }
.headline .hint { margin: 0; font-size: 15px; }
.button.attention { background: #fde8d4; border-color: #f2bd8c; color: #8a3f00; }
.button.attention:hover { background: #fbd9b8; border-color: #e0a066; color: #8a3f00; }
.bar { display: block; border-radius: 999px; overflow: hidden; }
.bar .track { fill: #e8ecf2; }
.f-not_invited { fill: #c5cdd9; background: #c5cdd9; }
.f-invited { fill: #7fa8dc; background: #7fa8dc; }
.f-opened { fill: #8b7fe0; background: #8b7fe0; }
.f-submitted { fill: #f08a24; background: #f08a24; }
.f-returned { fill: #d9a700; background: #d9a700; }
.f-verified { fill: #1f9d57; background: #1f9d57; }
.tiles { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tile { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 12px 14px; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--brand); color: var(--ink); box-shadow: var(--shadow); }
.tile.on { border-color: var(--brand); background: var(--brand-wash); box-shadow: inset 0 0 0 1px var(--brand); }
.tile.due { border-color: #f2bd8c; background: #fff7ef; }
.tile .key { width: 10px; height: 10px; border-radius: 3px; }
.tilename { font-size: 13px; font-weight: 600; color: #36435a; }
.tile strong { grid-column: 1 / -1; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile small { grid-column: 1 / -1; color: var(--quiet); font-size: 12.5px; line-height: 1.3; }

/* Accounts: the list */
.list { padding: 0; overflow: hidden; }
.list .filters { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #f7f9fc; }
.list .filters input[type=search] { flex: 2 1 240px; }
.clear { font-size: 14px; font-weight: 600; padding: 0 6px; }
.listhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 16px; }
.listhead .hint { margin: 0; }
.listhead button { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.list .grid { border-left: 0; border-right: 0; }
.accounts td { vertical-align: middle; }
.accounts .check { width: 44px; text-align: center; }
.accounts .code a { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.accounts .code small { display: block; color: var(--quiet); font-size: 12.5px; }
.accounts .name { font-size: 15px; }
.accounts .email { overflow-wrap: anywhere; color: #36435a; }
.when { white-space: nowrap; color: var(--quiet); font-size: 13px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.pager .button { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.counts { margin-top: 4px; }

/* One account */
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--warn-wash); border: 1px solid var(--warn-line); vertical-align: -1px; }
.compare td, .compare th { font-size: 14.5px; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); line-height: 1.35; }
.files li:first-child { border-top: 0; padding-top: 0; }
.files .icon { color: var(--brand); margin-top: 2px; }
.files a { font-weight: 600; }
.files small { display: block; color: var(--quiet); font-size: 13px; overflow-wrap: anywhere; }
.declared { display: flex; gap: 10px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: #36435a; font-size: 14px; }
.declared .icon { color: var(--good); }
.columns aside { display: grid; gap: 16px; }
.columns aside .card { margin: 0; }
.columns aside textarea { margin-bottom: 0; }
.card.act { border-color: var(--good-line); background: #f7fcf9; }
.card.act button.primary { background: var(--good); border-color: var(--good); }
.card.act button.primary:hover { background: #12613a; border-color: #12613a; }
.actions.tight { margin-top: 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); line-height: 1.35; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--brand); }
.timeline strong { display: block; font-size: 14px; }
.timeline small { color: var(--quiet); font-size: 13px; overflow-wrap: anywhere; }
.timeline .none { border: 0; padding-left: 0; color: var(--quiet); }
.timeline .none::before { display: none; }

/* Import, outbox, sign-in */
.cols2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cols2.even > .card { margin: 0; }
.cardtitle a { font-size: 14px; font-weight: 600; text-decoration: none; }
.result { margin: 14px 0 0; padding: 14px 16px; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; }
.result ul { margin: 6px 0; padding-left: 20px; }
.result p { margin: 0; }
.mail { padding: 12px 16px; margin-bottom: 8px; }
.mail summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.mailkind { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); min-width: 76px; }
.mailto { font-weight: 600; }
.mailsubject { flex: 1 1 260px; color: #36435a; }
.signin main { padding-top: 56px; }
.login { max-width: 440px; margin: 0 auto; padding: 28px; }
.login h1 { margin-bottom: 4px; }
.login > .hint { margin-bottom: 20px; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .cols2.even { grid-template-columns: 1fr; }
  .exports { margin-left: 0; flex-basis: 100%; border-top: 1px solid var(--line); }
  .side { position: static; }
  .cols2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) { .columns { grid-template-columns: 1fr; } h1 { font-size: 24px; } }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 20px; }
  .grid2, .plan, .cardset.two { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .headline .big { font-size: 32px; }
  .person small { display: none; }
  .step { padding: 20px 16px 22px; }
  .stepper { padding: 12px; }
  .stepper li:not(.current) .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }      /* dots only; the current step keeps its name */
  .stepper li:not(:last-child)::after { margin: 0 8px; }
  .verify form { margin-left: 0; }
  .slot { padding: 12px; gap: 10px; }
  .sloticon { width: 32px; height: 32px; border-radius: 8px; }
  .slot .upload button { width: 100%; }
  .pairs div { grid-template-columns: 1fr; gap: 0; }
  .step .actions { flex-direction: column-reverse; align-items: stretch; }
  .step .actions > span:empty { display: none; }
  .lead { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------------------------------------------------------- uploaded documents (workspace account page) */
/* The tiles under "Documents": a small picture of the first page; a click opens the viewer below. */
.docs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.doc { display: flex; gap: 12px; align-items: stretch; height: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); text-decoration: none; }
.doc:hover { border-color: var(--brand); background: var(--brand-wash); color: var(--ink); }
.shot { flex: none; width: 84px; min-height: 108px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--wash); border: 1px solid var(--line); border-radius: 4px; color: var(--faint); }
.shot img { display: block; width: 100%; height: auto; max-height: 150px; object-fit: cover; object-position: top; }
.shot .icon, .doc.nopicture .shot img { display: none; }
.doc.nopicture .shot .icon { display: block; }
.about { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.about strong { font-size: 15px; }
.about small { color: var(--quiet); font-size: 13px; overflow-wrap: anywhere; }
.about em { margin-top: auto; padding-top: 6px; font-style: normal; font-weight: 600; font-size: 14px; color: var(--brand); }

/* The viewer: a full-window dialog, pages on the left, the details to compare on the right. */
dialog.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #e9edf3; color: var(--ink); }
dialog.viewer[open] { display: flex; flex-direction: column; }
.vhead { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 8px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.vdocs { display: flex; flex-wrap: wrap; gap: 6px; }
.vdocs button { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 999px; }
.vdocs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.vtools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vtools button, .vtools .button { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.vtools .button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.vgroup { display: inline-flex; }
.vgroup button { border-radius: 0; margin-left: -1px; min-width: 44px; font-size: 18px; line-height: 1; }
.vgroup button:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); margin-left: 0; }
.vgroup button:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.vgroup .vzoom { min-width: 104px; font-size: 14px; }
.vtools [aria-pressed="true"] { background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand-dark); }
.vbody { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
.noside .vbody { grid-template-columns: minmax(0, 1fr); }
.noside .vside { display: none; }
.vstage { overflow: auto; padding: 16px; }
.vstage:focus { outline: none; }      /* focused so the arrow and page keys scroll it; the whole area needs no ring */
.vpages { margin: 0 auto; min-width: 240px; }      /* its width is the zoom: 100% = fit the width */
.vpages figure { margin: 0 0 16px; }
.vpages img { display: block; width: 100%; height: auto; min-height: 120px; background: var(--paper); box-shadow: 0 1px 3px rgba(21, 32, 51, .25); }
.vpages figcaption { text-align: center; color: var(--quiet); font-size: 13px; padding-top: 6px; }
.vnote { max-width: 46ch; margin: 80px auto; padding: 18px 20px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); color: #36435a; }
.vside { overflow: auto; padding: 16px 18px 24px; background: var(--paper); border-left: 1px solid var(--line); }
.vside h2 { margin: 0 0 8px; font-size: 18px; overflow-wrap: anywhere; }
.vfields { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.vfields th { width: 42%; font-weight: 600; color: #36435a; }
.vfields td { overflow-wrap: anywhere; }
.vfields td small { display: block; color: var(--warn); font-size: 13px; }
.vfields tr.look th { box-shadow: inset 4px 0 0 var(--brand); }      /* a field this document should show */
.vfields tr.look td { font-weight: 600; }
.lookmark { display: inline-block; width: 4px; height: 13px; background: var(--brand); border-radius: 2px; vertical-align: -2px; }
.vact { display: grid; gap: 8px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.vact button.primary { background: var(--good); border-color: var(--good); }
.vact button.primary:hover { background: #12613a; border-color: #12613a; }
.vkeys { margin: 16px 0 0; font-size: 13px; }
@media (max-width: 900px) {
  .vbody { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); }
  .vside { border-left: 0; border-top: 1px solid var(--line); }
  .vkeys { display: none; }
}

/* The AI reading of a document: a badge on the tile, a block beside the page in the viewer. Always marked as AI. */
.aibadge { align-self: flex-start; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--wash); color: var(--quiet); }
.aibadge.ai-ok { color: var(--good); background: var(--good-wash); border-color: var(--good-line); }
.aibadge.ai-check { color: var(--warn); background: var(--warn-wash); border-color: var(--warn-line); }
.vcheck { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--faint); border-radius: var(--radius-s); background: #fafbfd; }
.vcheck.ai-ok { border-left-color: var(--good); }
.vcheck.ai-check { border-left-color: #d39a00; }
.vcheck h3 { margin: 0 0 8px; font-size: 15px; }
.vcheck form { margin: 6px 0 0; }
.vcheck .hint { margin: 8px 0 0; font-size: 13px; }
.aiflag { display: flex; gap: 8px; margin: 0 0 8px; color: var(--warn); font-weight: 600; font-size: 14px; }
.ailines { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.ailines li { display: grid; grid-template-columns: 42% 1fr; gap: 0 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.ailines li:first-child { border-top: 0; }
.ailines .what { color: #36435a; font-weight: 600; }
.ailines .read { overflow-wrap: anywhere; }
.ailines .read.none { color: var(--faint); }
.ailines .verdict { grid-column: 2; font-size: 13px; font-weight: 600; }
.ailines .v-match .verdict { color: var(--good); }
.ailines .v-differs .verdict { color: var(--warn); }
.ailines .v-differs .read { background: var(--warn-wash); }
.ainote { margin: 8px 0 0; font-size: 14px; color: #36435a; }

/* ---------------------------------------------------------------- possible duplicates (account page card, /duplicates) */
.lede { max-width: 900px; margin: 0 0 16px; color: #36435a; }
.pairs-list { list-style: none; margin: 0 0 10px; padding: 0; }
.pairs-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.pairs-list li:first-child { border-top: 0; padding-top: 4px; }
.pair-who { margin: 0; overflow-wrap: anywhere; } .pair-who a { font-weight: 600; }
.pair-who + .hint { margin: 2px 0 0; overflow-wrap: anywhere; }
.opinion { margin: 8px 0 0; padding: 7px 10px; border-left: 3px solid var(--line-strong); background: var(--wash); border-radius: 4px; font-size: 14px; line-height: 1.4; }
.opinion.o-same_entity { border-left-color: var(--good); background: var(--good-wash); }
.opinion.o-branch, .opinion.o-sister { border-left-color: var(--warn); background: var(--warn-wash); }
.opinion.o-wait { color: var(--quiet); }
.pair-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 14px; }
.pair-tabs a { font-weight: 600; text-decoration: none; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: #36435a; }
.pair-tabs a.on { color: var(--accent-ink); background: var(--brand); border-color: var(--brand); }
.grid.pairs td { min-width: 150px; } .grid.pairs .chips { margin: 0; } .grid.pairs .opinion { margin-top: 0; }
.grid.pairs .tag { white-space: normal; }
.pair-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pair-act button:not(.link) { min-height: 36px; padding: 5px 12px; font-size: 14px; white-space: nowrap; }
.pair-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -4px 0 14px; }
.pair-filter a { font-size: 13px; font-weight: 600; text-decoration: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: #36435a; }
.pair-filter a.on { color: var(--brand); background: var(--brand-wash); border-color: var(--brand-line); }
