:root {
  --navy: #263E56;
  --navy-2: #3a5674;
  --amber: #F3A40B;
  --amber-soft: #fff5df;
  --bg: #F6F6F6;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #263E56;
  --muted: #5f6b7a;
  --ok: #1f8a4c; --ok-soft: #e6f6ec;
  --warn: #8a5a00; --warn-soft: #fff4e0;
  --bad: #b42318; --bad-soft: #fde8e7;
  --info: #1d5fa8; --info-soft: #e7f0fb;
  --radius: 14px;
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 20px; padding-bottom: 48px; outline: none; }
[hidden] { display: none !important; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 17px; margin: 0; }
a { color: var(--navy); }
.lead { margin: 0 0 4px; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { height: 52px; width: auto; display: block; }
.secure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; }
.center { text-align: center; }
.intro { margin: 4px 2px 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px; border-radius: 12px; border: 0; font: 600 16px var(--font); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.btn.block { width: 100%; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:active { background: var(--navy-2); }
.btn.secondary { background: var(--amber-soft); color: var(--navy); border: 1px solid #f1d9a6; }
.btn.link { background: none; color: var(--navy); min-height: 44px; text-decoration: underline; width: 100%; margin-top: 6px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, .upload-label:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }
.upload-label { margin: 12px 0 0; }
input[inputmode="numeric"] { width: 100%; font: 600 26px/1 var(--font); letter-spacing: 10px; text-align: center; padding: 14px; border: 2px solid var(--border); border-radius: 12px; color: var(--navy); }
.field-error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
form .btn { margin-top: 16px; }

.progress-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.progress-text { font-weight: 700; white-space: nowrap; }
.bar { height: 10px; background: #eceef1; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--amber); border-radius: 99px; transition: width .4s ease; }
.progress-card p { margin: 10px 0 0; }

.section-title { margin: 22px 2px 10px; }
.requests { list-style: none; margin: 0; padding: 0; }
.req-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.req-meta { margin: 2px 0 0; }
.req-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }

.chip { flex: none; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.chip.s-fehlt { background: #eef0f3; color: #4b5563; }
.chip.s-hochgeladen, .chip.s-pruefung { background: var(--info-soft); color: var(--info); }
.chip.s-akzeptiert { background: var(--ok-soft); color: var(--ok); }
.chip.s-nachforderung { background: var(--bad-soft); color: var(--bad); }
.chip.s-entfaellt { background: #f1f1f1; color: #6b7280; }

.files { list-style: none; margin: 12px 0 0; padding: 0; }
.files li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--border); }
.files .fname { overflow-wrap: anywhere; }
.files .fstate { color: var(--muted); white-space: nowrap; }
.files .fstate.bad { color: var(--bad); }
.files .fstate.ok { color: var(--ok); }

.queue:empty { display: none; }
.queue { margin-top: 10px; }
.qitem { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #f7f8fa; margin-top: 8px; font-size: 14px; }
.qitem .qname { overflow-wrap: anywhere; }
.qitem .qstate { font-weight: 600; white-space: nowrap; }
.qitem .qbar { grid-column: 1 / -1; height: 6px; background: #e4e7eb; border-radius: 99px; overflow: hidden; }
.qitem .qbar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .2s; }
.qitem.ok { background: var(--ok-soft); } .qitem.ok .qstate { color: var(--ok); } .qitem.ok .qbar { display: none; }
.qitem.bad { background: var(--bad-soft); } .qitem.bad .qstate { color: var(--bad); } .qitem.bad .qbar { display: none; }
.qitem .qmsg { grid-column: 1 / -1; color: var(--bad); }
.qitem .retry { grid-column: 1 / -1; min-height: 44px; background: #fff; border: 1px solid var(--bad); color: var(--bad); }

.done-card { margin-top: 20px; }
.done-card p { margin: 10px 0 0; text-align: center; }
.foot { margin: 22px 2px 0; }

.spinner { width: 34px; height: 34px; margin: 10px auto 12px; border: 3px solid #e3e6ea; border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .bar > span { transition: none; } }
@media (min-width: 640px) { main { padding-top: 32px; } h1 { font-size: 28px; } }
.test-hint { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
