/* Arcana Persona — Dedicated 5th Mode UI (Mobile-First, Modular) */
body.arcana-persona-active > *:not(#personaWorkspace):not(#arcane-avatar-btn):not(#arcane-account-backdrop):not(#arcane-upgrade-modal):not(#arcane-admin-codes-modal):not(#arcane-auth-gate):not(.arcane-modal-overlay) {
  visibility: hidden;
}

#personaWorkspace.prs-hidden {
  display: none !important;
}

#personaWorkspace {
  position: fixed;
  inset: 0;
  z-index: 4100;
  background: radial-gradient(circle at top right, #1b1730 0%, #0d1018 52%, #090b12 100%);
  color: #f3f4f6;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  height: 100dvh;
}

.prs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 68px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(13, 16, 24, 0.92);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.prs-top-left,
.prs-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.24), rgba(56, 189, 248, 0.22));
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}

.prs-main {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.prs-card {
  background: #131724;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prs-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.prs-sub {
  font-size: 13.5px;
  color: #b4bcc8;
  line-height: 1.48;
}

.prs-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.prs-badge.warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.prs-badge.ok {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
}

.prs-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.prs-avatar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 210px;
  gap: 16px;
  align-items: start;
}

.prs-input,
.prs-select,
.prs-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0c0f18;
  color: #f9fafb;
  font-size: 14px;
  box-sizing: border-box;
}

.prs-textarea {
  min-height: 78px;
  resize: vertical;
  font-family: inherit;
}

.prs-file-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.06);
  min-height: 44px;
}

.prs-file-box input[type="file"] {
  width: 100%;
  color: #e5e7eb;
  font-size: 13px;
}

.prs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f3f4f6;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease-out, background 120ms ease-out;
}

.prs-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.prs-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.prs-btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  border: none;
  color: #ffffff;
}

.prs-btn.green {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #ffffff;
}

.prs-btn.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.prs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  flex-wrap: wrap;
}

.prs-item-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 180px;
  flex: 1 1 auto;
}

.prs-avatar-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #38bdf8;
  flex-shrink: 0;
}

/* Live 9:16 YouTube Shorts Safe-Zone PiP Preview */
.prs-phone-stage {
  position: relative;
  width: 196px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #111827 0%, #1e293b 65%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.prs-phone-top-card {
  position: absolute;
  top: 9%;
  left: 10%;
  right: 10%;
  height: 18%;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.04em;
}

.prs-phone-pip {
  position: absolute;
  right: 6%;
  bottom: 22.5%;
  width: 26%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28), 0 6px 14px rgba(0, 0, 0, 0.55);
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.prs-phone-pip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prs-phone-pip.reactive {
  animation: prsBounce 1.1s ease-in-out infinite;
}

@keyframes prsBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.04); }
}

.prs-phone-safezone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20%;
  background: rgba(239, 68, 68, 0.16);
  border-top: 1.5px dashed rgba(248, 113, 113, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #fca5a5;
  padding: 4px;
}

.prs-photo-preview {
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.prs-scene-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13.5px;
}

.prs-prog-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.prs-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  transition: width 220ms ease-out;
}

.prs-video-preview {
  width: 100%;
  max-height: 460px;
  border-radius: 12px;
  background: #000;
}

.prs-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(18px);
  background: #1f2937;
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 5400;
  transition: opacity 180ms ease, transform 180ms ease;
}

.prs-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 720px) {
  .prs-row-2,
  .prs-avatar-layout {
    grid-template-columns: 1fr;
  }
  .prs-topbar {
    padding: 8px 60px 8px 10px;
  }
  .prs-actions .prs-btn {
    flex: 1 1 auto;
  }
}
