/* Fixes (app/fixes): the order flow, documents, the Proof File and the fix desk. Only what the shared parts
   (app.css, site.css, accounts.css .work) do not already give. Calm: white cards on the light page, one blue
   button per screen, an order's state in a plain word. */

/* ---------- Documents (cause report, packets, the Proof File): a careful printed page ---------- */
.doc { max-width: var(--measure); }
.doc-sheet .doc { max-width: none; }
.doc h2 { font-size: var(--step-2); margin: var(--s-6) 0 var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.doc h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc h3 { font-size: var(--step-1); margin: var(--s-5) 0 var(--s-2); }
.doc p, .doc li { overflow-wrap: anywhere; }
.doc ol, .doc ul { padding-left: 1.4rem; }
.doc li { margin-bottom: 0.4rem; }
/* A notice on a document: a quiet filled box, read at body size. */
.doc-note { border-radius: var(--radius-small); background: var(--paper-2); padding: var(--s-3) var(--s-4); margin: var(--s-4) 0; line-height: 1.55; }
.doc-note p { margin: 0; }
/* What the owner must do before anything else: a red edge on a pale red ground, the first paragraph bold. */
.doc-alert { border: 2px solid var(--bad); border-radius: var(--radius-small); background: var(--bad-bg); padding: var(--s-3) var(--s-4); margin: var(--s-4) 0; line-height: 1.55; }
.doc-alert p { margin: 0 0 var(--s-2); }
.doc-alert p:first-child { font-weight: 650; }
.doc-alert p:last-child { margin-bottom: 0; }
/* Facts with their source and date: label, value, then where it came from, in the reading face. */
.doc-facts { margin: var(--s-3) 0 var(--s-4); border-top: 1px solid var(--rule); }
.doc > .doc-facts:first-child { margin-top: 0; border-top: 0; }
.doc > .doc-facts:first-child > div:first-child { padding-top: 0; }
.doc-facts > div { display: grid; gap: 0.1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.doc-facts dt { font-weight: 600; color: var(--ink-2); font-size: 1rem; }
.doc-facts dd { margin: 0; font-weight: 700; }
.doc-facts dd .src { display: block; margin-top: 0.15rem; font-family: var(--font-sans); font-weight: 400; font-size: 1rem; color: var(--ink-3); }
@media (min-width: 48rem) { .doc-facts > div { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--s-4); } }
.doc .src { font-family: var(--font-sans); font-size: 1rem; }
.doc-checklist { list-style: none; padding-left: 0 !important; }
.doc-checklist li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: var(--s-2); align-items: start; }
.doc-box { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; margin-top: 0.25rem; border: 2px solid var(--ink-2); border-radius: 3px; font-weight: 700; font-size: 0.8rem; line-height: 1; }
.doc-sign { margin: var(--s-6) 0 var(--s-2); color: var(--ink-2); }
.doc-sign-line { display: block; width: min(22rem, 100%); border-bottom: 1.5px solid var(--ink); height: 2.2rem; margin-bottom: 0.25rem; }
.doc-break { border: 0; border-top: 1px solid var(--rule); margin: var(--s-6) 0; }
.doc-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin: 0 0 var(--s-4); }
.doc-meta { margin: 0 0 var(--s-2); color: var(--ink-2); }
.doc-notice { margin: 0 0 var(--s-4); font-weight: 600; color: var(--ink-2); }
.doc-sheet { margin-bottom: var(--s-4); }
@media (min-width: 48rem) { .doc-sheet { padding: var(--s-6); } }

/* ---------- Terms the owner agrees to (also the start and Full Service pages) ---------- */
.terms-box { border-radius: var(--radius-small); background: var(--paper-2); padding: var(--s-4); margin: 0 0 var(--s-4); max-width: var(--measure); }
.terms-box p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.terms-box + .field { margin-top: var(--s-3); }
.agree { margin-top: var(--s-5); max-width: var(--measure); }
.agree > h2 { font-size: var(--step-1); }
.agree.card { max-width: none; }
/* The carrier an order is for, with the way to pick another. */
.carrier-pick { display: grid; gap: var(--s-2); justify-items: start; margin: 0 0 var(--s-4); }

/* ---------- An order ---------- */
.order-head { margin-bottom: var(--s-4); }
.order-head h1 { margin: 0 0 var(--s-2); }
.order-head__state { margin: 0 0 var(--s-2); }
.order-carrier { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.6rem; margin: 0; color: var(--ink-2); }
.order-carrier__name { font-weight: 700; color: var(--ink); }
.work > .order-carrier { margin-bottom: var(--s-5); }
/* The one next step: its own white card with the order's one blue button. */
.next-box { margin: var(--s-4) 0; border-color: var(--rule-strong); }
.next-box h2 { font-size: var(--step-2); margin: 0 0 var(--s-2); }
.next-box .sign { margin-top: var(--s-4); }
.next-box__actions { display: grid; gap: var(--s-2); justify-items: start; margin-top: var(--s-4); }
.next-box__actions form { margin: 0; width: 100%; }
.next-box__actions .inline-form { width: auto; }
.next-box > :last-child { margin-bottom: 0; }
.order-price { margin: 0 0 var(--s-2); font-weight: 700; font-size: var(--step-3); line-height: 1.2; font-variant-numeric: tabular-nums; }
/* Progress in ink: a tick when done, an empty ring when not yet. On a phone the date sits under its step, so the step's
   name never wraps around it; on a wider screen it sits at the right. */
.progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.progress__step { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0 var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 30rem) { .progress__step { grid-template-columns: 1.6rem minmax(0, 1fr) auto; padding: var(--s-2) 0; } }
.progress__step:last-child { border-bottom: 0; }
.progress__mark { position: relative; grid-row: 1 / span 2; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px dashed var(--rule-strong); }
.progress__step.is-done .progress__mark { border: 0; background: var(--ink-2); }
.progress__step.is-done .progress__mark::after { content: ""; position: absolute; left: 0.47rem; top: 0.25rem; width: 0.38rem; height: 0.7rem;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.progress__label { font-weight: 600; color: var(--ink-2); }
.progress__step.is-done .progress__label { color: var(--ink); }
.progress__when { grid-column: 2; color: var(--ink-3); font-size: 1rem; }
@media (min-width: 30rem) { .progress__mark { grid-row: auto; } .progress__when { grid-column: 3; text-align: right; } }
.order-section { margin-top: var(--s-4); }
.order-upsell { margin: var(--s-6) 0 var(--s-4); color: var(--ink-2); }
.order-fine { margin-top: var(--s-5); }
.order-proof-tools { margin-top: var(--s-3); }
.order-proof-tools form { margin: 0; }

/* Rows inside a card: a thing, its date, and what you can do with it. */
.rows { list-style: none; margin: 0 0 var(--s-3); padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); align-items: center; justify-content: space-between; padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.rows > li:first-child { padding-top: var(--s-1); }
.rows > li:last-child { border-bottom: 0; }
.rows .row-main { min-width: 0; flex: 1 1 16rem; }
.rows .row-title { font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.row-meta { margin: 0; font-size: 1rem; color: var(--ink-3); }
.row-code { font-weight: 400; color: var(--ink-3); }
.share-url { font-size: 1rem; word-break: break-all; background: var(--paper-2); border-radius: var(--radius-small); padding: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.inline-actions { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); align-items: center; }
.inline-actions > a, .rows .inline-actions a, .rows > li > a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.inline-actions > .more { flex: 1 1 100%; }
.fee { font-weight: 700; }

/* The list of orders: one card each, the whole card is the link. */
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.order-list__item { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.order-list__link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem var(--s-3); padding: var(--s-4); color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.order-list__link:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.order-list__link:hover .order-list__title { text-decoration: underline; text-underline-offset: 0.18em; }
.order-list__link > * { grid-column: 1; }
.order-list__link > svg { grid-column: 2; grid-row: 1 / span 4; align-self: center; width: 1.25rem; height: 1.25rem; color: var(--ink-2); }
.order-list__title { font-weight: 700; font-size: var(--step-1); }
.order-list__carrier { color: var(--ink-2); }
.order-list__meta { color: var(--ink-3); font-size: 1rem; }
.order-list__state { margin: 0.1rem 0 var(--s-1); }
.order-list__carrier .usdot .num { font-weight: 400; color: inherit; }
.order-list__demo { margin: 0; padding: 0 var(--s-4) var(--s-3); }

/* ---------- Choosing violations and answering ---------- */
.pick { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-4); margin: 0 0 var(--s-3); background: var(--paper); }
.pick:has(input:checked) { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.pick .field-check { margin-bottom: 0; }
.pick legend, .pick .pick__title { font-weight: 700; font-size: var(--step-0); }
.pick__meta { margin: 0 0 var(--s-2); color: var(--ink-3); font-size: 1rem; }
.pick.is-off { background: var(--paper-2); }
.pick .outlook { margin-bottom: var(--s-2); }
.pick .outlook > p:not(.outlook__head) { margin: var(--s-2) 0 0; font-size: 1rem; color: var(--ink-2); }   /* the read's last word, set like its reasons */
fieldset.pick { padding-top: var(--s-4); }
.intake-form fieldset.pick { margin-bottom: var(--s-5); border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: var(--s-4) 0 0; background: none; box-shadow: none; }
.intake-go { display: grid; gap: var(--s-3); max-width: none; }
.intake-go .button { width: 100%; }
.intake-cancel { display: block; margin-top: var(--s-2); }
.intake-cancel .button { text-align: left; }
.chosen { list-style: none; margin: 0 0 var(--s-4); display: grid; gap: var(--s-2); }
.chosen li { display: grid; gap: 0.1rem; padding-bottom: var(--s-2); border-bottom: 1px solid var(--rule); }
.chosen li:last-child { border-bottom: 0; padding-bottom: 0; }
.chosen__fee { color: var(--ink-2); }

/* ---------- The Proof File a broker opens: plainly from the carrier, quiet and dated ---------- */
.proof-head { margin-bottom: var(--s-5); }
.proof-head h1 { margin-bottom: var(--s-2); }
.proof-head__from { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0 0 var(--s-2); color: var(--ink-2); font-weight: 600; }
.proof-head__from svg { width: 1.2rem; height: 1.2rem; }
.proof-head__ids { margin: 0 0 var(--s-2); color: var(--ink-2); }
.proof-head__private { margin: 0 0 var(--s-4); color: var(--ink-2); max-width: var(--measure); }
.proof .specimen { margin-bottom: var(--s-4); }
.proof-files { margin-bottom: var(--s-4); }

/* ---------- Staff desk: dense, never cluttered ---------- */
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5) var(--s-6); margin-top: var(--s-6); }
.desk-grid > * { min-width: 0; }
@media (min-width: 70rem) { .desk-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.desk-quality { margin: var(--s-5) 0; }
.desk-payment, .desk-note { margin-bottom: var(--s-3); padding: var(--s-4); }
.desk-note p { margin-bottom: var(--s-1); }
/* Results and fees: one ruled row per item, its facts on the left and the one form for it on the right. */
.desk-items > li { align-items: flex-start; padding: var(--s-4) 0; }
.desk-item-facts { display: flex; flex-wrap: wrap; gap: 0.2rem var(--s-5); margin: var(--s-2) 0 0; }
.desk-item-facts > div { display: flex; gap: 0.4rem; align-items: baseline; }
.desk-item-facts dt { font-weight: 700; color: var(--ink-2); font-size: 0.95rem; }
.desk-item-facts dd { margin: 0; }
.desk-item-action { flex: 1 1 15rem; max-width: 22rem; }
.desk-item-action .stack > * + * { margin-top: var(--s-2); }
.desk-item-action label { font-weight: 700; font-size: 0.95rem; }
.desk-task-action input { min-height: 44px; }
.draft { margin-bottom: var(--s-4); }
.draft > summary { min-height: 44px; padding: var(--s-2) 0; }
.draft textarea { font-family: var(--font-mono); font-size: 0.9rem; min-height: 26rem; width: 100%; }
.draft-preview { border: 1px solid var(--rule); border-radius: var(--radius-small); padding: var(--s-4); background: var(--paper); max-height: 34rem; overflow: auto; }
.problems { margin: 0 0 var(--s-3); padding-left: 1.2rem; }
/* Filters as a row of tabs: the current one in blue, every one a 44px target. */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.filters a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--rule-strong);
  border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 1rem; text-decoration: none; background: var(--paper); }
.filters a:hover { border-color: var(--ink-2); background: var(--paper-2); color: var(--ink); }
.filters a[aria-current] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.intake-answers dt { font-weight: 700; }
.intake-answers dd { margin: 0 0 var(--s-3); white-space: pre-line; }

@media print {
  .doc-actions, .no-print, .work > .back, .proof-files { display: none !important; }
  .doc-sheet { border: 0; box-shadow: none; padding: 0; }
  /* A document's links already print their address as their words: no second copy in brackets. */
  .doc a[href^="http"]::after { content: none; }
  .doc h2, .doc h3 { break-after: avoid; }
  .doc li, .doc-facts > div, .doc-note { break-inside: avoid; }
}

/* The owner's confirm screen: long labels and the chosen option's full words wrap on a phone (390px). */
.confirm-group { min-width: 0; min-inline-size: 0; }   /* a fieldset grows to its widest control unless told not to */
.confirm-group legend { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
/* The paper (or the violation) is the group's heading; each thing read from it is a quieter label under it. */
.confirm-group > legend { font-size: var(--step-1); font-weight: 700; margin-bottom: var(--s-3); }
.confirm-group .field label { font-weight: 600; }
.confirm-group select, .confirm-group input:not([type="checkbox"]):not([type="radio"]) { width: 100%; max-width: 100%; min-width: 0; }
.confirm-group label, .confirm-chosen { overflow-wrap: anywhere; }

/* ---------- Filing it in DataQs (/orders/{id}/file): one card per DataQs screen, a copy button per value ---------- */
.dq p, .dq li { overflow-wrap: anywhere; }
.dq-jump ul { margin: 0; padding-left: 1.2rem; }
.dq-jump li { margin-bottom: 0.3rem; }
.dq-request { margin-top: var(--s-6); }
.dq-request > h2 { font-size: var(--step-2); margin: 0 0 var(--s-1); }
.dq-what { margin: 0 0 var(--s-1); font-weight: 650; }
.dq-steps { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.dq-step { min-width: 0; }
.dq-step h3 { font-size: var(--step-1); margin: 0 0 var(--s-1); }
.dq-step h4 { font-size: var(--step-0); margin: var(--s-4) 0 var(--s-2); }
.dq-screen { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: 1rem; }
.dq-copy { margin: var(--s-3) 0; min-width: 0; }
.dq-label { margin: 0 0 var(--s-1); }
.dq-field { font-weight: 700; }
.dq-meaning { color: var(--ink-2); }
.dq-value { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; min-width: 0; }
.dq-value code { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; padding: 0.55rem 0.7rem;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius-small); font-size: 1rem; }
.dq-copy-btn.is-done { border-color: var(--good); }
.dq-box { display: block; width: 100%; max-width: 100%; min-height: 12rem; padding: 0.6rem 0.7rem; font: inherit;
  font-size: 1rem; line-height: 1.5; border: 1px solid var(--border-strong); border-radius: var(--radius-small);
  background: var(--paper); color: var(--ink); resize: vertical; }
.dq-count { margin: var(--s-1) 0 var(--s-2); font-weight: 600; color: var(--ink-2); }
.dq-count.is-over { color: var(--bad); }
.dq-gap { margin: var(--s-3) 0; padding: var(--s-2) var(--s-3); border-left: 3px solid var(--caution-edge);
  background: var(--caution-wash); border-radius: var(--radius-small); }
.dq-src { margin: var(--s-3) 0 0; font-size: 0.95rem; color: var(--ink-3); }
.dq-files { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.dq-file { border-top: 1px solid var(--rule); padding-top: var(--s-3); min-width: 0; }
.dq-file__head { margin: 0 0 var(--s-1); }
.dq-download { font-weight: 650; overflow-wrap: anywhere; }
.dq-first > summary { margin-top: var(--s-2); }
