:root {
  --bg-main: #0d1117;
  --bg-sidebar: #161b22;
  --bg-card: #21262d;
  --bg-input: #1c2128;
  --border-color: #30363d;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --primary: #388bfd;
  --primary-hover: #58a6ff;
  --success: #238636;
  --success-hover: #2ea043;
  --accent: #a371f7;
  --danger: #f85149;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

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

.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #a371f7, #388bfd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-text h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-text span {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-new-chat {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-new-chat:hover {
  background: #30363d;
  border-color: #8b949e;
}

.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px 0 6px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.btn-clear-all {
  background: transparent;
  border: 1px solid rgba(248, 81, 73, 0.25);
  color: #f85149;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-clear-all:hover {
  background: rgba(248, 81, 73, 0.15);
  border-color: #f85149;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.conv-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

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

.btn-delete-conv {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.conv-item:hover .btn-delete-conv {
  opacity: 0.85;
}

.btn-delete-conv:hover {
  opacity: 1 !important;
  color: #f85149;
  background: rgba(248, 81, 73, 0.15);
}

.conv-item:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.conv-item.active {
  background: #232a35;
  color: var(--primary-hover);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.engine-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green {
  background: #3fb950;
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.6);
}

.dot-yellow {
  background: #d29922;
  box-shadow: 0 0 8px rgba(210, 153, 34, 0.6);
}

.dot-red {
  background: #f85149;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow: hidden;
}

/* TOP BAR */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.account-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.account-badge.authenticated {
  border-color: #238636;
  background: rgba(35, 134, 54, 0.15);
  color: #3fb950;
}

.account-badge.guest {
  border-color: #388bfd;
  background: rgba(56, 139, 253, 0.12);
  color: #58a6ff;
}

.auth-bar-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: #30363d;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: var(--success-hover);
}

/* CONTROL STRIP */
.control-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: #11151c;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  color: var(--text-muted);
  font-weight: 500;
}

.select-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.select-dropdown:focus {
  border-color: var(--primary);
}

.cost-badge {
  margin-left: auto;
  font-size: 11px;
  color: #3fb950;
  background: rgba(63, 185, 80, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

/* CHAT VIEWPORT */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.welcome-card {
  margin: auto;
  max-width: 650px;
  text-align: center;
  padding: 40px 20px;
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.welcome-card h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}

.chip-prompt {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.chip-prompt:hover {
  background: #2a313d;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* MESSAGES */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.message-row {
  display: flex;
  gap: 14px;
  animation: fadeIn 0.25s ease-in;
  width: 100%;
}

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

.message-row.user {
  justify-content: flex-end;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.msg-avatar.user-avatar {
  background: #388bfd;
  color: #fff;
  order: 2;
}

.msg-avatar.assistant-avatar {
  background: linear-gradient(135deg, #a371f7, #388bfd);
  color: #fff;
  box-shadow: 0 0 12px rgba(163, 113, 247, 0.4);
}

.msg-bubble {
  max-width: 82%;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  line-height: 1.7;
  word-break: break-word;
}

.message-row.user .msg-bubble {
  background: #1f3a5f;
  border: 1px solid #2d558a;
  color: #f0f6fc;
  border-bottom-right-radius: 4px;
}

.message-row.assistant .msg-bubble {
  background: #161b22;
  border: 1px solid #30363d;
  color: #f0f6fc;
  border-bottom-left-radius: 4px;
  max-width: 94%;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* TYPOGRAPHY IN ASSISTANT BUBBLE */
.msg-bubble p {
  margin: 0 0 12px;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble h1, .msg-bubble h2, .msg-bubble h3, .msg-bubble h4 {
  font-family: inherit;
  font-weight: 700;
  color: #f0f6fc;
  margin-top: 20px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.msg-bubble h1 {
  font-size: 22px;
  color: #58a6ff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
}

.msg-bubble h2 {
  font-size: 18px;
  color: #bc8cff;
}

.msg-bubble h3 {
  font-size: 16px;
  color: #79c0ff;
}

.msg-bubble h4 {
  font-size: 14.5px;
  color: #7ee787;
}

.msg-bubble hr {
  border: none;
  border-top: 1px solid #30363d;
  margin: 18px 0;
}

.msg-bubble ul, .msg-bubble ol {
  margin: 8px 0 14px;
  padding-left: 24px;
}

.msg-bubble li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.msg-bubble strong {
  color: #ffffff;
  font-weight: 700;
}

.msg-bubble em {
  color: #d2a8ff;
  font-style: italic;
}

.msg-bubble blockquote {
  border-left: 3px solid #58a6ff;
  background: rgba(56, 139, 253, 0.08);
  padding: 10px 16px;
  border-radius: 0 6px 6px 0;
  margin: 14px 0;
  color: #c9d1d9;
}

/* MARKDOWN TABLES PRO */
.table-wrapper {
  margin: 16px 0;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow-x: auto;
  background: #0d1117;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.msg-bubble table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
  min-width: 600px;
}

.msg-bubble th {
  background: #1b232e;
  color: #58a6ff;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid #30363d;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.msg-bubble td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
  color: #e6edf3;
  vertical-align: top;
}

.msg-bubble tr:last-child td {
  border-bottom: none;
}

.msg-bubble tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

.msg-bubble tr:hover {
  background: rgba(56, 139, 253, 0.08);
  transition: background 0.15s ease;
}

/* CODE BLOCKS PRO */
.code-block-container {
  margin: 14px 0;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1117;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #161b22;
  padding: 7px 14px;
  font-size: 12px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
  font-family: var(--font-mono);
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: #58a6ff;
  font-weight: 600;
}

.btn-copy-code {
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-copy-code:hover {
  background: #30363d;
  color: #58a6ff;
  border-color: #58a6ff;
}

.msg-bubble pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}

.msg-bubble code {
  font-family: var(--font-mono);
}

:not(pre) > code {
  background: rgba(110, 118, 129, 0.25);
  color: #ff7b72;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* MESSAGE ACTIONS TOOLBAR */
.msg-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.msg-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-msg-action {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8b949e;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-msg-action:hover {
  background: rgba(56, 139, 253, 0.15);
  border-color: #58a6ff;
  color: #58a6ff;
}

.msg-tag {
  font-size: 11.5px;
  color: #8b949e;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* SUGGESTIONS / FOLLOW-UP CHIPS */
.suggestions-box {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(188, 140, 255, 0.05);
  border: 1px dashed rgba(188, 140, 255, 0.35);
  border-radius: 10px;
  animation: fadeIn 0.3s;
}

.suggestions-title {
  font-size: 12px;
  font-weight: 700;
  color: #bc8cff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-btn {
  background: rgba(188, 140, 255, 0.12);
  border: 1px solid rgba(188, 140, 255, 0.3);
  color: #d2a8ff;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.suggestion-btn:hover {
  background: rgba(188, 140, 255, 0.25);
  border-color: #bc8cff;
  transform: translateY(-1px);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(188,140,255,0.25);
}

/* COMPOSER */
.composer-area {
  padding: 14px 24px 20px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
}

/* QUICK SOURCE & TOOL PILLS */
.quick-tools-strip {
  max-width: 850px;
  margin: 0 auto 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.quick-tools-strip::-webkit-scrollbar {
  height: 4px;
}

.quick-tools-strip::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.tool-pill-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}

.tool-pill-chip:hover {
  background: rgba(56, 139, 253, 0.15);
  border-color: #58a6ff;
  color: #f0f6fc;
  transform: translateY(-1px);
}

.tool-pill-chip.active {
  background: #388bfd;
  border-color: #58a6ff;
  color: #ffffff;
  font-weight: 600;
}

/* ATTACHMENTS PREVIEW BAR */
.attachments-preview-bar {
  max-width: 850px;
  margin: 0 auto 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #161b22;
  border: 1px dashed #30363d;
  border-radius: var(--radius-md);
  animation: fadeIn 0.2s ease-in;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #e6edf3;
  max-width: 260px;
}

.attachment-chip-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

.attachment-chip-icon {
  font-size: 16px;
}

.attachment-chip-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.attachment-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.attachment-chip-size {
  font-size: 10px;
  color: var(--text-muted);
}

.attachment-chip-remove {
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.attachment-chip-remove:hover {
  color: #ff7b72;
}

.hidden-file-input {
  display: none;
}

.btn-composer-tool {
  background: transparent;
  border: none;
  color: #8b949e;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 4px 4px 4px;
  font-size: 17px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-composer-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #58a6ff;
  transform: scale(1.08);
}

.btn-voice-mic.listening {
  background: #da3633;
  color: #ffffff;
  animation: pulse-mic 1s infinite alternate;
}

@keyframes pulse-mic {
  from { box-shadow: 0 0 4px #da3633; transform: scale(1); }
  to { box-shadow: 0 0 14px #f85149; transform: scale(1.12); }
}

/* USER ATTACHMENTS IN MESSAGE BUBBLE */
.user-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.user-attach-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: #e6edf3;
  text-decoration: none;
  transition: border-color 0.2s;
}

.user-attach-item:hover {
  border-color: #58a6ff;
  background: rgba(0, 0, 0, 0.35);
}

.user-attach-img {
  max-width: 220px;
  max-height: 160px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  cursor: pointer;
}

.composer-form {
  max-width: 850px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: flex-end;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 4px;
  transition: border-color 0.2s;
}

.composer-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 139, 253, 0.2);
}

.composer-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  line-height: 1.4;
}

.btn-send {
  background: var(--primary);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 4px 4px auto;
  transition: all 0.2s;
}

.btn-send:hover {
  background: var(--primary-hover);
  transform: scale(1.04);
}

.btn-send:disabled {
  background: #30363d;
  color: #8b949e;
  cursor: not-allowed;
  transform: none;
}

.composer-footer {
  max-width: 850px;
  margin: 8px auto 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.composer-footer code {
  color: var(--accent);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-close:hover { color: #fff; }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-card {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-info strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.step-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-status-box {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.modal-status-box.success {
  background: rgba(35, 134, 54, 0.2);
  border: 1px solid #238636;
  color: #3fb950;
}

.modal-status-box.error {
  background: rgba(248, 81, 73, 0.2);
  border: 1px solid #f85149;
  color: #ff7b72;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1100;
  transition: all 0.3s;
}

/* FILTER BADGE & MODAL */
.btn-filter-status {
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.35);
  color: #58a6ff;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-filter-status:hover {
  background: rgba(56, 139, 253, 0.22);
  border-color: #58a6ff;
  box-shadow: 0 0 10px rgba(56, 139, 253, 0.25);
}

.filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 6px rgba(63, 185, 80, 0.8);
}

.filter-section {
  background: #12161c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
}

.filter-toggle-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 12.5px;
  color: #c9d1d9;
  line-height: 1.5;
}

.filter-toggle-item:last-child {
  margin-bottom: 0;
}

.filter-toggle-item input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.filter-toggle-item span code {
  color: #58a6ff;
  background: rgba(56, 139, 253, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}

.hidden {
  display: none !important;
}

/* GENERATED IMAGE CARD PRO */
.generated-image-card {
  margin: 16px 0;
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1117;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  max-width: 540px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.generated-image-card:hover {
  border-color: #58a6ff;
  transform: translateY(-2px);
}

.generated-image-media {
  position: relative;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.generated-image-media img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.generated-image-media img:hover {
  transform: scale(1.02);
}

.generated-video-card {
  max-width: 640px;
}

.generated-image-media video {
  display: block;
  width: 100%;
  max-height: 480px;
  background: #000;
  outline: none;
}

.generated-image-badge.veo-badge {
  color: #d2a8ff;
}

.generated-image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #161b22;
  border-top: 1px solid #30363d;
  font-size: 12.5px;
}

.generated-image-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #79c0ff;
  font-weight: 600;
  font-size: 12px;
}

.generated-image-badge span {
  font-size: 14px;
}

.btn-download-image {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #238636;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-download-image:hover {
  background: #2ea043;
  box-shadow: 0 0 10px rgba(46, 160, 67, 0.4);
}

/* GENERATED OFFICE & PDF DOCUMENT CARD (GEMINI CANVAS STYLE) */
.generated-doc-card {
  margin: 14px 0;
  border: 1px solid #30363d;
  border-top: 3px solid #58a6ff;
  border-radius: 14px;
  overflow: hidden;
  background: #161b22;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 780px;
}

.generated-doc-card.doc-pdf { border-top-color: #f85149; }
.generated-doc-card.doc-word { border-top-color: #58a6ff; }
.generated-doc-card.doc-excel { border-top-color: #3fb950; }
.generated-doc-card.doc-pptx { border-top-color: #f0883e; }

.doc-canvas-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.doc-canvas-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.doc-canvas-icon {
  font-size: 26px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-canvas-titles {
  min-width: 0;
  flex: 1;
}

.doc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f0f6fc;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #8b949e;
}

.doc-type-pill {
  font-weight: 600;
  color: #79c0ff;
}

.doc-canvas-viewport {
  background: #0d1117;
  padding: 14px;
}

.doc-canvas-iframe {
  width: 100%;
  height: 540px;
  border: none;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: block;
}

.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-preview-doc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-preview-doc:hover {
  background: #30363d;
  color: #ffffff;
}
