:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --panel: #111827;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --border: rgba(148, 163, 184, 0.2);
  --danger: #f87171;
  font-family: "Inter", "Dubai", "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
}

html,
body {
  height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 24px 16px;
  overflow: hidden;
}

body.gradient-canvas {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(79, 70, 229, 0.35) 0%, rgba(15, 23, 42, 0) 55%),
    radial-gradient(120% 120% at 100% 0%, rgba(16, 185, 129, 0.28) 0%, rgba(15, 23, 42, 0) 55%),
    radial-gradient(140% 140% at 50% 100%, rgba(14, 165, 233, 0.32) 0%, rgba(15, 23, 42, 0.2) 60%),
    linear-gradient(155deg, #0b1220 0%, #111c33 55%, #070b13 100%);
}

body.editor-open {
  overflow: hidden;
}

.app-shell {
  width: min(1200px, 100%);
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.frame-container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
}

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

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

.brand-mark {
  font-size: 2rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.ghost-button:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.4);
}

.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.chat-area {
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  min-height: 0;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.chat-area::-webkit-scrollbar {
  width: 8px;
}

.chat-area::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.35);
  border-radius: 10px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.status-tracker {
  position: sticky;
  top: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
  margin-bottom: 16px;
}

.status-tracker.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.status-indicator {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 220px;
  max-width: min(480px, 90vw);
  pointer-events: auto;
}

.status-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef9c3 0%, #f59e0b 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.65);
  animation: statusPulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.status-tracker[data-state="failed"] .status-pulse {
  background: radial-gradient(circle at 30% 30%, #fecaca 0%, #f87171 100%);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.6);
}

.status-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.status-message {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.01em;
}

.status-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.18);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.status-tracker.has-progress .status-progress {
  opacity: 1;
}

.status-progress-bar {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

@keyframes statusPulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.alert-stack {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  z-index: 200;
}

.alert-chip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.18);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
  position: relative;
  backdrop-filter: blur(4px);
}

.alert-chip.alert-error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.22);
}

.alert-chip.alert-info {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.16);
}

.alert-chip.alert-warning {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.18);
}

.alert-text {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.alert-detail {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text);
  max-width: 480px;
  overflow-x: auto;
}

.alert-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s ease;
}

.alert-dismiss:hover {
  color: var(--text);
}

.status-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-timeline-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.status-timeline-entry:last-child {
  border-bottom: none;
}

.status-timeline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.2);
  font-size: 0.95rem;
}

.status-entry-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
}

.status-entry-message {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.status-entry-time {
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.8);
  letter-spacing: 0.02em;
}

.status-entry-detail {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.4;
  overflow-x: auto;
}

.status-timeline-entry[data-status="failed"] .status-entry-message {
  color: var(--danger);
}

.status-timeline-entry[data-status="failed"] .status-timeline-icon {
  background: rgba(248, 113, 113, 0.18);
  color: var(--danger);
}

.status-timeline-entry[data-status="succeeded"] .status-entry-message {
  color: var(--text);
}

.status-timeline-entry[data-status="succeeded"] .status-timeline-icon {
  background: rgba(34, 197, 94, 0.2);
  color: #34d399;
}

.status-timeline-entry[data-status="pending"] .status-entry-message {
  color: var(--text-muted);
}

.status-timeline-entry[data-status="pending"] .status-timeline-icon {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
}

.status-timeline-entry[data-status="in-progress"] .status-entry-message {
  color: var(--accent);
}

.status-timeline-entry[data-status="in-progress"] .status-timeline-icon {
  background: rgba(56, 189, 248, 0.24);
  color: var(--accent);
}

.agent-stage-block {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 680px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.agent-stage-block + .agent-stage-block {
  margin-top: 14px;
}

.agent-stage-block.compact-stage {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(17, 24, 39, 0.92);
  max-width: 540px;
}

.agent-stage-block.compact-stage .stage-header {
  padding: 12px 16px;
  gap: 10px;
}

.agent-stage-block.completed .stage-header {
  opacity: 0.85;
}

.stage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.stage-header:hover {
  background: rgba(148, 163, 184, 0.12);
}

.stage-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stage-title {
  flex: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.stage-toggle-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.agent-stage-block:not(.collapsed) .stage-toggle-icon {
  transform: none;
  color: var(--accent);
}

.agent-stage-block.collapsed .stage-body {
  display: none;
}

.stage-body {
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.compact-stage .stage-body {
  padding: 16px;
}

.stage-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.stage-content pre {
  margin: 0;
  background: rgba(15, 23, 42, 0.68);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 12px;
  overflow: auto;
  font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  font-size: 0.85rem;
}

.tool-summary-text {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.tool-source-list {
  margin: 12px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-source-item {
  color: var(--text);
}

.tool-source-link {
  font-weight: 600;
  color: #facc15;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tool-source-link:hover {
  color: #fde68a;
  text-decoration: underline;
}

.tool-source-snippet {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-file-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-file-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.85rem;
}

.tool-file-link {
  color: #facc15;
  text-decoration: none;
  font-weight: 600;
}

.tool-file-link:hover {
  color: #fde68a;
}

.tool-file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tool-note-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-note-item {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
  max-width: 100%;
  overflow: hidden;
}

.message.user {
  flex-direction: row-reverse;
  justify-self: end;
  direction: rtl;
}

.message.user .message-body {
  background: rgba(56, 189, 248, 0.12);
  border-radius: 16px 16px 4px 16px;
}

.message.assistant .message-body {
  background: rgba(30, 41, 59, 0.95);
  border-radius: 16px 16px 16px 4px;
}

.message.assistant.streaming .message-content::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  margin-left: 4px;
  animation: caretBlink 0.9s steps(2, start) infinite;
  vertical-align: bottom;
}

.message .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.message.user .avatar {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}

.message.assistant .avatar {
  background: rgba(16, 185, 129, 0.18);
}

.message-body {
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  max-width: 100%;
  width: fit-content;
  min-width: 200px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.message-meta .confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.16);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.confidence-badge.confidence-medium {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.32);
  color: #fbbf24;
}

.confidence-badge.confidence-low {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

.confidence-badge.confidence-sources {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.message-content {
  color: var(--text);
  line-height: 1.6;
  font-size: 0.97rem;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.message-content pre {
  background: linear-gradient(135deg, #0f172a 0%, #1a2332 100%);
  border-radius: 16px;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  margin: 16px 0;
}

.message-content pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 50%, #38bdf8 100%);
  border-radius: 16px 16px 0 0;
}

.message-content code {
  font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  font-size: 0.9em;
  color: #e2e8f0;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.message-content pre code {
  display: block;
  line-height: 1.7;
  color: #f1f5f9;
}

.message-files {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-files li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.message-files a {
  color: var(--accent);
  text-decoration: none;
}

.message-attachments {
  margin-top: 12px;
}

.attachment-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-items: center;
}

.attachment-card {
  position: relative;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 2px solid #d4af37;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  width: min(100%, 600px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.attachment-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.attachment-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.attachment-details {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.attachment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.attachment-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.attachment-size {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.attachment-preview {
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: rgba(212, 175, 55, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  max-height: 360px;
  overflow: hidden;
}

.attachment-preview img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  max-height: 336px;
}

.attachment-preview pre {
  margin: 0;
  width: 100%;
  max-height: 320px;
  overflow: auto;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.attachment-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.uploaded-file-container {
  border: 2px solid #d4af37;
  border-radius: 16px;
  background: rgba(212, 175, 55, 0.08);
}

.uploaded-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.4);
}

.attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-button {
  padding: 12px 24px;
  border-radius: 14px;
  border: 2px solid;
  border-image: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700) 1;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 193, 7, 0.15) 100%);
  color: #ffd700;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 12px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.attachment-button:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 193, 7, 0.25) 100%);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 20px rgba(255, 215, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-width: 3px;
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
  color: #ffed4e;
}

.attachment-button:disabled {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}

.message-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.message-action {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.2s ease, border 0.2s ease;
}

.message-action:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.32);
}

.attachments-panel {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
}

.attachments-panel[hidden] {
  display: none !important;
}

.attachments-panel h2 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.virtual-desktop-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  height: 320px;
  background: rgba(9, 13, 23, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 1500;
  cursor: default;
}

.virtual-desktop-panel[hidden],
.virtual-desktop-panel[data-minimized="true"] {
  display: none !important;
}

.virtual-desktop-panel[data-maximized="true"] {
  top: 18px;
  left: 18px;
  right: 18px;
  bottom: 18px;
  width: calc(100vw - 300px);
  height: calc(100vh - 36px);
}

.virtual-desktop-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
}

.virtual-desktop-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.virtual-desktop-indicator {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.virtual-desktop-indicator strong {
  font-weight: 600;
}

.virtual-desktop-indicator[data-state="connected"] {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.5);
}

.virtual-desktop-indicator[data-state="connecting"],
.virtual-desktop-indicator[data-state="reconnecting"] {
  color: #facc15;
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.5);
}

.virtual-desktop-indicator[data-state="error"] {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.5);
}

.virtual-desktop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.virtual-desktop-viewport {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.12), rgba(15, 23, 42, 0.9));
  min-height: 360px;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.virtual-desktop-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  transition: opacity 0.25s ease, transform 0.2s ease;
}

.virtual-desktop-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 16px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.virtual-desktop-placeholder[hidden] {
  opacity: 0;
  pointer-events: none;
}

.virtual-desktop-panel[data-state="connected"] .virtual-desktop-placeholder {
  display: none;
}

.virtual-desktop-panel[data-state="connected"] .virtual-desktop-iframe {
  opacity: 1;
}

.virtual-desktop-panel[data-state="connecting"] .virtual-desktop-placeholder,
.virtual-desktop-panel[data-state="reconnecting"] .virtual-desktop-placeholder {
  display: flex;
  background: rgba(15, 23, 42, 0.85);
  color: #facc15;
}

.virtual-desktop-panel[data-state="error"] .virtual-desktop-placeholder {
  display: flex;
  color: var(--danger);
}

.virtual-desktop-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vd-control {
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.vd-control:hover {
  background: rgba(148, 163, 184, 0.35);
}

.vd-control.danger {
  color: #f87171;
  background: rgba(248, 113, 113, 0.2);
}

.vd-control.danger:hover {
  background: rgba(248, 113, 113, 0.35);
}

.virtual-desktop-resize-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  bottom: 12px;
  right: 12px;
  cursor: nwse-resize;
  padding: 0;
}

.virtual-desktop-resize-handle::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-right: 2px solid rgba(148, 163, 184, 0.6);
  border-bottom: 2px solid rgba(148, 163, 184, 0.6);
  border-radius: 2px;
}

.virtual-desktop-dock-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  z-index: 1400;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.virtual-desktop-dock-button[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .virtual-desktop-panel {
    width: min(360px, calc(100vw - 24px));
    right: 12px;
    left: auto;
    bottom: 16px;
    padding: 16px;
  }
  .virtual-desktop-toolbar {
    justify-content: flex-start;
  }
}

.pending-files {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pending-files li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.24);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-file {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
}

.composer textarea {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--text);
  resize: none;
  font-size: 1rem;
  line-height: 1.4;
  max-height: 220px;
  min-height: 48px;
  transition: border 0.2s ease, background 0.2s ease;
}

.composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(14, 116, 144, 0.2);
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border 0.2s ease;
}

.icon-button:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

.icon-button.subtle {
  width: 36px;
  height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
}

.icon-button.subtle:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.primary-button {
  padding: 12px 20px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--bg);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(56, 189, 248, 0.35);
}

.accent-button {
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.accent-button:hover {
  background: rgba(56, 189, 248, 0.22);
  transform: translateY(-1px);
}

.send-button {
  padding: 12px 20px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  color: #0b1220;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.send-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.35);
}

.send-button:disabled {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

.editor-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 24px;
}

.editor-panel[hidden] {
  display: none !important;
}

.editor-dialog {
  width: min(760px, 100%);
  max-height: 90vh;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.65);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: 22px;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.editor-filename {
  font-weight: 600;
  color: var(--text);
}

.editor-size {
  opacity: 0.8;
}

#editorTextarea {
  width: 100%;
  min-height: 320px;
  max-height: calc(80vh - 200px);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 16px;
  resize: vertical;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.editor-actions .ghost-button {
  min-width: 120px;
}

.editor-actions .accent-button {
  min-width: 200px;
}

@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  .app-shell {
    border-radius: 18px;
    max-width: 100%;
    width: 100%;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .composer {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .composer textarea {
    grid-column: 1 / -1;
  }

  .attachment-grid {
    grid-template-columns: 1fr;
  }

  .editor-dialog {
    width: 100%;
    padding: 18px;
    gap: 14px;
  }

  #editorTextarea {
    min-height: 240px;
  }

  /* Mobile-specific message styles */
  .message {
    gap: 12px;
    max-width: 100%;
  }

  .message-body {
    max-width: calc(100vw - 100px);
    min-width: 150px;
    padding: 12px 14px;
  }

  .message .avatar {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .message-content {
    font-size: 0.95rem;
    max-width: 100%;
  }

  .message-content pre {
    max-width: 100%;
    overflow-x: auto;
  }

  .message-content pre code {
    font-size: 0.85rem;
  }
}

[dir="rtl"] .message {
  grid-template-columns: 1fr auto;
}

[dir="rtl"] .message.assistant .message-body {
  border-radius: 16px 16px 4px 16px;
}

[dir="rtl"] .message.user .message-body {
  border-radius: 16px 16px 16px 4px;
}

/* Status messages in chat */
.status-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 8px 0;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: slideIn 0.3s ease-out;
}

.status-message .status-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.status-message .status-text {
  flex: 1;
  line-height: 1.4;
}

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

@keyframes caretBlink {
  0%,
  45% {
    opacity: 1;
  }
  55%,
  100% {
    opacity: 0;
  }
}

/* Mode Selector Styles */
.mode-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-right: 12px;
}

.mode-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.mode-select {
  padding: 8px 12px;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  min-width: 200px;
}

.mode-select:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
}

.mode-select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.mode-select option {
  background: var(--bg);
  color: var(--text);
  padding: 8px;
}

.mode-indicator {
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.2));
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse-glow 2s ease-in-out infinite;
  cursor: help;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  }
}

/* Mode indicator variants */
.mode-indicator.agent-mode {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
}

.mode-indicator.ai2-mode {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
}

.mode-indicator.ai1-mode {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.2));
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mode-selector {
    flex-wrap: wrap;
    padding: 6px 12px;
  }
  
  .mode-label {
    font-size: 0.75rem;
  }
  
  .mode-select {
    min-width: 160px;
    font-size: 0.75rem;
    padding: 6px 10px;
  }
  
  .mode-indicator {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }
}

/* Golden glowing border animation for brand logo */
.brand-logo {
  border-radius: 12px;
  border: 3px solid #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6),
              0 0 20px rgba(255, 215, 0, 0.4),
              0 0 30px rgba(255, 215, 0, 0.2);
  animation: golden-glow 2s ease-in-out infinite;
}

@keyframes golden-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6),
                0 0 20px rgba(255, 215, 0, 0.4),
                0 0 30px rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                0 0 30px rgba(255, 215, 0, 0.6),
                0 0 40px rgba(255, 215, 0, 0.4),
                0 0 50px rgba(255, 215, 0, 0.2);
    border-color: #FFA500;
  }
}

/* Golden glowing border for avatar */
.avatar img {
  border-radius: 8px;
  border: 2px solid #FFD700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5),
              0 0 15px rgba(255, 215, 0, 0.3);
  animation: golden-glow-avatar 2s ease-in-out infinite;
}

@keyframes golden-glow-avatar {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5),
                0 0 15px rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7),
                0 0 25px rgba(255, 215, 0, 0.5),
                0 0 35px rgba(255, 215, 0, 0.3);
    border-color: #FFA500;
  }
}

/* ===== Conversations Sidebar ===== */
.conversations-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-left: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  backdrop-filter: blur(12px);
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.new-chat-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

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

.sidebar-title {
  color: rgba(148, 163, 184, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

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

.conversation-item {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.15);
}

.conversation-item.active {
  background: rgba(79, 70, 229, 0.2);
  border-color: rgba(79, 70, 229, 0.4);
}

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

.conversation-delete {
  opacity: 0;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
  transition: opacity 0.15s ease;
}

.conversation-item:hover .conversation-delete {
  opacity: 1;
}

.no-conversations {
  color: rgba(148, 163, 184, 0.4);
  text-align: center;
  padding: 24px 16px;
  font-size: 0.875rem;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  gap: 10px;
}

.lang-select {
  flex: 1;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.logout-btn {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* تعديل app-shell لاستيعاب الشريط الجانبي */
body {
  padding-right: 260px;
}

@media (max-width: 900px) {
  .conversations-sidebar {
    width: 220px;
  }
  body {
    padding-right: 220px;
  }
}

/* Responsive Sidebar - Mobile FIX */
@media (max-width: 768px) {
    .conversations-sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        width: 85%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
        z-index: 9999;
        transition: right 0.3s ease;
        overflow-y: auto;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    }
    
    .conversations-sidebar.open {
        right: 0;
    }
    
    .sidebar-toggle {
        position: fixed;
        right: 20px;
        top: 20px;
        z-index: 9998;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        color: white;
        padding: 0;
        border-radius: 50%;
        cursor: pointer;
        font-size: 24px;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    
    .sidebar-toggle:active {
        transform: scale(0.95);
    }
    
    body {
        padding-right: 0;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none !important;
    }
    
    .conversations-sidebar {
        position: fixed;
        right: 0;
        width: 260px;
    }
}

#goldCountdown::before {
    content: '⏱️ ';
    margin-right: 5px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #goldCountdown {
        bottom: 80px;
        font-size: 12px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    #goldCountdown {
        bottom: 70px;
        font-size: 11px;
        padding: 8px 14px;
    }
}
/* Gold Trading Expert - Countdown Timer - Mobile Fix */
/* Desktop Version */
@media (min-width: 769px) {
    #goldCountdown {
        position: fixed;
        bottom: 120px;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
        color: #1a1a1a;
        padding: 12px 20px;
        border-radius: 25px;
        font-weight: bold;
        font-size: 14px;
        z-index: 1000;
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
        animation: slideUp 0.3s ease-out;
        white-space: nowrap;
        border: 2px solid #ffb700;
    }
}

/* Mobile Version - Top of screen */
@media (max-width: 768px) {
    #goldCountdown {
        position: fixed;
        top: 80px !important;  /* أعلى الصفحة */
        bottom: auto !important;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
        color: #1a1a1a;
        padding: 8px 12px;
        border-radius: 20px;
        font-weight: bold;
        font-size: 11px;
        z-index: 1000;
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
        animation: slideUp 0.3s ease-out;
        white-space: nowrap;
        border: 2px solid #ffb700;
    }
}

#goldCountdown::before {
    content: '⏱️ ';
    margin-right: 3px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Gold Countdown */
#goldCountdown {
    position: fixed !important;
    top: 70px !important;
    right: 20px !important;
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #1a1a1a !important;
    padding: 6px 12px !important;
    border-radius: 15px !important;
    font-weight: bold !important;
    font-size: 12px !important;
    z-index: 1001 !important;
    white-space: nowrap !important;
}
@media (max-width: 768px) {
    #goldCountdown {
        font-size: 11px !important;
        padding: 5px 10px !important;
        right: 15px !important;
    }
}


/* زر النسخ للحاويات السوداء */
.copy-code-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  background: rgba(50, 50, 50, 0.9) !important;
  color: #fff !important;
  border: 1px solid #666 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  opacity: 0.8 !important;
  transition: all 0.2s ease !important;
  z-index: 100 !important;
  font-family: inherit !important;
}

.copy-code-btn:hover {
  opacity: 1 !important;
  background: rgba(70, 70, 70, 0.95) !important;
}

.copy-code-btn:active {
  transform: scale(0.95);
}

.message-content pre {
  position: relative !important;
}

/* تحسين للموبايل */
@media (max-width: 768px) {
  .copy-code-btn {
    padding: 8px 14px !important;
    font-size: 14px !important;
    top: 5px !important;
    right: 5px !important;
  }
}
