/* Redesign phase 3 (5 Dec 2026): the supplier invoice page, the invoice readiness case page, the supplier's upload page and the
   "Request quotes by link" form. Presentation only, on the phase 1 tokens (tokens.css). Loaded after style.css, so it wins on ties. */

/* shared: sentence-case chips (the text the page sets is unchanged; only its first letter is drawn as a capital) */
.badge::first-letter{text-transform:uppercase}
.synthetic{background:var(--amber-tint);color:var(--demo-ink);border-radius:999px;padding:2px 10px;font-size:.78rem;font-weight:600;font-family:var(--font-ui);vertical-align:middle;letter-spacing:0}
.page-title{font-family:var(--font-ui);font-size:1.9rem;font-weight:800;letter-spacing:-.01em;line-height:1.2;margin:.2rem 0 .3rem;color:var(--ink)}
.page-meta{color:var(--ink-muted);margin:0 0 .6rem}
.step-no{color:var(--ink-muted);font-weight:600;font-size:.85rem;margin-inline-end:.2rem}
.nowrap{white-space:nowrap}

/* tables scroll inside their own box; on a phone the first column stays in view */
.scroll{overflow-x:auto;max-width:100%}
@media (max-width:760px){
  .sticky-first table th:first-child,.sticky-first table td:first-child{position:sticky;inset-inline-start:0;background:var(--surface);z-index:1;box-shadow:1px 0 0 var(--rule)}
  .sticky-first table tbody th:first-child{min-width:9rem;max-width:12rem}
}

/* ---- supplier invoice page ---- */
.si-hero{background:var(--surface);border:1px solid var(--rule);border-inline-start:6px solid var(--rule);border-radius:12px;padding:18px 20px;margin:0 0 14px}
.si-hero.bad{border-inline-start-color:var(--red)}
.si-hero.ok{border-inline-start-color:var(--green)}
.si-headline{font-size:1.7rem;font-weight:800;line-height:1.25;letter-spacing:-.01em;margin:0 0 .4rem;color:var(--ink)}
.si-headline.bad{color:var(--ink)}
.si-headline.ok{color:var(--green)}
mark.si-diff{background:var(--highlighter);color:var(--ink);padding:0 .2em;border-radius:3px;font-variant-numeric:tabular-nums;white-space:nowrap}
.si-outcome{margin:.2rem 0;font-weight:600}
.si-hero.bad .si-outcome{color:var(--red)}
#si-outcome.ok{color:var(--green)}
.si-totals{margin:.3rem 0;font-variant-numeric:tabular-nums}
.si-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:0 18px;align-items:start}
.si-main,.si-side{min-width:0}
@media (min-width:1100px){.si-grid{grid-template-columns:minmax(0,1fr) 24rem}}
@media (max-width:1099px){
  /* phone and tablet: the issues and the decision come right after the line-by-line table */
  .si-grid{display:flex;flex-direction:column}
  .si-main,.si-side{display:contents}
  #si-printed{order:1}#si-table{order:2}#si-issues{order:3}#si-decision{order:4}#si-passed{order:5}#si-link{order:6}#si-approved{order:7}#si-invoice{order:8}
  .si-grid>*,.si-main>*,.si-side>*{width:100%}
}
.si-decision{border-inline-start:4px solid var(--navy)}
.si-decision .never{font-weight:600;color:var(--ink)}
main:has(.si-grid){max-width:80rem}
#si-issues .item.issue{border:1px solid var(--rule);border-radius:8px;padding:10px 12px;margin:8px 0}
#si-issues .item.issue.blocking{border-inline-start:4px solid var(--red)}
#si-issues .item.issue.resolved{background:var(--paper)}

/* what each document prints, side by side */
.printed-pair{margin:0 0 12px}.printed-pair h3{margin:.2rem 0 .4rem}
.printed-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr));gap:10px}
.printed-col{border:1px solid var(--rule);border-radius:8px;padding:8px 10px;background:var(--paper);min-width:0}
.printed-label{margin:0 0 .2rem;font-size:.85rem;font-weight:600;color:var(--ink-muted)}
.printed-text{margin:0;font-family:var(--font-mono);font-size:.9rem;overflow-wrap:anywhere}
.printed-text mark{background:var(--highlighter);color:var(--ink);padding:0 .15em;border-radius:2px}

/* line by line */
.table.si{font-variant-numeric:tabular-nums}
.table.si td.differs{background:transparent;color:var(--red);font-weight:700}
.table.si tr.has-diff>*{background:var(--red-tint)}
.table.si tr.has-diff>:first-child{box-shadow:inset 4px 0 0 var(--red)}
[dir=rtl] .table.si tr.has-diff>:first-child{box-shadow:inset -4px 0 0 var(--red)}
.table.si tr.total-row>*{border-top:2px solid var(--ink);font-weight:700}
.table.si td.diff{white-space:nowrap}

.facts-list{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:4px 14px;margin:0}
.facts-list dt{color:var(--ink-muted);font-size:.9rem}.facts-list dd{margin:0;min-width:0;overflow-wrap:anywhere}
@media (max-width:520px){.facts-list{grid-template-columns:minmax(0,1fr)}.facts-list dd{margin:0 0 .4rem}}

/* ---- invoice readiness case page ---- */
.readiness{background:var(--surface);border:1px solid var(--rule);border-inline-start:6px solid var(--rule);border-radius:12px;padding:16px 20px;margin:0 0 14px}
.readiness.bad{border-inline-start-color:var(--red)}.readiness.ok{border-inline-start-color:var(--green)}.readiness.warn{border-inline-start-color:var(--amber)}
.readiness-sentence{font-size:1.55rem;font-weight:800;line-height:1.25;letter-spacing:-.01em;margin:0}
.readiness.bad .readiness-sentence{color:var(--red)}.readiness.ok .readiness-sentence{color:var(--green)}.readiness.warn .readiness-sentence{color:var(--amber)}
.readiness-sources{margin:.6rem 0 0;padding-inline-start:1.1rem;font-size:.9rem}.readiness-sources li{margin:.15rem 0}
.readiness-sources button.link{margin-inline-end:.4rem}
#check .item.finding{border-radius:8px}
#check .item.blocking:not(.satisfied){border-color:var(--rule);border-inline-start:4px solid var(--red)}
#check .item.satisfied{background:var(--paper)}

/* ---- supplier upload page ---- */
.supplier-page{font-family:var(--font-ui);color:var(--ink)}
.supplier-page h1{font-size:1.8rem;font-weight:800;margin:.2rem 0 .3rem}
.supplier-page .deadline strong{font-variant-numeric:tabular-nums}
.supplier-items{width:100%;table-layout:fixed}
.table.supplier-items th,.table.supplier-items td,.table.supplier-items td:last-child{white-space:normal;overflow-wrap:break-word;vertical-align:top}
.table.supplier-items td{overflow-wrap:anywhere}
.supplier-items th:nth-child(2),.supplier-items td:nth-child(2){width:5.5rem;text-align:end;font-variant-numeric:tabular-nums}
.supplier-items th:nth-child(3),.supplier-items td:nth-child(3){width:4.5rem}
@media (max-width:480px){.supplier-items{font-size:.86rem}.supplier-items th:nth-child(2),.supplier-items td:nth-child(2){width:4.6rem}.supplier-items th:nth-child(3),.supplier-items td:nth-child(3){width:3.2rem}.table.supplier-items th,.table.supplier-items td{padding:6px 4px}}
.upload-card{border-inline-start:4px solid var(--navy)}
.upload-drop{display:flex;flex-direction:column;gap:6px;border:2px dashed var(--field-line);border-radius:10px;padding:16px;background:var(--paper);cursor:pointer;margin:.4rem 0 .6rem}
.upload-drop:hover,.upload-drop:focus-within{border-color:var(--navy)}
.upload-title{font-weight:700;font-size:1.05rem}
.upload-drop input[type=file]{max-width:100%}
.supplier-page .privacy{margin-top:1rem}

/* ---- request quotes by link: the row editor ---- */
.qr-group{border:1px solid var(--rule);border-radius:10px;padding:10px 12px 4px;margin:.8rem 0;min-width:0}
.qr-group legend{font-weight:700;padding:0 4px}
.qr-head,.qr-row{display:grid;grid-template-columns:minmax(10rem,3fr) minmax(4rem,1fr) minmax(4rem,1fr) minmax(8rem,3fr) auto;gap:6px;align-items:center}
.qr-head{font-size:.85rem;color:var(--ink-muted);font-weight:600;margin:0 0 2px}
.qr-row{margin:0 0 6px}
.qr-row input,.qr-supplier input{width:100%;min-width:0;margin:0}
.qr-supplier{display:grid;grid-template-columns:minmax(0,24rem) max-content;justify-content:start;gap:6px;align-items:center;margin:0 0 6px}
.qr-remove{padding-inline:10px}
.qr-paste{margin:.2rem 0 .6rem}.qr-paste summary{color:var(--navy);font-weight:600}.qr-paste textarea{width:100%}
@media (max-width:760px){
  .qr-head{display:none}
  .qr-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);border:1px solid var(--rule);border-radius:8px;padding:8px}
  .qr-row .qr-desc,.qr-row .qr-specs{grid-column:1 / -1}
  .qr-row .qr-remove{grid-column:1 / -1;justify-self:start}
  .qr-supplier{grid-template-columns:minmax(0,1fr) max-content;justify-content:stretch}
}
.si-headline.ok~#si-outcome{color:var(--ink-muted);font-weight:400}
.table.si thead th{white-space:normal;vertical-align:bottom}
@media (max-width:480px){.table.supplier-items thead th{font-size:.76rem;overflow-wrap:normal}}
