:root {
  --bg: #0b0d12;
  --surface: #12161f;
  --surface-2: #181d28;
  --surface-3: #1f2533;
  --line: #242b3a;
  --line-2: #323b4f;
  --text: #e9ecf3;
  --muted: #a0a8b9;
  --faint: #8a93a6;
  --accent: #8f7dff;
  --accent-2: #36d1c0;
  --ok: #3fcf8f;
  --err: #ff7a7a;
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(143, 125, 255, 0.16), transparent 60%),
    radial-gradient(800px 520px at 100% 110%, rgba(54, 209, 192, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

/* --- Kopf --------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.mark {
  position: relative;
  flex: none;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 30px rgba(143, 125, 255, 0.35);
}
.mark span {
  position: absolute; inset: 11px;
  border-radius: 50%;
  border: 4px solid #0b0d12;
}
.mark span::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  right: -8px; top: -8px;
  border-radius: 50%;
  background: #0b0d12;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.tagline { margin: 4px 0 0; color: var(--muted); }

/* --- Bühne mit den zwei Feldern ----------------------------------------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 400px;
  padding: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
}

.arrow {
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.drop, .empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
  border-radius: 14px;
}

.drop {
  cursor: pointer;
  border: 1.5px dashed var(--line-2);
  background: rgba(255, 255, 255, 0.01);
  transition: border-color .15s, background-color .15s, transform .15s;
}
.drop:hover { border-color: #4a5470; background: rgba(143, 125, 255, 0.04); }
.drop.over {
  border-color: var(--accent);
  background: rgba(143, 125, 255, 0.09);
  transform: scale(1.01);
}
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

.empty { border: 1.5px dashed var(--line); }

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(143, 125, 255, 0.3);
}
.drop-icon.muted { color: var(--muted); background: var(--surface-3); box-shadow: none; }

.drop-title { font-size: 17px; font-weight: 650; }
.drop-sub { color: var(--muted); font-size: 13.5px; max-width: 320px; }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* --- Datei und Ziele ---------------------------------------------------- */

.upload, .picked { display: flex; flex-direction: column; gap: 16px; flex: 1; }

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.file-text { min-width: 0; flex: 1; }
.fname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { color: var(--muted); font-size: 13px; }

.badge {
  flex: none;
  min-width: 52px;
  padding: 9px 8px;
  border-radius: 10px;
  font: 700 11.5px/1 var(--mono);
  text-align: center;
  text-transform: uppercase;
  color: #0b0d12;
  background: #c9cfdb;
}
.badge.image { background: #f2b880; }
.badge.document { background: #8fb5ff; }
.badge.sheet { background: #7ddea0; }
.badge.slides { background: #ffa07a; }
.badge.pdf { background: #ff8f8f; }
.badge.audio { background: #d7a6ff; }
.badge.video { background: #6fe0d4; }

.ghost {
  flex: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ghost:hover { color: var(--text); border-color: #4a5470; }

.targets { display: flex; flex-direction: column; gap: 14px; }
.group-label {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background-color .12s, transform .12s;
}
.chip strong { font-size: 14px; font-weight: 650; }
.chip small { color: var(--faint); font-size: 11.5px; }
.chip:hover { border-color: var(--accent); background: #1d2131; }
.chip:active { transform: translateY(1px); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.busy { border-color: var(--accent); background: rgba(143, 125, 255, 0.12); }

.bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}
.bar span {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .2s;
}
.bar.indeterminate span {
  width: 35%;
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide {
  0% { left: -35%; }
  100% { left: 100%; }
}

.error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 122, 0.35);
  background: rgba(255, 122, 122, 0.08);
  color: #ffc4c4;
  font-size: 14px;
}

/* --- Ergebnisse --------------------------------------------------------- */

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.results:empty { display: none; }

.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  animation: rise .25s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.result .status { color: var(--muted); font-size: 13px; }
.result.failed .status { color: #ffc4c4; }
.result.done .status { color: var(--muted); }

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #6f8bff 55%, var(--accent-2));
  color: #0b0d12;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(143, 125, 255, 0.28);
}
.download:hover { filter: brightness(1.07); }
.download:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Hinweise und Fuß --------------------------------------------------- */

.facts {
  margin-top: 28px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 31, 0.6);
  color: var(--muted);
  font-size: 13.5px;
}
.facts summary { cursor: pointer; color: var(--text); font-weight: 600; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 16px; }
.facts h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.facts dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.facts dt { color: var(--text); font-weight: 600; }
.facts dd { margin: 0; }
.facts code { font: 12px/1.6 var(--mono); color: var(--muted); }
.facts-note { margin: 0 0 12px; }

.foot { margin-top: 22px; text-align: center; color: var(--faint); font-size: 12.5px; }

.counter {
  position: fixed;
  right: 14px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 31, 0.82);
  backdrop-filter: blur(6px);
  color: var(--faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

/* --- Schmale Bildschirme ------------------------------------------------ */

@media (max-width: 860px) {
  .shell { padding: 32px 16px 20px; }
  /* Am Handy schwebt der Zähler nicht über dem Inhalt, sondern steht am
     Seitenende rechts. */
  .counter {
    position: static;
    display: block;
    width: max-content;
    margin: 0 16px 16px auto;
  }
  .counter[hidden] { display: none; }
  .stage { grid-template-columns: minmax(0, 1fr); }
  .arrow { transform: rotate(90deg); }
  .panel { min-height: 300px; }
  .facts-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
