:root {

  --primary-color: #60a5fa;

  --primary-rgb: 96, 165, 250;

  --bg-dark: #212121;

  --bg-chat: #212121;

  --panel-bg: #171717;

  --panel-hover: #2a2a2a;

  --panel-border: rgba(255, 255, 255, 0.05);

  --text-main: #f3f3f3;

  --text-muted: #a3a3a3;

  --accent: #9a9a9a;

  --accent-glow: rgba(255, 255, 255, 0.04);

  --danger: #ef4444;

  --danger-bg: rgba(239, 68, 68, 0.1);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --sidebar-w: 260px;

  --fs-chat: 0.875rem;

}


body.theme-light {

  --bg-dark: #f9f9f9;

  --bg-chat: #ffffff;

  --panel-bg: #f3f3f3;

  --panel-hover: #e5e5e5;

  --panel-border: rgba(0, 0, 0, 0.05);

  --text-main: #1a1a1a;

  --text-muted: #666666;

  --accent: #3b82f6;

}


body.theme-matrix {

  --bg-dark: #000a00;

  --bg-chat: #000d00;

  --panel-bg: #001200;

  --panel-hover: #002500;

  --panel-border: rgba(0, 255, 0, 0.1);

  --text-main: #00ff00;

  --text-muted: #008800;

  --accent: #00ff00;

}

*,

*::before,

*::after {

  box-sizing: border-box;

  margin: 0;

  padding: 0

}

body {

  font-family: 'Inter', system-ui, sans-serif;

  background: var(--bg-dark);

  color: var(--text-main);

  min-height: 100vh;

  overflow: hidden;

  font-size: var(--fs-chat);

}

body.no-animations * {

  transition: none !important;

  animation: none !important;

}


body.theme-contrast {

  --bg-dark: #000000;

  --bg-chat: #000000;

  --panel-bg: #000000;

  --panel-border: #ffffff;

  --text-main: #ffffff;

  --text-muted: #ffffff;

  --accent: #ffff00;

}


.app {

  display: flex;

  height: 100vh

}

.sidebar-overlay {

  display: none;

  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, .6);

  z-index: 90;

  backdrop-filter: blur(4px)

}


.sidebar {

  width: var(--sidebar-w);

  min-width: 0;

  background: var(--panel-bg);

  display: flex;

  flex-direction: column;

  overflow: hidden;

  transition: width .3s var(--ease), min-width .3s var(--ease), padding .3s var(--ease), border-color .3s;

  z-index: 100;

  border-right: 1px solid var(--panel-border);

  flex-shrink: 0;

}

.app.sidebar-collapsed .sidebar {

  width: 0;

  min-width: 0;

  padding: 0;

  border-color: transparent;

  overflow: hidden;

}

.sidebar-top {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 12px

}

.sidebar-icon-btn {

  width: 36px;

  height: 36px;

  border-radius: 8px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: background .2s, color .2s;

  flex-shrink: 0

}

.sidebar-icon-btn:hover {

  background: var(--panel-hover);

  color: var(--text-main)

}

.new-chat-btn {

  flex: 1;

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 10px 14px;

  background: rgba(255, 255, 255, 0.03);

  color: var(--text-main);

  border: 1px solid rgba(255, 255, 255, 0.1);

  border-radius: 8px;

  font-family: inherit;

  font-size: .875rem;

  cursor: pointer;

  transition: all .2s ease;

}

.new-chat-btn:hover {

  background: rgba(255, 255, 255, 0.06);

  border-color: rgba(255, 255, 255, 0.2);

}

.sidebar-search {

  padding: 0 12px 8px;

  position: relative;

  display: flex;

  align-items: center;

  gap: 8px;

  border-bottom: 1px solid var(--panel-border)

}

.sidebar-search svg {

  color: var(--text-muted);

  flex-shrink: 0;

  margin-left: 4px

}

.sidebar-search input {

  width: 100%;

  background: transparent;

  border: none;

  color: var(--text-main);

  font-family: inherit;

  font-size: .8rem;

  padding: 8px 4px;

  outline: none

}

.sidebar-search input::placeholder {

  color: var(--text-muted)

}

.sidebar-history {

  flex: 1;

  overflow-y: auto;

  padding: 8px 8px 0;

  scrollbar-width: thin;

  scrollbar-color: rgba(255, 255, 255, .1) transparent

}

.sidebar-history::-webkit-scrollbar {

  width: 4px

}

.sidebar-history::-webkit-scrollbar-thumb {

  background: rgba(255, 255, 255, .1);

  border-radius: 4px

}

.history-group {

  margin-bottom: 16px

}

.history-group-label {

  padding: 6px 10px;

  font-size: .7rem;

  font-weight: 600;

  color: var(--text-muted);

  text-transform: uppercase;

  letter-spacing: .05em

}

.history-item {

  width: 100%;

  text-align: left;

  padding: 8px 12px;

  background: transparent;

  border: none;

  color: var(--text-main);

  font-family: inherit;

  font-size: .84rem;

  border-radius: 6px;

  cursor: pointer;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

  display: flex;

  align-items: center;

  gap: 8px;

  transition: all .2s ease;

  border-left: 3px solid transparent;

}

.history-item:hover {

  background: rgba(255, 255, 255, 0.03);

}

.history-item.active {

  background: rgba(255, 255, 255, 0.05);

  border-left-color: var(--primary-color);

  color: var(--primary-color);

}

.history-item .item-title {

  flex: 1;

  overflow: hidden;

  text-overflow: ellipsis

}

.history-item .item-actions {

  display: none;

  gap: 4px;

  flex-shrink: 0

}

.history-item:hover .item-actions {

  display: flex

}

.item-action-btn {

  width: 26px;

  height: 26px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;

  border-radius: 6px;

  display: grid;

  place-items: center;

  transition: background .15s, color .15s

}

.item-action-btn:hover {

  background: rgba(255, 255, 255, .1);

  color: var(--text-main)

}

.sidebar-bottom {

  margin-top: auto;

  padding: 16px 12px;

  display: flex;

  flex-direction: column;

  gap: 6px;

  border-top: 1px solid var(--panel-border);

  background: rgba(0, 0, 0, 0.2);

}

.bottom-action-btn {

  width: 100%;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 10px 12px;

  background: transparent;

  border: none;

  color: var(--text-muted);

  font-family: inherit;

  font-size: .85rem;

  font-weight: 500;

  cursor: pointer;

  border-radius: 8px;

  transition: all .2s ease;

}

.bottom-action-btn:hover {

  background: rgba(255, 255, 255, 0.05);

  color: var(--text-main);

  transform: translateX(4px);

}

.bottom-action-btn svg {

  transition: transform .2s ease;

  opacity: 0.8;

}

.bottom-action-btn:hover svg {

  transform: scale(1.1);

  color: var(--primary-color);

  opacity: 1;

}

.brand {

  display: flex;

  gap: 12px;

  align-items: center;

  padding: 10px 10px 4px

}

.brand-icon {

  width: 34px;

  height: 34px;

  border-radius: 10px;

  background: linear-gradient(135deg, #3a3a3a, #1a1a1a);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);

  display: grid;

  place-items: center;

  flex-shrink: 0

}

.brand-logo {

  width: 20px;

  height: 20px;

  filter: brightness(2)

}

.brand h1 {

  font-size: .9rem;

  font-weight: 600;

  letter-spacing: 0.02em

}

.brand p {

  color: var(--text-muted);

  font-size: .68rem;

  margin-top: 2px

}


.chat-area {

  display: flex;

  flex-direction: column;

  background: var(--bg-chat);

  min-width: 0;

  position: relative;

  overflow: hidden;

  flex: 1

}

.chat-topbar {

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 10px 16px;

  border-bottom: 1px solid var(--panel-border);

  flex-shrink: 0;

  background: var(--bg-chat);

  z-index: 10;

  position: relative;

  height: 56px

}

#sidebar-open-btn {

  display: none

}

.app.sidebar-collapsed #sidebar-open-btn {

  display: grid

}

.topbar-title {

  position: absolute;

  left: 50%;

  top: 50%;

  transform: translate(-50%, -50%);

  font-weight: 600;

  font-size: 1rem;

  color: #fff;

  letter-spacing: 0.01em;

  pointer-events: none;

  white-space: nowrap

}

.topbar-left {

  display: flex;

  align-items: center;

  gap: 8px

}

.model-selector select {

  background: var(--panel-bg);

  color: var(--text-main);

  border: 1px solid var(--panel-border);

  border-radius: 8px;

  padding: 6px 12px;

  font-family: inherit;

  font-size: .78rem;

  cursor: pointer;

  outline: none;

  appearance: auto

}


.hero {

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  flex: 1;

  gap: 16px;

  padding: 40px 24px;

  animation: fadeUp .8s var(--ease) both;

  position: relative

}

.hero-glow {

  display: none;

}

.hero-logo {

  width: 96px;

  height: 96px;

  animation: heroFloat 4s ease-in-out infinite;

  z-index: 1;

  position: relative;

  transition: filter 0.3s ease;

}

/* ===== Logo Wrapper & Skin Canvas (mask-based) ===== */
.hero-logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  animation: heroFloat 4s ease-in-out infinite;
}

.hero-logo-wrap .hero-logo {
  animation: none;
}

.logo-skin-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  display: none;
  -webkit-mask-image: url('./assets/spyiot-logo.svg');
  mask-image: url('./assets/spyiot-logo.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.hero-logo-wrap[data-skin]:not([data-skin="none"]):not([data-skin="pulse"]):not([data-skin=""]) .hero-logo {
  opacity: 0;
}

.hero-logo-wrap[data-skin]:not([data-skin="none"]):not([data-skin="pulse"]):not([data-skin=""]) .logo-skin-canvas {
  display: block;
}

/* Rainbow Logo Color Animation */
@keyframes logoRainbowTint {
  0% { filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(500%) hue-rotate(0deg); }
  100% { filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(500%) hue-rotate(360deg); }
}

.hero-logo-wrap[data-logo-color="rainbow"] .hero-logo {
  animation: logoRainbowTint 4s linear infinite;
}

/* Logo skin: pulse glow ring (this one stays outside) */
.hero-logo-wrap[data-skin="pulse"]::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  animation: logoPulseRing 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes logoPulseRing {
  0%, 100% { transform: scale(0.9); opacity: 0.2; }
  50% { transform: scale(1.2); opacity: 0.6; }
}

.hero h2 {

  font-size: 2.5rem;

  font-weight: 700;

  z-index: 1;

  color: #fff;

  letter-spacing: -0.02em

}

.hero-sub {

  color: var(--text-muted);

  font-size: .95rem;

  z-index: 1;

  letter-spacing: 0.01em

}

/* ===== Background Animation Canvas ===== */
.bg-animation-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ===== Hero Typing Effect ===== */
.hero-typing-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  z-index: 1;
  margin-top: 4px;
  min-height: 28px;
}

.hero-typing-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.hero-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--text-muted);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: typingBlink 1s step-end infinite;
}

@keyframes typingBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== Background Animation Settings Grid ===== */
.bg-anim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bg-anim-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.bg-anim-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transform: translateY(-1px);
}

.bg-anim-btn.active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary-color);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.15);
}

.bg-anim-btn svg {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.bg-anim-btn:hover svg,
.bg-anim-btn.active svg {
  opacity: 1;
}

.suggestion-grid {

  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 12px;

  width: 100%;

  max-width: 800px;

  margin-top: 32px;

  margin-bottom: 24px;

}

.suggestion-card {

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 16px 18px;

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 14px;

  color: var(--text-main);

  font-family: inherit;

  font-size: .86rem;

  cursor: pointer;

  transition: all .3s var(--ease);

  text-align: left;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02)

}

.suggestion-card:hover {

  background: var(--panel-hover);

  border-color: rgba(255, 255, 255, .1);

  transform: translateY(-2px);

  box-shadow: 0 12px 30px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .05)

}

.suggestion-icon {

  font-size: 1.25rem;

  flex-shrink: 0;

  opacity: 0.8

}


.messages {

  flex: 1;

  padding: 0 16px 16px;

  overflow-y: auto;

  scroll-behavior: smooth;

  display: none;

  scrollbar-width: thin;

  scrollbar-color: rgba(255, 255, 255, .08) transparent

}

.messages::-webkit-scrollbar {

  width: 6px

}

.messages::-webkit-scrollbar-thumb {

  background: rgba(255, 255, 255, .08);

  border-radius: 6px

}

.msg-row {

  max-width: 780px;

  margin: 0 auto;

  padding: 20px 0;

  display: flex;

  gap: 16px;

  animation: messageIn .4s var(--ease) both

}

.msg-avatar {

  width: 40px;

  height: 40px;

  border-radius: 10px;

  flex-shrink: 0;

  display: grid;

  place-items: center;

  font-size: .8rem;

  font-weight: 700

}

.msg-avatar.user-av {

  background: #2f2f2f;

  color: var(--text-muted)

}

.msg-avatar.bot-av {

  background: transparent;

  color: #fff;

  border: none;

}

.msg-avatar.bot-av svg {

  width: 28px;

  height: 28px;

  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.15))

}

.msg-row.bot.bot-entrance {
  animation: botSlideIn .6s cubic-bezier(0.16, 1, 0.3, 1) both
}

.msg-row.bot.bot-entrance .msg-avatar.bot-av {
  animation: avatarPop .5s cubic-bezier(0.34, 1.56, 0.64, 1) .1s both
}

.msg-row.bot.bot-entrance .msg-body {
  animation: bodyReveal .7s cubic-bezier(0.16, 1, 0.3, 1) .08s both
}

@keyframes botSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98)
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1)
  }
}

@keyframes avatarPop {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-15deg)
  }

  60% {
    transform: scale(1.12) rotate(3deg)
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg)
  }
}

@keyframes bodyReveal {
  from {
    opacity: 0;
    transform: translateX(-8px);
    filter: blur(3px)
  }

  to {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0)
  }
}

.msg-bot-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.msg-body {
  flex: 1;
  min-width: 0;
  line-height: 1.7;
  font-size: .94rem
}

.msg-body p {
  margin: 0 0 12px
}

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

.msg-body ul,
.msg-body ol {
  margin: 0 0 12px 20px
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--primary-color);
  margin-left: 2px;
  vertical-align: middle;
  animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.msg-body li {

  margin-bottom: 4px

}

.msg-body strong {

  color: #fff;

  font-weight: 600

}

.msg-body code {

  font-family: 'JetBrains Mono', monospace;

  font-size: .85rem;

  background: rgba(255, 255, 255, .08);

  padding: 2px 6px;

  border-radius: 4px;

  color: #e8e8e8

}

.msg-body pre {

  margin: 12px 0;

  background: #171717;

  border: 1px solid var(--panel-border);

  border-radius: 10px;

  overflow: hidden;

}

.msg-body pre .code-header {

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 8px 14px;

  background: rgba(255, 255, 255, .04);

  border-bottom: 1px solid var(--panel-border);

  font-size: .75rem;

  color: var(--text-muted)

}

.code-actions {

  display: flex;

  gap: 8px

}

.msg-body pre .copy-code-btn,

.msg-body pre .preview-code-btn {

  background: transparent;

  border: none;

  color: var(--text-muted);

  cursor: pointer;

  font-family: inherit;

  font-size: .72rem;

  padding: 2px 8px;

  border-radius: 4px;

  transition: all .15s

}

.msg-body pre .copy-code-btn:hover,

.msg-body pre .preview-code-btn:hover {

  background: rgba(255, 255, 255, .1);

  color: var(--text-main)

}

.msg-body pre code {

  display: block;

  padding: 14px;

  color: #e8e8e8;

  background: transparent !important;

  font-size: .82rem;

  overflow-x: auto;

  white-space: pre

}

.message-files-wrap {

  display: flex;

  flex-wrap: wrap;

  gap: 8px;

  margin-bottom: 12px

}

.message-file-chip {

  display: flex;

  align-items: center;

  gap: 6px;

  padding: 6px 10px;

  background: rgba(255, 255, 255, .05);

  border: 1px solid var(--panel-border);

  border-radius: 6px;

  font-size: .8rem;

  color: var(--text-main)

}

.message-file-chip svg {

  color: var(--accent);

  flex-shrink: 0

}

.msg-actions {

  display: flex;

  gap: 4px;

  margin-top: 8px

}

.msg-action-btn {

  background: transparent;

  border: none;

  color: var(--text-muted);

  cursor: pointer;

  padding: 4px 8px;

  border-radius: 6px;

  display: flex;

  align-items: center;

  gap: 4px;

  font-size: .75rem;

  font-family: inherit;

  transition: all .15s

}

.msg-action-btn:hover {

  background: rgba(255, 255, 255, .08);

  color: var(--text-main)

}

.msg-row.blocked .msg-body {

  border-left: 3px solid var(--danger);

  padding-left: 14px;

  background: var(--danger-bg);

  border-radius: 8px;

  padding: 14px

}

.typing-indicator {

  max-width: 780px;

  margin: 0 auto;

  padding: 20px 0;

  display: flex;

  gap: 16px;

  animation: messageIn .4s var(--ease) both

}

.typing-dots {

  display: flex;

  align-items: center;

  gap: 6px;

  padding: 12px 0

}

.typing-dot {

  width: 8px;

  height: 8px;

  border-radius: 50%;

  background: #b4b4b4;

  opacity: .4;

  animation: typingPulse 1.4s infinite ease-in-out both

}

.typing-dot:nth-child(1) {

  animation-delay: -.32s

}

.typing-dot:nth-child(2) {

  animation-delay: -.16s

}

.message-attachments {

  display: flex;

  gap: 10px;

  flex-wrap: wrap;

  margin-top: 10px

}

.message-attachments img {

  width: 140px;

  height: 140px;

  object-fit: cover;

  border-radius: 10px;

  border: 1px solid var(--panel-border);

  cursor: pointer;

  transition: transform .2s

}

.message-attachments img:hover {

  transform: scale(1.05)

}


.chat-form-wrapper {

  flex-shrink: 0;

  padding: 0 24px 24px;

  background: linear-gradient(to top, var(--bg-chat) 70%, transparent);

  transition: all 0.5s var(--ease);

  position: relative;

  z-index: 200;

}

body:not(.has-messages) .chat-form-wrapper {

  background: transparent;

}

.chat-form {

  max-width: 780px;

  margin: 0 auto;

}

.composer {

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 24px;

  display: flex;

  flex-direction: column;

  padding: 14px 16px;

  transition: all 0.3s var(--ease);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 4px 16px rgba(0, 0, 0, 0.2);

  backdrop-filter: blur(20px);

}

.composer:focus-within {

  border-color: rgba(255, 255, 255, .15);

  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 12px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .04)

}

#user-input {

  width: 100%;

  resize: none;

  border: none;

  background: transparent;

  color: var(--text-main);

  font-family: inherit;

  font-size: .94rem;

  padding: 0 4px 8px;

  max-height: 200px;

  min-height: 24px;

  line-height: 1.5;

  outline: none

}

#user-input::placeholder {

  color: var(--text-muted)

}

.composer-toolbar {

  display: flex;

  justify-content: space-between;

  align-items: center;

  width: 100%

}

.composer-actions-left {

  display: flex;

  align-items: center;

  gap: 4px

}

.composer-actions-right {

  display: flex;

  align-items: center;

  gap: 12px

}

.char-count {

  font-size: .65rem;

  color: var(--text-muted);

  opacity: 0.6;

  font-family: monospace

}

.upload-btn {

  width: 34px;

  height: 34px;

  display: grid;

  place-items: center;

  border-radius: 8px;

  color: var(--text-muted);

  cursor: pointer;

  transition: all .2s cubic-bezier(0.2, 0.8, 0.2, 1);

  background: transparent;

  border: none

}

.upload-btn:hover {

  background: rgba(255, 255, 255, .08);

  color: var(--text-main);

  transform: translateY(-1px)

}

.upload-btn:active {

  transform: translateY(1px)

}

.upload-btn.active,

.upload-btn.recording {

  color: var(--accent);

  background: rgba(255, 255, 255, .08)

}

.upload-btn.recording {

  animation: pulse-mic 1.5s infinite;

  color: #ff4b4b

}

@keyframes pulse-mic {

  0% {

    transform: scale(1);

    box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.4);

  }

  70% {

    transform: scale(1.1);

    box-shadow: 0 0 0 10px rgba(255, 75, 75, 0);

  }

  100% {

    transform: scale(1);

    box-shadow: 0 0 0 0 rgba(255, 75, 75, 0);

  }

}

.send-btn {

  width: 32px;

  height: 32px;

  border-radius: 8px;

  background: #fff;

  border: none;

  color: #212121;

  cursor: pointer;

  display: grid;

  place-items: center;

  flex-shrink: 0;

  transition: all .2s;

  opacity: .5;

  pointer-events: none

}

.send-btn.active {

  opacity: 1;

  pointer-events: auto

}

.send-btn.active:hover {

  background: #555;

  transform: scale(1.05)

}

.image-preview {

  display: flex;

  gap: 10px;

  padding: 8px 4px;

  overflow-x: auto;

  margin-bottom: 0;

  scrollbar-width: none

}

.image-preview::-webkit-scrollbar {

  display: none

}

.image-preview:empty {

  display: none;

  margin: 0

}

.image-preview:not(:empty) {

  margin-bottom: 8px

}

.preview-tile {

  position: relative

}

.preview-tile img {

  width: 64px;

  height: 64px;

  object-fit: cover;

  border-radius: 10px;

  border: 1px solid var(--panel-border)

}

.file-chip {

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  width: 64px;

  height: 64px;

  background: rgba(255, 255, 255, .04);

  border: 1px solid var(--panel-border);

  border-radius: 10px;

  color: var(--text-muted);

  gap: 4px;

  padding: 4px

}

.file-chip svg {

  color: var(--accent)

}

.file-chip-name {

  font-size: .55rem;

  text-align: center;

  width: 100%;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis

}

.preview-remove {

  position: absolute;

  top: -6px;

  right: -6px;

  width: 20px;

  height: 20px;

  border-radius: 50%;

  background: var(--danger);

  border: none;

  color: #fff;

  cursor: pointer;

  font-size: .7rem;

  font-weight: 700;

  display: grid;

  place-items: center;

  transition: transform .15s

}

.preview-remove:hover {

  transform: scale(1.1)

}

.disclaimer {

  text-align: center;

  color: var(--text-muted);

  font-size: .72rem;

  margin-top: 8px

}


.search-toggle {

  display: flex;

  align-items: center;

  gap: 6px;

  background: transparent;

  border: 1px solid transparent;

  color: var(--text-muted);

  font-family: inherit;

  font-size: .8rem;

  font-weight: 500;

  padding: 4px 10px;

  border-radius: 16px;

  cursor: pointer;

  transition: all .2s cubic-bezier(0.2, 0.8, 0.2, 1);

  flex-shrink: 0

}

.search-toggle:hover {

  background: rgba(255, 255, 255, .08);

  color: var(--text-main);

  transform: translateY(-1px)

}

.search-toggle:active {

  transform: translateY(1px)

}

.search-toggle.active {

  background: rgba(255, 255, 255, .1);

  color: #fff;

  border-color: rgba(255, 255, 255, .2)

}

.search-toggle svg {

  flex-shrink: 0

}


.search-sources {

  margin-top: 10px;

  padding: 10px 14px;

  background: rgba(255, 255, 255, .03);

  border: 1px solid var(--panel-border);

  border-radius: 8px;

  font-size: .78rem

}

.search-sources-title {

  color: var(--text-muted);

  font-weight: 600;

  font-size: .7rem;

  text-transform: uppercase;

  letter-spacing: .04em;

  margin-bottom: 6px

}

.search-source-item {

  display: flex;

  align-items: center;

  gap: 6px;

  padding: 3px 0;

  color: var(--text-muted)

}

.search-source-item a {

  color: var(--text-main);

  text-decoration: none;

  font-size: .78rem

}

.search-source-item a:hover {

  text-decoration: underline

}

.search-label {

  display: inline-flex;

  align-items: center;

  gap: 4px;

  font-size: .7rem;

  color: var(--text-muted);

  background: rgba(255, 255, 255, .05);

  padding: 2px 8px;

  border-radius: 4px;

  margin-bottom: 8px

}


.search-thinking {

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 14px 18px;

  background: rgba(255, 255, 255, .03);

  border: 1px solid var(--panel-border);

  border-radius: 12px;

  animation: searchPulse 2s ease-in-out infinite;

}

.search-thinking-icon {

  display: grid;

  place-items: center;

  color: var(--primary-color);

  animation: globeSpin 3s linear infinite;

}

.search-thinking-text {

  display: flex;

  flex-direction: column;

  gap: 2px;

  flex: 1;

  overflow: hidden;

}

.search-status-label {

  font-size: .82rem;

  font-weight: 600;

  color: #fff

}

.search-status-sources {

  font-size: .72rem;

  color: var(--text-muted);

  display: inline-block;

  animation: marquee-scroll 10s linear infinite

}

.search-spinner {

  width: 18px;

  height: 18px;

  border: 2px solid rgba(255, 255, 255, .1);

  border-top-color: var(--primary-color);

  border-radius: 50%;

  animation: spin .8s linear infinite;

  flex-shrink: 0

}

@keyframes globeSpin {

  0% {

    transform: rotate(0deg)

  }

  100% {

    transform: rotate(360deg)

  }

}

@keyframes spin {

  0% {

    transform: rotate(0deg)

  }

  100% {

    transform: rotate(360deg)

  }

}

@keyframes searchPulse {

  0%,

  100% {

    border-color: rgba(255, 255, 255, .05);

    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0)

  }

  50% {

    border-color: rgba(var(--primary-rgb), .15);

    box-shadow: 0 0 12px 0 rgba(var(--primary-rgb), .08)

  }

}


body.has-messages .hero {

  display: none

}

body.has-messages .messages {

  display: block

}


.rename-input {

  background: transparent;

  border: 1px solid var(--accent);

  color: var(--text-main);

  font-family: inherit;

  font-size: .84rem;

  padding: 2px 6px;

  border-radius: 4px;

  width: 100%;

  outline: none

}


@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes fadeUp {

  from {

    opacity: 0;

    transform: translateY(16px)

  }

  to {

    opacity: 1;

    transform: translateY(0)

  }

}

@keyframes messageIn {

  from {

    opacity: 0;

    transform: translateY(15px);

    filter: blur(4px)

  }

  to {

    opacity: 1;

    transform: translateY(0);

    filter: blur(0)

  }

}

.msg-row.bot {

  animation: messageIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;

}


.advanced-thinking {

  display: flex;

  align-items: center;

  gap: 16px;

  padding: 14px 20px;

  background: rgba(255, 255, 255, 0.03);

  border: 1px solid var(--panel-border);

  border-radius: 8px;

  position: relative;

  overflow: hidden;

}

.at-icon {

  display: grid;

  place-items: center;

  color: var(--accent);

  animation: pulseIcon 2.5s ease-in-out infinite;

}

.at-text {

  display: flex;

  flex-direction: column;

  gap: 2px;

  flex: 1;

  z-index: 1;

  overflow: hidden;

}

.at-title {

  font-size: 0.85rem;

  font-weight: 600;

  color: #fff;

  letter-spacing: 0.01em;

}

.at-marquee-container {

  width: 100%;

  overflow: hidden;

  white-space: nowrap;

  position: relative;

}

.at-sub {

  font-size: 0.72rem;

  color: var(--text-muted);

  display: inline-block;

  animation: marquee-scroll 10s linear infinite;

}

@keyframes marquee-scroll {

  0% {

    transform: translateX(100%);

  }

  100% {

    transform: translateX(-100%);

  }

}

.at-spinner {

  width: 18px;

  height: 18px;

  border: 2px solid rgba(255, 255, 255, 0.05);

  border-top-color: var(--accent);

  border-radius: 50%;

  animation: spin 0.8s linear infinite;

  flex-shrink: 0;

  z-index: 1;

}

@keyframes sweep {

  0% {

    left: -100%;

  }

  100% {

    left: 200%;

  }

}

@keyframes pulseIcon {

  0%,

  100% {

    transform: scale(1);

    opacity: 0.7;

  }

  50% {

    transform: scale(1.15);

    opacity: 1;

    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));

  }

}

@keyframes typingPulse {

  0%,

  80%,

  100% {

    transform: scale(.8);

    opacity: .3

  }

  40% {

    transform: scale(1.2);

    opacity: 1

  }

}

@keyframes pulse {

  0%,

  100% {

    opacity: .4;

    transform: scale(1)

  }

  50% {

    opacity: .7;

    transform: scale(1.1)

  }

}


@media(max-width:768px) {

  .sidebar {

    position: fixed;

    left: 0;

    top: 0;

    bottom: 0;

    width: 280px !important;

    transform: translateX(-100%);

    z-index: 100

  }

  .app.sidebar-open .sidebar {

    transform: translateX(0);

    width: 280px !important

  }

  .sidebar-overlay.visible {

    display: block

  }

  #sidebar-open-btn {

    display: grid !important

  }

  .suggestion-grid {

    grid-template-columns: 1fr

  }

  .app.sidebar-collapsed .sidebar {

    width: 0 !important;

    transform: translateX(-100%)

  }

}


.modal-overlay {

  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.8);

  backdrop-filter: blur(5px);

  z-index: 1000;

  display: flex;

  align-items: center;

  justify-content: center;

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.3s var(--ease);

}

.modal-overlay.active {

  opacity: 1;

  pointer-events: auto;

}

.modal {

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 16px;

  padding: 24px;

  width: 90%;

  max-width: 400px;

  transform: translateY(20px) scale(0.95);

  transition: transform 0.3s var(--ease);

  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);

}

.modal-overlay.active .modal {

  transform: translateY(0) scale(1);

}

.modal-icon {

  width: 48px;

  height: 48px;

  border-radius: 50%;

  background: var(--danger-bg);

  color: var(--danger);

  display: flex;

  align-items: center;

  justify-content: center;

  margin: 0 auto 16px;

}

.modal-title {

  font-size: 1.2rem;

  font-weight: 600;

  text-align: center;

  margin-bottom: 8px;

  color: var(--text-main);

}

.modal-desc {

  font-size: 0.9rem;

  color: var(--text-muted);

  text-align: center;

  margin-bottom: 24px;

  line-height: 1.5;

}

.modal-actions {

  display: flex;

  gap: 12px;

  justify-content: center;

}

.modal-btn {

  padding: 10px 18px;

  border-radius: 8px;

  font-weight: 500;

  font-family: inherit;

  font-size: 0.9rem;

  cursor: pointer;

  transition: all 0.2s;

  border: none;

  flex: 1;

}

.modal-btn-cancel {

  background: transparent;

  color: var(--text-main);

  border: 1px solid var(--panel-border);

}

.modal-btn-cancel:hover {

  background: rgba(255, 255, 255, 0.05);

}

.modal-btn-confirm {

  background: var(--danger);

  color: #fff;

}

.modal-btn-confirm:hover {

  background: #dc2626;

  transform: translateY(-1px);

}


.custom-model-selector {

  position: relative;

  margin-left: 12px;

  z-index: 100;

  user-select: none;

}

.cms-trigger {

  display: flex;

  align-items: center;

  gap: 10px;

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 12px;

  padding: 6px 12px;

  cursor: pointer;

  transition: all 0.2s var(--ease);

}

.cms-trigger:hover {

  background: var(--panel-hover);

  border-color: rgba(255, 255, 255, 0.15);

}

.custom-model-selector.open .cms-trigger {

  border-color: rgba(255, 255, 255, 0.2);

  background: var(--panel-hover);

}

.custom-model-selector.open .cms-chevron {

  transform: rotate(180deg);

}

.cms-trigger-content {

  display: flex;

  flex-direction: column;

  align-items: flex-end;

}

.cms-trigger-title {

  font-size: 0.8rem;

  font-weight: 600;

  color: #fff;

  line-height: 1.1;

}

.cms-trigger-sub {

  font-size: 0.65rem;

  color: var(--accent);

  margin-top: 2px;

}

.cms-chevron {

  color: var(--text-muted);

  transition: transform 0.3s var(--ease);

}

.cms-dropdown {

  position: absolute;

  top: calc(100% + 8px);

  right: 0;

  width: 240px;

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 16px;

  padding: 6px;

  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  opacity: 0;

  pointer-events: none;

  transform: translateY(-10px) scale(0.98);

  transition: all 0.25s var(--ease);

  transform-origin: top right;

}

.custom-model-selector.open .cms-dropdown {

  opacity: 1;

  pointer-events: auto;

  transform: translateY(0) scale(1);

}

.cms-option {

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 10px 12px;

  border-radius: 10px;

  cursor: pointer;

  transition: background 0.2s;

  border: 1px solid transparent;

}

.cms-option:hover {

  background: rgba(255, 255, 255, 0.04);

}

.cms-option.active {

  background: rgba(255, 255, 255, 0.08);

  border-color: rgba(255, 255, 255, 0.05);

}

.cms-option-icon {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 32px;

  height: 32px;

  border-radius: 8px;

  background: rgba(0, 0, 0, 0.2);

  color: var(--text-main);

}

.cms-option.active .cms-option-icon {

  color: var(--primary-color);

  background: rgba(var(--primary-rgb), 0.1);

}

.cms-option-text {

  display: flex;

  flex-direction: column;

}

.cms-option-title {

  font-size: 0.85rem;

  font-weight: 600;

  color: #fff;

}

.cms-option-sub {

  font-size: 0.7rem;

  color: var(--text-muted);

  margin-top: 2px;

}


.drawer-overlay {

  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.6);

  backdrop-filter: blur(4px);

  z-index: 900;

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.4s var(--ease);

}

.drawer-overlay.active {

  opacity: 1;

  pointer-events: auto;

}

.drawer {

  position: fixed;

  top: 0;

  right: 0;

  bottom: 0;

  width: 650px;

  max-width: 95%;

  background: var(--bg-chat);

  border-left: 1px solid var(--panel-border);

  z-index: 1000;

  transform: translateX(100%);

  transition: transform 0.4s var(--ease);

  display: flex;

  flex-direction: column;

  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.4);

}

.drawer.active {

  transform: translateX(0);

}

.drawer-header {

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 16px 24px;

  border-bottom: 1px solid var(--panel-border);

  background: var(--panel-bg);

}

.drawer-header-left {

  display: flex;

  align-items: center;

  gap: 14px;

}

.drawer-file-icon {

  width: 40px;

  height: 40px;

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);

  display: flex;

  align-items: center;

  justify-content: center;

  color: var(--accent);

}

.drawer-filename {

  font-size: 0.94rem;

  font-weight: 600;

  color: #fff;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  max-width: 200px;

}

.drawer-file-meta {

  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 0.68rem;

  color: var(--text-muted);

  margin-top: 2px;

}

.meta-dot {

  opacity: 0.4;

}

.drawer-header-right {

  display: flex;

  align-items: center;

  gap: 10px;

}

.drawer-divider {

  width: 1px;

  height: 24px;

  background: var(--panel-border);

  margin: 0 4px;

}

.drawer-search-wrap {

  position: relative;

  display: flex;

  align-items: center;

  background: rgba(0, 0, 0, 0.2);

  border: 1px solid var(--panel-border);

  border-radius: 8px;

  padding: 0 10px;

  transition: border-color 0.2s;

}

.drawer-search-wrap:focus-within {

  border-color: rgba(255, 255, 255, 0.2);

}

.drawer-search-wrap svg {

  color: var(--text-muted);

  pointer-events: none;

}

.drawer-search-wrap input {

  background: transparent;

  border: none;

  color: var(--text-main);

  font-family: inherit;

  font-size: 0.8rem;

  padding: 6px 4px;

  width: 120px;

  outline: none;

  transition: width 0.3s;

}

.drawer-search-wrap input:focus {

  width: 180px;

}

.drawer-search-wrap input::placeholder {

  color: var(--text-muted);

}

.drawer-action-btn {

  display: grid;

  place-items: center;

  width: 32px;

  height: 32px;

  border-radius: 8px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--panel-border);

  color: var(--text-muted);

  cursor: pointer;

  transition: all 0.2s;

}

.drawer-action-btn:hover {

  background: rgba(255, 255, 255, 0.1);

  color: var(--text-main);

  border-color: rgba(255, 255, 255, 0.2);

}

.drawer-close-btn {

  width: 32px;

  height: 32px;

  border-radius: 8px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: all 0.2s;

}

.drawer-close-btn:hover {

  background: rgba(255, 255, 255, 0.08);

  color: var(--text-main);

}

.drawer-content {

  flex: 1;

  overflow-y: auto;

  padding: 0;

  background: var(--bg-chat);

  position: relative;

  scrollbar-width: thin;

  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;

}

.drawer-content::-webkit-scrollbar {

  width: 8px;

}

.drawer-content::-webkit-scrollbar-thumb {

  background: rgba(255, 255, 255, 0.1);

  border-radius: 4px;

  border: 2px solid var(--bg-chat);

}

.drawer-content::-webkit-scrollbar-thumb:hover {

  background: rgba(255, 255, 255, 0.2);

}

.drawer-content pre {

  margin: 0;

  padding: 0;

  font-family: 'JetBrains Mono', monospace;

  font-size: 0.85rem;

  line-height: 1.5;

  display: flex;

}

.drawer-content code {

  background: transparent !important;

  padding: 20px 15px !important;

  flex: 1;

  overflow-x: auto;

  color: #e8e8e8;

  tab-size: 4;

}

.drawer-content code span.hljs-search-match {

  background: rgba(255, 255, 0, 0.2);

  border-bottom: 2px solid yellow;

  color: #000;

}


.plus-wrap {

  position: relative;

  display: flex;

  align-items: center;

}

.plus-menu {

  position: absolute;

  bottom: 100%;

  left: 0;

  width: 220px;

  margin-bottom: 12px;

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 12px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

  opacity: 0;

  transform: translateY(10px);

  pointer-events: none;

  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  z-index: 100;

  padding: 6px;

}

.plus-menu.active {

  opacity: 1;

  transform: translateY(0);

  pointer-events: auto;

}

.plus-menu-item {

  width: 100%;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 10px 12px;

  border-radius: 8px;

  background: transparent;

  border: none;

  color: var(--text-main);

  font-family: inherit;

  font-size: 0.82rem;

  cursor: pointer;

  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);

  text-align: left;

}

.plus-menu-item:hover {

  background: rgba(255, 255, 255, 0.08);

  transform: translateX(4px);

}

.plus-icon {

  width: 28px;

  height: 28px;

  border-radius: 6px;

  background: rgba(255, 255, 255, 0.04);

  display: grid;

  place-items: center;

  color: var(--accent);

  flex-shrink: 0;

}

.line-numbers-rows {

  display: inline-block;

  padding: 20px 12px;

  border-right: 1px solid rgba(255, 255, 255, 0.05);

  color: rgba(255, 255, 255, 0.3);

  text-align: right;

  user-select: none;

  font-family: inherit;

  font-size: inherit;

  background: rgba(0, 0, 0, 0.1);

  flex-shrink: 0;

  min-width: 45px;

}


.preview-tile {

  transition: transform 0.2s var(--ease);

  cursor: pointer;

  position: relative;

}

.preview-tile:hover {

  transform: translateY(-4px);

}

.file-chip {

  min-width: 180px;

  max-width: 240px;

  height: 100px;

  display: flex;

  flex-direction: column;

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 12px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

  overflow: hidden;

}

.file-chip-top {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 8px 10px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.03);

  background: rgba(255, 255, 255, 0.02);

  min-width: 0;

}

.file-chip-top svg {

  width: 16px;

  height: 16px;

  color: var(--accent);

  opacity: 0.8;

  flex-shrink: 0;

}

.file-chip-info {

  display: flex;

  flex-direction: column;

  overflow: hidden;

  min-width: 0;

}

.file-chip-name {

  font-size: 0.7rem;

  font-weight: 600;

  color: #fff;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.file-chip-preview {

  flex: 1;

  padding: 6px 10px;

  font-family: 'JetBrains Mono', monospace;

  font-size: 0.55rem;

  color: #d4d4d4;

  opacity: 0.7;

  overflow-y: hidden;

  overflow-x: auto;

  line-height: 1.4;

  white-space: pre;

  background: rgba(0, 0, 0, 0.2) !important;

  scrollbar-width: none;

}

.file-chip-preview::-webkit-scrollbar {

  display: none;

}

.file-chip-preview.hljs {

  padding: 6px 10px !important;

}


body.builder-mode .app {

  flex-direction: row;

}

body.builder-mode .chat-area {

  flex: 1 1 50%;

  min-width: 320px;

  max-width: 50%;

  border-right: 1px solid var(--panel-border);

}

.builder-panel {

  flex: 1;

  display: none;

  flex-direction: column;

  background: #0f0f0f;

  position: relative;

  z-index: 10;

}

body.builder-mode .builder-panel {

  display: flex;

}

.builder-header {

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 10px 16px;

  background: var(--panel-bg);

  border-bottom: 1px solid var(--panel-border);

  height: 56px;

  flex-shrink: 0;

}

.builder-tabs {

  display: flex;

  gap: 8px;

  background: rgba(0, 0, 0, 0.2);

  padding: 4px;

  border-radius: 8px;

}

.builder-tab {

  background: transparent;

  border: none;

  color: var(--text-muted);

  font-family: inherit;

  font-size: 0.8rem;

  font-weight: 500;

  padding: 6px 14px;

  border-radius: 6px;

  cursor: pointer;

  transition: all 0.2s;

}

.builder-tab.active {

  background: rgba(255, 255, 255, 0.1);

  color: #fff;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

}

.builder-devices {

  display: flex;

  gap: 4px;

}

.device-btn {

  width: 32px;

  height: 32px;

  border-radius: 6px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: all 0.2s;

}

.device-btn:hover {

  background: rgba(255, 255, 255, 0.05);

  color: var(--text-main);

}

.device-btn.active {

  color: var(--primary-color);

  background: rgba(var(--primary-rgb), 0.1);

}

.builder-actions {

  display: flex;

  gap: 8px;

}

.builder-action-btn {

  width: 32px;

  height: 32px;

  border-radius: 6px;

  border: 1px solid var(--panel-border);

  background: var(--panel-bg);

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: all 0.2s;

}

.builder-action-btn:hover {

  background: rgba(255, 255, 255, 0.08);

  color: var(--text-main);

}

.builder-body {

  flex: 1;

  position: relative;

  overflow: hidden;

  display: flex;

  justify-content: center;

  align-items: flex-start;

  background: #0a0a0a;

  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);

  background-size: 20px 20px;

}

.builder-view {

  position: absolute;

  inset: 0;

  display: none;

  overflow: hidden;

}

.builder-view.active {

  display: flex;

}

.preview-view {

  justify-content: center;

  align-items: stretch;

  padding: 20px;

}

.iframe-container {

  background: #fff;

  border-radius: 8px;

  overflow: hidden;

  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);

  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);

  margin: 0 auto;

  display: flex;

  flex-direction: column;

  width: 100%;

  height: 100%;

}

.iframe-container.tablet {

  width: 768px;

}

.iframe-container.mobile {

  width: 375px;

}

#builder-iframe {

  width: 100%;

  height: 100%;

  border: none;

  background: #fff;

  flex: 1;

}

.code-view {

  padding: 0;

  background: var(--bg-chat);

}

.code-view pre {

  margin: 0;

  height: 100%;

  overflow: auto;

  padding: 20px;

  font-family: 'JetBrains Mono', monospace;

  font-size: 0.85rem;

  line-height: 1.5;

  background: transparent;

}

.code-view code {

  display: block;

  color: #e8e8e8;

  background: transparent !important;

}


.settings-dashboard {

  max-width: 850px;

  width: 90vw;

  height: 75vh;

  display: flex;

  padding: 0;

  overflow: hidden;

  border-radius: 16px;

  border: 1px solid rgba(255, 255, 255, 0.1);

  background: var(--bg-dark);

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);

}

.settings-sidebar {

  width: 220px;

  background: rgba(0, 0, 0, 0.3);

  border-right: 1px solid rgba(255, 255, 255, 0.05);

  padding: 24px 12px;

  display: flex;

  flex-direction: column;

  gap: 4px;

  z-index: 2;

}

.settings-sidebar-title {

  font-size: 1.1rem;

  font-weight: 700;

  color: var(--text-main);

  margin-bottom: 20px;

  padding: 0 12px;

  letter-spacing: 0.02em;

}

.settings-nav-btn {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 10px 12px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  font-family: inherit;

  font-size: 0.9rem;

  border-radius: 8px;

  cursor: pointer;

  transition: all 0.2s;

  text-align: left;

}

.settings-nav-btn:hover {

  background: rgba(255, 255, 255, 0.05);

  color: var(--text-main);

}

.settings-nav-btn.active {

  background: rgba(255, 255, 255, 0.1);

  color: var(--primary-color);

  font-weight: 600;

  box-shadow: inset 3px 0 0 var(--primary-color);

}

.settings-nav-btn svg {

  flex-shrink: 0;

  opacity: 0.7;

}

.settings-content {

  flex: 1;

  padding: 32px;

  display: flex;

  flex-direction: column;

  overflow-y: auto;

  background: radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.04), transparent 60%);

  scrollbar-width: thin;

  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;

  position: relative;

}

.settings-content::-webkit-scrollbar {

  width: 8px;

}

.settings-content::-webkit-scrollbar-thumb {

  background: rgba(255, 255, 255, 0.15);

  border-radius: 4px;

}

.settings-pane {

  display: none;

  animation: fadeIn 0.2s ease forwards;

}

.settings-pane.active {

  display: block;

}

.setting-group {

  margin-bottom: 28px;

}

.settings-label {

  display: block;

  font-size: 0.95rem;

  font-weight: 600;

  color: var(--text-main);

  margin-bottom: 6px;

}

.settings-desc {

  font-size: 0.8rem;

  color: var(--text-muted);

  line-height: 1.4;

  margin-bottom: 12px;

}


.theme-grid {

  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));

  gap: 12px;

  margin-top: 10px;

}

.theme-card {

  background: rgba(255, 255, 255, 0.03);

  border: 2px solid transparent;

  border-radius: 12px;

  padding: 12px;

  cursor: pointer;

  transition: all 0.2s;

  text-align: center;

}

.theme-card:hover {

  border-color: rgba(255, 255, 255, 0.1);

}

.theme-card.active {

  border-color: var(--primary-color);

  background: rgba(var(--primary-rgb), 0.05);

}

.theme-preview {

  height: 60px;

  border-radius: 6px;

  margin-bottom: 8px;

  border: 1px solid rgba(255, 255, 255, 0.1);

}

.theme-preview.dark {

  background: #212121;

}

.theme-preview.light {

  background: #ffffff;

}

.theme-preview.matrix {

  background: #000a00;

  border-color: #00ff0033;

  position: relative;

  overflow: hidden;

}

.theme-preview.matrix::after {

  content: "10101";

  color: #00ff00;

  font-size: 8px;

  position: absolute;

  inset: 0;

  opacity: 0.2;

}

.theme-card span {

  font-size: 0.8rem;

  color: var(--text-main);

  font-weight: 500;

}


.settings-slider {

  width: 100%;

  -webkit-appearance: none;

  height: 6px;

  border-radius: 3px;

  background: rgba(255, 255, 255, 0.1);

  outline: none;

  margin: 15px 0 5px;

}

.settings-slider::-webkit-slider-thumb {

  -webkit-appearance: none;

  appearance: none;

  width: 18px;

  height: 18px;

  border-radius: 50%;

  background: var(--primary-color);

  cursor: pointer;

  border: 2px solid var(--bg-dark);

  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);

}

.slider-labels {

  display: flex;

  justify-content: space-between;

  font-size: 0.75rem;

  color: var(--text-muted);

}


.switch {

  position: relative;

  display: inline-block;

  width: 44px;

  height: 24px;

}

.switch input {

  opacity: 0;

  width: 0;

  height: 0;

}

.slider.round {

  position: absolute;

  cursor: pointer;

  inset: 0;

  background-color: rgba(255, 255, 255, 0.1);

  transition: .4s;

  border-radius: 34px;

}

.slider.round:before {

  position: absolute;

  content: "";

  height: 18px;

  width: 18px;

  left: 3px;

  bottom: 3px;

  background-color: white;

  transition: .4s;

  border-radius: 50%;

}

input:checked+.slider {

  background-color: var(--primary-color);

}

input:checked+.slider:before {

  transform: translateX(20px);

}



.builder-panel {

  display: none;

  flex: 1 1 50%;

  border-left: 1px solid var(--panel-border);

  background: #0d0f1a;

  flex-direction: column;

  overflow: hidden;

}

body.builder-mode .builder-panel {

  display: flex;

}

body.builder-mode .chat-area {

  flex: 1 1 50%;

  max-width: 50%;

  min-width: 320px;

}


.builder-navbar {

  height: 50px;

  border-bottom: 1px solid var(--panel-border);

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 0 10px;

  background: #13151f;

  flex-shrink: 0;

  gap: 8px;

}

.builder-nav-left,

.builder-nav-right {

  display: flex;

  align-items: center;

  gap: 6px;

  flex-shrink: 0;

}

.nav-btn {

  width: 30px;

  height: 30px;

  border-radius: 6px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: background 0.2s, color 0.2s;

}

.nav-btn:hover {

  background: rgba(255, 255, 255, 0.08);

  color: #fff;

}

.main-tabs {

  display: flex;

  background: rgba(0, 0, 0, 0.35);

  border-radius: 7px;

  padding: 3px;

  gap: 2px;

}

.main-tab {

  display: flex;

  align-items: center;

  gap: 6px;

  padding: 5px 14px;

  border-radius: 5px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  font-size: 0.82rem;

  font-weight: 600;

  cursor: pointer;

  transition: all 0.2s;

  letter-spacing: 0.02em;

}

.main-tab svg {

  flex-shrink: 0;

}

.main-tab:hover {

  color: #fff;

}

.main-tab.active {

  background: #252836;

  color: #fff;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);

}

.builder-address-bar {

  flex: 1;

  min-width: 0;

  display: flex;

  align-items: center;

  gap: 7px;

  background: rgba(0, 0, 0, 0.3);

  border: 1px solid rgba(255, 255, 255, 0.06);

  border-radius: 7px;

  padding: 5px 12px;

  font-size: 0.79rem;

  color: var(--text-muted);

  overflow: hidden;

  white-space: nowrap;

}

.builder-address-bar svg {

  flex-shrink: 0;

  opacity: 0.6;

}

.url-base {

  opacity: 0.5;

}

#builder-url-path {

  color: #e2e8f0;

  font-weight: 500;

}

.builder-devices {

  display: flex;

  gap: 2px;

}

.device-btn {

  width: 28px;

  height: 28px;

  border-radius: 6px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: all 0.2s;

}

.device-btn:hover {

  background: rgba(255, 255, 255, 0.07);

  color: #fff;

}

.device-btn.active {

  background: rgba(96, 165, 250, 0.15);

  color: #60a5fa;

}


.builder-body {

  display: flex;

  flex: 1;

  overflow: hidden;

  position: relative;

}


.builder-pane {

  display: flex;

  flex: 1;

  overflow: hidden;

}

.builder-pane.hidden {

  display: none;

}


.preview-shell {

  flex: 1;

  display: flex;

  align-items: center;

  justify-content: center;

  background: #0d0f1a;

  overflow: auto;


  padding: 0;

}

.iframe-container {

  background: #fff;

  overflow: hidden;

  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);

  border: 1px solid rgba(255, 255, 255, 0.08);

  transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease;

  flex-shrink: 0;

}


.iframe-container.desktop {

  width: 100%;

  height: 100%;

  border-radius: 0;

  box-shadow: none;

  border: none;

}

.iframe-container iframe {

  width: 100%;

  height: 100%;

  border: none;

  display: block;

  background: #fff;

}


.preview-shell:has(.iframe-container.tablet),

.preview-shell:has(.iframe-container.mobile) {

  padding: 20px;

  align-items: flex-start;

}

.iframe-container.tablet {

  width: 768px;

  height: 1024px;

  border-radius: 12px;

}


.iframe-container.mobile {

  width: 390px;

  height: 844px;

  border-radius: 40px;

  border: 8px solid #1e2030;

  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), inset 0 0 0 1px #333;

}


.builder-sidebar {

  width: 196px;

  border-right: 1px solid var(--panel-border);

  background: #111320;

  display: flex;

  flex-direction: column;

  flex-shrink: 0;

  overflow-y: auto;

}

.sidebar-header {

  padding: 10px 14px 8px;

  font-size: 0.7rem;

  font-weight: 700;

  color: var(--text-muted);

  letter-spacing: 0.08em;

  border-bottom: 1px solid var(--panel-border);

  flex-shrink: 0;

}

.builder-file-list {

  padding: 6px;

  display: flex;

  flex-direction: column;

  gap: 1px;

}

.builder-file-item {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 7px 10px;

  border-radius: 6px;

  font-size: 0.83rem;

  font-weight: 500;

  color: var(--text-muted);

  cursor: pointer;

  transition: all 0.15s;

  white-space: nowrap;

  overflow: hidden;

}

.builder-file-item:hover {

  background: rgba(255, 255, 255, 0.05);

  color: var(--text-main);

}

.builder-file-item.active {

  background: rgba(96, 165, 250, 0.12);

  color: #60a5fa;

}

.builder-editor {

  flex: 1;

  display: flex;

  flex-direction: column;

  overflow: hidden;

  background: #0d0f1a;

}

.editor-tabbar {

  height: 40px;

  flex-shrink: 0;

  display: flex;

  align-items: center;

  border-bottom: 1px solid var(--panel-border);

  background: #13151f;

  padding: 0 8px;

}

.active-file-tab {

  display: flex;

  align-items: center;

  gap: 7px;

  padding: 4px 12px;

  border-radius: 5px;

  background: #0d0f1a;

  border: 1px solid var(--panel-border);

  border-bottom-color: #0d0f1a;

  font-size: 0.82rem;

  color: #e2e8f0;

  font-weight: 500;

  margin-top: 4px;

}

.active-file-tab svg {

  opacity: 0.6;

}


.code-editor-container {

  position: relative;

  flex: 1;

  overflow: hidden;

  background: #0d0f1a;

}

#builder-code-input,

.code-editor-container pre {

  position: absolute;

  inset: 0;

  margin: 0;

  padding: 16px 20px;

  width: 100%;

  height: 100%;

  font-family: 'JetBrains Mono', 'Fira Code', monospace;

  font-size: 0.88rem;

  line-height: 1.6;

  tab-size: 2;

  white-space: pre;

  overflow: auto;

  box-sizing: border-box;

}

#builder-code-input {

  background: transparent;

  color: transparent;

  caret-color: #60a5fa;

  z-index: 2;

  resize: none;

  border: none;

  outline: none;

  border-radius: 0;

}

.code-editor-container pre {

  z-index: 1;

  pointer-events: none;

  color: #cdd6f4;

  overflow: hidden;

}

.code-editor-container pre code.hljs {

  background: transparent !important;

  padding: 0;

  display: block;

}


#builder-code-input::-webkit-scrollbar,

.builder-sidebar::-webkit-scrollbar,

.preview-shell::-webkit-scrollbar {

  width: 6px;

  height: 6px;

}

#builder-code-input::-webkit-scrollbar-track,

.builder-sidebar::-webkit-scrollbar-track,

.preview-shell::-webkit-scrollbar-track {

  background: transparent;

}

#builder-code-input::-webkit-scrollbar-thumb,

.builder-sidebar::-webkit-scrollbar-thumb,

.preview-shell::-webkit-scrollbar-thumb {

  background: rgba(255, 255, 255, 0.1);

  border-radius: 3px;

}

#builder-code-input::-webkit-scrollbar-thumb:hover,

.builder-sidebar::-webkit-scrollbar-thumb:hover,

.preview-shell::-webkit-scrollbar-thumb:hover {

  background: rgba(255, 255, 255, 0.2);

}


.files-view {

  display: none !important;

}


.files-view {

  flex-direction: row;

  background: var(--bg-chat);

  width: 100%;

  height: 100%;

  position: absolute;

  inset: 0;

}

.files-view-sidebar {

  width: 200px;

  border-right: 1px solid var(--panel-border);

  display: flex;

  flex-direction: column;

  background: rgba(0, 0, 0, 0.1);

}

.files-view-title {

  padding: 16px 20px;

  font-size: 0.8rem;

  font-weight: 700;

  color: var(--text-muted);

  text-transform: uppercase;

  letter-spacing: 0.05em;

  border-bottom: 1px solid var(--panel-border);

}

.files-view-tree {

  padding: 12px;

  flex: 1;

  overflow-y: auto;

}

.tree-item {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 8px 12px;

  border-radius: 6px;

  color: var(--text-muted);

  font-size: 0.85rem;

  cursor: pointer;

  transition: all 0.2s;

}

.tree-item:hover {

  background: rgba(255, 255, 255, 0.05);

  color: var(--text-main);

}

.tree-item svg {

  opacity: 0.7;

}

.files-view-main {

  flex: 1;

  display: flex;

  flex-direction: column;

  padding: 24px;

  overflow-y: auto;

}

.files-grid-header {

  font-size: 1.2rem;

  font-weight: 600;

  color: var(--text-main);

  margin-bottom: 20px;

}

.files-grid {

  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));

  gap: 16px;

}

.file-card {

  background: rgba(255, 255, 255, 0.03);

  border: 1px solid var(--panel-border);

  border-radius: 12px;

  padding: 16px;

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 12px;

  cursor: pointer;

  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

}

.file-card:hover {

  transform: translateY(-4px);

  border-color: var(--primary-color);

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);

}

.file-card-icon {

  width: 48px;

  height: 48px;

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.05);

  display: grid;

  place-items: center;

  color: var(--primary-color);

}

.file-card-name {

  font-size: 0.9rem;

  font-weight: 500;

  color: var(--text-main);

  text-align: center;

  word-break: break-all;

}

.file-card-type {

  font-size: 0.7rem;

  color: var(--text-muted);

  text-transform: uppercase;

}


.upload-btn.screensharing {

  color: #22c55e;

  background: rgba(34, 197, 94, 0.12);

  animation: pulse-share 2s infinite;

  position: relative;

}

.upload-btn.screensharing::after {

  content: '';

  position: absolute;

  top: 4px;

  right: 4px;

  width: 7px;

  height: 7px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow: 0 0 6px #22c55e;

  animation: blink-dot 1.5s ease-in-out infinite;

}

@keyframes pulse-share {

  0% {

    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);

  }

  70% {

    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);

  }

  100% {

    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);

  }

}

@keyframes blink-dot {

  0%,

  100% {

    opacity: 1;

  }

  50% {

    opacity: 0.3;

  }

}


.screenshare-floating {

  position: fixed;

  bottom: 100px;

  right: 24px;

  width: 280px;

  background: rgba(20, 20, 28, 0.92);

  backdrop-filter: blur(16px) saturate(160%);

  border: 1px solid rgba(34, 197, 94, 0.25);

  border-radius: 16px;

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(34, 197, 94, 0.08);

  z-index: 2000;

  display: none;

  flex-direction: column;

  overflow: hidden;

  animation: floatIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;

  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);

}

.screenshare-floating:hover {

  transform: translateY(-4px);

  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(34, 197, 94, 0.12);

}

.screenshare-floating.active {

  display: flex;

}

@keyframes floatIn {

  from {

    opacity: 0;

    transform: translateY(30px) scale(0.92);

  }

  to {

    opacity: 1;

    transform: translateY(0) scale(1);

  }

}

.screenshare-floating-header {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 10px 14px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);

  font-size: 0.78rem;

  font-weight: 600;

  color: #22c55e;

  letter-spacing: 0.02em;

}

.screenshare-status-dot {

  width: 8px;

  height: 8px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);

  animation: blink-dot 1.5s ease-in-out infinite;

  flex-shrink: 0;

}

.screenshare-floating-close {

  margin-left: auto;

  width: 26px;

  height: 26px;

  border-radius: 6px;

  border: none;

  background: rgba(255, 255, 255, 0.05);

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: all 0.2s;

}

.screenshare-floating-close:hover {

  background: rgba(239, 68, 68, 0.15);

  color: #ef4444;

}

.screenshare-floating video {

  width: 100%;

  aspect-ratio: 16 / 9;

  object-fit: cover;

  background: #000;

  display: block;

  border: none;

}

.screenshare-floating-footer {

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 8px 14px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);

}

.screenshare-snapshot-label {

  font-size: 0.68rem;

  color: var(--text-muted);

  letter-spacing: 0.03em;

  display: flex;

  align-items: center;

  gap: 6px;

}

.screenshare-snapshot-label::before {

  content: '';

  display: inline-block;

  width: 5px;

  height: 5px;

  border-radius: 50%;

  background: #22c55e;

  animation: blink-dot 1.5s ease-in-out infinite;

}


.IOT-toast {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 12px 20px;

  background: rgba(24, 24, 32, 0.92);

  backdrop-filter: blur(16px) saturate(150%);

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 12px;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;

  color: #f3f3f3;

  font-family: 'Inter', system-ui, sans-serif;

  font-size: 0.86rem;

  font-weight: 500;

  pointer-events: auto;

  opacity: 0;

  transform: translateY(20px) scale(0.95);

  transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);

  white-space: nowrap;

  max-width: 420px;

}

.IOT-toast.visible {

  opacity: 1;

  transform: translateY(0) scale(1);

}

.IOT-toast.exiting {

  animation: toastExit 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;

}

@keyframes toastExit {

  to {

    opacity: 0;

    transform: translateY(12px) scale(0.92);

  }

}

.toast-icon {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 28px;

  height: 28px;

  border-radius: 8px;

  flex-shrink: 0;

}

.toast-msg {

  letter-spacing: 0.01em;

  line-height: 1.3;

}


.IOT-toast-success {

  border-color: rgba(34, 197, 94, 0.2);

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 197, 94, 0.06);

}

.IOT-toast-success .toast-icon {

  color: #22c55e;

  background: rgba(34, 197, 94, 0.12);

}


.IOT-toast-error {

  border-color: rgba(239, 68, 68, 0.2);

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(239, 68, 68, 0.06);

}

.IOT-toast-error .toast-icon {

  color: #ef4444;

  background: rgba(239, 68, 68, 0.12);

}


.IOT-toast-info {

  border-color: rgba(96, 165, 250, 0.2);

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(96, 165, 250, 0.06);

}

.IOT-toast-info .toast-icon {

  color: #60a5fa;

  background: rgba(96, 165, 250, 0.12);

}


.sidebar-agents {

  padding: 8px 12px 12px;

  border-top: 1px solid var(--panel-border);

  border-bottom: 1px solid var(--panel-border);

  flex-shrink: 0;

}

.agents-label {

  padding: 6px 10px 8px;

  font-size: 0.68rem;

  font-weight: 700;

  color: var(--text-muted);

  text-transform: uppercase;

  letter-spacing: 0.08em;

}

.agent-item {

  width: 100%;

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 10px 12px;

  background: transparent !important;

  border: 1px solid transparent;

  border-radius: 10px;

  cursor: pointer;

  transition: all 0.25s var(--ease);

  text-align: left;

  color: var(--text-main);

  font-family: inherit;

}

.agent-item:hover {

  background: rgba(var(--primary-rgb), 0.08);

  border-color: rgba(var(--primary-rgb), 0.2);

  transform: translateX(4px);

}

.agent-item.active {

  background: rgba(var(--primary-rgb), 0.1);

  border-color: rgba(var(--primary-rgb), 0.3);

  box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.08);

}

.agent-icon {

  width: 32px;

  height: 32px;

  border-radius: 8px;

  background: transparent !important;

  display: grid;

  place-items: center;

  color: #9ca3af;

  flex-shrink: 0;

}

.agent-info {

  display: flex;

  flex-direction: column;

  flex: 1;

  min-width: 0;

}

.agent-name {

  font-size: 0.84rem;

  font-weight: 600;

  color: var(--text-main);

  line-height: 1.2;

}

.agent-desc {

  font-size: 0.68rem;

  color: var(--text-muted);

  margin-top: 1px;

}

.agent-badge {

  font-size: 0.58rem;

  font-weight: 700;

  color: var(--primary-color);

  background: rgba(var(--primary-rgb), 0.12);

  padding: 2px 6px;

  border-radius: 4px;

  letter-spacing: 0.06em;

  flex-shrink: 0;

}


body.osint-mode {

  --primary-color: #60a5fa;

  --primary-rgb: 96, 165, 250;

}

.osint-view {

  display: none;

  flex-direction: column;

  flex: 1;

  overflow: hidden;

  background: var(--bg-dark);

}

body.osint-mode .osint-view {

  display: flex;

}

body.osint-mode .hero {

  display: none;

}

body.osint-mode .messages {

  display: none;

}

body.osint-mode .chat-form-wrapper {

  display: none;

}


.dox-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

body.osint-searching .dox-messages {

  justify-content: flex-start;

}


.dox-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  animation: fadeUp 0.6s var(--ease) both;
  transition: opacity 0.3s ease;
}

body.osint-searching .dox-hero {

  display: none;

}

.dox-hero-icon {

  width: 72px;

  height: 72px;

  display: grid;

  place-items: center;

  animation: heroFloat 4s ease-in-out infinite;

}

.dox-title {

  font-size: 3.2rem;

  font-weight: 800;

  color: #fff;

  letter-spacing: -0.03em;

  margin: 0;

  text-transform: none;

}

.dox-title-ai {

  font-size: 1.2rem;

  vertical-align: super;

  margin-left: 4px;

  color: var(--primary-color);

  font-weight: 900;

}

.dox-sparkles {

  display: none;

}

.dox-subtitle {

  font-size: 1rem;

  color: var(--text-muted);

  letter-spacing: 0.02em;

}

.dox-capability-chips {

  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 8px;

  margin-top: 20px;

}

.dox-chip {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  padding: 6px 14px;

  background: rgba(255, 255, 255, 0.03);

  border: 1px solid rgba(255, 255, 255, 0.07);

  border-radius: 20px;

  color: var(--text-muted);

  font-size: 0.76rem;

  font-weight: 500;

  letter-spacing: 0.02em;

  transition: all 0.25s var(--ease);

}

.dox-chip:hover {

  background: rgba(var(--primary-rgb), 0.08);

  border-color: rgba(var(--primary-rgb), 0.2);

  color: #fff;

}


.dox-form-wrapper {
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg-chat);
}

.dox-composer {
  max-width: 780px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 6px 6px 6px 18px;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.dox-composer:focus-within {
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.06);
}

.dox-input {
  flex: 1;
  width: 100%;
  resize: none;
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  padding: 10px 0;
  line-height: 1.4;
  outline: none;
}

.dox-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.dox-send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  border: none;
  background: var(--primary-color);
  color: #000;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.dox-send-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.dox-send-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.dox-toolbar {

  display: flex;

  justify-content: space-between;

  align-items: center;

  width: 100%;

}

.dox-toolbar-left {

  display: flex;

  align-items: center;

  gap: 4px;

}

.dox-toolbar-right {

  display: flex;

  align-items: center;

  gap: 12px;

}

.dox-type-select {

  background: rgba(255, 255, 255, 0.04);

  border: 1px solid rgba(255, 255, 255, 0.06);

  color: var(--text-muted);

  font-size: 0.78rem;

  font-weight: 600;

  padding: 6px 10px;

  border-radius: 8px;

  outline: none;

  cursor: pointer;

  transition: all 0.2s;

  font-family: inherit;

}

.dox-type-select:hover {

  background: rgba(255, 255, 255, 0.08);

  color: #fff;

}

.dox-type-select:focus {

  border-color: rgba(var(--primary-rgb), 0.4);

}

.dox-filter-input {

  flex: 1;

  min-width: 120px;

  background: rgba(255, 255, 255, 0.03);

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 10px;

  padding: 8px 14px;

  font-size: 0.82rem;

  color: var(--text-main);

  font-family: inherit;

  outline: none;

  transition: border-color 0.2s;

}

.dox-filter-input::placeholder {

  color: var(--text-muted);

}

.dox-filter-input:focus {

  border-color: rgba(var(--primary-rgb), 0.3);

}


.dox-form-wrapper .osint-history-dropdown,

.dox-form-wrapper .osint-suggestions-dropdown {

  position: absolute;

  bottom: calc(100% + 6px);

  top: auto;

  left: 0;

  right: 0;

  background: rgba(15, 23, 42, 0.97);

  backdrop-filter: blur(20px) saturate(160%);

  border: 1px solid rgba(255, 255, 255, 0.1);

  border-radius: 14px;

  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);

  z-index: 200;

  max-height: 280px;

  overflow-y: auto;

  scrollbar-width: thin;

  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;

  animation: doxDropUp 0.25s var(--ease);

}

@keyframes doxDropUp {

  from {

    opacity: 0;

    transform: translateY(8px);

  }

  to {

    opacity: 1;

    transform: translateY(0);

  }

}


.dox-form-wrapper .osint-filters-panel {

  max-width: 780px;

  margin: 10px auto 0;

  background: rgba(15, 23, 42, 0.85);

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 16px;

  padding: 16px;

  display: none;

  animation: doxDropUp 0.3s var(--ease);

}

.dox-form-wrapper .osint-filters-panel.active {

  display: block;

}


.osint-dropdown-item {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 10px 16px;

  font-size: 0.86rem;

  color: var(--text-muted);

  cursor: pointer;

  transition: all 0.15s;

  border-bottom: 1px solid rgba(255, 255, 255, 0.03);

}

.osint-dropdown-item:last-child {

  border-bottom: none;

}

.osint-dropdown-item:hover {

  background: rgba(var(--primary-rgb), 0.1);

  color: #fff;

}

.osint-dropdown-item svg {

  flex-shrink: 0;

  opacity: 0.5;

}

@keyframes spin {

  to {

    transform: rotate(360deg);

  }

}

.spin {

  animation: spin 1s linear infinite;

}

.osint-hero-icon {

  width: 80px;

  height: 80px;

  border-radius: 20px;

  background: transparent !important;

  border: none !important;

  display: grid;

  place-items: center;

  color: var(--primary-color);

  box-shadow: none !important;

  animation: heroFloat 4s ease-in-out infinite;

}

.osint-title {

  font-size: 2rem;

  font-weight: 700;

  color: #fff;

  letter-spacing: -0.02em;

}

.osint-subtitle {

  font-size: 0.92rem;

  color: var(--text-muted);

  letter-spacing: 0.01em;

}

.osint-grid {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 14px;

  max-width: 700px;

  width: 100%;

  animation: fadeUp 0.7s var(--ease) 0.1s both;

}

.osint-card {

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 10px;

  padding: 24px 16px;

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 16px;

  cursor: pointer;

  transition: all 0.3s var(--ease);

  text-align: center;

  font-family: inherit;

  color: var(--text-main);

  position: relative;

  overflow: hidden;

}

.osint-card::before {

  content: '';

  position: absolute;

  top: 0;

  left: 0;

  right: 0;

  height: 3px;

  background: linear-gradient(90deg, var(--primary-color), #ef4444);

  opacity: 0;

  transition: opacity 0.3s;

}

.osint-card:hover {

  background: var(--panel-hover);

  border-color: rgba(var(--primary-rgb), 0.2);

  transform: translateY(-4px);

  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--primary-rgb), 0.06);

}

.osint-card:hover::before {

  opacity: 1;

}

.osint-card-icon {

  width: 48px;

  height: 48px;

  border-radius: 12px;

  background: rgba(var(--primary-rgb), 0.08);

  display: grid;

  place-items: center;

  color: var(--primary-color);

  transition: all 0.3s;

}

.osint-card:hover .osint-card-icon {

  background: rgba(var(--primary-rgb), 0.15);

  transform: scale(1.1);

}

.osint-card-title {

  font-size: 0.88rem;

  font-weight: 600;

  color: #fff;

}

.osint-card-desc {

  font-size: 0.72rem;

  color: var(--text-muted);

  line-height: 1.3;

}

.osint-card.loading {

  pointer-events: none;

  opacity: 0.7;

}

.osint-card.loading .osint-card-icon {

  animation: spin 1s linear infinite;

}


.osint-header-bar {

  width: 100%;

  padding: 24px 32px;

  background: rgba(10, 15, 25, 0.8);

  backdrop-filter: blur(25px) saturate(180%);

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  position: sticky;

  top: 0;

  z-index: 100;

  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);

  animation: hudFadeIn 0.8s var(--ease);

}

@keyframes hudFadeIn {

  from {

    opacity: 0;

    transform: translateY(-20px);

  }

  to {

    opacity: 1;

    transform: translateY(0);

  }

}

.osint-advanced-bar {

  display: flex;

  align-items: center;

  max-width: 1000px;

  margin: 0 auto;

  background: rgba(15, 23, 42, 0.8);

  border: 1px solid rgba(255, 255, 255, 0.1);

  border-radius: 16px;

  padding: 6px;

  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 20px 40px rgba(0, 0, 0, 0.5);

  transition: all 0.4s var(--ease);

  position: relative;

}

.osint-advanced-bar::before {

  content: '';

  position: absolute;

  inset: -1px;

  border-radius: 16px;

  padding: 1px;

  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);

  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);

  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);

  -webkit-mask-composite: xor;

  mask-composite: exclude;

  pointer-events: none;

}

.osint-advanced-bar:focus-within {

  border-color: rgba(var(--primary-rgb), 0.5);

  box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.2);

  transform: scale(1.01);

}

.osint-minimal-select {

  background: rgba(255, 255, 255, 0.03);

  border: none;

  color: #fff;

  font-size: 0.8rem;

  font-weight: 600;

  padding: 10px 16px;

  border-radius: 12px;

  margin-right: 8px;

  outline: none;

  cursor: pointer;

  transition: background 0.2s;

  text-transform: uppercase;

  letter-spacing: 0.05em;

}

.osint-minimal-select:hover {

  background: rgba(255, 255, 255, 0.06);

}

.osint-bar-input {

  flex: 1;

  background: transparent;

  border: none;

  color: #fff;

  padding: 12px 20px;

  font-size: 1rem;

  outline: none;

  font-family: var(--font-main);

  letter-spacing: 0.02em;

}

.osint-bar-input::placeholder {

  color: rgba(255, 255, 255, 0.3);

}

.osint-bar-actions {

  display: flex;

  align-items: center;

  gap: 8px;

  padding-right: 6px;

}

.osint-action-btn {

  width: 42px;

  height: 42px;

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.03);

  border: 1px solid rgba(255, 255, 255, 0.05);

  color: var(--text-muted);

  cursor: pointer;

  display: grid;

  place-items: center;

  transition: all 0.2s;

}

.osint-action-btn:hover {

  background: rgba(255, 255, 255, 0.08);

  color: #fff;

  border-color: rgba(255, 255, 255, 0.1);

}

.osint-action-btn.active {

  color: var(--primary-color);

  background: rgba(var(--primary-rgb), 0.15);

  border-color: rgba(var(--primary-rgb), 0.3);

  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);

}

.osint-submit-btn {

  display: flex;

  align-items: center;

  gap: 10px;

  background: linear-gradient(135deg, var(--primary-color), #4f46e5);

  color: #fff;

  border: none;

  padding: 10px 24px;

  border-radius: 12px;

  font-weight: 700;

  font-size: 0.88rem;

  cursor: pointer;

  transition: all 0.3s var(--ease);

  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);

  text-transform: uppercase;

  letter-spacing: 0.05em;

}

.osint-submit-btn:hover {

  filter: saturate(1.2) brightness(1.1);

  transform: translateY(-2px);

  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);

}


.osint-filters-panel {

  max-width: 1000px;

  margin: 16px auto 0;

  background: rgba(15, 23, 42, 0.95);

  border: 1px solid rgba(255, 255, 255, 0.1);

  border-radius: 18px;

  padding: 24px;

  display: none;

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);

  animation: hudSlideDown 0.4s var(--ease);

}

@keyframes hudSlideDown {

  from {

    opacity: 0;

    transform: translateY(-10px) scale(0.98);

  }

  to {

    opacity: 1;

    transform: translateY(0) scale(1);

  }

}

.osint-filters-panel.active {

  display: block;

}

.filter-group label {

  display: flex;

  align-items: center;

  gap: 8px;

  font-size: 0.7rem;

  font-weight: 800;

  color: var(--primary-color);

  margin-bottom: 12px;

  text-transform: uppercase;

  letter-spacing: 0.1em;

}

.filter-group label::after {

  content: '';

  flex: 1;

  height: 1px;

  background: rgba(var(--primary-rgb), 0.2);

}

.filter-chip {

  padding: 8px 16px;

  background: rgba(255, 255, 255, 0.03);

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 10px;

  font-size: 0.82rem;

  font-weight: 500;

  color: var(--text-muted);

  cursor: pointer;

  transition: all 0.2s;

}

.filter-chip:hover {

  background: rgba(255, 255, 255, 0.07);

  color: #fff;

}

.filter-chip.active {

  background: rgba(var(--primary-rgb), 0.2);

  border-color: var(--primary-color);

  color: #fff;

  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);

}



.dox-results-container {

  width: 100%;

  max-width: 860px;

  display: flex;

  flex-direction: column;

  gap: 24px;

  padding: 0 8px 40px;

  opacity: 0;

  transform: translateY(20px);

  transition: all 0.5s var(--ease);

}

body.osint-searching .dox-results-container {

  opacity: 1;

  transform: translateY(0);

}

.dox-report-box {

  background: var(--panel-bg);

  border: 1px solid var(--panel-border);

  border-radius: 16px;

  padding: 24px;

  color: var(--text-main);

  line-height: 1.6;

  font-size: 0.94rem;

  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);

  position: relative;

  animation: doxEntry 0.4s var(--ease) both;

}

@keyframes doxEntry {

  from { opacity: 0; transform: translateY(10px); }

  to { opacity: 1; transform: translateY(0); }

}

.dox-report-header {

  border-bottom: 1px solid var(--panel-border);

  padding-bottom: 12px;

  margin-bottom: 16px;

  display: flex;

  justify-content: space-between;

  align-items: center;

  font-size: 1rem;

  font-weight: 700;

  color: var(--primary-color);

}

.dox-report-timestamp {

  font-size: 0.78rem;

  color: var(--text-muted);

  font-weight: 500;

}

.dox-report-content {

  white-space: pre-wrap;

  word-break: break-word;

}

.dox-report-content strong {

  color: #fff;

}

.dox-report-content ul {

  margin: 12px 0 12px 24px;

}

.dox-report-content li {

  margin-bottom: 6px;

}

@media(max-width: 768px) {

  .dox-report-box {

    padding: 20px;

    font-size: 1rem;

  }

  .dox-title {

    font-size: 3rem;

  }

}

@media(max-width: 480px) {

  .dox-title {

    font-size: 2.2rem;

  }

}

#image-viewer-modal .image-viewer-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: modalScale 0.3s var(--ease) both;
}

.image-viewer-main {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.image-viewer-main img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.image-viewer-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.image-viewer-footer {
  width: 100%;
  display: flex;
  justify-content: center;
}

#image-viewer-download-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  text-decoration: none;
}

.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(var(--primary-rgb), 0.06) 0%, rgba(0,0,0,0.98) 70%) !important;
  z-index: 9999 !important;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-particle {
  position: absolute;
  background: rgba(var(--primary-rgb), 0.4);
  border-radius: 50%;
  animation: authFloat linear infinite;
}

@keyframes authFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

.auth-gateway {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px 36px 28px;
  box-shadow:
    0 0 0 1px rgba(var(--primary-rgb), 0.08),
    0 25px 70px rgba(0, 0, 0, 0.7),
    0 0 100px rgba(var(--primary-rgb), 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: gatewayAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gatewayAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-gateway-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-ring {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
}

.auth-logo-ring-inner {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.08);
  animation: logoPulse 3s ease-in-out infinite;
}

.auth-logo-ring-inner .brand-logo {
  width: 34px;
  height: 34px;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.2); }
  50% { box-shadow: 0 0 20px 5px rgba(var(--primary-rgb), 0.15); }
}

.auth-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.auth-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 2;
}

.auth-ring-progress {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(var(--primary-rgb), 0.5));
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

.auth-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.15);
  font-size: 0.7rem;
  font-weight: 600;
  color: #22c55e;
  letter-spacing: 0.03em;
}

.auth-tabs {
  display: flex;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  font-family: inherit;
}

.auth-tab:hover { color: #fff; }
.auth-tab.active { color: #fff; }

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 9px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: authFormIn 0.3s ease both;
}

.auth-form.active {
  display: flex;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
}

.auth-input:focus {
  border-color: rgba(var(--primary-rgb), 0.4);
  background: rgba(var(--primary-rgb), 0.04);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.auth-input-wrap .auth-input {
  padding-right: 44px;
}

.auth-eye-btn {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.auth-eye-btn:hover { color: rgba(255, 255, 255, 0.7); background: rgba(255,255,255,0.05); }
.auth-eye-btn.active { color: var(--primary-color); }

.auth-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.auth-strength-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.auth-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 100px;
  transition: all 0.4s ease;
}

.auth-strength-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 60px;
  text-align: right;
}

.auth-key-status {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-key-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(var(--primary-rgb), 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: keySpin 0.7s linear infinite;
}

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

.auth-key-info {
  font-size: 0.75rem;
  margin-top: 4px;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.auth-key-info.visible {
  display: flex;
}

.auth-key-valid {
  color: #22c55e;
  font-weight: 600;
}

.auth-key-invalid {
  color: #ef4444;
  font-weight: 600;
}

.auth-key-meta {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), rgba(var(--primary-rgb), 0.8));
  color: #000;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.auth-submit:hover::before {
  transform: translateX(100%);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.4);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

.auth-submit.loading .auth-submit-text { opacity: 0; }
.auth-submit.loading .auth-submit-arrow { opacity: 0; }

.auth-submit.loading .auth-submit-loader {
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0, 0, 0, 0.15);
  border-top-color: #000;
  border-radius: 50%;
  animation: keySpin 0.6s linear infinite;
}

.auth-submit-loader { display: none; }

.auth-submit.success {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  pointer-events: none;
}

.auth-submit.shake {
  animation: authShake 0.4s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.auth-submit-arrow {
  transition: transform 0.2s ease;
}

.auth-submit:hover .auth-submit-arrow {
  transform: translateX(3px);
}

.auth-attempts-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.auth-attempts-fill {
  height: 4px;
  border-radius: 100px;
  flex: 1;
  transition: width 0.4s ease;
}

.auth-attempts-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ef4444;
  white-space: nowrap;
}

.auth-error {
  color: #ef4444;
  font-size: 0.82rem;
  min-height: 20px;
  font-weight: 500;
  text-align: center;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.auth-fingerprint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.1);
  letter-spacing: 0.1em;
  word-break: break-all;
  line-height: 1.4;
  max-width: 340px;
}

.auth-footer-text {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.2);
}

.auth-footer-text code {
  font-family: 'JetBrains Mono', monospace;
  color: rgba(var(--primary-rgb), 0.4);
  font-size: 0.65rem;
}

@media (max-width: 500px) {
  .auth-gateway {
    margin: 16px;
    padding: 28px 22px 20px;
  }
  .auth-title { font-size: 1.3rem; }
  .auth-fingerprint { display: none; }
}

.hidden {
  display: none !important;
}

.delayed-reveal { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.delayed-reveal.visible { opacity: 1; pointer-events: all; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.drawer-overlay.active {
  display: block;
  opacity: 1;
}
.drawer {
  position: fixed;
  right: -100%;
  top: 0;
  bottom: 0;
  width: 90%;
  max-width: 1000px;
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  z-index: 1001;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.drawer.active { right: 0; }
.drawer-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}
.drawer-header-left { display: flex; align-items: center; gap: 16px; }
.drawer-file-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; color: var(--primary-color); }
.drawer-file-info { display: flex; flex-direction: column; gap: 2px; }
.drawer-filename { font-weight: 600; font-size: 1rem; color: #fff; }
.drawer-file-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.drawer-header-right { display: flex; align-items: center; gap: 12px; }
.drawer-search-wrap { position: relative; display: flex; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--panel-border); border-radius: 8px; padding: 0 10px; margin-right: 12px; }
.drawer-search-wrap input { background: transparent; border: none; color: #fff; padding: 8px; font-size: 0.85rem; outline: none; width: 180px; }
.drawer-action-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--panel-border); background: transparent; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; transition: all 0.2s; }
.drawer-action-btn:hover { background: var(--panel-hover); color: #fff; border-color: rgba(255, 255, 255, 0.1); }
.drawer-close-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; transition: all 0.2s; }
.drawer-close-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.drawer-content { flex: 1; overflow: auto; background: #0d0d0d; position: relative; }
.drawer-content pre { margin: 0; padding: 24px; min-height: 100%; }
.drawer-content code { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; line-height: 1.6; background: transparent !important; }
.line-numbers-rows { position: absolute; top: 24px; left: 0; width: 48px; text-align: right; padding-right: 12px; color: rgba(255, 255, 255, 0.2); font-family: monospace; font-size: 0.9rem; pointer-events: none; user-select: none; }
.hljs-search-match { background: rgba(255, 255, 0, 0.3); border-bottom: 2px solid yellow; }

.dox-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.3);
}

body.osint-mode .dox-topbar { display: flex; }

.dox-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.dox-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.dox-clear-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-color: rgba(255,255,255,0.12);
}


.dox-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.dox-msg {
  animation: doxMsgIn 0.3s ease both;
}

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

.dox-msg-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.dox-msg-bubble {
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.7;
  word-break: break-word;
}

.dox-user-bubble {
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  color: #fff;
  font-weight: 500;
  max-width: 600px;
  margin-left: auto;
}

.dox-ai-bubble {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-main);
}

.dox-ai-bubble strong { color: #fff; }
.dox-ai-bubble ul { margin: 10px 0 10px 20px; }
.dox-ai-bubble li { margin-bottom: 4px; }
.dox-ai-bubble h1, .dox-ai-bubble h2, .dox-ai-bubble h3 {
  color: var(--primary-color);
  margin: 16px 0 8px;
  font-size: 1rem;
}
.dox-ai-bubble p { margin: 8px 0; }
.dox-ai-bubble code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.dox-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: fit-content;
}

.dox-thinking-dots {
  display: flex;
  gap: 4px;
}

.dox-thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: doxDotPulse 1.4s ease-in-out infinite;
}

.dox-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.dox-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes doxDotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}




.mermaid-container { background: rgba(0,0,0,0.2); border-radius: 12px; padding: 20px; margin: 15px 0; display: flex; justify-content: center; border: 1px solid rgba(255,255,255,0.05); overflow-x: auto; }
.mermaid { background: transparent !important; }
.chart-container { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); }
.visualization-error { color: #ef4444; font-size: 0.8rem; padding: 10px; background: rgba(239,68,68,0.1); border-radius: 6px; border: 1px solid rgba(239,68,68,0.2); }


.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.modal {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  width: 90%;
  max-width: 480px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.05);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.modal-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-btn-confirm {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

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

.settings-dashboard {
  max-width: 800px;
  width: 90vw;
  height: 80vh;
  max-height: 700px;
  padding: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.settings-sidebar {
  width: 240px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--panel-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 12px;
  margin-bottom: 12px;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.settings-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.settings-nav-btn.active {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
}

.settings-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.settings-pane {
  display: none;
  animation: fadeUp 0.3s ease both;
}

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

.setting-group {
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 16px;
}

.settings-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.settings-input, .settings-textarea, select.settings-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

select.settings-input option {
  background: var(--panel-bg);
  color: var(--text-main);
}

.settings-input:focus, .settings-textarea:focus, select.settings-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.4);
}

.settings-textarea {
  resize: vertical;
  min-height: 100px;
}

.settings-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: transform 0.1s;
}
.settings-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.color-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.2s;
}
.color-btn:hover {
  transform: scale(1.1);
}
.color-btn.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 4px var(--c);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.theme-card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-family: inherit;
  display: flex;
  flex-direction: column;
}
.theme-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}
.theme-card.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.05);
}
.theme-preview {
  height: 60px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.theme-preview.dark { background: #212121; }
.theme-preview.light { background: #f9f9f9; }
.theme-preview.matrix { background: #000a00; border-color: #00ff00; }

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider.round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 24px;
}
.slider.round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}
.switch input:checked + .slider.round {
  background-color: var(--primary-color);
}
.switch input:checked + .slider.round:before {
  transform: translateX(20px);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.drawer-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}

.docs-modal {
  max-width: 800px;
  width: 90vw;
  height: 80vh;
  padding: 0;
}
.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.02);
}
.docs-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
}
.docs-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.docs-body {
  padding: 32px;
  overflow-y: auto;
  height: calc(100% - 80px);
}
.docs-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 24px;
  margin-bottom: 12px;
}
.docs-body h4:first-child {
  margin-top: 0;
}
.docs-body p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.docs-body strong {
  color: #fff;
}
.docs-body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
}
.docs-body li {
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.docs-body li::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
}
.docs-body code {
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

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


#image-viewer-modal {
  display: none;
  z-index: 10000;
}
#image-viewer-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  animation: imgFadeIn 0.2s ease;
}
@keyframes imgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.image-viewer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  padding: 24px;
}
.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.image-viewer-close:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.1);
}
.image-viewer-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}
.image-viewer-main img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: imageZoomIn 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes imageZoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.image-viewer-footer {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.image-viewer-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.2s ease;
  cursor: pointer;
}
.image-viewer-footer a:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}
.message-attachments img {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
}
.message-attachments img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

body { -webkit-user-select: auto; -moz-user-select: auto; -ms-user-select: auto; user-select: auto; }
input, textarea, .hljs, [contenteditable="true"] { -webkit-user-select: auto; -moz-user-select: auto; -ms-user-select: auto; user-select: auto; }
img { -webkit-user-drag: none; }

/* Chat Bubble Styles */
body[data-bubble-style="square"] .message {
  border-radius: 4px !important;
}
body[data-bubble-style="minimal"] .message {
  border-radius: 0 !important;
  background: transparent !important;
  border-bottom: 1px solid var(--panel-border) !important;
  box-shadow: none !important;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
/* Firefox support */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
  .app {
    position: relative;
  }
  
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 105;
    transform: translateX(0);
    width: 280px !important;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  }
  
  .app.sidebar-collapsed .sidebar {
    transform: translateX(-100%) !important;
  }
  
  .sidebar-overlay {
    z-index: 104;
  }
  
  .app:not(.sidebar-collapsed) .sidebar-overlay {
    display: block !important;
  }
  
  .chat-area {
    width: 100%;
  }

  .hero h2 {
    font-size: 2rem;
  }
  
  .hero-logo {
    width: 48px;
    height: 48px;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }
  
  .composer {
    flex-direction: column;
    padding-bottom: 10px;
  }

  .composer-toolbar {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: space-between;
  }
  
  .msg-row {
    padding: 16px 0;
    gap: 12px;
  }
  
  .msg-avatar {
    width: 32px;
    height: 32px;
  }
  
  .builder-panel {
    position: fixed !important;
    inset: 0;
    z-index: 200;
    width: 100% !important;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  
  .builder-panel.active {
    transform: translateY(0);
  }
  
  /* Settings Mobile */
  .settings-dashboard {
    flex-direction: column;
    height: 90vh;
    max-height: 90vh;
    width: 95vw;
  }
  
  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    padding: 12px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    gap: 8px;
    scrollbar-width: none;
  }
  
  .settings-sidebar::-webkit-scrollbar {
    display: none;
  }
  
  .settings-sidebar-title {
    display: none;
  }
  
  .settings-nav-btn {
    padding: 8px 14px;
    white-space: nowrap;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
  }
  
  .settings-nav-btn.active {
    background: rgba(var(--primary-rgb), 0.15);
  }
  
  .settings-content {
    padding: 16px;
  }
  
  .color-grid, .bg-anim-grid, .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
}
