/* ==========================================================================
   VALKYRIE STUDIO - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Nordic Cyber-Folk, Glassmorphism, Deep Obsidian & Amber Glow
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-core: #07090e;
  --bg-surface-1: #0d121d;
  --bg-surface-2: rgba(17, 24, 39, 0.75);
  --bg-surface-3: #1f293d;
  --bg-surface-hover: #26334d;

  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);

  --accent-ice: #38bdf8;
  --accent-ice-light: #7dd3fc;
  --accent-ice-glow: rgba(56, 189, 248, 0.2);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.35);
  --border-ice: rgba(56, 189, 248, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-epic: 'Cinzel', serif, Georgia;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px -5px var(--accent-gold-glow);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Lights */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
  top: -150px;
  right: -100px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-ice) 0%, transparent 70%);
  bottom: 50px;
  left: -200px;
}

.ambient-noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 1;
}

/* Header Styles */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px 0 24px;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-gold-glow);
}

.rune-icon {
  font-size: 1.8rem;
  color: var(--accent-gold-light);
  font-family: var(--font-epic);
  font-weight: 700;
}

.brand-text h1 {
  font-family: var(--font-epic);
  font-size: 1.5rem;
  letter-spacing: 2px;
  font-weight: 900;
  background: linear-gradient(90deg, #ffffff, var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--accent-ice);
  letter-spacing: 1.5px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-accent {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-ice-light);
  border: 1px solid var(--border-ice);
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-ice);
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Nav Tabs */
.nav-tabs {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; /* todas as abas sempre visíveis */
  gap: 6px;
  padding-bottom: 8px;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #1a1204;
  background: var(--accent-gold);
  border-bottom-color: var(--accent-gold-light);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  box-shadow: 0 0 18px -4px var(--accent-gold-glow);
}

.tab-btn.active .tab-icon { filter: none; }

/* Main Container */
.main-content {
  position: relative;
  z-index: 2;
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 24px 60px 24px;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Hero */
.section-hero {
  margin-bottom: 32px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.section-hero h2 {
  font-family: var(--font-epic);
  font-size: 2rem;
  letter-spacing: 1px;
  color: #ffffff;
  margin-bottom: 8px;
}

.section-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 800px;
}

/* Prompt Cards & Grid */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 24px;
}

@media (max-width: 768px) {
  .prompts-grid {
    grid-template-columns: 1fr;
  }
}

.prompt-card {
  background: var(--bg-surface-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.prompt-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 14px 35px -10px rgba(0, 0, 0, 0.8), 0 0 20px -5px var(--accent-gold-glow);
}

.featured-card {
  grid-column: 1 / -1;
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, var(--bg-surface-2) 100%);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.category-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-ice);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.card-title-group h3 {
  font-size: 1.25rem;
  color: #ffffff;
  font-weight: 700;
}

/* Prompt Code Box */
.prompt-code-box {
  background: #04060a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.prompt-code-box code {
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Consolas', 'Monaco', monospace;
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-ice), #0284c7);
  color: #07090e;
  font-weight: 700;
}

.btn-accent:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-copy {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold-light);
  border: 1px solid var(--border-gold);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.btn-copy:hover {
  background: var(--accent-gold);
  color: #000;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Prompt Breakdown */
.prompt-breakdown {
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.prompt-breakdown h4 {
  font-size: 0.9rem;
  color: var(--accent-gold-light);
  margin-bottom: 12px;
}

.breakdown-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.b-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.b-term {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-ice-light);
  border: 1px solid var(--border-ice);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.8rem;
}

.b-desc {
  color: var(--text-muted);
}

.card-footer-tip {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Builder Layout */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 992px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }
}

.builder-controls {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.custom-select, .custom-input {
  background: #090d15;
  border: 1px solid var(--border-subtle);
  color: #f1f5f9;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.custom-select:focus, .custom-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.builder-preview {
  position: sticky;
  top: 100px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
}

.dynamic-output-box {
  background: #05070c;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.dynamic-output-box p {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.96rem;
  color: #e2e8f0;
  line-height: 1.6;
}

.prompt-translation-box {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-ice);
  padding: 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
}

.translation-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ice);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.prompt-translation-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.action-bar-tips {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.85rem;
}

.tip-badge {
  font-weight: 700;
  color: var(--accent-gold-light);
  margin-bottom: 4px;
}

/* Lip-Sync Concept Card */
.concept-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(245, 158, 11, 0.08));
  border: 1px solid var(--border-ice);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}

.concept-icon {
  font-size: 2.2rem;
}

.concept-text h3 {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.concept-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Scripts Grid */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.script-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.script-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.script-header h4 {
  font-size: 1.05rem;
  color: #ffffff;
}

.tag-bpm {
  font-size: 0.75rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold-light);
  border: 1px solid var(--border-gold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.script-lyrics {
  background: #05070c;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lyric-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.syllable-open {
  color: var(--accent-gold-light);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
}

.syllable-beat {
  color: var(--accent-ice-light);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
}

.phonetic-tip {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.script-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 12px;
}

.script-match {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Custom Phonetic Generator */
.phonetic-generator-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.phonetic-generator-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.phonetic-generator-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.input-inline {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.input-inline .custom-input {
  flex: 1;
  min-width: 260px;
}

.phonetic-result-box {
  background: #05070c;
  border: 1px solid var(--border-ice);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
}

.phonetic-result-box p {
  font-size: 1.1rem;
  color: var(--accent-ice-light);
  font-weight: 700;
  letter-spacing: 1px;
  margin: 8px 0 12px 0;
}

/* Timeline Workflow */
.timeline-workflow {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.timeline-step {
  display: flex;
  gap: 24px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.2s ease;
}

.timeline-step:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.step-number {
  font-family: var(--font-epic);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-gold);
  opacity: 0.8;
  line-height: 1;
  min-width: 50px;
}

.step-body {
  flex: 1;
}

.step-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  display: inline-block;
}

.tag-audio { color: #f43f5e; }
.tag-image { color: var(--accent-gold); }
.tag-video { color: var(--accent-ice); }
.tag-edit { color: #a855f7; }
.tag-yt { color: #ef4444; }

.step-body h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #ffffff;
}

.step-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.step-body ul {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-body code {
  background: #05070c;
  color: var(--accent-gold-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.edit-tricks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.trick-card {
  background: #05070c;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.85rem;
}

.trick-card strong {
  display: block;
  color: #a855f7;
  margin-bottom: 4px;
}

.trick-card span {
  color: var(--text-muted);
}

.viral-titles-box {
  background: #05070c;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.viral-titles-box code {
  display: block;
  background: transparent;
  color: #38bdf8;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 32px;
}

.gallery-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
}

.img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
}

.square-wrapper {
  aspect-ratio: 1 / 1;
}

.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .img-wrapper img {
  transform: scale(1.03);
}

.img-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.card-caption {
  padding: 20px;
}

.card-caption h4 {
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.card-caption p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0d1627;
  border: 1px solid var(--accent-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--accent-gold-glow);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 999;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  background: var(--accent-gold);
  color: #000;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   CHARACTER PROFILE HUB & SELECTOR STYLES
   ========================================================================== */
.profile-selector-container {
  margin-bottom: 2.5rem;
  background: rgba(13, 18, 29, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
}

.profile-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-selector-header h3 {
  font-size: 1.15rem;
  font-family: var(--font-epic);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.profile-selector-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.profile-selector-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  box-shadow: 0 12px 30px -10px rgba(245, 158, 11, 0.25);
}

.profile-selector-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(13, 18, 29, 0.95) 100%);
  box-shadow: 0 0 25px -5px var(--accent-gold-glow), 0 10px 30px -5px rgba(0, 0, 0, 0.6);
}

.profile-selector-card.active::before {
  content: '✓ ATIVO';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-gold);
}

.profile-selector-card.card-gospel.active {
  border-color: var(--accent-ice);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(13, 18, 29, 0.95) 100%);
  box-shadow: 0 0 25px -5px var(--accent-ice-glow);
}

.profile-selector-card.card-gospel.active::before {
  color: var(--accent-ice);
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--border-ice);
}

.profile-avatar-wrapper {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.profile-selector-card.card-gospel .profile-avatar-wrapper {
  border-color: var(--accent-ice);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  margin-bottom: 0.2rem;
}

.profile-selector-card.card-gospel .profile-tag {
  color: var(--accent-ice);
}

.profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.profile-short-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.profile-selector-card.card-add-new {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  justify-content: center;
  text-align: center;
  flex-direction: column;
  padding: 1.25rem;
}

.profile-selector-card.card-add-new:hover {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
}

.add-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
}

.profile-detail-panel {
  display: none;
  animation: fadeInProfile 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.profile-detail-panel.active {
  display: block;
}

@keyframes fadeInProfile {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==========================================================================
   PERFIS DINÂMICOS — barra de ações, painel e editor
   ========================================================================== */

.profile-toolbar,
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-toolbar label.btn { cursor: pointer; }

.btn-danger:hover {
  border-color: #ef4444;
  color: #fca5a5;
}

.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-epic);
  font-size: 1.6rem;
  color: var(--accent-gold);
  background: var(--bg-surface-3);
}

.profile-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.profile-image-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.profile-image-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.profile-image-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-sm);
  display: block;
}

.profile-image-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.profile-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* Editor modal */
body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(6px);
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  width: min(860px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-family: var(--font-epic);
  color: var(--accent-gold);
}

.modal-footer {
  justify-content: flex-end;
  border-bottom: none;
  border-top: 1px solid var(--border-subtle);
}

.modal-body {
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-section legend {
  padding: 0 0.5rem;
  font-weight: 700;
  color: var(--accent-gold-light);
}

.form-section label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.form-section small { color: var(--text-dim); font-weight: 400; }

.form-section code {
  font-size: 0.8em;
  color: var(--accent-ice-light);
}

.form-section textarea.custom-input {
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-row > label { min-width: 180px; }

.storage-status {
  font-size: 0.8rem;
  margin: -0.5rem 0 1rem;
  color: var(--text-muted);
}
.storage-status.storage-ok { color: #4ade80; }
.storage-status.storage-saving { color: var(--accent-ice-light); }
.storage-status.storage-warn { color: var(--accent-gold-light); }
.storage-status.storage-error { color: #f87171; }

.profile-reference {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 1.25rem;
  align-items: start;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.06);
}
.profile-reference img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-sm);
}
.profile-reference-info { display: flex; flex-direction: column; gap: 0.75rem; }
.profile-reference-info p { font-size: 0.9rem; color: var(--text-muted); }
.profile-reference-info code { font-size: 0.8rem; color: var(--accent-ice-light); word-break: break-all; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); }
@media (max-width: 600px) {
  .profile-reference { grid-template-columns: 1fr; }
  .profile-reference img { max-width: 220px; }
}

/* Aba Publicar */
.publish-status { margin-bottom: 1.25rem; }
.publish-guide { display: block; margin-bottom: 1.5rem; }
.publish-guide summary { cursor: pointer; color: var(--accent-gold-light); }
.publish-guide ol { margin: 1rem 0 0.75rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.publish-guide a { color: var(--accent-ice-light); }
.publish-guide code, .section-hero code { color: var(--accent-ice-light); word-break: break-all; }
.publish-kids { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.publish-kids legend { padding: 0 0.4rem; font-size: 0.85rem; }
.publish-kids label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.publish-preview { width: 100%; max-width: 320px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius-md); display: block; margin: 0 auto 1rem; }
.publish-form textarea.custom-input { resize: vertical; }

[hidden] { display: none !important; }

.yt-channel-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.yt-channel-list:empty { display: none; }
.yt-channel-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.yt-channel-list li span { flex: 1; font-weight: 600; }
.yt-channel-list img, .yt-channel-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #c00; color: #fff; font-size: 0.8rem; flex: 0 0 auto; }


/* Prompts prontos compactos (perfil) */
.prompt-list { display: flex; flex-direction: column; gap: 0.5rem; }
.prompt-row {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  padding: 0.65rem 0.9rem;
}
.prompt-row-head { display: flex; align-items: center; gap: 0.75rem; }
.prompt-row-info { flex: 1; min-width: 0; }
.prompt-row-info h4 { font-size: 0.95rem; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt-row-info .category-tag { font-size: 0.68rem; }
.prompt-row-actions { display: flex; gap: 0.4rem; flex: 0 0 auto; }
.prompt-row .prompt-code-box { margin: 0.65rem 0 0; max-height: 320px; overflow-y: auto; }
.prompt-row .prompt-code-box code { white-space: pre-wrap; font-size: 0.82rem; }
.prompt-row.open .btn-toggle-prompt { border-color: var(--accent-gold); color: var(--accent-gold-light); }

/* Perfil mais compacto */
.profile-collapse { margin-top: 0.75rem; padding: 0.75rem 1rem; }
.profile-collapse summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.profile-collapse summary::-webkit-details-marker { display: none; }
.profile-collapse summary::after { content: '▸'; margin-left: auto; color: var(--text-dim); transition: transform 0.2s; }
.profile-collapse[open] summary::after { transform: rotate(90deg); }
.profile-collapse summary h4 { margin: 0; }
.profile-collapse[open] .breakdown-tags { margin-top: 0.75rem; }
.dna-clamp code { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.profile-reference { grid-template-columns: minmax(110px, 140px) 1fr; }
.profile-images-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.profile-image-card img { height: 160px; }
.profile-image-card p { display: none; }

/* Grupos de prompts (por roteiro) */
.prompt-group { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface-2); }
.prompt-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; font-weight: 700; }
.prompt-group > summary::-webkit-details-marker { display: none; }
.prompt-group > summary::before { content: '▸'; color: var(--accent-gold); transition: transform 0.2s; }
.prompt-group[open] > summary::before { transform: rotate(90deg); }
.prompt-group[open] > summary { color: var(--accent-gold-light); border-bottom: 1px solid var(--border-subtle); }
.prompt-group-name { flex: 1; }
.prompt-group-count { font-size: 0.75rem; font-weight: 500; color: var(--text-dim); }
.prompt-group-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.prompt-group-body .prompt-row { background: rgba(0, 0, 0, 0.25); }

.channel-row { display: flex; gap: 0.5rem; align-items: center; }
.channel-row .custom-select { flex: 1; }

.field-missing { outline: 2px solid #f87171; outline-offset: 3px; border-radius: var(--radius-md); }

/* Vídeos enviados */
.sent-videos { margin-top: 2rem; }
.sent-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }
.sent-list li { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.6rem 0.75rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: rgba(0,0,0,0.25); }
.sent-list img { width: 72px; height: 54px; object-fit: cover; border-radius: var(--radius-sm); }
.sent-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.sent-title { color: var(--text-main); font-weight: 600; text-decoration: none; }
.sent-title:hover { color: var(--accent-gold-light); text-decoration: underline; }
.sent-status { font-size: 0.8rem; color: var(--text-muted); }
.sent-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.sent-when { width: auto; padding: 6px 8px; font-size: 0.8rem; }
#pub-schedule { margin-top: 0.5rem; }

.yt-app-select { width: auto; padding: 6px 10px; font-size: 0.85rem; }
.yt-app-tag { font-weight: 500; color: var(--text-dim); margin-left: 0.4rem; }

/* Página do perfil */
.profile-breadcrumb { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
#profile-breadcrumb-name { color: var(--text-muted); font-weight: 600; }

.profile-channel { margin: 1rem 0 0.5rem; padding: 0.9rem 1rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: rgba(0,0,0,0.25); display: flex; flex-direction: column; gap: 0.5rem; }
.profile-channel label { font-weight: 700; font-size: 0.9rem; }

.publish-lock { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; border: 1px solid var(--border-gold); border-radius: var(--radius-md); background: rgba(245, 158, 11, 0.08); font-size: 0.9rem; }
.custom-select:disabled { opacity: 0.6; cursor: not-allowed; }

/* Roteirizador */
.rt-setup { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.25rem; }
.rt-setup label, .rt-scene label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--text-muted); flex: 1; min-width: 180px; }
.rt-setup .rt-check { flex-direction: row; align-items: center; gap: 0.5rem; }
.rt-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.rt-scene { display: flex; flex-direction: column; gap: 0.75rem; }
.rt-scene h4 { color: var(--accent-gold-light); }
.rt-scene h4 small { color: var(--text-dim); font-weight: 500; }
.rt-scene .form-row { flex-direction: column; }
.rt-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1rem 0; }
.rt-problems { padding: 1rem; border: 1px solid #f87171; border-radius: var(--radius-md); background: rgba(248, 113, 113, 0.08); }
.rt-problems ul { margin: 0.5rem 0 0 1.25rem; color: var(--text-muted); }
.prompt-row.open .prompt-code-box { display: block; }

.legacy-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.legacy-list label { display: flex; gap: 0.75rem; align-items: center; padding: 0.6rem 0.8rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); cursor: pointer; }
.legacy-list small { color: var(--text-dim); }

.rt-refimage { margin-bottom: 1rem; border-color: var(--border-gold); }
.rt-refimage .prompt-code-box { margin-top: 0.5rem; }

/* Excluir prompts do perfil */
.btn-del-prompt { padding: 0.2rem 0.5rem; line-height: 1; }
.btn-del-prompt:hover { border-color: #e05555; background: rgba(224, 85, 85, 0.15); }
.prompt-group summary .btn-del-prompt { margin-left: 0.5rem; }
.prompt-meta { display: inline-flex; gap: 0.5rem; align-items: center; font-size: 0.72rem; color: var(--text-dim); margin-right: 0.5rem; font-weight: 500; }
.prompt-src { padding: 0.1rem 0.45rem; border-radius: 999px; border: 1px solid currentColor; }
.prompt-src-auto { color: #6fcf97; }
.prompt-src-ai { color: #9b8cff; }
.prompt-src-manual { color: var(--text-dim); }
.pub-roteiro-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pub-roteiro-row select { flex: 1; min-width: 200px; }

/* Onde publicar (YouTube / Facebook) */
.publish-targets { display: flex; flex-direction: column; gap: 0.4rem; border: 1px solid var(--border, #2a3142); border-radius: 10px; padding: 0.75rem 1rem; }
.publish-targets legend { padding: 0 0.3rem; }
.publish-targets label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.publish-targets select { margin-top: 0.25rem; }
.pub-lang-toggle { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; cursor: pointer; }
.ig-token-box { margin-top: 0.75rem; }
.ig-token-box summary { cursor: pointer; font-weight: 600; }
.ig-token-box .channel-row { margin-top: 0.5rem; }

/* Itens técnicos: só o administrador enxerga (o aluno nunca vê token, .env, endereço de retorno etc.) */
.admin-only { display: none !important; }
html[data-role="admin"] .admin-only { display: revert !important; }
