/* E-invoice checker and viewer (einvoice_checks/*; DESIGN.md, mode Operate): the upload form, the
   verdict and the invoice laid out like a statement. Tokens, fields, panels and the FAQ come from
   site.css. The verdict, the messages and the invoice also serve the inbox in the app shell
   (shared/einvoices/*), with the shell's tokens. The verdict is a pip and a heading, never a tinted band or a thick coloured edge. */

/* Upload */
body.site .checker-form { margin: 24px 0; }
body.site .checker-form-title { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.015em; }
body.site .checker-drop {
  padding: 20px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--field);
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}
body.site .checker-drop:hover { border-color: var(--text-3); }
body.site .checker-drop:focus-within { border-color: var(--ink); }
body.site .checker-drop.is-over { border-style: solid; border-color: var(--ink); background: var(--yellow-wash); }
body.site .checker-form .checker-drop label { margin-top: 0; font-size: 15px; font-weight: 800; }
body.site .checker-hint { margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
body.site .checker-drop input[type="file"] {
  display: block; width: 100%; padding: 8px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper);
  color: var(--text-2); font: inherit; font-size: 15px; cursor: pointer;
}
body.site .checker-drop input[type="file"]::file-selector-button {
  margin-right: 14px; min-height: 40px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 750; cursor: pointer;
}
body.site .checker-drop input[type="file"]:hover::file-selector-button { background: var(--field); }
body.site .checker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 18px; }
body.site .checker-busy { margin: 0; color: var(--text-2); font-weight: 600; }
body.site .checker-muted { margin: 14px 0 0; color: var(--text-3); font-size: 14px; line-height: 1.5; }

/* Verdict */
:is(body.site, .shell) .checker-result { margin: 24px 0; }
:is(body.site, .shell) .checker-verdict { position: relative; }
:is(body.site, .shell) .checker-kicker { margin: 0 0 4px; color: var(--text-2); font-size: 14px; font-weight: 700; }
:is(body.site, .shell) .checker-verdict h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
:is(body.site, .shell) .checker-verdict h2::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); }
:is(body.site, .shell) .checker-verdict--valid h2::before { background: var(--green); box-shadow: 0 0 0 5px var(--green-wash); }
:is(body.site, .shell) .checker-verdict--warnings h2::before { background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-wash); }
:is(body.site, .shell) .checker-verdict--invalid h2::before { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-wash); }
:is(body.site, .shell) .checker-verdict--valid .checker-status { color: var(--green-ink); }
:is(body.site, .shell) .checker-verdict--warnings .checker-status { color: var(--ink); }
:is(body.site, .shell) .checker-verdict--invalid .checker-status, :is(body.site, .shell) .checker-verdict--invalid h2 { color: var(--danger-ink); }
:is(body.site, .shell) .checker-verdict > p { max-width: 68ch; }
:is(body.site, .shell) .checker-verdict .error, :is(body.site, .shell) .checker-facts .error { color: var(--danger-ink); font-weight: 650; }
:is(body.site, .shell) .checker-facts .ok { color: var(--green-ink); font-weight: 650; }
:is(body.site, .shell) .checker-note { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--field); font-weight: 600; }
:is(body.site, .shell) .checker-code { padding: 1px 6px; border-radius: 6px; background: var(--field); color: var(--ink); font: 500 0.85em/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* Label/value lists: the facts about the file, the invoice header, the parties */
:is(body.site, .shell) .checker-facts, :is(body.site, .shell) .checker-pairs { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 0 20px; margin: 18px 0; }
:is(body.site, .shell) .checker-facts dt, :is(body.site, .shell) .checker-pairs dt { padding: 7px 0; border-top: 1px solid var(--line); color: var(--text-2); font-size: 14px; font-weight: 600; }
:is(body.site, .shell) .checker-facts dd, :is(body.site, .shell) .checker-pairs dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
:is(body.site, .shell) .checker-pairs .checker-full { grid-column: 1 / -1; }

/* Messages */
:is(body.site, .shell) .checker-messages-title { margin: 28px 0 8px; font-size: 1.05rem; font-weight: 800; }
:is(body.site, .shell) .checker-messages-title--error { color: var(--danger-ink); }
:is(body.site, .shell) .checker-messages-title--warning { color: var(--ink); }
:is(body.site, .shell) .checker-messages { font-size: 14.5px; }
:is(body.site, .shell) .checker-messages td { overflow-wrap: anywhere; }
:is(body.site, .shell) .checker-messages td:first-child { white-space: nowrap; }

/* The invoice, laid out like the printed one */
:is(body.site, .shell) .checker-invoice { margin-top: 20px; }
:is(body.site, .shell) .checker-invoice h2 { margin: 0 0 14px; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.015em; overflow-wrap: anywhere; }
:is(body.site, .shell) .checker-invoice h3 { margin: 28px 0 10px; font-size: 1.05rem; font-weight: 800; }
:is(body.site, .shell) .checker-invoice table { font-size: 14.5px; }
:is(body.site, .shell) .checker-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 28px; }
:is(body.site, .shell) .checker-party p { margin: 0 0 8px; overflow-wrap: anywhere; }
:is(body.site, .shell) .checker-sub { display: block; color: var(--text-2); font-size: 13.5px; }
:is(body.site, .shell) .checker-item { overflow-wrap: anywhere; }
:is(body.site, .shell) .checker-invoice td.num { white-space: nowrap; }
:is(body.site, .shell) .checker-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 0 28px; }
:is(body.site, .shell) .checker-totals th { color: var(--text-2); font-weight: 500; }
:is(body.site, .shell) .checker-payable th, :is(body.site, .shell) .checker-payable td { border-top: 1.5px solid var(--ink); color: var(--ink); font-weight: 800; }
:is(body.site, .shell) .checker-pre { white-space: pre-line; overflow-wrap: anywhere; }
:is(body.site, .shell) abbr[title] { text-decoration: none; }

/* Explainer, FAQ, privacy */
body.site .checker-info, body.site .checker-faq, body.site .checker-privacy { max-width: 70ch; margin-top: 72px; }
body.site .checker-info h2:first-child, body.site .checker-faq h2, body.site .checker-privacy h2 { margin-top: 0; }
body.site .checker-info p, body.site .checker-info li { line-height: 1.7; }
body.site .checker-faq details { border-top: 1px solid var(--line-2); }
body.site .checker-faq details:last-of-type { border-bottom: 1px solid var(--line-2); }
body.site .checker-faq summary {
  position: relative; display: block; padding: 18px 44px 18px 0; list-style: none; cursor: pointer;
  color: var(--ink); font-size: 1.05rem; font-weight: 750; line-height: 1.4;
}
body.site .checker-faq summary::-webkit-details-marker { display: none; }
body.site .checker-faq summary::before, body.site .checker-faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 14px; height: 2px; border-radius: 1px; background: var(--ink); transition: transform 0.2s var(--ease); }
body.site .checker-faq summary::after { transform: rotate(90deg); }
body.site .checker-faq details[open] summary::after { transform: rotate(0deg); }
body.site .checker-faq details p { max-width: 64ch; margin: 0; padding: 0 0 22px; color: var(--text-2); line-height: 1.65; }
body.site .checker-privacy { padding-top: 18px; border-top: 1.5px solid var(--ink); }

/* Tables become stacked label/value rows on narrow screens. */
@media (max-width: 640px) {
  :is(body.site, .shell) .checker-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(body.site, .shell) .checker-stack, :is(body.site, .shell) .checker-stack tbody, :is(body.site, .shell) .checker-stack tr, :is(body.site, .shell) .checker-stack td { display: block; width: 100%; }
  :is(body.site, .shell) .checker-stack tr { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  :is(body.site, .shell) .checker-stack td { padding: 2px 0; border: 0; text-align: left; }
  :is(body.site, .shell) .checker-stack td.num { text-align: left; white-space: normal; }
  :is(body.site, .shell) .checker-stack td::before { content: attr(data-label); display: block; color: var(--text-3); font-size: 12.5px; font-weight: 700; }
  :is(body.site, .shell) .checker-messages td:first-child { white-space: normal; }
  :is(body.site, .shell) .checker-facts, :is(body.site, .shell) .checker-pairs { grid-template-columns: minmax(0, 1fr); }
  :is(body.site, .shell) .checker-facts dt, :is(body.site, .shell) .checker-pairs dt { padding-bottom: 0; }
  :is(body.site, .shell) .checker-facts dd, :is(body.site, .shell) .checker-pairs dd { padding-top: 2px; border-top: 0; }
  body.site .checker-drop { padding: 14px; }
  body.site .checker-actions .button { flex: 1 1 100%; }
}
