/* ══════════════════════════════════════════════════════════════
   Vyakhya AI Reader Drawer & Floating Button Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Floating "Explain with AI" Selection Button ── */
#vyakhya-floating-btn {
  position: absolute;
  z-index: 999999;
  display: none;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  padding: 7px 16px;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, filter 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  animation: vyakhyaPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

#vyakhya-floating-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.55), 0 4px 10px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

#vyakhya-floating-btn:active {
  transform: translateY(0) scale(0.98);
}

#vyakhya-floating-btn .btn-sparkle {
  font-size: 14px;
  display: inline-block;
  animation: vyakhyaSpin 4s linear infinite;
}

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

@keyframes vyakhyaSpin {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

/* ── Backdrop Overlay ── */
#vyakhya-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#vyakhya-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sliding Side Drawer ── */
#vyakhya-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 94vw;
  height: 100vh;
  height: 100dvh;
  background: var(--t-bg-overlay, #0f172a);
  color: var(--t-text-primary, #f8fafc);
  border-left: 1px solid var(--t-border, rgba(255, 255, 255, 0.12));
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 1000001;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
}

#vyakhya-drawer.open {
  transform: translateX(0);
}

/* ── Drawer Header ── */
.vyakhya-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.vyakhya-header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vyakhya-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(217, 70, 239, 0.25));
  border: 1px solid rgba(139, 92, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.vyakhya-header-text {
  min-width: 0;
}

.vyakhya-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t-accent, #a855f7);
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vyakhya-header-context {
  font-size: 11.5px;
  color: var(--t-text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.vyakhya-close-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--t-text-secondary, #94a3b8);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.vyakhya-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Selected Text Card ── */
.vyakhya-target-card {
  padding: 12px 18px;
  background: rgba(139, 92, 246, 0.06);
  border-bottom: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}

.vyakhya-target-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.vyakhya-target-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.vyakhya-copy-target-btn {
  background: none;
  border: none;
  color: var(--t-text-muted, #94a3b8);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.vyakhya-copy-target-btn:hover {
  color: var(--t-accent, #a855f7);
}

.vyakhya-target-snippet {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--t-text-primary, #f1f5f9);
  max-height: 90px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.06));
  font-style: italic;
}

/* ── Messages Chat Scroll Area ── */
.vyakhya-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  scroll-behavior: smooth;
}

/* Empty State Banner */
.vyakhya-empty-state {
  margin: auto;
  text-align: center;
  padding: 30px 20px;
  max-width: 320px;
}

.vyakhya-empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.vyakhya-empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t-text-primary, #f8fafc);
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
}

.vyakhya-empty-state-desc {
  font-size: 13px;
  color: var(--t-text-muted, #94a3b8);
  line-height: 1.5;
}

/* Chat Messages */
.vyakhya-msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  animation: vyakhyaMsgFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.vyakhya-msg.user {
  align-self: flex-end;
  max-width: 85%;
}

.vyakhya-msg.user .vyakhya-bubble {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 16px 16px 2px 16px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  word-break: break-word;
}

.vyakhya-msg.ai {
  align-self: flex-start;
  width: 100%;
}

.vyakhya-msg.ai .vyakhya-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  color: var(--t-text-primary, #f8fafc);
  padding: 14px 16px;
  border-radius: 16px 16px 16px 2px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
  word-break: break-word;
}

/* Markdown styling inside AI bubble */
.vyakhya-bubble p {
  margin: 0 0 10px 0;
}
.vyakhya-bubble p:last-child {
  margin-bottom: 0;
}
.vyakhya-bubble strong {
  color: var(--t-accent, #a855f7);
  font-weight: 700;
}
.vyakhya-bubble em {
  font-style: italic;
  color: #cbd5e1;
}
.vyakhya-bubble h4, .vyakhya-bubble h3 {
  font-family: 'Outfit', sans-serif;
  color: var(--t-accent, #a855f7);
  font-size: 14px;
  font-weight: 700;
  margin: 12px 0 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}
.vyakhya-bubble ul, .vyakhya-bubble ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}
.vyakhya-bubble li {
  margin-bottom: 4px;
}
.vyakhya-bubble blockquote {
  border-left: 3px solid #8b5cf6;
  padding-left: 10px;
  margin: 8px 0;
  color: var(--t-text-secondary, #cbd5e1);
  font-style: italic;
}
.vyakhya-bubble code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.vyakhya-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--t-text-muted, #94a3b8);
}

.vyakhya-msg-actions {
  display: flex;
  gap: 8px;
}

.vyakhya-action-btn {
  background: none;
  border: none;
  color: var(--t-text-muted, #94a3b8);
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.vyakhya-action-btn:hover {
  color: var(--t-accent, #a855f7);
  background: rgba(255, 255, 255, 0.05);
}

/* Typing Indicator */
.vyakhya-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  width: fit-content;
}

.vyakhya-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a855f7;
  animation: vyakhyaBounce 1.4s infinite ease-in-out both;
}
.vyakhya-dot:nth-child(1) { animation-delay: -0.32s; }
.vyakhya-dot:nth-child(2) { animation-delay: -0.16s; }

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

.vyakhya-typing-text {
  font-size: 12px;
  color: var(--t-text-muted, #94a3b8);
  margin-left: 4px;
}

/* ── Input Footer Area ── */
.vyakhya-drawer-footer {
  padding: 14px 18px 16px 18px;
  border-top: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.vyakhya-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  padding: 6px 10px 6px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vyakhya-input-wrapper:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.vyakhya-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--t-text-primary, #f8fafc);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 4px 0;
}

.vyakhya-textarea::placeholder {
  color: var(--t-text-muted, #64748b);
}

.vyakhya-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.vyakhya-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.vyakhya-send-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.vyakhya-input-hint {
  font-size: 11px;
  color: var(--t-text-muted, #64748b);
  margin-top: 6px;
  text-align: right;
}

/* Mobile Responsiveness for Reader Drawer */
@media (max-width: 480px) {
  #vyakhya-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   In-Studio OCR Vyakhya AI Full-Screen Popup Modal & Components
   ══════════════════════════════════════════════════════════════ */

#ocrVyakhyaDrawer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  background: var(--t-bg-overlay, #080c16);
  color: var(--t-text-primary, #f1f5f9);
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.985);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

#ocrVyakhyaDrawer.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

#ocrVyakhyaDrawer.boxed-view {
  inset: 24px;
  width: auto;
  height: auto;
  max-width: 1440px;
  max-height: 94vh;
  margin: auto;
  border-radius: 16px;
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.15));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
}

#ocrVyakhyaBackdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#ocrVyakhyaBackdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Fullscreen Popup Header ── */
#ocrVyakhyaDrawer .vyakhya-drawer-header {
  padding: 12px 24px;
  border-bottom: 1px solid var(--t-border, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--t-bg-surface, rgba(15, 23, 42, 0.88));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  flex-wrap: wrap;
}

#ocrVyakhyaDrawer .vyakhya-header-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#ocrVyakhyaDrawer .vyakhya-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(217, 70, 239, 0.3));
  border: 1px solid rgba(139, 92, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

#ocrVyakhyaDrawer .vyakhya-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #a855f7;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vyakhya-header-sub {
  font-size: 0.85em;
  opacity: 0.9;
  color: inherit;
  font-family: 'Martel', serif;
}

.vyakhya-header-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 2px 8px;
  border-radius: 12px;
}

#ocrVyakhyaDrawer .vyakhya-header-context {
  font-size: 12px;
  color: var(--t-text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  max-width: 320px;
}

/* Header Center Toolbar Controls */
.vyakhya-header-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vyakhya-context-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.vyakhya-toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--t-border, rgba(255, 255, 255, 0.15));
}

/* Hidable Toggles in Toolbar */
.vyakhya-toolbar-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.15));
  color: var(--t-text-muted, #94a3b8);
  user-select: none;
}

.vyakhya-toolbar-toggle-btn:hover {
  transform: translateY(-1px);
  color: var(--t-text-primary, #ffffff);
  border-color: rgba(255, 255, 255, 0.28);
}

.vyakhya-toolbar-toggle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
}

/* Header Right Actions */
.vyakhya-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vyakhya-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.12));
  color: var(--t-text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.vyakhya-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--t-text-primary, #ffffff);
  border-color: rgba(255, 255, 255, 0.25);
}

.vyakhya-tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.vyakhya-tool-btn.page-arrow {
  width: 28px;
  padding: 0;
  font-size: 10px;
}

/* ── Fullscreen Workspace Container ── */
.vyakhya-workspace-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

/* ── Scholarly Notice / Disclaimer Banner (Hidable) ── */
.vyakhya-disclaimer-banner {
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(217, 119, 6, 0.09) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  flex-shrink: 0;
  transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              padding 0.28s ease;
  max-height: 180px;
  overflow: hidden;
}

.vyakhya-disclaimer-banner.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  border-bottom-width: 0 !important;
  pointer-events: none;
}

.vyakhya-disclaimer-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.vyakhya-disclaimer-body {
  flex: 1;
  min-width: 0;
}

.vyakhya-disclaimer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  gap: 12px;
}

.vyakhya-disclaimer-title {
  font-weight: 700;
  color: #fbbf24;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.vyakhya-disclaimer-text {
  color: #fef3c7;
  font-size: 12.5px;
  line-height: 1.45;
}

.vyakhya-panel-hide-btn {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.vyakhya-panel-hide-btn:hover {
  background: rgba(245, 158, 11, 0.32);
  color: #ffffff;
}

/* ── Active Context Card (Hidable) ── */
.vyakhya-target-card {
  padding: 12px 24px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--t-border, rgba(255, 255, 255, 0.1));
  flex-shrink: 0;
  transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              padding 0.28s ease;
  max-height: 280px;
  overflow: hidden;
}

.vyakhya-target-card.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  border-bottom-width: 0 !important;
  pointer-events: none;
}

.vyakhya-target-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.vyakhya-target-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vyakhya-target-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.45);
  padding: 3px 9px;
  border-radius: 5px;
}

.vyakhya-target-sublabel {
  font-size: 11.5px;
  color: var(--t-text-muted, #94a3b8);
}

.vyakhya-target-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vyakhya-copy-target-btn,
.vyakhya-context-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.15));
  color: var(--t-text-muted, #cbd5e1);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.vyakhya-copy-target-btn:hover,
.vyakhya-context-toggle-btn:hover {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.45);
}

.vyakhya-chars-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--t-text-muted, #94a3b8);
  padding: 2px 8px;
  border-radius: 5px;
}

.vyakhya-context-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #c084fc;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vyakhya-target-snippet {
  font-family: 'Martel', 'Siddhanta', 'Yantramanav', 'Noto Serif Devanagari', Georgia, serif;
  font-size: 14px;
  line-height: 1.65;
  color: #f8fafc;
  max-height: 120px;
  overflow-y: auto;
  padding: 10px 14px;
  background: rgba(3, 7, 18, 0.88);
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.vyakhya-target-snippet::-webkit-scrollbar {
  width: 6px;
}

.vyakhya-target-snippet::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.vyakhya-page-context-snippet {
  font-family: 'Martel', 'Siddhanta', 'Yantramanav', Georgia, serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--t-text-secondary, #cbd5e1);
  max-height: 90px;
  overflow-y: auto;
  padding: 8px 12px;
  background: rgba(3, 7, 18, 0.5);
  border-radius: 8px;
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  opacity: 0.9;
}

.vyakhya-page-context-snippet::-webkit-scrollbar {
  width: 6px;
}

.vyakhya-page-context-snippet::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ── OCR Studio Selection Button States ── */
#learnGranthaBtn:disabled,
#ocrAiLearnCardBtn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.12)) !important;
  color: var(--t-text-muted, #94a3b8) !important;
  box-shadow: none !important;
  transform: none !important;
}

#learnGranthaBtn.active-selection,
#ocrAiLearnCardBtn.active-selection {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.45) !important;
  animation: pulseSelectionBtn 2s infinite ease-in-out;
  cursor: pointer !important;
  opacity: 1 !important;
}

@keyframes pulseSelectionBtn {
  0%, 100% { box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4); transform: scale(1); }
  50% { box-shadow: 0 6px 20px rgba(217, 70, 239, 0.6); transform: scale(1.02); }
}

#learnGranthaBtn.too-long,
#ocrAiLearnCardBtn.too-long {
  background: rgba(239, 68, 68, 0.18) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 0.9 !important;
}

/* ── Live Selection Helper Bar Below Editor ── */
.ocr-selection-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  transition: all 0.2s ease;
}

.ocr-selection-helper.active {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--t-text-primary, #f8fafc);
}

.ocr-selection-helper.warning {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* ── Quick Learning Prompt Chips ── */
.vyakhya-chips-container {
  padding: 10px 24px;
  border-bottom: 1px solid var(--t-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.vyakhya-chips-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--t-text-muted, #94a3b8);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.vyakhya-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.vyakhya-chips-scroll::-webkit-scrollbar {
  height: 4px;
}

.vyakhya-chips-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.vyakhya-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #e9d5ff;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.vyakhya-chip:hover {
  background: rgba(139, 92, 246, 0.32);
  border-color: #c084fc;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.vyakhya-chip:active {
  transform: translateY(0);
}

/* ── Chat Messages Scroll Area ── */
#ocrVyakhyaDrawer .vyakhya-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  scroll-behavior: smooth;
}

#ocrVyakhyaDrawer .vyakhya-chat-body::-webkit-scrollbar {
  width: 8px;
}

#ocrVyakhyaDrawer .vyakhya-chat-body::-webkit-scrollbar-thumb {
  background: var(--t-scrollbar-thumb, rgba(255, 255, 255, 0.25));
  border-radius: 4px;
}

/* Empty State */
.vyakhya-empty-state {
  margin: auto;
  text-align: center;
  padding: 40px 24px;
  max-width: 440px;
}

.vyakhya-empty-state-icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: 0.9;
}

.vyakhya-empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}

.vyakhya-empty-state-desc {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.6;
}

/* Message Bubble Aesthetics & Typography */
#ocrVyakhyaDrawer .vyakhya-msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  animation: vyakhyaMsgFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#ocrVyakhyaDrawer .vyakhya-msg.user {
  align-self: flex-end;
  max-width: 82%;
}

#ocrVyakhyaDrawer .vyakhya-msg.user .vyakhya-bubble {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 18px 18px 3px 18px;
  font-size: 14.5px;
  line-height: 1.55;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.32);
  word-break: break-word;
}

#ocrVyakhyaDrawer .vyakhya-msg.ai {
  align-self: flex-start;
  width: 100%;
  max-width: 96%;
}

#ocrVyakhyaDrawer .vyakhya-msg.ai .vyakhya-bubble {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.14));
  color: #f8fafc;
  padding: 18px 24px;
  border-radius: 18px 18px 18px 3px;
  font-size: 15px;
  line-height: 1.75;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.28);
  word-break: break-word;
}

/* Rich Markdown Content Inside Bubbles */
#ocrVyakhyaDrawer .vyakhya-bubble p {
  margin: 0 0 12px 0;
}

#ocrVyakhyaDrawer .vyakhya-bubble p:last-child {
  margin-bottom: 0;
}

#ocrVyakhyaDrawer .vyakhya-bubble strong {
  color: #c084fc;
  font-weight: 700;
}

#ocrVyakhyaDrawer .vyakhya-bubble em {
  font-style: italic;
  color: #cbd5e1;
}

#ocrVyakhyaDrawer .vyakhya-bubble h3,
#ocrVyakhyaDrawer .vyakhya-bubble h4 {
  font-family: 'Outfit', sans-serif;
  color: #c084fc;
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}

#ocrVyakhyaDrawer .vyakhya-bubble ul,
#ocrVyakhyaDrawer .vyakhya-bubble ol {
  margin: 8px 0 12px 22px;
  padding: 0;
}

#ocrVyakhyaDrawer .vyakhya-bubble li {
  margin-bottom: 6px;
  line-height: 1.6;
}

#ocrVyakhyaDrawer .vyakhya-bubble blockquote {
  border-left: 4px solid #a855f7;
  background: rgba(168, 85, 247, 0.08);
  padding: 8px 14px;
  margin: 10px 0;
  border-radius: 0 8px 8px 0;
  color: #f1f5f9;
  font-style: italic;
}

#ocrVyakhyaDrawer .vyakhya-bubble code {
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'Fira Code', 'Roboto Mono', monospace;
  font-size: 13px;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#ocrVyakhyaDrawer .vyakhya-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
}

#ocrVyakhyaDrawer .vyakhya-bubble th,
#ocrVyakhyaDrawer .vyakhya-bubble td {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
}

#ocrVyakhyaDrawer .vyakhya-bubble th {
  background: rgba(139, 92, 246, 0.18);
  color: #e9d5ff;
}

/* Typing Bubble */
#ocrVyakhyaDrawer .vyakhya-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  width: fit-content;
}

#ocrVyakhyaDrawer .vyakhya-typing-text {
  font-size: 13px;
  color: var(--t-text-muted, #94a3b8);
}

/* ── Fullscreen Drawer Footer Area ── */
#ocrVyakhyaDrawer .vyakhya-drawer-footer {
  padding: 14px 24px 18px 24px;
  border-top: 1px solid var(--t-border, rgba(255, 255, 255, 0.1));
  background: var(--t-bg-surface, rgba(15, 23, 42, 0.88));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.vyakhya-footer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--t-text-muted, #94a3b8);
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
}

.vyakhya-sanskrit-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: var(--t-text-secondary, #cbd5e1);
}

.vyakhya-sanskrit-toggle input {
  accent-color: #8b5cf6;
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.vyakhya-footer-shortcuts {
  font-size: 11px;
  color: var(--t-text-muted, #64748b);
}

.vyakhya-input-wrapper {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(3, 7, 18, 0.88);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.18));
  border-radius: 14px;
  padding: 8px 12px 8px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vyakhya-input-wrapper:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.vyakhya-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 140px;
  min-height: 26px;
  padding: 4px 0;
}

.vyakhya-textarea::placeholder {
  color: #64748b;
}

.vyakhya-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.vyakhya-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.vyakhya-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.vyakhya-send-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.vyakhya-input-hint {
  max-width: 1360px;
  margin: 6px auto 0 auto;
  font-size: 11.5px;
  color: var(--t-text-muted, #64748b);
  text-align: right;
}

/* ══════════════════════════════════════════════════════════════
   Light Theme Color Combinations for High Legibility & Visibility
   ══════════════════════════════════════════════════════════════ */
:root[data-theme="light"] #ocrVyakhyaDrawer {
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-drawer-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-header-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(217, 70, 239, 0.15));
  border-color: rgba(139, 92, 246, 0.35);
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-header-title {
  color: #6d28d9;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-header-pill {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-header-context {
  color: #475569;
}

:root[data-theme="light"] .vyakhya-context-badge-pill {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

:root[data-theme="light"] .vyakhya-toolbar-toggle-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

:root[data-theme="light"] .vyakhya-toolbar-toggle-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

:root[data-theme="light"] .vyakhya-toolbar-toggle-btn.active {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #5b21b6;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

:root[data-theme="light"] .vyakhya-tool-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

:root[data-theme="light"] .vyakhya-tool-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

:root[data-theme="light"] .vyakhya-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Scholarly Notice in Light Mode */
:root[data-theme="light"] .vyakhya-disclaimer-banner {
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 1px solid #f59e0b;
}

:root[data-theme="light"] .vyakhya-disclaimer-title {
  color: #92400e;
}

:root[data-theme="light"] .vyakhya-disclaimer-text {
  color: #78350f;
}

:root[data-theme="light"] .vyakhya-panel-hide-btn {
  background: #fde68a;
  border-color: #d97706;
  color: #78350f;
}

:root[data-theme="light"] .vyakhya-panel-hide-btn:hover {
  background: #fcd34d;
  color: #451a03;
}

/* Active Context Card in Light Mode */
:root[data-theme="light"] .vyakhya-target-card {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

:root[data-theme="light"] .vyakhya-target-badge {
  color: #6b21a8;
  background: #ede9fe;
  border-color: #c4b5fd;
}

:root[data-theme="light"] .vyakhya-target-sublabel {
  color: #64748b;
}

:root[data-theme="light"] .vyakhya-copy-target-btn,
:root[data-theme="light"] .vyakhya-context-toggle-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

:root[data-theme="light"] .vyakhya-copy-target-btn:hover,
:root[data-theme="light"] .vyakhya-context-toggle-btn:hover {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #4c1d95;
}

:root[data-theme="light"] .vyakhya-chars-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

:root[data-theme="light"] .vyakhya-context-section-label {
  color: #6d28d9;
}

:root[data-theme="light"] .vyakhya-target-snippet {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .vyakhya-target-snippet::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

:root[data-theme="light"] .vyakhya-page-context-snippet {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .vyakhya-page-context-snippet::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

:root[data-theme="light"] #learnGranthaBtn:disabled,
:root[data-theme="light"] #ocrAiLearnCardBtn:disabled {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
}

:root[data-theme="light"] .ocr-selection-helper.active {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #4338ca;
}

:root[data-theme="light"] .ocr-selection-helper.warning {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Chips in Light Mode */
:root[data-theme="light"] .vyakhya-chips-container {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

:root[data-theme="light"] .vyakhya-chips-label {
  color: #475569;
}

:root[data-theme="light"] .vyakhya-chip {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

:root[data-theme="light"] .vyakhya-chip:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #3b0764;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.15);
}

/* AI Bubble in Light Mode */
:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-msg.ai .vyakhya-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble strong {
  color: #6d28d9;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble em {
  color: #334155;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble h3,
:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble h4 {
  color: #5b21b6;
  border-bottom-color: #e2e8f0;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble blockquote {
  border-left-color: #7c3aed;
  background: #faf5ff;
  color: #1e293b;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble code {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble th {
  background: #ede9fe;
  color: #4c1d95;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble th,
:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-bubble td {
  border-color: #e2e8f0;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-typing-bubble {
  background: #ffffff;
  border-color: #e2e8f0;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-typing-text {
  color: #475569;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-empty-state-title {
  color: #0f172a;
}

:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-empty-state-desc {
  color: #475569;
}

/* Footer in Light Mode */
:root[data-theme="light"] #ocrVyakhyaDrawer .vyakhya-drawer-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

:root[data-theme="light"] .vyakhya-sanskrit-toggle {
  color: #1e293b;
}

:root[data-theme="light"] .vyakhya-input-wrapper {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .vyakhya-input-wrapper:focus-within {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

:root[data-theme="light"] .vyakhya-textarea {
  color: #0f172a;
}

:root[data-theme="light"] .vyakhya-textarea::placeholder {
  color: #94a3b8;
}

:root[data-theme="light"] .vyakhya-input-hint {
  color: #64748b;
}

/* Mobile Screens */
@media (max-width: 768px) {
  #ocrVyakhyaDrawer .vyakhya-drawer-header {
    padding: 10px 14px;
    gap: 10px;
  }
  .vyakhya-header-toolbar {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
  }
  .vyakhya-workspace-content {
    padding: 0;
  }
  .vyakhya-disclaimer-banner,
  .vyakhya-target-card,
  .vyakhya-chips-container {
    padding-left: 14px;
    padding-right: 14px;
  }
  #ocrVyakhyaDrawer .vyakhya-chat-body {
    padding: 16px 14px;
  }
  #ocrVyakhyaDrawer .vyakhya-drawer-footer {
    padding: 10px 14px 14px 14px;
  }
  .vyakhya-target-sublabel {
    display: none;
  }
}


