*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  color: #1d1d1f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top nav --- */

.top-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.75rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav-left {
  display: flex;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.nav-logo:hover {
  opacity: 1;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  transition: background 0.12s;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Account-Pill im WeTransfer-Stil */
.account-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.35rem 0.25rem 0.85rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nav-brand {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-avatar {
  width: 28px;
  height: 28px;
  background: #1d1d1f;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Stage: Bild links, Karte rechts, auf gleicher Hoehe (vertikal zentriert) --- */

.stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 4vh 5vw;
}

/* Hero-Bild links, volle Deckkraft, etwa Kartengroesse */
.hero-img {
  flex: 0 1 auto;
  width: auto;
  max-width: 46%;
  max-height: 64vh;
  object-fit: contain;
  align-self: center;
}

.container {
  flex: 0 0 auto;
  width: 100%;
  max-width: 400px;
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Card wrapper with label --- */

.card-wrapper {
  position: relative;
}

.card {
  background: #fff;
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow:
    0 18px 50px -14px rgba(24, 30, 60, 0.28),
    0 6px 18px -8px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.03);
}

/* Drop-Zustand: Karte hebt sich leicht an + blauer Ring + Tint —
   klares "hier ablegen"-Signal, aber dezent. */
.card.drag-over {
  background: #f2f5ff;
  transform: scale(1.015);
  box-shadow: 0 0 0 2.5px #4f6ef7, 0 26px 60px -16px rgba(24, 30, 60, 0.34);
}

/* --- Upload buttons --- */

.upload-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.upload-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem 0.85rem;
  background: #eef0fb;
  border: none;
  border-radius: 12px;
  color: #1d1d1f;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.upload-btn:hover {
  background: #e2e6f9;
}

.upload-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Form fields --- */

.form-field {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: 0.72rem;
  color: #8e8e93;
  margin-bottom: 0;
  padding-top: 0.9rem;
  font-weight: 400;
}

.form-field input[type="email"],
.form-field input[type="text"],
.form-field input[type="password"] {
  width: 100%;
  padding: 0.55rem 0;
  background: none;
  border: none;
  border-bottom: 1px solid #e5e5ea;
  color: #1d1d1f;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input::placeholder {
  color: #c7c7cc;
  font-weight: 400;
}

.form-field input:focus {
  border-bottom-color: #4f6ef7;
}

.field-with-icon {
  position: relative;
}

.field-with-icon input {
  padding-right: 2.25rem;
}

.field-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
}

/* --- Bottom row --- */

/* Modus-Auswahl: zwei Optionen nebeneinander ueber dem Button */
.mode-select {
  display: flex;
  gap: 0.5rem;
  margin: 1.1rem 0 0.85rem;
}

.mode-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #e5e5ea;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1d1d1f;
  transition: border-color 0.15s, background 0.15s;
}

.mode-option:has(input:checked) {
  border-color: #4f6ef7;
  background: #f2f5ff;
}

.mode-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d1d6;
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.mode-option input[type="radio"]:checked {
  border-color: #4f6ef7;
  background: #4f6ef7;
}

.mode-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* --- CTA button --- */

.cta-btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}

.cta-btn:hover {
  background: #3d5bd9;
}

.cta-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --- Selected files --- */

.selected-files {
  margin-bottom: 0.25rem;
  padding: 0.6rem 0.75rem;
  background: #f8f8fa;
  border-radius: 10px;
}

.selected-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.78rem;
}

.selected-file-item:not(:last-child) {
  border-bottom: 1px solid #eee;
}

.selected-file-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1d1d1f;
}

.selected-file-size {
  color: #8e8e93;
  margin-left: 0.5rem;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.selected-file-remove {
  margin-left: 0.4rem;
  background: none;
  border: none;
  color: #c7c7cc;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0 0.2rem;
  line-height: 1;
}

.selected-file-remove:hover {
  color: #ff3b30;
}

/* --- Code section --- */

.code-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f5;
}

.code-section label {
  font-size: 0.72rem;
  color: #8e8e93;
  display: block;
  margin-bottom: 0.35rem;
}

.code-row {
  display: flex;
  gap: 0.5rem;
}

.code-row input {
  flex: 1;
  padding: 0.6rem 0;
  border: none;
  border-bottom: 1.5px solid #e5e5ea;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.25em;
  text-align: center;
  outline: none;
  color: #1d1d1f;
  background: none;
}

.code-row input:focus {
  border-bottom-color: #4f6ef7;
}

.code-row input::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: #c7c7cc;
}

.code-verify-btn {
  padding: 0.5rem 0.9rem;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.code-verify-btn:hover {
  background: #3d5bd9;
}

/* --- Progress --- */

#progress-section {
  padding: 1.75rem 0 1.25rem;
  text-align: center;
}

/* Kreis-Progress-Ring mit sanftem Puls */
.progress-ring-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 1.1rem;
  animation: ring-pulse 1.9s ease-in-out infinite;
}

.progress-ring {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg); /* Start oben */
}

.progress-ring-track {
  fill: none;
  stroke: #eceef5;
  stroke-width: 9;
}

.progress-ring-fill {
  fill: none;
  stroke: url(#pgrad);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.73;   /* Umfang: 2*PI*52 */
  stroke-dashoffset: 326.73;  /* leer */
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 2px 7px rgba(79, 110, 247, 0.45));
}

/* Reconnect-Zustand: Ring wird amber bei kurzem Verbindungsaussetzer */
.progress-ring-fill.reconnecting {
  stroke: #f59e0b;
  filter: drop-shadow(0 2px 7px rgba(245, 158, 11, 0.5));
}

.progress-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-pct {
  font-size: 1.7rem;
  font-weight: 700;
  color: #1d1d1f;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.progress-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.25rem;
}

.progress-bytes {
  font-size: 0.8rem;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

/* --- Result --- */

.result-box {
  text-align: center;
  padding: 1.75rem 0 0.5rem;
}

.result-check {
  margin-bottom: 0.9rem;
}

.result-check svg {
  display: block;
  margin: 0 auto;
  animation: check-pop 0.4s cubic-bezier(0.2, 1.5, 0.45, 1) both;
  filter: drop-shadow(0 4px 12px rgba(34, 197, 94, 0.35));
}

.result-check-mark {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: check-draw 0.35s 0.28s ease forwards;
}

@keyframes check-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}

.result-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1d1d1f;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  background: #f5f6fa;
  border: 1px solid #e9e9ef;
  border-radius: 12px;
  padding: 0.3rem 0.3rem 0.3rem 0.7rem;
}

.link-icon {
  flex-shrink: 0;
}

.link-row input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0.4rem 0.2rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: #4a4a4f;
  outline: none;
}

.copy-btn {
  padding: 0.5rem 0.9rem;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: #3f5ae0;
}

.copy-btn.copied {
  background: #22c55e;
}

/* --- Utilities --- */

.error {
  color: #ff3b30;
  font-size: 0.78rem;
  margin-top: 0.6rem;
  text-align: center;
}

.hint {
  color: #8e8e93;
  font-size: 0.78rem;
  margin-top: 0.5rem;
  text-align: center;
}

.meta {
  color: #8e8e93;
  font-size: 0.72rem;
  margin-top: 0.3rem;
}

.center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Pflichtfeld-Markierung */
.req {
  color: #ff3b30;
  font-weight: 600;
}

/* Fehler-Popup (Toast) */
.popup {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100vw - 2rem);
  padding: 0.85rem 1.15rem;
  background: #fff;
  color: #1d1d1f;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 12px;
  border-left: 4px solid #ff3b30;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  cursor: pointer;
  animation: popup-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.popup svg {
  flex-shrink: 0;
}

@keyframes popup-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Responsive --- */

/* Tablet / schmaler Desktop: Karte weiter links, Hero tritt etwas zurueck */
@media (max-width: 1100px) {
  .stage {
    padding-left: 3vw;
    padding-right: 3vw;
  }
}

/* Schmale Screens: gestapelt — Karte oben, Bild darunter; kein horizontales Scrollen. */
@media (max-width: 820px) {
  .stage {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 3vh 1rem 2.5rem;
  }

  .container {
    order: 1;
    max-width: 440px;
  }

  .hero-img {
    order: 2;
    max-width: 88%;
    max-height: 34vh;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding: 0.65rem 0.9rem;
  }

  .nav-link {
    padding: 0.4rem 0.6rem;
  }

  .nav-brand {
    display: none;
  }

  .account-pill {
    padding: 0.2rem;
  }

  .card {
    padding: 2rem 1.15rem 1.25rem;
  }
}

/* ---------- File-Manager (Projekte) ---------- */

/* Toolbar + geteilter Boxed-Input */
.fm-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.input-box {
  padding: 0.5rem 0.7rem;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1d1d1f;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.input-box:focus { border-color: #4f6ef7; }
.input-box::placeholder { color: #c7c7cc; }

/* Button-Hierarchie: sekundaer (Kontur) + destruktiv (rot erst bei Hover) */
.btn-ghost {
  padding: 0.45rem 0.75rem;
  background: none;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  color: #4a4a4f;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.btn-ghost:hover { background: #f5f6fa; border-color: #d1d1d6; }
.btn-ghost:disabled { opacity: 0.5; cursor: default; }

.btn-danger {
  padding: 0.45rem 0.75rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #8e8e93;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.btn-danger:hover { background: #fff1f0; color: #ff3b30; }

.btn-danger-solid {
  padding: 0.5rem 0.9rem;
  background: #ff3b30;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}

.btn-danger-solid:hover { background: #e0281d; }

/* Breadcrumb = Navigation, nicht Meta-Text */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.1rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  color: #8e8e93;
}

.breadcrumb a {
  color: #4f6ef7;
  text-decoration: none;
  font-weight: 500;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.breadcrumb a:hover { background: #f2f5ff; text-decoration: underline; }

.breadcrumb a:last-child {
  color: #1d1d1f;
  font-weight: 600;
  pointer-events: none;
}

.breadcrumb .sep { color: #c7c7cc; padding: 0 0.05rem; }

/* Node-Zeilen: Icon | Name (ellipsis) | Groesse | Aktionen */
.node-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  transition: background 0.12s;
}

.node-row + .node-row { border-top: 1px solid #f0f0f5; }
.node-row:hover { background: #f8f8fa; }

.node-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.node-icon { flex-shrink: 0; display: flex; color: #4f6ef7; }

.node-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1d1d1f;
  font-size: 0.9rem;
  font-weight: 500;
}

.node-main:hover .node-name { color: #4f6ef7; }

.node-size {
  flex-shrink: 0;
  color: #8e8e93;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.node-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Leere Zustaende */
.empty {
  text-align: center;
  color: #8e8e93;
  font-size: 0.85rem;
  padding: 2.25rem 1rem;
}

/* Upload-Fortschritt: Balken + Reconnect-Zustand (amber) */
.fm-progress { margin: 0.25rem 0 1.1rem; }

.fm-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #eceef5;
  overflow: hidden;
}

.fm-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f6ef7, #9b6bff);
  transition: width 0.3s ease, background 0.3s ease;
}

.fm-progress.is-reconnecting .fm-progress-fill { background: #f59e0b; }
.fm-progress.is-reconnecting .fm-progress-text { color: #b45309; }

.fm-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.fm-progress-text {
  font-size: 0.74rem;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}

/* Drop-Ziel (Karte) */
.fm-drop-active {
  outline: 2px dashed #4f6ef7;
  outline-offset: -10px;
  background: #f2f5ff;
}

/* Mitglieder-Sektion: klar abgetrennt, Rolle als Badge */
.members-section {
  margin-top: 1.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f0f5;
}

.members-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1d1d1f;
}

.members-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.85rem;
}

.member-row + .member-row { border-top: 1px solid #f5f5f7; }

.member-email {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role {
  flex-shrink: 0;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4f6ef7;
  background: #eef0fb;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* Kleines Modal (ersetzt prompt/confirm) */
.fm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
}

.fm-modal {
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.fm-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.5rem;
}

.fm-modal-text {
  font-size: 0.85rem;
  color: #4a4a4f;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.fm-modal-text strong { color: #1d1d1f; }

.fm-modal .input-box {
  width: 100%;
  margin-top: 0.75rem;
}

.fm-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.15rem;
}

/* Projektliste Startseite */
.project-row {
  padding: 0.55rem 0;
}

.project-row + .project-row { border-top: 1px solid #f0f0f5; }

.project-link {
  color: #4f6ef7;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.project-link:hover { text-decoration: underline; }

/* File-Manager responsive */
@media (max-width: 520px) {
  .node-size { display: none; }

  .node-row { flex-wrap: wrap; }

  .node-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Zeilen-Aktionen erst bei Hover/Fokus zeigen (Touch: immer sichtbar) */
.node-actions { opacity: 0; transition: opacity 0.12s; }

.node-row:hover .node-actions,
.node-row:focus-within .node-actions { opacity: 1; }

@media (hover: none) {
  .node-actions { opacity: 1; }
}

/* Skeleton beim Ordnerwechsel */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.5rem;
}

.skeleton-bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f5 25%, #f8f8fa 50%, #f0f0f5 75%);
  background-size: 200% 100%;
  animation: fm-shimmer 1.1s linear infinite;
}

.skeleton-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes fm-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; }
}

/* Verschieben per Drag&Drop */
.node-row.dragging { opacity: 0.45; }

.node-row.drop-target {
  background: #eef0fb;
  box-shadow: inset 0 0 0 1.5px #4f6ef7;
}

.breadcrumb a.drop-target {
  background: #eef0fb;
  box-shadow: inset 0 0 0 1.5px #4f6ef7;
}

/* Projekt-Header: Breadcrumb links, Details-Dropdown rechts */
.fm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fm-header .breadcrumb { margin-bottom: 0; }

.fm-details-wrap {
  position: relative;
  flex-shrink: 0;
}

.fm-details {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 270px;
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.14),
    0 0 0 0.5px rgba(0, 0, 0, 0.05);
  z-index: 50;
}

.fm-details-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  padding: 0.3rem 0;
}

.fm-details-row + .fm-details-row { border-top: 1px solid #f5f5f7; }

.fm-details-label { color: #8e8e93; flex-shrink: 0; }

.fm-details-value {
  color: #1d1d1f;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.fm-details .btn-ghost {
  width: 100%;
  margin-top: 0.7rem;
}

/* ---------- Projekt-Arbeitsbereich (Redesign) ---------- */

.fm-body { background: #f6f7fc; }
.fm-body .top-nav { background: rgba(246, 247, 252, 0.85); }

.fm-stage {
  flex: 1;
  width: 100%;
  padding: 2.2rem 5vw 3rem;
}

.fm-wrap {
  max-width: 1020px;
  margin: 0 auto;
}

/* Projekt-Kopf: Identitaets-Kachel + Titel + Meta + Aktionen */
.fm-project-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.fm-tile {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}

.fm-head-text {
  flex: 1;
  min-width: 0;
}

.fm-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-meta {
  font-size: 0.78rem;
  color: #8e8e93;
  margin-top: 0.15rem;
}

.fm-head-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Arbeitsbereich: Material links, Details/Mitglieder rechts */
.fm-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.1rem;
  align-items: start;
}

.fm-main {
  min-height: 380px;
}

.fm-panel {
  padding: 1.15rem 1.25rem 1.25rem;
}

.fm-panel + .fm-panel { margin-top: 1.1rem; }

.fm-section-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8e8e93;
  margin-bottom: 0.75rem;
}

/* Icon-Toenung nach Medientyp (Videoproduktion: Scan-Kriterium) */
.node-icon--folder { color: #4f6ef7; }
.node-icon--video { color: #4f6ef7; }
.node-icon--image { color: #8b5cf6; }
.node-icon--audio { color: #c07c1d; }
.node-icon--archive { color: #8e8e93; }
.node-icon--file { color: #7a839e; }

/* Breadcrumb im Material-Bereich */
.crumb-home { display: inline-flex; align-items: center; }

/* Mitglieder-Avatare */
.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}

.fm-panel .member-row { padding: 0.4rem 0; }
.fm-panel .members-form { margin: 0.85rem 0 0; }
.fm-panel .fm-details-row:first-child { padding-top: 0; }
.fm-panel #details-panel .btn-ghost { width: 100%; margin-top: 0.75rem; }

/* Empty-State mit Icon */
.empty { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.empty-icon { color: #c7cbe3; }
.empty-icon svg { width: 34px; height: 34px; }

/* Responsive: Seitenleiste stapelt, Kopf bricht um */
@media (max-width: 780px) {
  .fm-grid { grid-template-columns: 1fr; }
  .fm-project-head { flex-wrap: wrap; }
  .fm-head-actions { width: 100%; }
  .fm-head-actions .copy-btn { flex: 1; }
  .fm-head-actions .btn-ghost { flex: 1; }
  .fm-stage { padding: 1.4rem 4vw 2rem; }
}

/* Projektliste Startseite: Kachel + Name + Rolle */
.project-row-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.12s;
}

.project-row-link + .project-row-link { border-top: 1px solid #f0f0f5; }
.project-row-link:hover { background: #f8f8fa; }

.project-tile {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.project-name {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-row-link:hover .project-name { color: #4f6ef7; }

/* Seitenleiste: Entfernen erst bei Hover (E-Mail braucht den Platz) */
.fm-panel .member-row .btn-danger {
  opacity: 0;
  padding: 0.3rem 0.5rem;
  transition: opacity 0.12s;
}

.fm-panel .member-row:hover .btn-danger,
.fm-panel .member-row:focus-within .btn-danger { opacity: 1; }

@media (hover: none) {
  .fm-panel .member-row .btn-danger { opacity: 1; }
}

/* Stage darf umbrechen (eingeloggt: Transfer-Karte + Projekte-Box nebeneinander/untereinander) */
.stage { flex-wrap: wrap; }

/* Grid-Blowout verhindern: Items duerfen unter ihre Content-Breite schrumpfen */
.fm-grid > *,
.fm-aside > * { min-width: 0; }

.fm-details-value { white-space: normal; }

/* Toolbar-Zeile ueber der Material-Box: Pfadleiste links, Aktionen rechts */
.fm-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  min-width: 0;
}

.fm-col-main { min-width: 0; }

/* Pfadleiste: Chips auf der getoenten Buehne; aktueller Ort = weiße Pille */
.pathbar {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.pathbar a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  color: #6a7186;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 0;
  transition: background 0.12s, color 0.12s;
}

.pathbar .crumb-label {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pathbar a:hover { background: rgba(255, 255, 255, 0.85); color: #1d1d1f; }

.pathbar a:last-child {
  background: #fff;
  color: #1d1d1f;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  pointer-events: none;
}

.pathbar .crumb-home { display: inline-flex; color: #8b93ad; }
.pathbar a:last-child .crumb-home { color: #4f6ef7; }

.pathbar .sep { color: #c0c4d6; font-size: 0.8rem; padding: 0 0.1rem; }

.pathbar a.drop-target {
  background: #eef0fb;
  box-shadow: inset 0 0 0 1.5px #4f6ef7;
  color: #1d1d1f;
}

@media (max-width: 780px) {
  .fm-toolbar-row { flex-wrap: wrap; }
  .fm-toolbar-row .fm-head-actions { width: 100%; }
}

/* Pfad-Kuerzung: „…"-Chip + stabile Zeile (Pfad nutzt Restbreite, Aktionen bleiben rechts) */
.fm-toolbar-row .pathbar { flex: 1; }
.fm-toolbar-row .fm-head-actions { flex-shrink: 0; }

.pathbar a.crumb-more {
  padding: 0.4rem 0.55rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #8b93ad;
}
