/* ==========================================================================
   1. DESIGN TOKENS & VARIÁVEIS CSS (TEMA ESCURO PREMIUM SLATE)
   ========================================================================== */:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Cores de Fundo Premium (Deep Obsidian Slate) */
  --bg-app: #080d16;             /* Fundo da aplicação ultra-escuro */
  --bg-card: rgba(15, 23, 42, 0.65); /* Slate-900 translúcido */
  --bg-surface: #0f172a;         /* Slate-900 sólido para contraste */
  --bg-input: rgba(5, 8, 15, 0.7); /* Input escuro integrado */
  
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%); /* Azul Royal a Índigo */
  --primary-color: #3b82f6;      /* Azul Cobalto */
  --secondary-color: #4f46e5;    /* Índigo */
  
  /* Identidade Dourada Premium (Gold Accents) */
  --color-gold: #f5d061;
  --gold-gradient: linear-gradient(135deg, #ffe082 0%, #f5d061 50%, #d97706 100%);
  --gold-glow: 0 0 15px rgba(245, 208, 97, 0.35);
  --blue-glow: 0 4px 15px rgba(37, 99, 235, 0.35);
  
  /* Cores de Feedback (Status & Validações com melhor contraste) */
  --color-success: #10b981;    /* Verde */
  --color-info: #3b82f6;       /* Azul */
  --color-danger: #f87171;     /* Vermelho mais claro para contraste WCAG no fundo escuro */
  --color-warning: #f59e0b;    /* Laranja */

  /* Cores de Texto e Bordas (Ajustadas para WCAG 2.1 AA) */
  --text-primary: #f8fafc;     /* Slate-50 */
  --text-secondary: #cbd5e1;   /* Slate-300 (melhora leitura e contraste) */
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: #8b5cf6;
  
  /* Efeitos e Sombras */
  --glass-blur: blur(16px);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-area-bottom: max(36px, env(safe-area-inset-bottom, 36px));
  --safe-area-top: env(safe-area-inset-top, 0px);
  --ad-banner-height: 0px;
}

/* Reset Básico para Mobile */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Remove outline azul de toque no Android */
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden; /* Evita rolagem da página inteira no mobile */
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* Interface Principal Layout Grid */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Header / Título do App */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: calc(12px + var(--safe-area-top)) 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 90;
}

.app-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  font-size: 24px;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #f5d061 0%, #e6a100 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Botão de configurações com área de toque expandida (~46px) */
.app-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.app-actions-group .btn-settings {
  width: 38px;
  height: 38px;
  padding: 8px !important;
}

.btn-settings {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-settings:hover, .btn-settings:active {
  color: var(--text-primary);
}

.auth-chip {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  max-width: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.auth-chip-header .auth-label {
  display: none;
}

.auth-chip:hover,
.auth-chip:active,
.auth-chip.logged {
  color: var(--text-primary);
  border-color: rgba(245, 208, 97, 0.32);
  box-shadow: var(--gold-glow);
}

.auth-google-mark,
.auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
}

.auth-google-mark {
  background: #ffffff;
  color: #1f2937;
}

.auth-avatar {
  background: var(--gold-gradient);
  color: #0f172a;
}

.auth-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-inline-help,
.btn-help-dot {
  border: 1px solid rgba(245, 208, 97, 0.35);
  background: rgba(245, 208, 97, 0.08);
  color: var(--color-gold);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-inline-help {
  min-width: 96px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
}

.btn-help-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-left: 4px;
}

.btn-inline-help:active,
.btn-help-dot:active {
  transform: scale(0.96);
  background: rgba(245, 208, 97, 0.16);
}

.assist-actions {
  display: flex;
  gap: 8px;
  padding: 0 0 4px;
}

.assist-actions .btn-inline-help {
  flex: 1;
}

.examples-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.example-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 13px;
  cursor: pointer;
}

.example-list-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.example-list-item span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.example-list-item:active {
  transform: scale(0.98);
}

.tutorial-body,
.quick-help-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-step-card {
  display: flex;
  gap: 12px;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

.tutorial-step-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-gradient);
  color: #080d16;
  font-weight: 800;
}

.tutorial-step-card strong,
.quick-help-body strong {
  color: var(--text-primary);
  font-size: 13px;
}

.tutorial-step-card p,
.quick-help-body p,
.quick-help-body li {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.quick-help-body ul {
  margin-left: 16px;
}

/* ==========================================================================
   2. TRILHA DE PROGRESSO DO WIZARD (RESPONSIVA)
   ========================================================================== */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  z-index: 80;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.1);
  z-index: -1;
  transition: var(--transition-smooth);
}

.wizard-step.completed:not(:last-child)::after {
  background: var(--primary-gradient);
}

.wizard-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.wizard-step.active .wizard-icon {
  background: var(--gold-gradient) !important;
  border-color: transparent !important;
  color: #080d16 !important; /* Texto escuro para excelente contraste */
  box-shadow: var(--gold-glow) !important;
  font-weight: 700;
}

.wizard-step.completed .wizard-icon {
  background: var(--secondary-color);
  border-color: transparent;
  color: var(--text-primary);
}

.wizard-label {
  font-size: 10px;
  margin-top: 6px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  transition: var(--transition-smooth);
}

.wizard-step.active .wizard-label {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 480px) {
  .wizard-label {
    display: none; /* Esconde em telas pequenas para evitar quebra */
  }
  .wizard-step.active .wizard-label {
    display: block; /* Mostra apenas o ativo */
    position: absolute;
    top: 34px;
    font-size: 9px;
    white-space: nowrap;
  }
  .wizard-progress {
    padding-bottom: 22px; /* Margem extra */
  }
}

/* Area de Conteúdo Principal (Wizard Viewports) */
.wizard-content {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.step-panel {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 16px 16px calc(16px + var(--ad-banner-height));
  overflow-y: auto;
}

.step-panel.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Bloqueio de scroll do painel para evitar conflito com pan/zoom no Canvas */
.step-panel-canvas {
  overflow: hidden !important;
  height: 100%;
  padding-bottom: 16px;
}

/* Suporte estrutural a abas */
.tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}
.tab-panel.active {
  display: flex;
}

/* ==========================================================================
   3. ESTILOS DE ESTRUTURA E PAINÉIS (GLASSMORPHISM)
   ========================================================================== */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05); /* Borda mais fina e elegante */
  border-radius: 16px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-lg); /* Efeito 3D reflexivo no topo */
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
  padding: 18px;
  margin-bottom: 16px;
}

@supports not (backdrop-filter: blur(1px)) {
  .glass-panel {
    background: rgba(30, 41, 59, 0.95);
  }
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* ==========================================================================
   4. FORMULÁRIOS, BOTÕES E SEGMENTED CONTROLS
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition-smooth);
  font-family: inherit;
}

.form-input::placeholder {
  color: rgba(148, 163, 184, 0.45) !important;
  opacity: 0.45 !important;
}
.form-input::-webkit-input-placeholder {
  color: rgba(148, 163, 184, 0.45) !important;
  opacity: 0.45 !important;
}
.form-input::-moz-placeholder {
  color: rgba(148, 163, 184, 0.45) !important;
  opacity: 0.45 !important;
}
.form-input:-ms-input-placeholder {
  color: rgba(148, 163, 184, 0.45) !important;
  opacity: 0.45 !important;
}

.form-input.example-text {
  color: rgba(148, 163, 184, 0.45) !important;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea.form-input {
  resize: none;
  min-height: 120px;
  line-height: 1.5;
}

/* Botões */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding: 10px 0 calc(10px + var(--safe-area-bottom) + var(--ad-banner-height));
  z-index: 10;
}

.step-panel-canvas .btn-group {
  padding-bottom: calc(10px + var(--safe-area-bottom));
}

.btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-primary);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
  transform: scale(0.96);
  opacity: 0.9;
  box-shadow: 0 2px 5px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--text-primary);
}

.btn-danger:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-success {
  background: var(--color-success);
  color: var(--bg-app);
}

.btn-success:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Segmented Control touch-friendly */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.segmented-button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segmented-button.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   5. CANVAS DO EDITOR BPMN & CONTROLES
   ========================================================================== */
.canvas-wrapper {
  flex: 1;
  position: relative;
  background: #111827; /* Fundo escuro neutro para o grid */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.bpmn-canvas {
  width: 100%;
  height: 100%;
}

.canvas-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

/* Controles de navegação aumentados para 48x48px (MD3) */
.btn-control {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-size: 18px;
  font-weight: bold;
  transition: var(--transition-smooth);
}

.btn-control:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.96);
  opacity: 0.9;
}

/* ==========================================================================
   6. BOTTOM SHEET (PROPRIEDADES DO ELEMENTO - TOUCH FRIENDLY)
   ========================================================================== */
/* Transição de fade refinada no backdrop da gaveta */
.bottom-sheet-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 990;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.1, 0.76, 0.55, 0.94);
  z-index: 1000;
  padding: 16px 20px calc(28px + var(--safe-area-bottom));
  max-height: 80vh;
  overflow-y: auto;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 0 auto 16px;
}

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

.bottom-sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Botão de Fechar com padding invisível expandido para toque */
.btn-close-sheet {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -12px;
}

/* Reorganização de status para grid legível no mobile (2x2) */
.status-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.status-option {
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.status-option:active {
  transform: scale(0.95);
}

.status-option.normal {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
}
.status-option.normal.selected {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.status-option.added {
  background: rgba(16, 185, 129, 0.05);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}
.status-option.added.selected {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--color-success);
  color: var(--text-primary);
}

.status-option.modified {
  background: rgba(59, 130, 246, 0.05);
  color: var(--color-info);
  border-color: rgba(59, 130, 246, 0.2);
}
.status-option.modified.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--color-info);
  color: var(--text-primary);
}

.status-option.removed {
  background: rgba(239, 68, 68, 0.05);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.status-option.removed.selected {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-danger);
  color: var(--text-primary);
}

/* ==========================================================================
   7. AUDITORIA LOCAL / PANEL DE CONFORMIDADE
   ========================================================================== */
.audit-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  max-height: 150px;
  overflow-y: auto;
  gap: 8px;
}

.audit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.audit-item:last-child {
  border-bottom: none;
}

.audit-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 2px;
}

.audit-indicator.error {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  border-radius: 4px;
}

.audit-indicator.warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fde047 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: 4px;
}

.audit-indicator.success {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #a7f3d0 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  border-radius: 4px;
}

.audit-text {
  color: var(--text-secondary);
  line-height: 1.4;
}

.audit-text strong {
  color: var(--text-primary);
}

/* Anotação Visual Pulsante para Erros no Canvas */
.canvas-node-error {
  outline: 2px solid var(--color-danger) !important;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { outline-color: rgba(239, 68, 68, 0.4); }
  50% { outline-color: rgba(239, 68, 68, 1); }
  100% { outline-color: rgba(239, 68, 68, 0.4); }
}

/* Efeito de gravação no botão de voz */
.btn-clear-text.listening {
  color: #ef4444 !important;
  font-weight: bold;
  animation: pulse-mic 1.2s infinite;
}

@keyframes pulse-mic {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg); }
}

/* ==========================================================================
   8. DASHBOARD DE GANHOS (ETAPA 4)
   ========================================================================== */
.gains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.gain-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.gain-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 6px;
}

.gain-value.success {
  color: var(--color-success);
}

.gain-label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.gains-summary-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--primary-color);
  padding: 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .gains-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }
  .gain-card {
    padding: 10px 4px;
  }
  .gain-value {
    font-size: 18px;
  }
  .gain-label {
    font-size: 9px;
  }
}

/* Modal Overlay padrão */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* Loader animado */
.loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.9);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   9. TELA DE CONFIGURAÇÕES DE API KEY
   ========================================================================== */
.settings-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  z-index: 2000;
  display: none;
  flex-direction: column;
  padding: 18px 20px;
  overflow-y: auto;
  gap: 12px;
}

.settings-overlay.open {
  display: flex;
}

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

.settings-auth-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(245, 208, 97, 0.16);
  border-radius: 8px;
  background: rgba(245, 208, 97, 0.05);
}

.settings-auth-copy {
  min-width: 0;
}

.settings-auth-card .panel-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.settings-auth-card .auth-chip {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 44px;
  justify-content: flex-start;
  padding: 10px 12px;
  gap: 8px;
}

.settings-auth-card .auth-chip .auth-label {
  display: block;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.settings-auth-card .auth-avatar,
.settings-auth-card .auth-google-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  font-size: 15px;
}

.settings-advanced {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.settings-advanced summary {
  cursor: pointer;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-advanced[open] summary {
  margin-bottom: 12px;
}

.settings-small-button {
  flex: 0 0 auto;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 12px !important;
  font-size: 13px !important;
}

.settings-status-message {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
}

.settings-action-button {
  flex: 0 0 auto;
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 8px;
}

/* ==========================================================================
   10. BPMN.JS DARK MODE OVERRIDES (ESTILO PREMIUM DO CANVAS)
   ========================================================================== */
.bjs-container, .bpmn-canvas, .bjs-container svg {
  background-color: #080d16 !important; /* Mesma cor de fundo do app */
}

/* Oculta logotipo de marca d'água no mobile */
.bjs-powered-by {
  display: none !important;
}

/* Elementos Padrão do Fluxo */
.djs-element:not(.djs-connection) .djs-visual > :nth-child(1) {
  stroke: #cbd5e1 !important;
  fill: #0f172a !important; /* Slate escuro sólido */
  stroke-width: 1.5px !important;
}

/* Evento de Início (Glow Verde) */
.djs-element[data-element-id^="StartEvent"] .djs-visual circle {
  stroke: var(--color-success) !important;
  fill: rgba(16, 185, 129, 0.06) !important;
  stroke-width: 2.5px !important;
}

/* Evento de Fim (Glow Vermelho) */
.djs-element[data-element-id^="EndEvent"] .djs-visual circle {
  stroke: #ef4444 !important;
  fill: rgba(239, 68, 68, 0.06) !important;
  stroke-width: 3px !important;
}

/* Gateways Padrão (Glow Laranja) */
.djs-element[data-element-id^="Gateway"] .djs-visual polygon {
  stroke: var(--color-warning) !important;
  fill: rgba(245, 158, 11, 0.06) !important;
  stroke-width: 2px !important;
}

/* --- OVERRIDES DE STATUS CUSTOMIZADOS (Glow Concept para Visual Premium) --- */

/* Elemento Adicionado (Nova/Automação) */
.status-added:not(.djs-connection) .djs-visual > :nth-child(1) {
  fill: rgba(16, 185, 129, 0.08) !important;
  stroke: #10b981 !important;
  stroke-width: 2px !important;
}
.status-added .djs-visual text {
  fill: #f8fafc !important; /* Texto branco de alto contraste */
}

/* Elemento Alterado (Modificada/Manual) */
.status-modified:not(.djs-connection) .djs-visual > :nth-child(1) {
  fill: rgba(59, 130, 246, 0.08) !important;
  stroke: #3b82f6 !important;
  stroke-width: 2px !important;
}
.status-modified .djs-visual text {
  fill: #f8fafc !important;
}

/* Elemento Excluído (Removida) */
.status-removed:not(.djs-connection) .djs-visual > :nth-child(1) {
  fill: rgba(239, 68, 68, 0.08) !important;
  stroke: #ef4444 !important;
  stroke-width: 2.5px !important;
}
.status-removed .djs-visual text {
  fill: #f8fafc !important;
}

/* Conexões e Setas do Fluxo */
.event-start:not(.djs-connection) .djs-visual > :nth-child(1) {
  fill: rgba(16, 185, 129, 0.12) !important;
  stroke: #10b981 !important;
  stroke-width: 2.5px !important;
}

.event-end:not(.djs-connection) .djs-visual > :nth-child(1) {
  fill: rgba(239, 68, 68, 0.12) !important;
  stroke: #ef4444 !important;
  stroke-width: 3px !important;
}

.djs-connection .djs-visual path {
  stroke: #475569 !important; /* Slate-600 para não poluir visualmente */
  stroke-width: 2px !important;
  fill: none !important;
}

.djs-connection .djs-visual marker path {
  fill: #475569 !important;
  stroke: none !important;
}

/* Textos e Rótulos do Diagrama */
.djs-element .djs-visual text,
.djs-label text {
  fill: #e2e8f0 !important;
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
}

/* Raias e Piscinas (Lanes & Pools) */
.djs-element[data-element-id^="Participant"] .djs-visual rect,
.djs-element[data-element-id^="Lane"] .djs-visual rect,
.djs-element[data-element-id*="lane"] .djs-visual rect,
.djs-element[data-element-id*="Lane"] .djs-visual rect {
  stroke: rgba(255, 255, 255, 0.12) !important;
  fill: #060a12 !important;
}

/* Foco e Seleção (Gold Active Glow) */
.djs-element.selected .djs-outline {
  stroke: var(--color-gold) !important;
  stroke-width: 3px !important;
}

/* Paleta Nativa do BPMN.js (Se Ativada) */
.djs-palette {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: 12px !important;
  left: 12px !important;
  top: 12px !important;
}

.djs-palette .entry {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
  filter: invert(1) brightness(100) !important; /* Inverte ícones escuros padrão do BPMN.js para branco */
}

.djs-palette .entry:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
}

/* Context Pad (Ações Flutuantes do Nó) */
.djs-context-pad {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: 12px !important;
  padding: 6px !important;
}

.djs-context-pad .entry {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
  filter: invert(1) brightness(100) !important; /* Corrige o bug dos botões quadrados brancos */
  margin: 2px !important;
}

.djs-context-pad .entry:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
}

/* Ocultar paleta lateral do BPMN.js para visualização em tela cheia */
.canvas-wrapper.hide-palette .djs-palette {
  display: none !important;
}

/* Destaque para botões de controle de tela ativos (Modo Mão e Tela Cheia) */
.btn-control.active {
  background: var(--primary-color) !important;
  color: #ffffff !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4) !important;
}

/* Otimização de Layout para Textareas Flexíveis e Responsivos no Mobile */
.step1-panel, .step3-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.form-group-textarea {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.form-input-scrollable {
  flex: 1;
  min-height: 280px; /* Garante tamanho grande inicial no celular */
  resize: none;
  overflow-y: auto !important;
  line-height: 1.5;
}

/* Cabeçalho do Rótulo para acomodar o botão de Limpar Texto */
.label-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.label-header .form-label {
  margin-bottom: 0;
}

.btn-clear-text {
  background: transparent;
  border: none;
  color: #fca5a5; /* Vermelho pastel suave mas com alto contraste */
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-clear-text:hover, .btn-clear-text:active {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  transform: scale(0.95);
}

/* Botão de demonstração em dourado premium */
#btnDemoMode {
  border: 1.5px dashed var(--color-gold) !important;
  background: rgba(245, 208, 97, 0.03) !important;
  color: var(--color-gold) !important;
}
#btnDemoMode:active {
  background: rgba(245, 208, 97, 0.1) !important;
  transform: scale(0.98);
}

/* ==========================================================================
   11. TELA CHEIA (FULLSCREEN MODE OVERRIDES)
   ========================================================================== */
.canvas-wrapper.fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 950 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

@supports (padding: env(safe-area-inset-top)) {
  .canvas-wrapper.fullscreen-active {
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    padding-left: env(safe-area-inset-left) !important;
    padding-right: env(safe-area-inset-right) !important;
  }
}

.canvas-wrapper.fullscreen-active .canvas-controls {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  right: calc(16px + env(safe-area-inset-right, 0px)) !important;
}

/* Badge de Exemplo/Demonstração nos Canvas */
.example-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.85); /* Slate-900 translúcido */
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 10;
  pointer-events: none;
  box-shadow: var(--blue-glow);
  display: flex;
  align-items: center;
  gap: 4px;
}

.example-badge.demo-badge {
  background: var(--gold-gradient);
  color: #080d16;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--gold-glow);
}

/* Credit Widget Styling */
.credit-widget {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.credit-widget.premium {
  background: rgba(245, 208, 97, 0.1);
  border-color: rgba(245, 208, 97, 0.3);
  color: var(--color-gold);
  box-shadow: var(--gold-glow);
}

.credit-widget.expired {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}

@media (max-width: 520px) {
  .app-header {
    padding-left: 10px;
    padding-right: 8px;
  }

  .app-title-group {
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-title {
    font-size: 17px;
    line-height: 1.12;
  }

  .app-actions-group {
    gap: 2px;
  }

  .app-actions-group .btn-settings {
    width: 32px;
    height: 32px;
    padding: 6px !important;
  }

  .app-actions-group .btn-settings svg {
    width: 18px;
    height: 18px;
  }

  .credit-widget {
    min-width: 58px;
    justify-content: center;
    padding: 5px 7px;
    font-size: 10px;
  }
}

/* API/Onboarding Gate Bottom Sheet Options */
.api-gate-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.api-gate-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.api-gate-card:hover, .api-gate-card:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.api-gate-card.recommend {
  border-color: rgba(245, 208, 97, 0.25);
  background: rgba(245, 208, 97, 0.02);
}

.api-gate-card.recommend:hover, .api-gate-card.recommend:active {
  background: rgba(245, 208, 97, 0.05);
  border-color: rgba(245, 208, 97, 0.4);
}

.api-gate-card.premium-card {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.02);
}

.api-gate-card.premium-card:hover, .api-gate-card.premium-card:active {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.5);
}

.api-gate-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.api-gate-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.api-gate-card.recommend .api-gate-card-title {
  color: var(--color-gold);
}

.api-gate-card.premium-card .api-gate-card-title {
  color: #818cf8; /* Light Indigo */
}

.api-gate-card-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.api-gate-card.recommend .api-gate-card-badge {
  background: var(--gold-gradient);
  color: #080d16;
}

.api-gate-card.premium-card .api-gate-card-badge {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
}

.api-gate-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Dica de rotação para mobile */
.mobile-rotation-tip {
  display: none;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -6px;
  margin-bottom: 12px;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .mobile-rotation-tip {
    display: block;
  }
}

/* Impedir seleção e cópia de textos na tela para visual de app nativo */
*, *::before, *::after {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* Permitir seleção e digitação apenas em campos de entrada de dados */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Otimizações para o Modo Paisagem (Landscape) em telas móveis */
@media (max-width: 900px) and (orientation: landscape) {
  .app-header {
    display: none !important;
  }
  .wizard-progress {
    display: none !important;
  }
  .collapsible-linter {
    display: none !important;
  }
  .app-container {
    height: 100vh !important;
    padding: 8px !important;
  }
  .wizard-content {
    padding: 0 !important;
    height: calc(100vh - 16px) !important;
  }
  .step-panel {
    height: 100% !important;
  }
  /* Faz o canvas-wrapper ocupar quase toda a tela, deixando apenas espaço para o btn-group */
  .canvas-wrapper {
    height: calc(100vh - 80px) !important;
    margin-bottom: 8px !important;
  }
  .mobile-rotation-tip {
    display: none !important; /* Esconde a dica se já está em paisagem! */
  }
  
  /* Ajustes para a etapa 1 */
  .step1-panel {
    height: calc(100vh - 80px) !important;
    margin-bottom: 8px !important;
  }
  .form-group-textarea {
    height: calc(100% - 60px) !important;
  }
  #txtAsIsDescription {
    height: 100% !important;
  }
}

/* ==========================================================================
   16. ESTILOS DO HISTÓRICO LOCAL DE FLUXOS
   ========================================================================== */
.history-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar personalizada para a lista de histórico */
.history-list-container::-webkit-scrollbar {
  width: 6px;
}
.history-list-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.history-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.history-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.history-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-smooth);
}

.history-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.8);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.history-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.history-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.history-badge.asis {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.history-badge.tobe {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

.history-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.history-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.history-btn-open {
  background: var(--primary-gradient);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}
.history-btn-open:active {
  transform: scale(0.97);
}

.history-btn-export {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.history-btn-export:hover, .history-btn-export:active {
  background: rgba(255, 255, 255, 0.1);
}

.history-btn-delete {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.15);
  color: #f87171;
}
.history-btn-delete:hover, .history-btn-delete:active {
  background: rgba(248, 113, 113, 0.2);
}

.history-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.history-empty svg {
  color: rgba(255, 255, 255, 0.15);
  margin-bottom: 4px;
}

/* ==========================================================================
   DESKTOP & WEB RESPONSIVE ADAPTATIONS (SaaS CENTERED CONTAINER & MODALS)
   ========================================================================== */
@media (min-width: 768px) {
  body {
    background-color: #03060c;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .app-container {
    max-width: 1040px;
    height: 96vh;
    margin: 2vh auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(37, 99, 235, 0.15);
    border: 1px solid var(--border-color);
    overflow: hidden;
  }

  .modal-overlay {
    background: rgba(3, 6, 12, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Configurações (Settings) em Desktop */
  .settings-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100vh !important;
    background: rgba(3, 6, 12, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 100000 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
  }

  .settings-overlay.open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #settingsOverlay.open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .settings-overlay .glass-panel {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
  }

  #settingsOverlay > * {
    width: 100% !important;
    max-width: 580px !important;
  }

  /* Limit Width of Settings, History, About, Pro Modals */
  .modal-card, .onboarding-modal-content, .settings-overlay {
    box-sizing: border-box;
  }

  .modal-card, .onboarding-modal-content {
    max-width: 580px !important;
    margin: auto !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 40px rgba(79, 70, 229, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  /* Bottom Sheets (Histórico, Sobre) em Desktop como Modais Centrais */
  .bottom-sheet {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100vh !important; max-height: 100vh !important;
    background: rgba(3, 6, 12, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 0 !important;
    z-index: 100000 !important;
    padding: 24px !important;
    box-sizing: border-box !important;
  }

  .bottom-sheet.open, .bottom-sheet.active {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .bottom-sheet-header, .bottom-sheet-body {
    width: 100% !important;
    max-width: 680px !important;
  }

  .bottom-sheet-body {
    background: #0f172a !important;
    border-radius: 16px !important;
    border: 1px solid var(--border-color) !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
  }

  .bottom-sheet-handle {
    display: none !important;
  }
}
