/* PDF – ein Stapel Blätter auf dem Schreibtisch, oben von einer Klammer zusammengehalten.
   Jede Datei ist ein Blatt, die Reihenfolge im Stapel ist die Reihenfolge im PDF. */

@font-face {
  font-family: 'Archivo';
  src: url(/fonts/archivo-latin.woff2) format('woff2-variations');
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url(/fonts/archivo-latin-ext.woff2) format('woff2-variations');
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

/* Schriften für das Nachbauen der Word-Dateien: gleiche Maße wie Calibri, Cambria, Arial, Times New Roman, Courier New */
@font-face { font-family: 'PX Carlito'; src: url(/fonts/carlito-regular.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'PX Carlito'; src: url(/fonts/carlito-bold.ttf) format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'PX Carlito'; src: url(/fonts/carlito-italic.ttf) format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'PX Carlito'; src: url(/fonts/carlito-bolditalic.ttf) format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'PX Caladea'; src: url(/fonts/caladea-regular.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'PX Caladea'; src: url(/fonts/caladea-bold.ttf) format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'PX Caladea'; src: url(/fonts/caladea-italic.ttf) format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'PX Caladea'; src: url(/fonts/caladea-bolditalic.ttf) format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'PX Sans'; src: url(/fonts/sans-regular.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'PX Sans'; src: url(/fonts/sans-bold.ttf) format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'PX Sans'; src: url(/fonts/sans-italic.ttf) format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'PX Sans'; src: url(/fonts/sans-bolditalic.ttf) format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'PX Serif'; src: url(/fonts/serif-regular.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'PX Serif'; src: url(/fonts/serif-bold.ttf) format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'PX Serif'; src: url(/fonts/serif-italic.ttf) format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'PX Serif'; src: url(/fonts/serif-bolditalic.ttf) format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'PX Mono'; src: url(/fonts/mono-regular.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'PX Mono'; src: url(/fonts/mono-bold.ttf) format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'PX Mono'; src: url(/fonts/mono-italic.ttf) format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'PX Mono'; src: url(/fonts/mono-bolditalic.ttf) format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'PX Symbols'; src: url(/fonts/symbols.ttf) format('truetype'); font-weight: 400; font-style: normal; }

/* unsichtbare Werkstatt, in der die Word-Datei nachgebaut wird */
.px-render { position: absolute; left: -40000px; top: 0; width: 2600px; pointer-events: none; }
.px-render, .px-render * {
  font-kerning: none; font-variant-ligatures: none; font-feature-settings: "liga" 0, "kern" 0; font-synthesis: none;
  hyphens: manual !important; -webkit-hyphens: manual !important;
}
.px-render .docx-wrapper { background: none; padding: 0; }
.px-render section.docx { box-shadow: none; margin-bottom: 40px; }
.px-nobefore::before { content: none !important; }
.px-probe { position: absolute; left: 0; top: 0; white-space: nowrap; }

:root {
  --desk: #E9EBEE;
  --paper: #FFFFFF;
  --ink: #15171C;
  --ink-soft: #5B6170;
  --line: #CDD1D8;
  --red: #D92D20;
  --red-deep: #9E1C13;
  --word: #2B579A;
  --img: #1E7D3A;
  --metal: #1B1D22;
}

body { margin: 0; background: var(--desk); color: var(--ink); }
.ui, .ui *, .ui *::before, .ui *::after { box-sizing: border-box; }
.ui { font-family: 'Archivo', system-ui, sans-serif; font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.ui :where(h1, h2, h3, p, ol, ul, figure) { margin: 0; padding: 0; }
.ui :where(button, input, select) { font: inherit; color: inherit; }
.ui :where(button) { cursor: pointer; background: none; border: 0; padding: 0; }
.ui :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[lang=de] [data-only=en], html[lang=en] [data-only=de] { display: none; }

body { min-height: 100dvh; display: flex; flex-direction: column; }

/* ─── Kopf ─── */
.top { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 820px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 28px) 0; }
.wordmark { font-size: 2rem; font-weight: 900; font-stretch: 125%; letter-spacing: -.03em; line-height: 1; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--red); }
.lang { font-weight: 600; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; padding: 8px 2px; }

.wrap { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 28px) 40px; display: flex; flex-direction: column; gap: 28px; }
.intro h1 { font-size: clamp(2rem, 6.2vw, 3.6rem); font-weight: 850; font-stretch: 125%; line-height: 1; letter-spacing: -.035em; max-width: 14ch; }
.sub { margin-top: 14px; font-size: 1.125rem; color: var(--ink-soft); max-width: 52ch; }

/* ─── Dateien auswählen ─── */
.pick {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 18px; border: 2px dashed #A9AFB9; border-radius: 16px; background: rgba(255,255,255,.5); cursor: pointer;
}
.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pick:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.pick-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; }
.pick-hint { color: var(--ink-soft); }

/* ─── Der Stapel ─── */
.stack-wrap { position: relative; padding-top: 26px; }
.clip { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 110px; z-index: 3; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.clip svg { display: block; width: 100%; height: auto; }
.stack { list-style: none; display: flex; flex-direction: column; gap: 0; position: relative; }
.sheet {
  position: relative;
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--paper);
  padding: 16px 14px 16px 10px;
  border: 1px solid #DADDE2;
  margin-top: -1px;
  box-shadow: 0 1px 0 #fff inset;
}
.sheet:first-child { border-radius: 4px 4px 0 0; padding-top: 30px; }
.sheet:last-child { border-radius: 0 0 4px 4px; box-shadow: 0 3px 0 #F4F5F7, 0 6px 0 #DADDE2, 0 8px 0 #F4F5F7, 0 10px 0 #CFD3D9, 0 22px 30px -16px rgba(21,23,28,.45); }
.sheet:only-child { border-radius: 4px; }
.sheet.dragging { z-index: 5; box-shadow: 0 18px 30px -10px rgba(21,23,28,.45); transform: scale(1.01) rotate(-.4deg); }
.grip {
  width: 28px; height: 40px; border-radius: 6px; color: #9AA0A8; touch-action: none; cursor: grab;
  background: radial-gradient(circle, currentColor 1.6px, transparent 2px) 0 0 / 9px 9px;
  background-position: 5px 6px;
}
.grip:active { cursor: grabbing; }
.badge {
  display: grid; place-items: center; width: 44px; height: 52px; border-radius: 4px 12px 4px 4px;
  color: #fff; font-weight: 850; font-stretch: 112%; font-size: .8125rem; letter-spacing: .02em;
}
.badge.docx { background: var(--word); }
.badge.pdf { background: var(--red); }
.badge.img { background: var(--img); }
.badge.bad { background: #8C929C; }
.info { min-width: 0; }
.fname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: .875rem; color: var(--ink-soft); }
.meta.err { color: var(--red-deep); font-weight: 600; }
.meta.work::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 2px solid var(--ink-soft); border-right-color: transparent; vertical-align: -1px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tools { display: flex; align-items: center; gap: 4px; }
.icon {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); font-size: 1.125rem; line-height: 1;
}
.icon:hover:not(:disabled) { background: var(--desk); color: var(--ink); }
.icon:disabled { opacity: .3; cursor: default; }
.mini { height: 36px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--word); color: var(--word); font-weight: 700; font-size: .875rem; margin-right: 4px; white-space: nowrap; }
.mini:hover { background: var(--word); color: #fff; }
.empty { background: var(--paper); border: 2px dashed var(--line); border-radius: 6px; padding: 40px 20px 30px; text-align: center; color: var(--ink-soft); }
.summary { margin-top: 18px; font-weight: 600; color: var(--ink-soft); min-height: 1.5em; }

/* ─── Herunterladen ─── */
.actions { display: flex; flex-direction: column; gap: 14px; }
.name-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9375rem; max-width: 420px; }
.name-input { display: flex; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding-right: 12px; }
.name-input:focus-within { border-color: var(--ink); }
.name-input input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: none; padding: 0 12px; outline: none; }
.name-input span { color: var(--ink-soft); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 10px; font-weight: 750; font-size: 1.0625rem; }
.btn-go { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-deep); }
.btn-go:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep); }
.btn-line { border: 2px solid var(--ink); color: var(--ink); background: #fff; }
.btn-quiet { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; padding: 0 8px; font-weight: 600; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.status { font-weight: 600; min-height: 1.5em; }
.status.err { color: var(--red-deep); }
.note { font-size: .9375rem; color: var(--ink-soft); max-width: 66ch; }

/* ─── Datei übers Fenster ziehen ─── */
.drop-overlay {
  position: fixed; inset: 0; z-index: 30; display: none; place-items: center;
  background: rgba(233, 235, 238, .88); border: 4px dashed var(--ink);
}
.drop-overlay.show { display: grid; }
.drop-overlay p { font-size: 1.75rem; font-weight: 850; font-stretch: 125%; }

/* ─── Fuß, Hinweise, Fenster ─── */
.foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; padding: 20px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.link { color: var(--ink-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 40; margin: 0;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(21, 23, 28, .6); }
.doc { margin: auto; width: min(100% - 24px, 680px); max-height: min(100dvh - 24px, 900px); background: #fff; border-radius: 14px; padding: 0; }
.doc article { padding: 32px 24px 36px; }
.doc h2 { font-size: 2rem; font-weight: 850; font-stretch: 115%; line-height: 1.1; margin-bottom: 18px; padding-right: 44px; }
.doc h3 { font-size: 1.0625rem; font-weight: 800; margin: 20px 0 6px; }
.doc p { line-height: 1.6; max-width: 68ch; }
.doc a { color: var(--ink); }
.doc-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 26px; line-height: 1; }
.noscript { padding: 40px; text-align: center; }

@media (max-width: 560px) {
  .sheet { grid-template-columns: auto auto minmax(0, 1fr); padding-right: 10px; }
  .tools { grid-column: 2 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .badge { width: 38px; height: 46px; }
  .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ui *, .ui *::before { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
