/* ============================================================================
   ERIT XRechnung-Viewer: result and drop-zone styles (Petrol, D-71)
   ----------------------------------------------------------------------------
   Used by /xrechnung-viewer.html (linked in its head) and by the home page's
   viewer panel (loaded by motion.js together with viewer.js). The markup comes
   from site/viewer.js; the embed iframe has its own small sheet
   (site/embed/viewer.css) because it must not depend on this site.

   Status keeps its shape (styles.css): a passed check is the filled circle,
   a missing field the triangle. The words stay in the markup for every reader.
   ============================================================================ */

/* ------------------------------------------------------- the page's drop zone */
.v-drop {
  max-width: 46rem; margin: 36px auto 0; padding: 44px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--r-xl); background: var(--surface);
  transition: border-color .3s var(--ease), background-color .3s var(--ease), transform .3s var(--ease);
}
.v-drop:hover { border-color: var(--brand); }
.v-drop.over { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.v-drop:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.v-drop > svg { width: 34px; height: 34px; color: var(--brand); transition: transform .3s var(--ease); }
.v-drop.over > svg { transform: translateY(-4px); }
.v-drop h2 { font-size: clamp(1.375rem, 1.2rem + .7vw, 1.75rem); margin-top: 4px; }
.v-drop p { font-size: var(--fs-sm); color: var(--muted); }
.v-drop .btn { margin-top: 8px; }
.v-privacy { max-width: 46rem; margin: 16px auto 0; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: var(--fs-sm); color: var(--muted); }
.v-privacy svg { width: 15px; height: 15px; color: var(--brand); }
[data-v="filename"] { margin-top: 6px; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .v-drop, .v-drop > svg { transition: none; } }

/* ----------------------------------------------------------------- result */
[data-erit-viewer="page"] [data-v="result"] { max-width: 52rem; margin: 36px auto 0; }
[data-v="result"] { animation: rise .4s var(--ease) both; }
.v-head {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: 18px; border-bottom: 2px solid var(--ink);
}
.v-badge {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  background: var(--brand-soft); color: var(--brand);
}
.v-badge.alt { background: var(--surface-2); color: var(--muted); }
.v-status {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; overflow-wrap: anywhere;
}
.v-status::before { content: ""; flex: 0 0 auto; width: 14px; height: 14px; background: currentColor; }
.v-status.ok { background: var(--ok-soft); color: var(--ok); animation: pop .35s var(--ease) both; }
.v-status.ok::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 110 14A7 7 0 018 1zm3.2 4.7L6.9 10.3 4.8 8.2l-1 1 3.1 3.1 5.3-5.6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 110 14A7 7 0 018 1zm3.2 4.7L6.9 10.3 4.8 8.2l-1 1 3.1 3.1 5.3-5.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.v-status.warn, .v-status.bad { background: var(--err-soft); color: var(--err); }
.v-status.warn::before, .v-status.bad::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1.2l7 13.3H1zM7.1 6v4h1.8V6zm.9 5.3a.95.95 0 100 1.9.95.95 0 000-1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1.2l7 13.3H1zM7.1 6v4h1.8V6zm.9 5.3a.95.95 0 100 1.9.95.95 0 000-1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.v-warn {
  margin-bottom: 18px; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--warn-soft); color: var(--ink); font-size: var(--fs-sm);
}

.v-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
@media (max-width: 760px) { .v-grid { grid-template-columns: minmax(0, 1fr); } }
.v-column { padding: 12px 0 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.v-column h3 {
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.v-column dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: var(--fs-sm); }
.v-column dt { color: var(--muted); }
.v-column dd { margin: 0; overflow-wrap: anywhere; }

.v-h { margin: 28px 0 10px; font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem); }
.v-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.v-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.v-table th {
  text-align: left; padding: 9px 12px; background: var(--surface-2); white-space: nowrap;
  font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.v-table td { padding: 9px 12px; border-top: 1px solid var(--line); }
.v-table .num, .v-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.v-totals { margin-top: 16px; margin-left: auto; max-width: 340px; display: grid; gap: 6px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.v-totals div { display: flex; justify-content: space-between; gap: 20px; }
.v-totals span { color: var(--muted); }
.v-totals .grand { border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; align-items: baseline; }
.v-totals .grand span { color: var(--ink); font-weight: 600; }
.v-totals .grand strong { font-family: var(--font-serif); font-weight: 600; font-size: 1.75rem; line-height: 1; }

.v-checks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.v-checks li { display: flex; align-items: baseline; gap: 10px; }
.v-checks li::before {
  content: ""; content: "" / "OK"; flex: 0 0 auto; width: 13px; height: 13px; transform: translateY(2px);
  background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 110 14A7 7 0 018 1zm3.2 4.7L6.9 10.3 4.8 8.2l-1 1 3.1 3.1 5.3-5.6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 110 14A7 7 0 018 1zm3.2 4.7L6.9 10.3 4.8 8.2l-1 1 3.1 3.1 5.3-5.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.v-checks li.bad { font-weight: 500; }
.v-checks li.bad::before {
  content: ""; content: "" / "Fehlt"; background: var(--err);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1.2l7 13.3H1zM7.1 6v4h1.8V6zm.9 5.3a.95.95 0 100 1.9.95.95 0 000-1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1.2l7 13.3H1zM7.1 6v4h1.8V6zm.9 5.3a.95.95 0 100 1.9.95.95 0 000-1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.v-checks .bt { flex: 0 0 auto; min-width: 5.4em; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); font-weight: 400; }
.v-detail { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; color: var(--muted); }
[data-v="result"] .v-note { margin-top: 14px; font-size: var(--fs-sm); color: var(--muted); }
[data-v="result"] > div > p, [data-v="result"] > p { margin-top: 10px; line-height: 1.6; }

.v-draft { margin-top: 10px; }
.v-draft pre {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; padding: 16px 18px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.v-next-cta { margin-top: 14px; }
.v-next-cta a { white-space: normal; max-width: 100%; }
[data-v="report"] { margin-top: 16px; }

[data-v="raw-wrap"] { max-width: 52rem; margin: 22px auto 0; }
[data-v="raw"] {
  max-height: 340px; overflow: auto; margin-top: 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  font-family: var(--font-mono); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) { [data-v="result"], .v-status.ok { animation: none; } }

/* Inside the home page's panel the result is narrower: one column, no margins. */
.drop-viewer [data-v="result"] { margin: 0; }
.drop-viewer .v-grid { grid-template-columns: minmax(0, 1fr); }
.drop-viewer [data-v="raw-wrap"] { margin: 12px 0 0; }
