/* Zenith Ethereal Professional Design System */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --surface: #f8fbf1;
  --surface-dim: #d8dbd2;
  --surface-bright: #f8fbf1;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f2f5eb;
  --surface-container: #ecefe6;
  --surface-container-high: #e6e9e0;
  --surface-container-highest: #e0e4db;
  --on-surface: #191d17;
  --on-surface-variant: #444841;
  --inverse-surface: #2e322c;
  --outline: #757870;
  --outline-variant: #c5c8be;
  --primary: #55624d;
  --on-primary: #ffffff;
  --primary-container: #98a68e;
  --on-primary-container: #2f3c29;
  --secondary: #72575f;
  --secondary-container: #fed9e2;
  --on-secondary-container: #795d65;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --success: #2e7d32;
  --success-container: #e8f5e9;
  --warning: #ed6c02;
  --warning-container: #fff3e0;
  --font-main: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --glass-bg: rgba(248, 251, 241, 0.85);
  --glass-border: rgba(152, 166, 142, 0.2);
  --shadow-ambient: 0 10px 30px rgba(85, 98, 77, 0.08);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--surface);
  color: var(--on-surface);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Container Layout */
#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  height: 100vh;
  max-height: 100vh;
  background-color: var(--surface-container);
  border-right: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-header {
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  border-bottom: 1px solid var(--outline-variant);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand-logo-img {
  max-height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: max-height 0.3s ease;
}

.sidebar.collapsed .brand-logo-img {
  max-height: 38px;
}

.btn-toggle-sidebar {
  background: rgba(152, 166, 142, 0.12);
  border: 1px solid rgba(152, 166, 142, 0.3);
  color: var(--primary);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
}

.btn-toggle-sidebar:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-toggle-sidebar svg {
  transition: transform 0.3s ease;
}

.sidebar.collapsed .btn-toggle-sidebar svg {
  transform: rotate(180deg);
}

.brand-title-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: opacity 0.2s ease;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--outline);
  font-weight: 500;
  white-space: nowrap;
}

.sidebar.collapsed .brand-title-sub,
.sidebar.collapsed .history-label,
.sidebar.collapsed .user-details,
.sidebar.collapsed .new-chat-btn span:not(:first-child),
.sidebar.collapsed .conversation-item-title,
.sidebar.collapsed .conversation-item-delete {
  display: none !important;
}

.sidebar.collapsed .new-chat-btn {
  margin: 12px 8px;
  padding: 10px 0;
  border-radius: var(--radius-md);
  justify-content: center;
}

.sidebar.collapsed .conversations-history {
  padding: 8px 4px;
}

.sidebar.collapsed .conversation-item {
  justify-content: center;
  padding: 10px 0;
}

.sidebar.collapsed .user-profile-card {
  justify-content: center;
  padding: 8px 4px;
}

.subnav-bar {
  padding: 6px 24px;
  background-color: rgba(248, 251, 241, 0.7);
  border-bottom: 1px solid rgba(152, 166, 142, 0.15);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.btn-new-chat {
  background-color: var(--primary, #55624d);
  color: var(--on-primary, #ffffff);
  border: none;
  border-radius: var(--radius-full, 9999px);
  padding: 6px 14px;
  font-family: var(--font-main, sans-serif);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(85, 98, 77, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
  width: auto;
}

.btn-new-chat:hover {
  background-color: #3e4a37;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(85, 98, 77, 0.25);
}

.history-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--outline, #757870);
  user-select: none;
  transition: all 0.2s ease;
}

.history-section-header .history-icon {
  flex-shrink: 0;
  color: var(--primary, #55624d);
}

.btn-clear-history {
  background: rgba(186, 26, 26, 0.08);
  border: 1px solid rgba(186, 26, 26, 0.2);
  color: #ba1a1a;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-clear-history:hover {
  background-color: #ba1a1a;
  color: #ffffff;
  border-color: #ba1a1a;
}

.sidebar.collapsed .history-section-header {
  justify-content: center;
  padding: 8px 0 6px;
}

.sidebar.collapsed .history-section-header .history-title-text {
  display: none;
}

.sidebar.collapsed .btn-clear-history {
  display: none;
}

.sidebar.collapsed .history-section-header .history-icon {
  width: 16px;
  height: 16px;
}


/* Área de Rolagem Unificada da Sidebar (Anúncio + Histórico) */
.sidebar-scrollable-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 0 10px 14px 10px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #98a68e transparent;
}

.sidebar-scrollable-area::-webkit-scrollbar,
#conversations-list::-webkit-scrollbar,
.conversations-history::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scrollable-area::-webkit-scrollbar-track,
#conversations-list::-webkit-scrollbar-track,
.conversations-history::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track {
  background: rgba(152, 166, 142, 0.1);
  border-radius: 4px;
}

.sidebar-scrollable-area::-webkit-scrollbar-thumb,
#conversations-list::-webkit-scrollbar-thumb,
.conversations-history::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb {
  background: #98a68e;
  border-radius: 4px;
}

.sidebar-scrollable-area::-webkit-scrollbar-thumb:hover,
#conversations-list::-webkit-scrollbar-thumb:hover,
.conversations-history::-webkit-scrollbar-thumb:hover,
.conversation-list::-webkit-scrollbar-thumb:hover {
  background: #55624d;
}

.conversations-history {
  width: 100%;
  padding: 0;
}

#conversations-list {
  width: 100%;
}

/* Área de Rolagem Unificada do Workspace (Respostas + Anúncio Rodapé) */
.workspace-scrollable-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px 24px 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: #98a68e transparent;
}

.workspace-scrollable-area::-webkit-scrollbar {
  width: 6px;
}

.workspace-scrollable-area::-webkit-scrollbar-track {
  background: rgba(152, 166, 142, 0.1);
  border-radius: 4px;
}

.workspace-scrollable-area::-webkit-scrollbar-thumb {
  background: #98a68e;
  border-radius: 4px;
}

.workspace-scrollable-area::-webkit-scrollbar-thumb:hover {
  background: #55624d;
}

.chat-feed-container,
.chat-messages {
  flex: 1 0 auto;
  overflow: visible !important;
}

.ad-block-bottom {
  flex-shrink: 0;
  width: 100%;
  margin: 16px auto 10px auto;
}

.history-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  margin-top: 8px;
}

.chat-history-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--on-surface-variant);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.chat-history-item:hover, .chat-history-item.active {
  background-color: var(--surface-container-highest);
  color: var(--on-surface);
}

.chat-history-item .chat-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.chat-history-item .delete-chat-btn {
  opacity: 0;
  border: none;
  background: none;
  color: var(--error);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
}

.chat-history-item:hover .delete-chat-btn {
  opacity: 0.7;
}

.chat-history-item .delete-chat-btn:hover {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--outline-variant);
  background-color: var(--surface-container-high);
}

.user-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--surface-container-highest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}

.user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: rgba(85, 98, 77, 0.15);
  color: var(--primary);
}

.admin-nav-btn, .logout-btn {
  background: none;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: color 0.2s ease;
}

.admin-nav-btn:hover { color: var(--primary); }
.logout-btn:hover { color: var(--error); }

/* Main Workspace */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  position: relative;
  overflow: hidden;
}

.top-navbar {
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(152, 166, 142, 0.18);
  background-color: #f2f5eb;
  flex-shrink: 0;
}

.platform-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
  flex: 1;
}

.platform-selector-bar::-webkit-scrollbar {
  display: none;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background-color: var(--surface-container-low);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.platform-chip.selected {
  background-color: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(85, 98, 77, 0.15);
}

.platform-chip input[type="checkbox"] {
  display: none;
}

/* ON/OFF Provider Toggle Switch Buttons (Modelo 1 - Clean & Minimalist) */
.chip-provider-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  border: 1px solid #c5c8be;
  background-color: #ffffff;
  color: #444841;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  white-space: nowrap;
}

.chip-provider-toggle:hover {
  border-color: #55624d;
  background-color: #fcfdfe;
  transform: translateY(-1px);
}

.chip-provider-toggle.active {
  background-color: rgba(72, 126, 68, 0.1);
  color: #2f3c29;
  border-color: #487e44;
  box-shadow: 0 2px 6px rgba(72, 126, 68, 0.12);
}

.toggle-switch {
  width: 24px;
  height: 13px;
  border-radius: 9999px;
  background-color: #c5c8be;
  position: relative;
  display: inline-block;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.chip-provider-toggle.active .toggle-switch {
  background-color: #487e44;
}

.toggle-knob {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chip-provider-toggle.active .toggle-knob {
  transform: translateX(11px);
}

.toggle-state-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  background-color: rgba(117, 120, 112, 0.15);
  color: #757870;
  transition: all 0.2s ease;
}

.chip-provider-toggle.active .toggle-state-badge {
  background-color: rgba(72, 126, 68, 0.2);
  color: #2f3c29;
}

/* Chat Feed Area */
.chat-feed-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.empty-chat-welcome {
  margin: auto;
  text-align: center;
  max-width: 600px;
  padding: 40px 20px;
}

.welcome-icon {
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-icon img, .welcome-logo-img {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.welcome-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--on-surface);
}

.welcome-subtitle {
  font-size: 0.95rem;
  color: var(--on-surface-variant);
  line-height: 1.6;
}

/* Message Card Group */
.message-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.user-prompt-card {
  align-self: flex-end;
  background-color: var(--primary);
  color: var(--on-primary);
  padding: 16px 20px;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  max-width: 80%;
  box-shadow: 0 4px 16px rgba(85, 98, 77, 0.15);
  position: relative;
}

.user-prompt-text {
  font-size: 0.95rem;
  white-space: pre-wrap;
  line-height: 1.6;
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  gap: 8px;
}

.prompt-action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-action-btn:hover { color: #fff; }

/* Multi-Platform Response Grid & Cards (Modelo 1 - Responsive & Aligned) */
.responses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 18px;
  width: 100%;
  align-items: stretch;
}

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

.response-card {
  background-color: #ffffff;
  border: 1px solid rgba(152, 166, 142, 0.28);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(85, 98, 77, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.response-card:hover {
  border-color: rgba(85, 98, 77, 0.4);
  box-shadow: 0 10px 28px rgba(85, 98, 77, 0.12);
  transform: translateY(-2px);
}

.response-header {
  padding: 12px 16px;
  background: linear-gradient(180deg, #f7f9f3 0%, #edf1e6 100%);
  border-bottom: 1px solid rgba(152, 166, 142, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.provider-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.provider-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: #2f3c29;
  letter-spacing: -0.01em;
}

.model-name {
  font-size: 11px;
  color: #55624d;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  background-color: rgba(152, 166, 142, 0.18);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: rgba(152, 166, 142, 0.12);
  border: 1px solid rgba(152, 166, 142, 0.25);
  color: #55624d;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.icon-btn:hover {
  background-color: #55624d;
  color: #ffffff;
  border-color: #55624d;
}

.response-body {
  padding: 18px 20px;
  font-size: 14px;
  color: #191d17;
  line-height: 1.65;
  flex: 1;
  overflow-x: auto;
  word-break: break-word;
}

.response-footer {
  padding: 10px 16px;
  background-color: #f7f9f3;
  border-top: 1px solid rgba(152, 166, 142, 0.15);
  font-size: 11.5px;
  color: #757870;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* Cross-Platform Summarizer Banner */
.summarizer-bar {
  margin-top: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--surface-container-high), var(--surface-container-highest));
  border: 1px dashed var(--primary-container);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.summarizer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--on-surface);
}

.summarize-btn {
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.summarize-btn:hover {
  background-color: var(--on-primary-container);
}

.summary-result-card {
  margin-top: 12px;
  background-color: #fdfcf7;
  border: 2px solid var(--primary-container);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-ambient);
}

.summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Prompt Input Container Flutuante (Modelo 1) */
.input-container-wrapper {
  padding: 10px 24px 20px;
  background: transparent;
  border-top: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 20;
}

.prompt-input-box {
  width: 100%;
  max-width: 840px;
  background-color: #ffffff;
  border: 1px solid rgba(152, 166, 142, 0.35);
  border-radius: 20px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(85, 98, 77, 0.09);
  transition: all 0.2s ease;
}

.prompt-input-box:focus-within {
  border-color: #55624d;
  box-shadow: 0 12px 36px rgba(85, 98, 77, 0.16);
}

/* Active Models Indicator inside Prompt Box */
.active-models-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
  border-top: 1px dashed rgba(152, 166, 142, 0.2);
}

.active-model-chip {
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  padding: 4px 11px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #c5c8be;
  background-color: #ffffff;
  color: #444841;
}

.active-model-chip:hover {
  transform: translateY(-1px);
  border-color: #55624d;
}

.active-model-chip.selected {
  background-color: rgba(72, 126, 68, 0.12);
  color: #2f3c29;
  border-color: #487e44;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(72, 126, 68, 0.12);
}

/* Skeleton Loader Shimmer for Cards */
@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.skeleton-card {
  background: #ffffff;
  border: 1px solid rgba(152, 166, 142, 0.25);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(85, 98, 77, 0.05);
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f2f5eb 0%, #e6e9e0 50%, #f2f5eb 100%);
  background-size: 400px 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full { width: 100%; }

.prompt-textarea {
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  max-height: 180px;
  min-height: 48px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--on-surface);
  background: transparent;
}

.attachments-preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  background-color: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--on-surface-variant);
}

.attachment-chip .remove-att-btn {
  border: none;
  background: none;
  color: var(--error);
  cursor: pointer;
  font-weight: 700;
}

.input-box-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.action-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attach-file-btn {
  background: rgba(152, 166, 142, 0.12);
  border: 1px solid rgba(152, 166, 142, 0.3);
  color: #55624d;
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.attach-file-btn:hover {
  background: rgba(152, 166, 142, 0.22);
  border-color: #55624d;
  color: #2f3c29;
}

.send-prompt-btn {
  height: 38px;
  padding: 0 18px;
  background-color: #55624d;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(85, 98, 77, 0.25);
  transition: all 0.2s ease;
}

.send-prompt-btn:hover {
  background-color: #3e4a37;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(85, 98, 77, 0.35);
}

/* Modals & Fullscreen Forms */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(25, 29, 23, 0.4);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--outline, #98a68e) transparent;
}

.modal-card::-webkit-scrollbar {
  width: 6px;
}

.modal-card::-webkit-scrollbar-track {
  background: rgba(152, 166, 142, 0.1);
  border-radius: 4px;
}

.modal-card::-webkit-scrollbar-thumb {
  background: var(--outline, #98a68e);
  border-radius: 4px;
}

.modal-card::-webkit-scrollbar-thumb:hover {
  background: var(--primary, #55624d);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--on-surface-variant);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--on-surface);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--on-surface);
  background-color: var(--surface-container-lowest);
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Password Strength Indicator */
.password-requirements {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.72rem;
}

.req-item {
  color: var(--outline);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.req-item.valid {
  color: var(--success);
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--on-primary-container);
}

.switch-modal-text {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 18px;
  color: var(--on-surface-variant);
}

.switch-modal-link {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Admin Portal Styles (Modelo 1 - 5 Itens sem Scroll) */
.admin-view-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 36px;
  background-color: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--outline, #98a68e) transparent;
}

.admin-view-container::-webkit-scrollbar {
  width: 8px;
}

.admin-view-container::-webkit-scrollbar-track {
  background: rgba(152, 166, 142, 0.1);
  border-radius: 4px;
}

.admin-view-container::-webkit-scrollbar-thumb {
  background: var(--outline, #98a68e);
  border-radius: 4px;
}

.admin-view-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary, #55624d);
}

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

.admin-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #191d17;
  letter-spacing: -0.01em;
}

.btn-back-portal, #back-to-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #2f3c29;
  border: 1px solid rgba(152, 166, 142, 0.35);
  border-radius: 9999px;
  padding: 7px 16px;
  font-family: var(--font-main, 'Manrope', sans-serif);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(85, 98, 77, 0.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-back-portal:hover, #back-to-portal-btn:hover {
  background-color: #ffffff;
  border-color: #55624d;
  color: #191d17;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(85, 98, 77, 0.12);
}

.btn-back-portal svg, #back-to-portal-btn svg {
  transition: transform 0.2s ease;
  color: #55624d;
}

.btn-back-portal:hover svg, #back-to-portal-btn:hover svg {
  transform: translateX(-3px);
  color: #2f3c29;
}

.admin-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid rgba(152, 166, 142, 0.35);
  margin-bottom: 18px;
  overflow: hidden;
}

.admin-tab-btn {
  padding: 8px 4px 10px;
  background: none;
  border: none;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  color: #444841;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: #2f3c29;
}

.admin-tab-btn.active {
  color: #2f3c29;
  border-bottom-color: #55624d;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(152, 166, 142, 0.25);
  box-shadow: 0 4px 16px rgba(85, 98, 77, 0.04);
}

.data-table th, .data-table td {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(152, 166, 142, 0.15);
}

.data-table th {
  background-color: #ecefe6;
  font-weight: 700;
  color: #191d17;
}

.badge-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-status.approved { background-color: #dcfce7; color: #15803d; }
.badge-status.pending { background-color: #ffedd5; color: #c2410c; }
.badge-status.blocked { background-color: #fee2e2; color: #b91c1c; }

/* Botões de Ação de Moderção em Pílula */
.action-approve, .action-block, .action-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-right: 6px;
}

.action-approve {
  background-color: #ffffff;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.action-approve:hover {
  background-color: #dcfce7;
  border-color: #16a34a;
}

.action-block {
  background-color: #ffffff;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.action-block:hover {
  background-color: #ffedd5;
  border-color: #ea580c;
}

.action-delete {
  background-color: #ffffff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.action-delete:hover {
  background-color: #fee2e2;
  border-color: #dc2626;
}

/* Markdown & Code Highlighting */
pre {
  background-color: #1e221d;
  color: #e0e4db;
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
}

code {
  font-family: var(--font-mono);
  background-color: rgba(85, 98, 77, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.86rem;
}

pre code {
  background: none;
  padding: 0;
}

.code-copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  cursor: pointer;
}

.code-copy-btn:hover { background-color: rgba(255, 255, 255, 0.3); }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background-color: var(--inverse-surface);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease;
}

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

/* Espaços e Blocos de Anúncios Dinâmicos (AdSense / Viads) */
.ad-block-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 12px auto;
  transition: all 0.3s ease;
  clear: both;
}

.ad-block-wrapper.hidden {
  display: none !important;
}

.ad-block-container {
  width: 100%;
  max-width: 100%;
  min-height: 50px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(152, 166, 142, 0.35);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(85, 98, 77, 0.04);
}

.ad-block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #757870;
  background: rgba(152, 166, 142, 0.15);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Bloco 1: Topo do Workspace */
.ad-block-top {
  max-width: 768px;
  margin: 12px auto 6px auto;
}

/* Bloco 2: Sidebar (Ocultado quando recolhida) */
.ad-block-sidebar {
  width: calc(100% - 20px);
  margin: 10px auto;
  padding: 8px;
}

.sidebar.collapsed .ad-block-sidebar {
  display: none !important;
}

/* Bloco 3: Feed de Respostas (In-Feed Card) */
.ad-block-feed {
  max-width: 720px;
  margin: 16px auto;
  background: #ffffff;
  border: 1px solid rgba(152, 166, 142, 0.25);
  box-shadow: 0 4px 16px rgba(85, 98, 77, 0.06);
}

/* Bloco 4: Rodapé do Chat */
.ad-block-bottom {
  max-width: 768px;
  margin: 8px auto 14px auto;
}

/* In-Card & In-Summary Response Ads */
.in-response-ad, .in-summary-ad {
  margin: 12px 16px 14px;
  padding: 10px 14px;
  background: rgba(248, 251, 241, 0.75);
  border: 1px dashed rgba(152, 166, 142, 0.35);
  border-radius: 10px;
  text-align: center;
}

.in-summary-ad {
  background: rgba(255, 255, 255, 0.85);
  border-style: solid;
  border-color: rgba(152, 166, 142, 0.3);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: -280px;
    top: 0; bottom: 0;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .responses-grid {
    grid-template-columns: 1fr;
  }
}
