/* ==============================================================================
   PROTHOM ALO AI CHATBOT - EDITORIAL DESIGN SYSTEM
   Authentic Prothom Alo Brand Identity, Typography & Dual-Theme Architecture
   ============================================================================== */

:root {
  /* Prothom Alo Brand Red */
  --brand-red: #EE1C24;
  --brand-red-hover: #D6151D;
  --brand-red-subtle: rgba(238, 28, 36, 0.08);
  --brand-red-glow: rgba(238, 28, 36, 0.25);
  
  /* Status Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-info: #0284C7;

  /* Typography */
  --font-bangla: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Noto Serif Bengali', serif;
  --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Geometry & Motion */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -----------------------------------------------------------------------------
   THEME: LIGHT (Official Prothom Alo Editorial Paper Aesthetic - Default)
   ----------------------------------------------------------------------------- */
html[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --top-bar-bg: #F1F5F9;
  --header-bg: rgba(255, 255, 255, 0.94);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --dock-bg: rgba(255, 255, 255, 0.92);

  --border-color: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-card: #E5E7EB;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  --user-bubble-bg: #F1F5F9;
  --user-bubble-text: #0F172A;
  --user-bubble-border: #E2E8F0;

  --bot-bubble-bg: #FFFFFF;
  --bot-bubble-border: #E2E8F0;
  --bot-callout-bg: #FEF2F2;
  --bot-callout-border: #FCA5A5;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-red: 0 4px 18px rgba(238, 28, 36, 0.28);

  --logo-filter: none;
}

/* -----------------------------------------------------------------------------
   THEME: DARK (Obsidian Slate Night Edition)
   ----------------------------------------------------------------------------- */
html[data-theme="dark"] {
  --bg-primary: #0B0F19;
  --bg-surface: #111827;
  --bg-card: #141C2B;
  --bg-card-hover: #1A2438;
  --top-bar-bg: #070A11;
  --header-bg: rgba(11, 15, 25, 0.92);
  --nav-bg: rgba(14, 19, 31, 0.88);
  --dock-bg: rgba(15, 21, 35, 0.92);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-card: rgba(255, 255, 255, 0.07);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #8896AB;
  --text-subtle: #4B5563;

  --user-bubble-bg: #1A2333;
  --user-bubble-text: #F8FAFC;
  --user-bubble-border: rgba(255, 255, 255, 0.08);

  --bot-bubble-bg: #131A27;
  --bot-bubble-border: rgba(255, 255, 255, 0.08);
  --bot-callout-bg: rgba(238, 28, 36, 0.08);
  --bot-callout-border: rgba(238, 28, 36, 0.3);

  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-red: 0 4px 20px rgba(238, 28, 36, 0.4);

  --logo-filter: none;
}

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

body {
  font-family: var(--font-bangla);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Layout Frame */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background-color: var(--bg-primary);
}

/* -----------------------------------------------------------------------------
   1. TOP UTILITY BAR (Editorial Date, Edition, Theme Switcher)
   ----------------------------------------------------------------------------- */
.top-utility-bar {
  background: var(--top-bar-bg);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  padding: 4px 24px;
  color: var(--text-muted);
  transition: background-color var(--transition-normal);
  z-index: 50;
}

.utility-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.utility-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.live-date {
  color: var(--text-secondary);
}

.utility-divider {
  color: var(--text-subtle);
  font-size: 0.7rem;
}

.utility-edition {
  color: var(--brand-red);
  font-weight: 600;
}

.utility-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-family: var(--font-bangla);
  cursor: pointer;
  transition: var(--transition-fast);
}

.utility-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-new-chat {
  font-weight: 600;
}

.btn-new-chat svg {
  stroke: var(--brand-red);
}

/* -----------------------------------------------------------------------------
   2. MAIN EDITORIAL HEADER (Authentic Prothom Alo Logo & Branding)
   ----------------------------------------------------------------------------- */
.app-header {
  height: 72px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  z-index: 40;
  transition: background-color var(--transition-normal);
}

.header-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.brand-link:hover .brand-logo-img {
  transform: scale(1.02);
}

.brand-ai-badge {
  font-family: var(--font-latin);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--brand-red);
  color: #FFFFFF;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 8px var(--brand-red-glow);
  text-transform: uppercase;
}

.brand-tagline-wrap {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  padding-left: 14px;
}

.brand-tagline {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-warning);
}

.status-active .status-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: pulse-dot 2.5s infinite;
}

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

/* -----------------------------------------------------------------------------
   3. EDITORIAL CATEGORY NAVIGATION BAR
   ----------------------------------------------------------------------------- */
.filter-nav {
  height: 48px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 30;
  transition: background-color var(--transition-normal);
}

.filter-nav::-webkit-scrollbar {
  display: none;
}

.filter-scroll {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.chip {
  padding: 5px 15px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-bangla);
}

.chip:hover {
  background: var(--brand-red-subtle);
  color: var(--brand-red);
}

.chip.active {
  background: var(--brand-red);
  color: #FFFFFF;
  border-color: var(--brand-red);
  font-weight: 600;
  box-shadow: var(--shadow-red);
}

.chip.media-chip {
  border-color: var(--border-color);
}

.chip.media-chip:hover {
  border-color: var(--brand-red);
}

/* -----------------------------------------------------------------------------
   4. MAIN CHAT / READING AREA
   ----------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 95px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Custom Minimalist Scrollbar */
.messages-stream::-webkit-scrollbar {
  width: 6px;
}

.messages-stream::-webkit-scrollbar-track {
  background: transparent;
}

.messages-stream::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.messages-stream::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   5. WELCOME HERO CARD (Authentic Prothom Alo Style - Responsive & Screen-Fitted)
   ----------------------------------------------------------------------------- */
.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-top: 3px solid var(--brand-red);
  border-radius: var(--radius-lg);
  padding: 16px 20px 14px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin: 0 auto;
  max-width: 780px;
  width: 100%;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.welcome-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 8px var(--brand-red-glow));
}

.welcome-motto-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  background: var(--brand-red-subtle);
  color: var(--brand-red);
  border: 1px solid rgba(238, 28, 36, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  font-style: italic;
  margin-bottom: 6px;
}

.motto-star {
  color: #F59E0B;
  font-size: 0.7rem;
  font-style: normal;
}

.welcome-title {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.25;
}

.welcome-desc {
  font-size: clamp(0.78rem, 1.5vw, 0.88rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 10px;
  line-height: 1.4;
}

/* Sleek Horizontal Capability Features Strip */
.welcome-features-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 auto 10px;
  padding: 4px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  max-width: 680px;
}

.feat-pill {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.feat-icon {
  font-size: 0.82rem;
}

.feat-sep {
  color: var(--border-color);
  font-size: 0.65rem;
}

/* Categorized Prompt Suggestions Grid (2x2 Compact) */
.prompt-suggestions {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  text-align: left;
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.suggestion-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  min-height: 52px;
  width: 100%;
}

.suggestion-btn:hover {
  border-color: var(--brand-red);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.suggestion-btn:hover .btn-headline {
  color: var(--brand-red);
}

.suggestion-btn:hover .btn-arrow {
  color: var(--brand-red);
  transform: translate(2px, -2px);
}

.btn-top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.btn-category-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.2px;
}

.tag-top {
  background: rgba(238, 28, 36, 0.1);
  color: #EE1C24;
  border: 1px solid rgba(238, 28, 36, 0.2);
}

.tag-biz {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tag-sports {
  background: rgba(2, 132, 199, 0.1);
  color: #0284C7;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.tag-fact {
  background: rgba(147, 51, 234, 0.1);
  color: #9333EA;
  border: 1px solid rgba(147, 51, 234, 0.2);
}

.btn-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  transition: transform 0.15s ease, color 0.15s ease;
}

.btn-headline {
  font-family: var(--font-bangla);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  transition: color var(--transition-fast);
}

/* Trending Quick Chips */
.trending-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

.trending-chips-row::-webkit-scrollbar {
  display: none;
}

.trending-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.trending-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.trend-chip {
  padding: 3px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-bangla);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.trend-chip:hover {
  background: var(--brand-red-subtle);
  color: var(--brand-red);
  border-color: var(--brand-red);
  transform: translateY(-1px);
}

/* -----------------------------------------------------------------------------
   6. CHAT MESSAGES & TYPOGRAPHY
   ----------------------------------------------------------------------------- */
.message-row {
  display: flex;
  flex-direction: column;
  animation: fadeInMsg 0.25s ease-out;
}

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

.message-row.user {
  align-items: flex-end;
}

.message-row.user .bubble {
  background: var(--user-bubble-bg);
  color: var(--user-bubble-text);
  border: 1px solid var(--user-bubble-border);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
  max-width: 80%;
  font-size: 0.98rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.message-row.bot {
  align-items: flex-start;
}

.message-row.bot .bubble {
  background: var(--bot-bubble-bg);
  border: 1px solid var(--bot-bubble-border);
  border-radius: 18px 18px 18px 4px;
  padding: 22px 24px;
  max-width: 100%;
  width: 100%;
  box-shadow: var(--shadow-md);
  position: relative;
}

.bot-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--brand-red-subtle);
  border: 1px solid rgba(238, 28, 36, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--brand-red);
  margin-bottom: 14px;
}

.bot-meta-tag svg {
  stroke: var(--brand-red);
}

.bot-content {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--text-primary);
}

.bot-content strong {
  font-weight: 700;
  color: var(--text-primary);
}

.bot-content em {
  font-style: italic;
  color: var(--text-secondary);
}

.bot-content a.bot-link {
  color: var(--brand-red);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.bot-content a.bot-link:hover {
  color: var(--brand-red-hover);
}

.bot-disclaimer-callout {
  margin: 14px 0;
  padding: 12px 16px;
  background: var(--bot-callout-bg);
  border-left: 3px solid var(--brand-red);
  border-radius: var(--radius-xs);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bot-img-wrap {
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.bot-markdown-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.bot-img-caption {
  display: block;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* Typing / Searching Indicator */
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-red);
  animation: typingBounce 1.2s infinite ease-in-out;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* -----------------------------------------------------------------------------
   7. NEWS CARDS GRID (Prothom Alo Newspaper Style)
   ----------------------------------------------------------------------------- */
.cards-wrapper {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.cards-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.cards-section-title svg {
  stroke: var(--brand-red);
}

.source-citation-list {
  list-style: none;
  margin: 0 0 14px 0;
  padding: 10px 14px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-citation-item {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.source-citation-index {
  font-weight: 700;
  color: var(--brand-red);
  margin-right: 2px;
}

.source-citation-headline {
  font-weight: 600;
  color: var(--text-primary);
}

.source-citation-headline-link {
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.source-citation-headline-link:hover {
  color: var(--brand-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-citation-date {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.source-citation-link {
  color: var(--brand-red);
  font-weight: 600;
  font-size: 0.84rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-citation-link:hover {
  color: var(--brand-red-hover);
}

.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.news-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-red);
}

.news-card-media {
  position: relative;
  width: 100%;
  height: 160px;
  background: #E2E8F0;
  overflow: hidden;
}

.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.news-card:hover .news-card-media img {
  transform: scale(1.05);
}

.media-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 4px;
}

.photo-badge {
  background: rgba(238, 28, 36, 0.85);
}

.news-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.card-category {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-red);
  background: var(--brand-red-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}

.card-kicker {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-headline {
  font-family: var(--font-bangla);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.42;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.news-card:hover .card-headline {
  color: var(--brand-red);
}

.card-summary {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-evidence-quote, .card-evidence-ocr {
  font-size: 0.78rem;
  padding: 6px 10px;
  background: var(--bg-card-hover);
  border-left: 2px solid var(--brand-red);
  border-radius: 4px;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: auto;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: 6px;
}

.btn-card {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--brand-red-subtle);
  border: 1px solid rgba(238, 28, 36, 0.2);
  color: var(--brand-red);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

/* -----------------------------------------------------------------------------
   8. FLOATING CHAT DOCK & INPUT
   ----------------------------------------------------------------------------- */
.chat-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px 20px;
  background: linear-gradient(to top, var(--bg-primary) 70%, transparent 100%);
  z-index: 20;
}

.chat-form {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 3px 10px;
  background: var(--brand-red);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.clear-filter-x {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--brand-red);
  box-shadow: 0 4px 20px var(--brand-red-glow);
}

.query-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-bangla);
  font-size: 0.98rem;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
  padding: 6px 0;
}

.query-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-red);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.send-btn:hover {
  background: var(--brand-red-hover);
  transform: scale(1.06);
}

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

.input-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hint-bullet {
  color: var(--brand-red);
  font-size: 0.5rem;
}

/* -----------------------------------------------------------------------------
   9. VIDEO MODAL PLAYER
   ----------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.btn-icon:hover {
  color: var(--brand-red);
}

.modal-body {
  position: relative;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#videoModalBody {
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
}

#videoModalBody iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -----------------------------------------------------------------------------
   10. RESPONSIVE DESIGN (Tablets & Mobile)
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .app-header {
    height: 64px;
    padding: 0 16px;
  }

  .brand-logo-img {
    height: 32px;
  }

  .brand-tagline-wrap {
    display: none;
  }

  .top-utility-bar {
    padding: 4px 16px;
    font-size: 0.72rem;
  }

  .utility-edition {
    display: none;
  }

  .welcome-card {
    padding: 12px 14px 10px;
    margin: 0 auto;
  }

  .welcome-title {
    font-size: 1.2rem;
  }

  .welcome-features-strip {
    gap: 6px;
    padding: 3px 8px;
    margin-bottom: 8px;
  }

  .feat-pill {
    font-size: 0.68rem;
  }

  .trending-chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .suggestions-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .suggestion-btn {
    min-height: 46px;
    padding: 6px 10px;
  }

  .news-cards-grid {
    grid-template-columns: 1fr;
  }

  .messages-stream {
    padding: 10px 12px 90px;
  }

  .message-row.user .bubble {
    max-width: 92%;
  }

  .chat-dock {
    padding: 8px 12px 12px;
  }
}

/* Height-Constrained Viewports (Laptops, Splitscreen, or Browser Chrome) */
@media (max-height: 760px) {
  .welcome-card {
    padding: 10px 16px 8px;
  }
  .welcome-emblem svg {
    width: 32px;
    height: 32px;
  }
  .welcome-motto-badge {
    margin-bottom: 3px;
    font-size: 0.68rem;
    padding: 1px 8px;
  }
  .welcome-title {
    font-size: 1.12rem;
    margin-bottom: 2px;
  }
  .welcome-desc {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }
  .welcome-features-strip {
    margin-bottom: 6px;
    padding: 2px 8px;
  }
  .prompt-suggestions {
    padding-top: 6px;
  }
  .suggestions-grid {
    gap: 6px;
  }
  .suggestion-btn {
    min-height: 44px;
    padding: 5px 8px;
  }
  .btn-headline {
    font-size: 0.76rem;
  }
  .trending-chips-row {
    margin-top: 6px;
    padding-top: 6px;
  }
}

@media (max-height: 620px) {
  .welcome-desc {
    display: none;
  }
  .welcome-features-strip {
    display: none;
  }
}

/* =========================================================================
   Ask Prothom Alo Client PoC UX Extensions (Phase 6)
   ========================================================================= */

.ai-disclosure-pill {
  background: var(--bg-soft, #f8fafc);
  border-color: var(--border-color, #e2e8f0);
  color: var(--text-secondary, #475569);
}

.trending-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.trending-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.trending-section-title svg {
  color: var(--brand-red, #d8232a);
}

.trending-window-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-red, #d8232a);
  background: rgba(216, 35, 42, 0.08);
  border: 1px solid rgba(216, 35, 42, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
}

.suggestions-grid-5 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.suggestion-btn-wide {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .suggestions-grid-5 {
    grid-template-columns: 1fr;
  }
}

/* Standard Answer Contract Header */
.bot-contract-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-left: 3px solid var(--brand-red, #d8232a);
  border-radius: 8px;
}

.bot-topic-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.bot-coverage-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bot-coverage-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Clickable Headline in Source Card */
.card-headline-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.card-headline-link:hover {
  color: var(--brand-red, #d8232a);
  text-decoration: underline;
}

/* Related Follow-Up Questions (Standard Answer Contract Section 5) */
.related-questions-wrapper {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
}

.related-questions-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #334155);
  margin-bottom: 8px;
}

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

.related-q-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
}

.related-q-chip:hover {
  border-color: var(--brand-red, #d8232a);
  color: var(--brand-red, #d8232a);
  background: rgba(216, 35, 42, 0.03);
  transform: translateX(2px);
}

.related-q-arrow {
  font-weight: 700;
  color: var(--brand-red, #d8232a);
  flex-shrink: 0;
}

/* Thumbs Up/Down + Report Issue Bar */
.bot-feedback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

.feedback-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feedback-prompt {
  font-size: 0.76rem;
  color: var(--text-secondary, #64748b);
  margin-right: 2px;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-card, #ffffff);
  color: var(--text-secondary, #475569);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-btn:hover {
  border-color: var(--brand-red, #d8232a);
  color: var(--brand-red, #d8232a);
}

.feedback-btn.active {
  background: var(--brand-red, #d8232a);
  border-color: var(--brand-red, #d8232a);
  color: #ffffff;
}

.feedback-ack {
  font-size: 0.74rem;
  font-weight: 600;
  color: #16a34a;
  margin-left: 4px;
}

.feedback-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: transparent;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-report-btn:hover {
  color: var(--brand-red, #d8232a);
  border-color: rgba(216, 35, 42, 0.35);
  background: rgba(216, 35, 42, 0.04);
}

/* Issue Report Modal */
.issue-modal-content {
  max-width: 480px;
}

.issue-report-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px 22px;
}

.issue-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue-field label,
.issue-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.issue-select,
.issue-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--surface-card, #ffffff);
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.issue-select:focus,
.issue-textarea:focus {
  outline: none;
  border-color: var(--brand-red, #d8232a);
  box-shadow: 0 0 0 3px rgba(216, 35, 42, 0.12);
}

.issue-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.btn-secondary,
.btn-secondary-modal {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-secondary, #475569);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover,
.btn-secondary-modal:hover {
  border-color: var(--text-secondary, #64748b);
  color: var(--text-primary, #0f172a);
}

.btn-primary,
.btn-submit-issue {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: var(--brand-red, #d8232a);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover,
.btn-submit-issue:hover {
  background: var(--brand-red-dark, #b5191f);
}

.issue-status-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: #16a34a;
  text-align: center;
  padding-top: 4px;
}

/* -----------------------------------------------------------------------------
   14. PERSISTENT SESSION SIDEBAR, 3-TIER MEMORY INSPECTOR & AUTHENTICATION UI
   ----------------------------------------------------------------------------- */
.btn-sidebar-toggle svg,
.btn-auth-nav svg {
  stroke: var(--brand-red, #ed1c24);
}

.btn-auth-nav {
  background: var(--brand-red, #ed1c24);
  color: #ffffff !important;
  border-color: var(--brand-red, #ed1c24) !important;
  font-weight: 600;
}

.btn-auth-nav svg {
  stroke: #ffffff !important;
}

.btn-auth-nav:hover {
  opacity: 0.92;
  background: var(--brand-red-dark, #c41219) !important;
}

.user-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 4px;
  border-radius: 999px;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #cbd5e1);
  font-size: 0.76rem;
}

.user-avatar-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-red, #ed1c24);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name-label {
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-signout-mini {
  border: none;
  background: rgba(237, 28, 36, 0.1);
  color: var(--brand-red, #ed1c24);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-signout-mini:hover {
  background: var(--brand-red, #ed1c24);
  color: #ffffff;
}

/* Collapsible Chat Sidebar */
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  height: 100%;
  background: var(--bg-card, #ffffff);
  border-right: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: margin-left 0.22s ease, opacity 0.2s ease;
}

.chat-sidebar.collapsed {
  margin-left: -280px;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.btn-sidebar-new-chat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--brand-red, #ed1c24);
  background: rgba(237, 28, 36, 0.06);
  color: var(--brand-red, #ed1c24);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sidebar-new-chat:hover {
  background: var(--brand-red, #ed1c24);
  color: #ffffff;
}

.btn-sidebar-close {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-sidebar-close:hover {
  background: var(--bg-surface, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

.sidebar-search-box {
  padding: 8px 12px 4px;
}

.session-search-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  font-size: 0.78rem;
}

.session-search-input:focus {
  outline: none;
  border-color: var(--brand-red, #ed1c24);
}

.sidebar-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.session-count-badge {
  background: var(--bg-surface, #f1f5f9);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 600;
}

.session-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-empty-state {
  text-align: center;
  padding: 22px 10px;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}

.session-item:hover {
  background: var(--bg-surface, #f8fafc);
  border-color: var(--border-color, #e2e8f0);
}

.session-item.active {
  background: rgba(237, 28, 36, 0.08);
  border-color: rgba(237, 28, 36, 0.35);
}

.session-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-item-title {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

.session-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-pin-badge {
  color: var(--brand-red, #ed1c24);
  flex-shrink: 0;
}

.session-inline-rename-input {
  width: 100%;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--brand-red, #ed1c24);
  border-radius: 5px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.12);
}

.session-item-meta {
  font-size: 0.69rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sidebar-section-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-inline-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.session-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.72;
}

.session-item:hover .session-item-actions {
  opacity: 1;
}

.btn-session-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.btn-session-action.is-pinned {
  color: var(--brand-red, #ed1c24);
}

.btn-session-action:hover {
  background: rgba(237, 28, 36, 0.1);
  color: var(--brand-red, #ed1c24);
}

/* 3-Tier Context Memory Inspector */
.memory-status-box {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-surface, #f8fafc);
  font-size: 0.74rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.memory-status-header {
  font-weight: 700;
  color: var(--brand-red, #ed1c24);
  font-size: 0.73rem;
  margin-bottom: 2px;
}

.memory-slot-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1.35;
}

.memory-slot-key {
  font-weight: 600;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.memory-slot-val {
  color: var(--text-primary, #0f172a);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-summary-preview {
  margin-top: 3px;
  padding-top: 4px;
  border-top: 1px dashed var(--border-color, #cbd5e1);
  font-size: 0.7rem;
  color: var(--text-secondary, #475569);
  line-height: 1.35;
  max-height: 52px;
  overflow: hidden;
}

/* Auth Modal Styles — Prothom Alo Editorial Authentication */
.auth-modal-content {
  max-width: 460px;
  width: 94%;
  border-radius: 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 4px 16px rgba(216, 35, 42, 0.08);
  background: var(--bg-card, #ffffff);
  overflow: hidden;
}

.auth-brand-top-accent {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg, #d8232a 0%, #ef4444 50%, #b5191f 100%);
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  background: var(--bg-card, #ffffff);
}

.auth-brand-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-brand-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  border-left: 2px solid var(--border-color, #e2e8f0);
}

.auth-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-red, #d8232a);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-brand-titles h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.25;
}

.auth-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--text-muted, #64748b);
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-close-btn:hover {
  background: var(--bg-surface, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

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

/* Step Indicator */
.auth-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--border-light, #e2e8f0);
}

.auth-step-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  transition: color 0.2s ease;
}

.auth-step-item .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--border-color, #e2e8f0);
  color: var(--text-secondary, #475569);
  transition: all 0.2s ease;
}

.auth-step-item.active {
  color: var(--text-primary, #0f172a);
}

.auth-step-item.active .step-num {
  background: var(--brand-red, #d8232a);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(216, 35, 42, 0.3);
}

.auth-step-item.completed .step-num {
  background: #16a34a;
  color: #ffffff;
}

.auth-step-connector {
  width: 36px;
  height: 2px;
  background: var(--border-color, #cbd5e1);
  border-radius: 2px;
}

/* Allowed Domain Notice & Pills */
.auth-domain-notice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--brand-red-light, #fef2f2);
  border: 1px solid rgba(216, 35, 42, 0.18);
  border-left: 3.5px solid var(--brand-red, #d8232a);
  padding: 11px 14px;
  border-radius: 10px;
}

.auth-domain-notice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary, #334155);
  line-height: 1.45;
}

.auth-shield-icon {
  color: var(--brand-red, #d8232a);
  flex-shrink: 0;
}

.auth-domain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 24px;
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-card, #ffffff);
  border: 1px solid rgba(216, 35, 42, 0.28);
  color: var(--brand-red, #d8232a);
  font-family: ui-monospace, 'Inter', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-step-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.auth-field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 4px;
}

.req-star {
  color: var(--brand-red, #d8232a);
  font-weight: 700;
}

.opt-tag {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
}

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

.auth-input-icon {
  position: absolute;
  left: 13px;
  color: var(--text-muted, #64748b);
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input.has-icon {
  padding-left: 38px;
}

.auth-input::placeholder {
  color: var(--text-muted, #94a3b8);
}

.auth-input:focus {
  outline: none;
  background: var(--bg-card, #ffffff);
  border-color: var(--brand-red, #d8232a);
  box-shadow: 0 0 0 3.5px rgba(216, 35, 42, 0.12);
}

.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--brand-red, #d8232a);
}

.auth-input:user-invalid {
  border-color: #dc2626;
  background: rgba(254, 242, 242, 0.5);
}

.auth-input:user-valid {
  border-color: #16a34a;
}

.auth-error-banner {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(216, 35, 42, 0.08);
  border: 1px solid rgba(216, 35, 42, 0.28);
  color: var(--brand-red, #d8232a);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.auth-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.btn-auth-submit {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #d8232a 0%, #b5191f 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 35, 42, 0.26);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(216, 35, 42, 0.34);
}

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

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.otp-sent-banner {
  font-size: 0.84rem;
  font-weight: 600;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 10px 13px;
  border-radius: 10px;
  line-height: 1.45;
}

.otp-instruction-hint {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--text-secondary, #475569);
  line-height: 1.4;
}

.otp-code-input {
  font-family: ui-monospace, 'Inter', monospace;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.45em;
  text-align: center;
  padding: 12px 14px;
  background: var(--bg-card, #ffffff);
}

.otp-helper-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.btn-link-inline {
  background: none;
  border: none;
  color: var(--brand-red, #d8232a);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-link-inline:hover {
  background: rgba(216, 35, 42, 0.08);
  text-decoration: underline;
}

.auth-trust-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light, #f1f5f9);
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
  text-align: center;
}

.auth-trust-footer svg {
  color: #16a34a;
  flex-shrink: 0;
}

.session-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  padding: 8px 8px 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

@media (max-width: 820px) {
  .chat-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }
}

/* -----------------------------------------------------------------------------
   12. ADMIN CONTROL CENTER (MODERATION, SESSIONS HISTORY, TOKEN/COST TELEMETRY)
   ----------------------------------------------------------------------------- */
.admin-mod-modal-content {
  max-width: 1140px;
  width: 96%;
  max-height: min(91vh, 890px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32), 0 4px 16px rgba(216, 35, 42, 0.08);
  background: var(--bg-card, #ffffff);
  overflow: hidden;
}

.admin-mod-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-card, #ffffff);
  flex-shrink: 0;
}

.admin-mod-header-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-mod-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-mod-title-row h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.admin-mod-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.admin-mod-controls-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 22px;
  background: var(--bg-surface, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0;
}

.admin-mod-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.admin-mod-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-mod-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #334155);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-mod-tab:hover {
  border-color: var(--brand-red, #d8232a);
  color: var(--brand-red, #d8232a);
}

.admin-mod-tab.active {
  background: var(--brand-red, #d8232a);
  border-color: var(--brand-red, #d8232a);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(216, 35, 42, 0.22);
}

.admin-mod-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.admin-mod-tab.active .admin-mod-tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.admin-mod-actions-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-mod-input {
  padding: 7px 11px;
  font-family: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-mod-input:focus {
  outline: none;
  border-color: var(--brand-red, #d8232a);
  box-shadow: 0 0 0 3px rgba(216, 35, 42, 0.12);
}

.admin-mod-whitelist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--bg-card, #ffffff);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.admin-mod-whitelist-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.79rem;
  max-height: 76px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.admin-mod-scroll-body {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: 54vh;
  padding: 16px 22px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card, #ffffff);
}

.admin-mod-flag-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg-card, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-mod-flag-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.admin-mod-flag-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-mod-flag-query {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
  line-height: 1.45;
  word-break: break-word;
  flex: 1;
  min-width: 200px;
}

.admin-mod-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.79rem;
  color: var(--text-muted, #64748b);
}

.admin-mod-term-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.76rem;
}

.admin-mod-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.btn-mod-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-mod-approve {
  border: 1px solid #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.btn-mod-approve:hover:not(:disabled) {
  background: #d1fae5;
}

.btn-mod-reject {
  border: 1px solid #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.btn-mod-reject:hover:not(:disabled) {
  background: #fee2e2;
}

.btn-mod-action:disabled {
  opacity: 0.55;
  cursor: default;
}

.admin-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 22px;
  background: var(--bg-surface, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  flex-shrink: 0;
}

.admin-section-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #334155);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.admin-section-tab:hover {
  border-color: var(--brand-red, #d8232a);
  color: var(--brand-red, #d8232a);
}

.admin-section-tab.active {
  background: var(--brand-red, #d8232a);
  border-color: var(--brand-red, #d8232a);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(216, 35, 42, 0.22);
}

.admin-section-tab.active .admin-mod-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.admin-section-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.admin-kpi-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-kpi-label {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.admin-kpi-val {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  font-family: 'Inter', sans-serif;
}

.admin-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
}

.admin-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 600;
  font-size: 0.76rem;
}

.admin-sessions-split-layout {
  display: grid;
  grid-template-columns: 370px 1fr;
  flex: 1 1 auto;
  min-height: 320px;
  max-height: 55vh;
  overflow: hidden;
  background: var(--bg-card, #ffffff);
}

@media (max-width: 860px) {
  .admin-sessions-split-layout {
    grid-template-columns: 1fr;
    max-height: 62vh;
    overflow-y: auto;
  }
}

.admin-sessions-list-pane {
  border-right: 1px solid var(--border-color, #e2e8f0);
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.admin-session-detail-pane {
  overflow-y: auto;
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  background: var(--bg-surface, #f8fafc);
}

.admin-session-row-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 11px 13px;
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.14s ease;
  text-align: left;
}

.admin-session-row-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.admin-session-row-card.active {
  border-color: var(--brand-red, #d8232a);
  background: rgba(216, 35, 42, 0.04);
  box-shadow: 0 0 0 2px rgba(216, 35, 42, 0.12);
}

.admin-turn-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 11px;
  padding: 12px 15px;
  background: var(--bg-card, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-turn-card.role-user {
  border-left: 4px solid #2563eb;
}

.admin-turn-card.role-assistant {
  border-left: 4px solid #10b981;
}

.admin-turn-metrics-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

.admin-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.admin-metric-chip.cost-chip {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.admin-metric-chip.token-chip {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}




