/* Kiste – Gestaltung
   Leitidee: ein Lager mit beschrifteten Kisten. Die Download-Seite trägt einen Frachtzettel
   (Absender = Bereitsteller, Inhalt = Werk, Urheber und Lizenz), alles andere bleibt ruhig.
   Schrift: Archivo (variable Breite) – breit für Überschriften, schmal für Feldnamen. Mono nur für Prüfsummen. */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-wdth-italic.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-700.woff2") format("woff2");
  font-weight: 700; font-display: swap; }

:root {
  --paper: #eef1f4;
  --stock: #ffffff;
  --ink: #17212b;
  --muted: #566573;
  --rule: #c9d1da;
  --rule-soft: #dfe4ea;
  --signal: #f5b700;
  --signal-ink: #17212b;
  --link: #1f4fd1;
  --ok: #1b7a4b;
  --ok-bg: #e3f3ea;
  --warn: #9a5b00;
  --warn-bg: #fff3d6;
  --bad: #c42b3a;
  --bad-bg: #fbe5e7;
  --focus: #1f4fd1;
  --shadow: 0 1px 0 rgba(23, 33, 43, .08), 0 8px 24px -12px rgba(23, 33, 43, .28);
  --wide: 112%;
  --narrow: 78%;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12181f; --stock: #1b232d; --ink: #e6ebf0; --muted: #9aa8b5; --rule: #34404c; --rule-soft: #26303a;
    --link: #93b4ff; --ok: #5fd39a; --ok-bg: #173327; --warn: #f0b955; --warn-bg: #3a2c12; --bad: #ff7d88;
    --bad-bg: #3e1d22; --focus: #93b4ff; --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 "Archivo", system-ui, sans-serif; font-stretch: 100%;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-stretch: var(--wide); line-height: 1.1; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: var(--mono); font-size: .88em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow-wrap { width: min(760px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Kopf und Fuß ------------------------------------------------------------------------------------- */
.top { border-bottom: 1px solid var(--rule); background: var(--stock); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-weight: 800; font-stretch: 118%; font-size: 1.3rem; letter-spacing: -.01em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo small { font-weight: 500; font-stretch: var(--narrow); font-size: .9rem; color: var(--muted); letter-spacing: 0; }
.top nav { display: flex; gap: 18px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 550; }
.top nav a:hover, .top nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.top nav form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 550; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
footer { margin-top: 64px; border-top: 1px solid var(--rule); padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* --- Hinweise ----------------------------------------------------------------------------------------- */
.notice { border-left: 4px solid var(--ok); background: var(--ok-bg); padding: 10px 14px; margin: 16px 0; border-radius: 0 4px 4px 0; }
.notice.fehler { border-color: var(--bad); background: var(--bad-bg); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
.notice.info { border-color: var(--rule); background: var(--stock); }
.notice p:last-child { margin: 0; }

/* --- Knöpfe und Formulare ----------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px;
  border: 2px solid var(--ink); border-radius: 4px; background: var(--stock); color: var(--ink); font: 650 .97rem/1.1 "Archivo";
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--rule-soft); text-decoration: none; }
.btn.primary { background: var(--signal); color: var(--signal-ink); border-color: var(--signal-ink); }
.btn.primary:hover { background: #ffc828; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.quiet { border-color: var(--rule); font-weight: 550; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .9rem; border-width: 1.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.field { display: block; }
.field > span, .label { display: block; font-weight: 650; font-stretch: var(--narrow); font-size: .95rem; margin-bottom: 5px; }
.field .hint, .hint { display: block; color: var(--muted); font-size: .86rem; font-weight: 400; font-stretch: 100%; margin-top: 4px; }
.req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=date],
input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--stock); border: 1.5px solid var(--rule);
  border-radius: 4px; padding: 9px 11px; min-height: 42px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 260px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; gap: 6px; align-items: center; border: 1.5px solid var(--rule); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; background: var(--stock); font-size: .93rem; }
.chips input { accent-color: var(--ink); margin: 0; }
.chips label:has(input:checked) { border-color: var(--ink); background: var(--rule-soft); font-weight: 600; }
.radios { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; border: 1.5px solid var(--rule); border-radius: 6px; padding: 12px 14px; cursor: pointer; background: var(--stock); }
.radio-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--signal); }
.radio-card input { accent-color: var(--ink); width: 18px; height: 18px; margin-top: 3px; flex: none; }
.radio-card b { display: block; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* --- Startseite: das Regal ---------------------------------------------------------------------------- */
.hero { padding: 48px 0 28px; }
.hero h1 { font-size: clamp(2.2rem, 1.2rem + 4.4vw, 4.4rem); font-stretch: 122%; font-weight: 850; letter-spacing: -.025em;
  max-width: 15ch; margin-bottom: 14px; }
.hero p { max-width: 60ch; font-size: 1.12rem; color: var(--muted); }
.searchbar { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; margin-top: 24px; }
.searchbar input[type=search] { min-height: 50px; font-size: 1.08rem; border: 2px solid var(--ink); }
.searchbar select { min-height: 50px; width: auto; }
.searchbar .btn { min-height: 50px; }
@media (max-width: 760px) { .searchbar { grid-template-columns: 1fr 1fr; } .searchbar input[type=search] { grid-column: 1 / -1; } }

.shelf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .shelf-layout { grid-template-columns: 1fr; } }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--ink);
  padding-bottom: 8px; margin-bottom: 0; flex-wrap: wrap; }
.shelf-head h2 { margin: 0; }
.shelf { list-style: none; margin: 0; padding: 0; }
.crate { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px 18px; padding: 18px 0;
  border-bottom: 1px solid var(--rule); align-items: start; }
.crate-mark { grid-row: span 2; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--rule-soft);
  display: grid; place-items: center; border: 1px solid var(--rule); }
.crate-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crate-mark svg { width: 30px; height: 30px; color: var(--muted); }
.crate h3 { margin: 0; font-size: 1.2rem; font-stretch: 110%; }
.crate h3 a { color: var(--ink); text-decoration: none; }
.crate h3 a:hover { text-decoration: underline; }
.crate .ver { font-weight: 500; color: var(--muted); font-stretch: 100%; font-size: .95rem; margin-left: 6px; }
.crate p { margin: 2px 0 0; color: var(--muted); max-width: 70ch; }
.crate .facts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); font-stretch: 90%; }
.crate .facts b { color: var(--ink); font-weight: 600; }
.crate .go { grid-row: span 2; align-self: center; }
@media (max-width: 640px) {
  .crate { grid-template-columns: 48px minmax(0, 1fr); }
  .crate-mark { width: 48px; height: 48px; }
  .crate .go { grid-column: 2; grid-row: auto; justify-self: start; }
}
.tag { display: inline-block; padding: 1px 8px; border-radius: 3px; background: var(--rule-soft); color: var(--ink);
  font-size: .82rem; font-weight: 600; font-stretch: var(--narrow); }
.tag.lock { background: var(--ink); color: var(--paper); }
.side h2 { font-size: 1rem; font-stretch: var(--narrow); font-weight: 700; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.side ul { list-style: none; padding: 0; margin: 0 0 28px; }
.side li a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft);
  color: var(--ink); text-decoration: none; }
.side li a:hover span:first-child, .side li a[aria-current] span:first-child { text-decoration: underline; }
.side li a span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 40px 0; text-align: left; }
.empty h3 { font-size: 1.3rem; }

/* --- Download-Seite ----------------------------------------------------------------------------------- */
.crumbs { font-size: .9rem; color: var(--muted); margin: 24px 0 6px; }
.crumbs a { color: var(--muted); }
.dl-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; padding: 8px 0 24px; }
.dl-head h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.5rem); font-stretch: 120%; font-weight: 850; letter-spacing: -.02em; margin: 0; }
.dl-head .version { display: inline-block; margin-top: 10px; font-weight: 600; font-stretch: var(--narrow); font-size: 1.05rem;
  border: 2px solid var(--ink); padding: 2px 10px; border-radius: 3px; }
.dl-head .summary { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 12px 0 0; }
@media (max-width: 720px) { .dl-head { grid-template-columns: 1fr; } }
.dl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
@media (max-width: 980px) { .dl-layout { grid-template-columns: 1fr; } .waybill-wrap { order: -1; } }

/* Der Frachtzettel */
.waybill-wrap { position: sticky; top: 16px; }
@media (max-width: 980px) { .waybill-wrap { position: static; } }
.waybill { background: var(--stock); border: 2px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.waybill-band { background: var(--signal); color: var(--signal-ink); display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-bottom: 2px solid var(--ink); font-weight: 800; font-stretch: 120%; }
.waybill-band span:last-child { font-weight: 600; font-stretch: var(--narrow); font-size: .9rem; }
.waybill-grid { display: grid; grid-template-columns: 1fr 1fr; }
.wb { padding: 9px 14px 10px; border-bottom: 1px solid var(--rule); min-width: 0; }
.wb:nth-child(odd):not(.full) { border-right: 1px solid var(--rule); }
.wb.full { grid-column: 1 / -1; }
.wb dt { font-stretch: var(--narrow); font-weight: 600; font-size: .8rem; color: var(--muted); margin: 0 0 1px; }
.wb dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.wb dd a { font-weight: 600; }
.wb dd .sub { display: block; font-weight: 400; color: var(--muted); font-size: .86rem; }
.waybill-files { padding: 14px; display: grid; gap: 10px; }
.dlbtn { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px;
  border: 2px solid var(--signal-ink); border-radius: 5px; background: var(--signal); color: var(--signal-ink); text-decoration: none; }
.dlbtn:hover { background: #ffc828; text-decoration: none; }
.dlbtn svg { grid-row: span 2; width: 26px; height: 26px; }
.dlbtn b { font-weight: 750; overflow-wrap: anywhere; }
.dlbtn small { font-size: .85rem; font-stretch: 90%; }
.dlbtn.secondary { background: var(--stock); border-color: var(--ink); color: var(--ink); }
.dlbtn.secondary:hover { background: var(--rule-soft); }
.dlbtn.off { background: var(--rule-soft); border-color: var(--rule); color: var(--muted); pointer-events: none; }
.fingerprint { display: block; width: 100%; height: 34px; color: var(--ink); }
.waybill-foot { border-top: 2px dashed var(--rule); padding: 12px 14px 14px; font-size: .86rem; color: var(--muted); }
.waybill-foot p { margin: 0 0 8px; }
.gate { padding: 16px 14px; display: grid; gap: 10px; }
.gate p { margin: 0; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose pre { background: var(--stock); border: 1px solid var(--rule); border-radius: 4px; padding: 12px 14px; overflow-x: auto; font-size: .9rem; }
.prose code { background: var(--rule-soft); padding: 1px 5px; border-radius: 3px; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid var(--rule); color: var(--muted); }
.prose img { max-width: 100%; }
.section { margin-top: 40px; }
.section > h2 { padding-bottom: 8px; border-bottom: 2px solid var(--ink); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0 0 8px; }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; background: var(--rule-soft); aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.gallery.lead { grid-template-columns: 1fr; }
.gallery.lead a { aspect-ratio: auto; max-height: 520px; }
.gallery.lead img { object-fit: contain; max-height: 520px; }

/* Dateiliste mit Prüfsummen */
.files { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.files > li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
.files .fname { font-family: var(--mono); font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
.files .flabel { color: var(--muted); font-size: .9rem; }
.files .fmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--muted); grid-column: 1 / -1; }
.hash { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; }
.hash code { flex: 1; background: var(--stock); border: 1px solid var(--rule); border-radius: 4px; padding: 6px 9px;
  font-size: .82rem; line-height: 1.5; word-spacing: .25em; overflow-wrap: anywhere; }
.hash .algo { font-stretch: var(--narrow); font-weight: 600; font-size: .8rem; color: var(--muted); padding-top: 7px; min-width: 56px; }
.state { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: .86rem; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.state.ok { color: var(--ok); }
.state.warn { color: var(--warn); }
.state.bad { color: var(--bad); }
.state.none { color: var(--muted); }

.more-from { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.more-from a { display: block; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: 5px; background: var(--stock);
  color: var(--ink); text-decoration: none; }
.more-from a:hover { border-color: var(--ink); }
.more-from b { display: block; font-stretch: 108%; }
.more-from span { font-size: .88rem; color: var(--muted); }

.preview-band { background: repeating-linear-gradient(-45deg, var(--signal) 0 14px, var(--ink) 14px 28px); padding: 4px; margin-top: 16px; border-radius: 4px; }
.preview-band div { background: var(--stock); padding: 8px 12px; border-radius: 2px; font-weight: 600; }

dialog { border: 2px solid var(--ink); border-radius: 6px; padding: 0; width: min(560px, 100% - 32px); background: var(--stock); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 16, 22, .55); }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 2px solid var(--ink); background: var(--signal); color: var(--signal-ink); }
dialog .dlg-head h2 { margin: 0; font-size: 1.15rem; }
dialog .dlg-body { padding: 16px; }
.closebtn { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: inherit; padding: 4px 8px; }
.hp { position: absolute; left: -9999px; }

/* --- Verwaltung --------------------------------------------------------------------------------------- */
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 28px 0 8px; }
.admin-top h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink); margin: 16px 0 24px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink); text-decoration: none; font-weight: 600; border: 2px solid transparent; border-bottom: 0;
  border-radius: 5px 5px 0 0; margin-bottom: -2px; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--stock); border-color: var(--ink); border-bottom: 2px solid var(--stock); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .8rem; text-align: center; }
.panel { background: var(--stock); border: 1.5px solid var(--rule); border-radius: 6px; padding: 20px; margin-bottom: 20px; }
.panel > h2:first-child { margin-top: 0; }
.stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 8px 0 20px; }
.stats div { font-size: .9rem; color: var(--muted); }
.stats b { display: block; font-size: 1.5rem; font-stretch: 110%; color: var(--ink); }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-stretch: var(--narrow); font-weight: 650; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 10px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--rule); padding: 10px; vertical-align: top; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a.title { font-weight: 700; color: var(--ink); }
.pill { display: inline-block; font-size: .8rem; font-weight: 650; font-stretch: var(--narrow); padding: 1px 8px; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.pill.published { color: var(--ok); }
.pill.draft { color: var(--muted); }
.pill.blocked { color: var(--bad); }

.mask-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
@media (max-width: 1100px) { .mask-layout { grid-template-columns: minmax(0, 1fr) 280px; } .mask-nav { display: none; } }
@media (max-width: 820px) { .mask-layout { grid-template-columns: 1fr; } }
.mask-nav, .mask-side { position: sticky; top: 16px; }
@media (max-width: 820px) { .mask-side { position: static; order: -1; } }
.mask-nav ol { list-style: none; padding: 0; margin: 0; counter-reset: schritt; }
.mask-nav li { counter-increment: schritt; }
.mask-nav a { display: flex; gap: 10px; padding: 8px 0; color: var(--ink); text-decoration: none; font-weight: 550; border-bottom: 1px solid var(--rule-soft); }
.mask-nav a::before { content: counter(schritt); font-weight: 800; font-stretch: 120%; color: var(--muted); width: 1.2em; }
.mask-nav a:hover { text-decoration: underline; }
fieldset.part { border: 1.5px solid var(--rule); border-radius: 6px; background: var(--stock); padding: 20px; margin: 0 0 20px; min-width: 0; scroll-margin-top: 16px; }
fieldset.part > legend { font-weight: 800; font-stretch: 115%; font-size: 1.2rem; padding: 0 8px; margin-left: -8px; }
fieldset.part .intro { color: var(--muted); margin: -2px 0 16px; font-size: .93rem; max-width: 70ch; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; font-size: .93rem; }
.checklist li::before { content: "○"; font-weight: 800; width: 1em; color: var(--muted); }
.checklist li.ok::before { content: "✓"; color: var(--ok); }
.checklist li.missing.required::before { content: "✗"; color: var(--bad); }
.checklist li.missing:not(.required)::before { content: "!"; color: var(--warn); }
.checklist li a { color: inherit; }
.checklist li.ok { color: var(--muted); }
.side-actions { display: grid; gap: 8px; }
.side-actions .btn { width: 100%; }

.dropzone { position: relative; border: 2.5px dashed var(--rule); border-radius: 8px; padding: 28px 20px; text-align: center; background: var(--paper);
  transition: border-color .15s, background .15s; }
.dropzone p { margin: 0 0 10px; }
.dropzone strong { font-stretch: 112%; font-size: 1.15rem; display: block; margin-bottom: 4px; }
.dropzone.over { border-style: solid; border-color: var(--ink);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--signal) 22%, var(--paper)) 0 16px, var(--paper) 16px 32px); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.queue { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.queue li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; background: var(--stock); border: 1px solid var(--rule); border-radius: 5px; padding: 8px 12px; font-size: .92rem; }
.queue .qname { font-family: var(--mono); overflow-wrap: anywhere; }
.queue progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: var(--ink); }
.queue .qstate.bad { color: var(--bad); font-weight: 600; }
.queue .qstate.ok { color: var(--ok); font-weight: 600; }

.ftable { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.ftable > li { border: 1.5px solid var(--rule); border-radius: 6px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; background: var(--stock); }
.ftable > li.k-checksum, .ftable > li.k-signature { background: var(--paper); }
.ftable .fname { font-family: var(--mono); font-weight: 700; overflow-wrap: anywhere; }
.ftable .fmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--muted); grid-column: 1 / -1; }
.ftable .fedit-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; }
.ftable .fedit-row input, .ftable .fedit-row select { min-height: 36px; padding: 5px 9px; font-size: .92rem; }
@media (max-width: 640px) { .ftable .fedit-row { grid-template-columns: 1fr; } }
.factions { display: flex; gap: 6px; flex-wrap: wrap; align-items: start; }
.factions form { margin: 0; }

.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.imgs figure { margin: 0; border: 1.5px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--stock); }
.imgs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--rule-soft); }
.imgs figcaption { padding: 8px; display: grid; gap: 6px; }
.imgs figcaption input { min-height: 34px; padding: 4px 8px; font-size: .88rem; }
.imgs .first { outline: 3px solid var(--signal); outline-offset: -3px; }

.copyline { display: flex; gap: 8px; }
.copyline input { font-family: var(--mono); font-size: .88rem; }
.report-item { border-left: 4px solid var(--warn); }
.report-item.done { border-left-color: var(--rule); opacity: .85; }
.report-item.rights, .report-item.malware { border-left-color: var(--bad); }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 6px; }
.secret { font-family: var(--mono); letter-spacing: .1em; }

.auth { max-width: 440px; margin: 56px auto; }
.auth h1 { font-size: 2.2rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top, footer, .waybill-files .dlbtn svg, dialog, .btn { display: none !important; } }
.hero.tight { padding-top: 8px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
[hidden] { display: none !important; }
.field > .copyline { display: flex; font: inherit; margin: 0; }
.gallery { margin-bottom: 24px; }
textarea.md { font-family: var(--mono); font-size: .88rem; }
.fp-caption { display: block; font-size: .78rem; color: var(--muted); margin-top: -4px; }
