.me-edit-shell {
  background: var(--color-bg, #0a0a14);
  min-height: 100vh;
}

.me-edit-stage {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 1rem 3rem;
  max-width: 820px;
  margin: 0 auto;
}

.me-edit-stage__nav {
  padding: 0.75rem 0;
}

.me-edit-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.me-edit-topbar__action {
  margin-left: auto;
  color: var(--color-accent, #7ec8e3);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border: 1px solid rgba(126, 200, 227, 0.3);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
  transition: background 0.15s;
}

.me-edit-topbar__action:hover {
  background: rgba(126, 200, 227, 0.08);
}

.me-edit-topbar__back {
  color: var(--color-accent, #7ec8e3);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
  white-space: nowrap;
}

.me-edit-topbar__back:hover {
  opacity: 1;
  text-decoration: underline;
}

.me-edit-topbar__title {
  font-size: 1.1rem;
  margin: 0;
  flex: 1;
}

.me-edit-topbar__dirty {
  font-size: 0.78rem;
  color: var(--color-warn, #f0c040);
  letter-spacing: 0.05em;
  opacity: 0.9;
  white-space: nowrap;
}

.me-edit-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 1.5rem;
}

.me-edit-card .player-card__form {
  max-height: none;
  overflow: visible;
}

.me-edit-danger {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.me-edit-danger__heading {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #ff6060;
  font-family: var(--font-display);
}

.me-edit-danger__desc {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.me-edit-danger__btn {
  align-self: flex-start;
  min-height: 40px;
  padding: 0 20px;
  border: 2px solid rgba(255, 80, 80, 0.5);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 80, 80, 0.18), rgba(12, 8, 38, 0.9) 40%, rgba(8, 7, 24, 0.96));
  color: #fff8ff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 80, 80, 0.1);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.me-edit-danger__btn:hover,
.me-edit-danger__btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 80, 80, 0.85);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), 0 0 20px rgba(255, 80, 80, 0.2);
}

.me-edit-danger__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.me-edit-danger__flash {
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #99ffff;
}

@media (max-width: 600px) {
  .me-edit-stage {
    padding: 0 0.75rem 2rem;
  }

  .me-edit-card {
    padding: 1rem;
  }
}

/* Hide the layout-editor entry point on phones — the editor is desktop-only
   (see the notice in css/profile-layout.css), so never navigate them into it. */
@media (pointer: coarse) and (max-width: 960px) {
  .me-edit-topbar__action[href$="layout/"] {
    display: none;
  }
}
