/* ==========================================================================
   VOID AI — INDEPENDENT AI PLATFORM
   Design System & Telegram Mini App Styles
   Tokens: GR-01 #17191C | OW-02 #F2F0E9 | SG-03 #A4B9A7
   ========================================================================== */

:root {
  /* Brand Palette from Mockup Spec */
  --gr-01: #17191C; /* Canvas Dark Graphite */
  --ow-02: #F2F0E9; /* Primary Off-White / Cream */
  --sg-03: #A4B9A7; /* Accent Sage Green */

  /* UI Surfaces & Borders */
  --bg-app: #17191C;
  --surface-card: #202327;
  --surface-card-hover: #262A30;
  --surface-input: #1B1E22;
  --border-subtle: #2B2F36;
  --border-card: rgba(255, 255, 255, 0.08);

  /* Bubbles */
  --bubble-user-bg: #23272D;
  --bubble-user-text: #F2F0E9;
  --bubble-user-border: rgba(255, 255, 255, 0.09);
  --bubble-ai-bg: #F2F0E9;
  --bubble-ai-text: #17191C;

  /* Typography Colors */
  --text-main: #F2F0E9;
  --text-muted: #8E9298;
  --text-dim: #5D636D;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Safe Area variables for Telegram */
  --tg-safe-top: var(--tg-viewport-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --tg-safe-bottom: var(--tg-viewport-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --nav-height: 62px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--gr-01);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom sleek scrollbars matching modern dark apps */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* App Shell - Responsive Perplexity/ChatGPT style desktop width */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px; /* Responsive desktop/tablet width */
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  position: relative;
  background-color: var(--gr-01);
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .app-container {
    max-width: 100%;
    box-shadow: none;
  }
}

/* ==========================================================================
   VIEW SWITCHING
   ========================================================================== */
.view {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding-bottom: var(--nav-height);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.view.active {
  display: flex;
  opacity: 1;
}

/* Hide global nav when chat is active */
body.in-chat .bottom-nav {
  display: none;
}

/* ==========================================================================
   VIEW 1: HOME DASHBOARD (Matching left phone in mockup)
   ========================================================================== */
.dashboard-header {
  padding: calc(var(--tg-safe-top) + 24px) 20px 14px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.session-badge-top {
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ow-02);
  text-transform: uppercase;
  opacity: 0.85;
}

.dashboard-content {
  flex: 1;
  padding: 16px 20px calc(var(--nav-height) + 16px) 20px;
  display: flex;
  flex-direction: column;
}

.feature-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 20px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--ow-02);
}

.feature-card:hover {
  background-color: var(--surface-card-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

.feature-card:active {
  transform: scale(0.985);
}

.card-left {
  flex: 1;
  padding-right: 14px;
}

.card-number-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ow-02);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.card-number {
  color: var(--ow-02);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 2px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ow-02);
  flex-shrink: 0;
  opacity: 0.9;
}

.status-pill-container {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  justify-content: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  background-color: #1A1D20;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 8px 18px;
}

.status-pill-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   VIEW 2: CHAT VIEW (Matching right phone in mockup)
   ========================================================================== */
#view-chat {
  display: none;
  flex-direction: column;
  height: 100%;
  padding-bottom: 0;
}

#view-chat.active {
  display: flex;
}

.chat-header {
  padding: calc(var(--tg-safe-top) + 12px) 16px 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background-color: var(--gr-01);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Header Offer Pill matching Screenshot 2 */
.header-offer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.32);
  color: #60A5FA;
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  outline: none;
}

.header-offer-pill:hover {
  background-color: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
  color: #93C5FD;
}

.header-offer-pill .offer-gift-icon {
  font-size: 13.5px;
}

/* Header Share Button matching Screenshot 2 */
.header-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  outline: none;
}

.header-share-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--ow-02);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background-color: var(--surface-card);
  color: #FFFFFF;
}

.close-chat-btn {
  color: rgba(255, 255, 255, 0.6);
}

.close-chat-btn:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Messages Area matching Screenshot 2 */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  width: 100%;
  animation: fadeIn 0.2s ease-out;
}

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

/* User Message Pill matching Screenshot 2 */
.message-user {
  justify-content: flex-end;
}

.bubble-user {
  background-color: #173868; /* Sleek navy blue from Screenshot 2 */
  color: #FFFFFF;
  border: 1px solid rgba(66, 128, 222, 0.32);
  border-radius: 20px 20px 6px 20px;
  padding: 10px 18px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  word-break: break-word;
  max-width: 82%;
}

/* AI Message matching Screenshot 2: Pure dark canvas, transparent background, crisp typography */
.message-ai {
  justify-content: flex-start;
  align-items: flex-start;
  max-width: 100%;
}

.avatar-ai {
  display: none; /* In Screenshot 2, text starts flush with the left margin */
}

.bubble-ai-container {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.bubble-ai {
  background: transparent !important;
  color: #ECECED;
  border-radius: 0;
  padding: 0;
  font-size: 15.5px;
  line-height: 1.65;
  font-weight: 400;
  box-shadow: none !important;
  border: none !important;
  word-break: break-word;
}

.bubble-ai strong, 
.bubble-ai b {
  color: #FFFFFF;
  font-weight: 600;
}

.bubble-ai code.inline-code {
  font-family: var(--font-mono);
  background: #191C21;
  color: var(--sg-03);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Bullet list styling matching Screenshot 2 */
.chat-bullet-list {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.55;
  color: #ECECED;
}

.chat-bullet-dot {
  color: #ECECED;
  font-size: 16px;
  line-height: 1.35;
  flex-shrink: 0;
}

.chat-bullet-text {
  flex: 1;
}

/* Numbered list styling */
.chat-num-list {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Markdown Headings within Chat Bubbles */
.chat-md-h1 {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 14px 0 8px 0;
  letter-spacing: -0.01em;
}

.chat-md-h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: #ECECED;
  margin: 12px 0 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.chat-md-h3 {
  font-size: 13px;
  font-weight: 600;
  color: #93C5FD;
  margin: 10px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-num-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.55;
  color: #ECECED;
}

.chat-num-idx {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--sg-03);
  font-size: 14px;
  flex-shrink: 0;
}

.chat-num-text {
  flex: 1;
}

/* Sources Pill matching Screenshot 2: e.g. [🪙 Coinucation +2] */
.chat-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #1E2228;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 2px 9px;
  font-size: 11.5px;
  color: #A3ABB7;
  font-weight: 500;
  vertical-align: middle;
  margin-left: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.chat-source-chip:hover {
  background-color: #262B33;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.22);
}

.chat-source-icon {
  font-size: 12px;
}

/* Clean link styling with ↗ matching Screenshot 2 */
.chat-link {
  color: #E2E6EE;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
  cursor: pointer;
}

.chat-link:hover {
  color: #FFFFFF;
  text-decoration-style: solid;
}

.chat-link .link-arrow {
  display: inline-block;
  font-size: 12px;
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.chat-link:hover .link-arrow {
  transform: translate(1px, -1px);
}

/* Typing pulse animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--bubble-ai-text);
  border-radius: 50%;
  opacity: 0.35;
  animation: typing-blink 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Quick Prompts Bar & Chips */
.quick-prompts-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background-color: var(--gr-01);
}
.quick-prompts-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  background-color: #202327;
  color: var(--ow-02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  display: inline-flex;
  align-items: center;
  user-select: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.chip:hover {
  background-color: #282C33;
  border-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.chip:active {
  transform: scale(0.96);
}

/* Attached Files Preview Bar */
.attached-files-bar {
  display: flex;
  gap: 8px;
  padding: 4px 0 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.attached-files-bar::-webkit-scrollbar {
  display: none;
}

.attached-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #202327;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--ow-02);
  max-width: 200px;
  flex-shrink: 0;
}

.attached-file-thumb {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
}

.attached-file-icon {
  font-size: 16px;
  line-height: 1;
}

.attached-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
}

.attached-file-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s ease;
}
.attached-file-remove:hover {
  color: #ff6b6b;
}

/* Chat bubble attachment elements */
.chat-attachment-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.chat-attachment-img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
.chat-attachment-video {
  max-width: 100%;
  max-height: 260px;
  border-radius: 12px;
  display: block;
}
.chat-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ow-02);
  text-decoration: none;
}

/* Message Composer matching mockup */
.composer-container {
  padding: 10px 16px calc(var(--tg-safe-bottom) + 14px) 16px;
  background-color: var(--gr-01);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.composer-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.composer-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attach-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.attach-btn:hover {
  background-color: var(--surface-card-hover);
  color: var(--ow-02);
  border-color: #3E4552;
}

.attach-btn:active {
  transform: scale(0.92);
}

.input-wrapper {
  flex: 1;
  background-color: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0 18px;
  display: flex;
  align-items: center;
}

.composer-input {
  width: 100%;
  height: 44px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ow-02);
  font-family: var(--font-sans);
  font-size: 14.5px;
}

.composer-input::placeholder {
  color: #5D636D;
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--sg-03);
  color: var(--gr-01);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s;
}

.send-btn:hover {
  background-color: #B4C7B7;
}

.send-btn:active {
  transform: scale(0.92);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   SUB-VIEWS (IMAGE GENERATION, CREATIVE TOOLS, SETTINGS)
   ========================================================================== */
.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--tg-safe-top) + 12px) 16px 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.sub-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sub-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ow-02);
  letter-spacing: 0.02em;
}

.image-content, .tools-content, .settings-content {
  flex: 1;
  padding: 20px 16px calc(var(--nav-height) + 16px) 16px;
  overflow-y: auto;
}

.section-intro {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 18px;
}

.input-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.prompt-textarea {
  width: 100%;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ow-02);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.style-chips, .ratio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.style-chip, .ratio-chip {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.style-chip.active, .ratio-chip.active {
  background-color: var(--ow-02);
  color: var(--gr-01);
  border-color: var(--ow-02);
  font-weight: 600;
}

.pill-btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background-color: var(--sg-03);
  color: var(--gr-01);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill-btn-submit:hover {
  background-color: #B4C7B7;
}

.pill-btn-submit:active {
  transform: scale(0.98);
}

.image-result-card {
  margin-top: 24px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.image-frame {
  width: 100%;
  min-height: 240px;
  position: relative;
  background-color: #121416;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.image-loader {
  position: absolute;
  inset: 0;
  background: rgba(23, 25, 28, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--sg-03);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(164, 185, 167, 0.2);
  border-top-color: var(--sg-03);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.image-actions {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
}

.action-btn {
  flex: 1;
  background-color: #272C33;
  color: var(--ow-02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn.danger {
  background-color: rgba(200, 50, 50, 0.15);
  color: #ff6b6b;
  border-color: rgba(200, 50, 50, 0.3);
}

.hidden {
  display: none !important;
}

/* Tools List */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card:hover {
  background-color: var(--surface-card-hover);
  border-color: #3A404A;
  transform: translateY(-1px);
}

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

.tool-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: rgba(164, 185, 167, 0.12);
  color: var(--sg-03);
  padding: 3px 8px;
  border-radius: 4px;
}

.tool-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.tool-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ow-02);
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.tool-action-btn {
  background: transparent;
  border: none;
  color: var(--sg-03);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Language Selector Grid */
.lang-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.lang-chip {
  background-color: #1A1D21;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.lang-chip:nth-child(5) {
  grid-column: span 2;
  justify-content: center;
}

.lang-chip:hover {
  background-color: var(--surface-card-hover);
  border-color: #3C424E;
  color: var(--ow-02);
}

.lang-chip.active {
  background-color: var(--ow-02);
  color: var(--gr-01);
  border-color: var(--ow-02);
  font-weight: 600;
}

.lang-chip.active .lang-name {
  color: var(--gr-01);
}

.lang-flag {
  font-size: 16px;
  line-height: 1;
}

.lang-name {
  font-size: 13px;
  color: inherit;
}

/* Settings Cards */
.settings-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.card-headline {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ow-02);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text-muted);
}
.settings-row:last-child {
  border-bottom: none;
}

.val-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--ow-02);
}

.val-tag.green {
  color: var(--sg-03);
  font-family: var(--font-mono);
  font-size: 11px;
}

.val-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.setting-slider-group {
  margin-bottom: 16px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.slider-val {
  font-family: var(--font-mono);
  color: var(--sg-03);
  font-weight: 600;
}

.range-slider {
  width: 100%;
  accent-color: var(--sg-03);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.settings-tip {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR (CHAT | TOOLS | SETTINGS)
   ========================================================================== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--tg-safe-bottom));
  padding-bottom: var(--tg-safe-bottom);
  background-color: var(--gr-01);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

.nav-item {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item.active {
  color: var(--ow-02);
}

.nav-item.active .nav-icon {
  color: var(--ow-02);
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================================
   ENHANCED CODE BLOCKS & SYNTAX STYLING
   ========================================================================== */
/* Progressive Stream Preview Code Box */
.stream-code-box {
  margin: 10px 0;
  background-color: #121417;
  border: 1px solid #2B2F36;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
}

.stream-code-header {
  padding: 5px 10px;
  background-color: #1a1d21;
  border-bottom: 1px solid #282c32;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sg-03);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stream-code-box pre {
  margin: 0;
  padding: 10px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #e6e9ee;
  background-color: #121417;
}

.stream-code-box pre code {
  font-family: inherit;
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-block-wrapper {
  margin: 10px 0;
  background-color: #121417;
  border: 1px solid #2B2F36;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background-color: #1a1d21;
  border-bottom: 1px solid #282c32;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.code-lang {
  color: var(--sg-03);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10px;
}

.code-header-btns {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}

.code-action-btn {
  background-color: #23272d;
  color: #cfd4dc;
  border: 1px solid #333842;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.code-action-btn:hover {
  background-color: #2e333b;
  color: #fff;
  border-color: #444b57;
}

.code-action-btn.copied {
  background-color: var(--sg-03);
  color: #17191C;
  font-weight: 600;
}

pre.code-content {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #e6e9ee;
  background-color: #121417;
}

/* ==========================================================================
   MINIMAL ACTION ICONS ROW MATCHING SCREENSHOT 2
   (Copy, Dislike, Like, Share, Speak TTS, Regenerate, More / Library)
   ========================================================================== */
.ai-actions-container {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.ai-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  flex-shrink: 0;
}

.ai-icon-btn:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.ai-icon-btn:active {
  transform: scale(0.92);
}

.ai-icon-btn.active {
  color: #60A5FA;
}

.ai-icon-btn.copied {
  color: var(--sg-03);
}

.ai-icon-btn.speaking {
  color: #60A5FA;
  animation: pulse-speaker 1.2s infinite ease-in-out;
}

@keyframes pulse-speaker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* Secondary Refinement Chips */
.ai-refine-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.refine-chip {
  background-color: #17191D;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  user-select: none;
}

.refine-chip:hover {
  background-color: #22262D;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.refine-chip:active {
  transform: scale(0.96);
}

/* Legacy/Fallback action styles */
.message-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.msg-action-btn {
  background-color: #202327;
  color: #ccd1d9;
  border: 1px solid #30353c;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

/* ==========================================================================
   MICROPHONE VOICE INPUT BUTTON
   ========================================================================== */
.mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 4px;
  flex-shrink: 0;
}

.mic-btn:hover {
  color: var(--ow-02);
  background-color: rgba(255, 255, 255, 0.05);
}

.mic-btn.listening {
  color: #ff4757;
  background-color: rgba(255, 71, 87, 0.15);
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.45);
  animation: pulse-red 1.2s infinite ease-in-out;
}

@keyframes pulse-red {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   LIBRARY VIEW (FAVORITES, NOTES, CODE SNIPPETS)
   ========================================================================== */
.library-content {
  flex: 1;
  padding: 16px 20px calc(var(--nav-height) + 16px) 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.library-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.lib-search-box {
  margin-bottom: 14px;
}

.lib-search-input {
  width: 100%;
  background-color: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease;
}

.lib-search-input:focus {
  border-color: var(--sg-03);
}

.library-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-item-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.library-item-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.lib-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lib-item-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.lib-item-badge.favorite {
  background-color: rgba(164, 185, 167, 0.15);
  color: var(--sg-03);
}

.lib-item-badge.note {
  background-color: rgba(120, 150, 255, 0.15);
  color: #9cb4ff;
}

.lib-item-badge.code {
  background-color: rgba(255, 180, 50, 0.15);
  color: #ffc060;
}

.lib-item-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

.lib-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ow-02);
}

.lib-item-content {
  font-size: 12.5px;
  color: #cfd4dc;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
  background-color: #141619;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #23272d;
}

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

.header-action-btn {
  background-color: #23272d;
  color: var(--ow-02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-action-btn:hover {
  background-color: #2d323a;
  border-color: var(--sg-03);
}

/* ==========================================================================
   CHAT HEADER ACTIONS & HISTORY DRAWER
   ========================================================================== */
.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-drawer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.history-drawer.hidden {
  display: none;
}

.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.drawer-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  background-color: #191b1f;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 20px 24px 20px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* History Drawer: Right Side Panel matching ChatGPT / Claude */
#chat-history-drawer .drawer-panel {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 330px;
  max-width: 86vw;
  height: 100%;
  max-height: 100%;
  background-color: #14171A;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top: none;
  padding: 18px 16px 20px 16px;
  box-shadow: -8px 0 35px rgba(0, 0, 0, 0.65);
  animation: slide-right-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 101;
}

@keyframes slide-right-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

.drawer-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ow-02);
  text-transform: uppercase;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.drawer-close-btn:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
}

.drawer-new-chat-btn {
  width: 100%;
  background-color: #23272d;
  color: var(--ow-02);
  border: 1px solid #333842;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.drawer-new-chat-btn:hover {
  background-color: #2c313a;
  border-color: #60A5FA;
  color: #FFFFFF;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 50vh;
}

#chat-history-drawer .drawer-list {
  max-height: none;
  flex: 1;
  padding-right: 2px;
}

.drawer-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1C2025;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-session-item:hover {
  background-color: #242930;
  border-color: rgba(255, 255, 255, 0.15);
}

.drawer-session-item.active {
  border-color: #60A5FA;
  border-left: 3px solid #60A5FA;
  background-color: rgba(59, 130, 246, 0.1);
}

.drawer-session-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
}

.drawer-session-title {
  font-size: 13px;
  font-weight: 600;
  color: #ECECED;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.drawer-session-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.drawer-session-del {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.drawer-session-del:hover {
  color: #FF5A5F;
  background-color: rgba(255, 90, 95, 0.12);
}

/* ==========================================================================
   CODE SYNTAX HIGHLIGHTING COLORS (C++, Python, JS, etc.)
   ========================================================================== */
.tok-comment { color: #768390; font-style: italic; }
.tok-string { color: #7EE787; } /* Strings: green */
.tok-number { color: #79C0FF; } /* Numbers/Hex: cyan */
.tok-type { color: #569CD6; font-weight: 600; } /* C++ void, int, uintptr_t, HANDLE: BLUE */
.tok-keyword { color: #C586C0; font-weight: 500; } /* return, if, struct: PURPLE */
.tok-def { color: #FF9E64; font-weight: 600; } /* Python def, class: ORANGE */
.tok-keyword-py { color: #FF7B72; font-weight: 500; } /* import, return, for: ORANGE/RED */
.tok-constant { color: #79C0FF; font-weight: 500; } /* NULL, None, True: CYAN */
.tok-builtin { color: #4EC9B0; } /* print, len: TEAL */
.tok-fn { color: #DCDCAA; } /* Functions: YELLOW/GOLD */
.tok-prep { color: #D2A8FF; } /* #include, #define: LIGHT PURPLE */

/* Empty Chat Session Welcome View */
.chat-welcome-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  padding: 40px 20px;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.welcome-logo-icon {
  width: 44px;
  height: 44px;
  color: #60A5FA;
  margin-bottom: 14px;
  opacity: 0.9;
}

.welcome-title {
  font-size: 19px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.welcome-desc {
  font-size: 13.5px;
  color: #8E9298;
  max-width: 440px;
  line-height: 1.5;
}

/* ==========================================================================
   MODEL SWITCHER & BALANCE CONTROLS
   ========================================================================== */
.model-select-wrapper {
  display: flex;
  align-items: center;
}

/* Header Compact Model Toggle */
.header-model-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.header-model-btn {
  background: transparent;
  border: none;
  color: var(--ow-02, #9ca3af);
  padding: 4px 9px;
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.header-model-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.header-model-btn.active {
  background: #282c32;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Composer Top Row & In-Chat Model Bar */
.composer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: nowrap;
}

.composer-top-row .composer-label {
  margin-bottom: 0;
  font-size: 11px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.chat-inpage-model-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.inpage-model-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-segmented-switch {
  display: inline-flex;
  align-items: center;
  background: #14171a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
  gap: 3px;
}

.model-seg-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--ow-02, #9ca3af);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.model-seg-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.model-seg-btn.active {
  background: #24282e;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.seg-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.model-seg-btn.active .seg-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Floating In-Chat Toast Notification */
.void-toast {
  position: fixed;
  top: calc(var(--tg-safe-top, 0px) + 62px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(23, 25, 28, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 9999;
  white-space: nowrap;
}

.void-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.model-dropdown {
  background-color: #202327;
  color: var(--ow-02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease;
}

.model-dropdown:focus {
  border-color: var(--sg-03);
}

.model-dropdown option {
  background-color: #17191C;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
}

.balance-bar-dashboard {
  margin-top: 14px;
  background-color: #1a1d21;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bal-pill-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.bal-label {
  color: var(--text-muted);
}

.bal-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--sg-03);
}

.btn-topup-dash {
  background-color: #262b32;
  color: var(--ow-02);
  border: 1px solid #363d47;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-topup-dash:hover {
  background-color: #313740;
  border-color: var(--sg-03);
}

/* ==========================================================================
   PERSONALIZATION OPTIONS (SETTINGS)
   ========================================================================== */
.pref-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.pref-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.pref-chip {
  background-color: #1a1d21;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.pref-chip.active {
  background-color: #23282f;
  border-color: var(--sg-03);
  color: var(--ow-02);
  font-weight: 600;
}

/* ==========================================================================
   READY PROMPTS LIBRARY DRAWER
   ========================================================================== */
.prompt-category-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--sg-03);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 10px;
  margin-bottom: 6px;
}

.prompt-card {
  background-color: #202327;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prompt-card:hover {
  background-color: #272c33;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.prompt-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ow-02);
}

.prompt-card-text {
  font-size: 11.5px;
  color: #adb3bc;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   TOPUP / PLAN SUBSCRIPTION CARDS
   ========================================================================== */
.plan-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-card {
  background-color: #1e2228;
  border: 1px solid #2d333b;
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.plan-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: #222830;
}

.plan-card.active {
  border-color: #6abf82;
  background: linear-gradient(135deg, rgba(106,191,130,0.10) 0%, rgba(30,34,40,0.0) 100%);
  box-shadow: 0 0 0 1px rgba(106,191,130,0.25);
}

.plan-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.plan-name {
  font-size: 13px;
  font-weight: 600;
  color: #c9d1d9;
}

.plan-price {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.plan-card.active .plan-price {
  color: #ffffff;
}

.plan-sub {
  font-size: 11px;
  color: #6e7681;
  line-height: 1.4;
}

/* Badge chips - Clean Monochrome */
.plan-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #c9d1d9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-start,
.badge-top,
.badge-pro,
.badge-biz {
  background: rgba(255, 255, 255, 0.06);
  color: #c9d1d9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Platega provider note */
.topup-provider-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #2d333b;
  font-size: 11.5px;
  color: #8b949e;
}
.topup-provider-note b {
  color: #c9d1d9;
}

/* ==========================================================================
   STREAMING TYPING CURSOR
   ========================================================================== */
.typing-cursor {
  display: inline-block;
  color: var(--sg-03);
  font-weight: 700;
  animation: blink 0.8s infinite;
  margin-left: 2px;
}

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

/* ==========================================================================
   PLATEGA PAYMENT CONTROLS
   ========================================================================== */
.pay-method-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pay-method-pill {
  background-color: #1a1d21;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--ow-02);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex: 1;
}

.pay-method-pill.active {
  background-color: #23282f;
  border-color: var(--sg-03);
  font-weight: 600;
}

.order-notice-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: rgba(164, 185, 167, 0.1);
  border: 1px solid var(--sg-03);
  font-size: 11.5px;
  color: var(--sg-03);
  line-height: 1.4;
}

.order-notice-box.hidden {
  display: none;
}

/* ==========================================================================
   CONFIRM DELETE DIALOG (CENTERED MODAL & INLINE CARD CONFIRMATION)
   ========================================================================== */
.modal-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-confirm-overlay.hidden {
  display: none !important;
}

.confirm-dialog-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background-color: #161B22;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: modal-pop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Inline card confirm state inside history drawer */
.drawer-session-item.confirming-delete {
  background-color: rgba(218, 54, 51, 0.15) !important;
  border-color: #f85149 !important;
  border-left: 3px solid #f85149 !important;
  padding: 10px 12px !important;
}

.session-inline-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.confirm-prompt-title {
  font-size: 12px;
  font-weight: 700;
  color: #ff7b72;
  white-space: nowrap;
}

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

.btn-inline-del-confirm {
  background-color: #da3633;
  color: #ffffff;
  border: 1px solid #f85149;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-inline-del-confirm:hover {
  background-color: #b62324;
}

.btn-inline-del-cancel {
  background-color: #21262d;
  color: #c9d1d9;
  border: 1px solid #363d47;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-inline-del-cancel:hover {
  background-color: #30363d;
}

/* Pinned Session Highlights */
.drawer-session-item.is-pinned {
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.drawer-session-action {
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.drawer-session-action:hover {
  opacity: 1 !important;
  transform: scale(1.1);
}

/* Library Tabs & Admin Filter Chips */
.lib-tab-btn, .admin-filter-chip {
  transition: all 0.15s ease;
}
.lib-tab-btn:hover, .admin-filter-chip:hover {
  opacity: 0.9;
}
.ai-icon-btn.active {
  color: #60a5fa !important;
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.15) !important;
}
