:root {
  --bg:           #f3f4f6;
  --card:         #ffffff;
  --border:       #e5e7eb;
  --primary:      #2563eb;
  --primary-h:    #1d4ed8;
  --primary-dim:  #93c5fd;
  --text:         #111827;
  --muted:        #6b7280;
  --success:      #16a34a;
  --error:        #dc2626;
  --radius:       10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 32px 24px;
  max-width: 860px;
  margin: 0 auto;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
  margin-right: 16px;
  cursor: pointer;
}
.brand-icon { width: 88px; height: 88px; border-radius: 12px; }
.brand-name { font-size: 0.7rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 8px;
}
select, input[type=email], input[type=text] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.92rem;
  background: white;
  color: var(--text);
}
select { cursor: pointer; }
select:focus, input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row .grow { flex: 1; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--muted);
  font-size: 0.92rem;
  user-select: none;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}
.drop-zone.has-file {
  border-color: var(--success);
  background: #f0fdf4;
  color: var(--success);
}
.drop-icon { font-size: 1.8rem; margin-bottom: 8px; }

/* Options row */
.options-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.options-row .grow { flex: 1; min-width: 140px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  cursor: pointer;
  padding-top: 20px;
}
.checkbox-label input[type=checkbox] { width: 17px; height: 17px; cursor: pointer; }

/* Buttons */
button { cursor: pointer; font-family: inherit; border: none; }
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: background .15s;
  margin-bottom: 14px;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }
.btn-primary:disabled { background: var(--primary-dim); cursor: not-allowed; }
.btn-primary .spinner, .btn-sm .spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-sm {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--border);
  color: var(--text);
  white-space: nowrap;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}
.btn-sm:hover { background: #d1d5db; }
.btn-danger { background: #fee2e2; color: var(--error); }
.btn-danger:hover { background: #fecaca; }
.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-h); }

/* Auth-Bereich in der Kopfzeile */
.auth-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 20px;
}
.auth-email { font-size: 0.75rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.auth-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Progress */
.status-text { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width .4s ease;
}
.progress-fill.error { background: var(--error); }

/* Result */
textarea {
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  font-size: 0.88rem;
  font-family: 'Consolas', 'Courier New', monospace;
  resize: vertical;
  color: var(--text);
  line-height: 1.6;
}
textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.result-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.error-msg { color: var(--error); font-size: 0.85rem; }
.no-container-msg { color: var(--error); font-size: 0.82rem; margin-top: 6px; }
.hint-msg { color: var(--muted); font-size: 0.8rem; margin-top: 8px; }

/* Modal (Login) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 400px;
}
.modal h2 { font-size: 1.05rem; margin-bottom: 6px; }
.modal p  { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.modal .modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal .modal-actions .grow { flex: 1; }
.code-input {
  font-size: 1.5rem !important;
  letter-spacing: .4em;
  text-align: center;
  font-family: 'Consolas', monospace;
}
.modal-error { color: var(--error); font-size: 0.82rem; margin-top: 10px; min-height: 1em; }
.modal-link { background: none; color: var(--primary); font-size: 0.82rem; text-decoration: underline; padding: 4px 0; }

/* Meine Dateien */
.view-header { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.view-header h2 { font-size: 1.05rem; }
.file-item { padding: 14px 16px; }
.file-name { font-weight: 600; font-size: 0.95rem; word-break: break-word; }
.file-meta { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.file-error { color: var(--error); font-size: 0.8rem; margin-top: 5px; }
.badge { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; vertical-align: middle; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-error { background: #fee2e2; color: #b91c1c; }
.file-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.file-text {
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  font-size: 0.85rem;
  font-family: 'Consolas', 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.6;
}
.empty-msg { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 30px 10px; }
.danger-zone { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
}
.footer-title { font-size: 0.78rem; font-weight: 600; }
.footer-desc  { font-size: 0.72rem; margin-top: 3px; line-height: 1.5; }

/* Mobil */
@media (max-width: 640px) {
  body { padding: 14px 10px; }
  .row { flex-wrap: wrap; }
  .brand {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 10px 0;
    margin: 0 0 10px 0;
    width: 100%;
    justify-content: center;
  }
  .brand-icon { width: 44px; height: 44px; }
  .auth-area { width: 100%; align-items: stretch; padding-top: 10px; }
  .auth-buttons { justify-content: stretch; }
  .auth-buttons .btn-sm { flex: 1; }
  .auth-email { max-width: none; text-align: center; }
  .checkbox-label { padding-top: 8px; }
  .btn-sm { padding: 9px 14px; }
  .file-actions .btn-sm { flex: 1; min-width: 100px; }
}
