/* ==========================================================
   CLAUDE.AI STYLE UI - MÔI TRƯỜNG LUYỆN THI OLPAi
   Thiết kế chuẩn Claude.ai: Parchment Warm Neutral Palette,
   Không avatar, Khối suy nghĩ thu gọn, Sidebar tính năng & lịch sử ○
   ========================================================== */

:root {
  --theme: 'light';
  --bg-canvas: #ffffff;
  --bg-sidebar: #faf9f5;
  --bg-hover: #ece9e2;
  --bg-active: #e8e6df;
  --bg-user-bubble: #f0eee6;
  --bg-card: #ffffff;
  --bg-code-header: #2f2f2f;
  --bg-code-body: #18181b;

  --border-subtle: #eeece5;
  --border-sidebar: #e8e6df;
  --border-input: #e3e0d8;

  --text-primary: #1f1e1d;
  --text-secondary: #57554f;
  --text-muted: #87867f;
  --text-brand: #c96442; /* Claude Terracotta */

  --accent-coral: #c96442;
  --accent-coral-hover: #b85736;
  --accent-blue-badge: #e0e7ff;
  --text-blue-badge: #3730a3;

  --btn-send-disabled: #e8e6df;
  --btn-send-disabled-icon: #b5b3aa;
  --btn-send-active: #c96442;
  --btn-send-active-icon: #ffffff;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Newsreader', Georgia, Cambria, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;

  --radius-bubble: 18px;
  --radius-card: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --chat-max-width: 800px;
  --sidebar-width: 260px;
  --transition: 150ms ease;
}

:root[data-theme="dark"] {
  --theme: 'dark';
  --bg-canvas: #262624;
  --bg-sidebar: #1e1e1d;
  --bg-hover: #2d2d2a;
  --bg-active: #363632;
  --bg-user-bubble: #333230;
  --bg-card: #2e2e2b;
  --bg-code-header: #20201e;
  --bg-code-body: #141413;

  --border-subtle: #363632;
  --border-sidebar: #33322f;
  --border-input: #3e3d39;

  --text-primary: #f0eee6;
  --text-secondary: #b8b6af;
  --text-muted: #828079;
  --text-brand: #d97757;

  --accent-coral: #d97757;
  --accent-coral-hover: #c96442;
  --accent-blue-badge: #312e81;
  --text-blue-badge: #c7d2fe;

  --btn-send-disabled: #3a3936;
  --btn-send-disabled-icon: #63615b;
  --btn-send-active: #d97757;
  --btn-send-active-icon: #ffffff;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================
   SIDEBAR (Claude.ai Exact Layout)
   ========================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-sidebar);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), width var(--transition);
  flex-shrink: 0;
  z-index: 50;
  height: 100%;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  position: absolute;
  height: 100%;
}

.sidebar-header {
  padding: 14px 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.claude-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.claude-logo-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.claude-logo-icon {
  color: var(--accent-coral);
}

.claude-logo-text {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.btn-sidebar-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-sidebar-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Sidebar Nav Items */
.sidebar-nav {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.sidebar-nav-item:hover {
  background-color: var(--bg-hover);
}

.sidebar-nav-item.active {
  background-color: var(--bg-active);
  font-weight: 500;
}

.sidebar-nav-item svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.badge-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}

.badge-upgrade {
  background-color: var(--accent-blue-badge);
  color: var(--text-blue-badge);
}

.badge-trial {
  background-color: rgba(201, 100, 66, 0.12);
  color: var(--accent-coral);
}

/* Section Header (Đoạn chat và tác vụ) */
.sidebar-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 4px 14px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-sidebar-icon-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-sidebar-icon-mini:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Trial Items in Sidebar */
.sidebar-special-items {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-special-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-special-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-special-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Chat History List with Circle Bullets ○ */
.sidebar-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  margin-top: 4px;
}

.sidebar-history-container::-webkit-scrollbar {
  width: 4px;
}

.sidebar-history-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.history-bullet {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}

.history-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.history-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 500;
}

.history-item.active .history-bullet {
  color: var(--accent-coral);
}

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

.history-item-actions {
  display: none;
  align-items: center;
  gap: 2px;
}

.history-item:hover .history-item-actions {
  display: flex;
}

.btn-action-tiny {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 3px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.btn-action-tiny:hover {
  color: var(--text-primary);
}

/* User Profile (Requested: Linh Duong pro) */
.sidebar-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--border-sidebar);
}

.claude-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.claude-user-profile:hover {
  background-color: var(--bg-hover);
}

.user-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #cf7858;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.user-info-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.user-full-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.user-tier-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.provider-status-dot-wrapper {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
}

.status-dot.error {
  background-color: #ef4444;
}

/* ==========================================================
   MAIN CANVAS & TOP BAR
   ========================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background-color: var(--bg-canvas);
  min-width: 0;
}

.main-header {
  height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  background-color: var(--bg-canvas);
  z-index: 20;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.claude-title-dropdown-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: background var(--transition);
}

.claude-title-dropdown-btn:hover {
  background-color: var(--bg-hover);
}

.btn-claude-share {
  background-color: var(--bg-hover);
  border: 1px solid var(--border-sidebar);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-claude-share:hover {
  background-color: var(--bg-active);
}

/* Model Dropdown Menu */
.model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-sidebar);
  border-radius: 12px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: none;
  z-index: 100;
  padding: 8px;
}

.model-dropdown.show {
  display: block;
}

.model-dropdown-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px;
  letter-spacing: 0.5px;
}

.model-option-item {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
}

.model-option-item:hover {
  background-color: var(--bg-hover);
}

.model-option-item.selected {
  background-color: var(--bg-active);
  font-weight: 500;
}

.model-custom-input-wrapper {
  padding: 8px 4px 4px 4px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.model-custom-input {
  flex: 1;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-sidebar);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-primary);
}

.btn-custom-model-apply {
  background-color: var(--accent-coral);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

/* ==========================================================
   CHAT CANVAS & MESSAGES (Claude.ai - NO AVATARS)
   ========================================================== */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 160px;
  scroll-behavior: smooth;
}

.chat-inner {
  max-width: var(--chat-max-width);
  margin: 0 auto;
  padding: 24px 24px 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
  padding: 30px 0;
}

.welcome-claude-star {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.welcome-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.quick-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  width: 100%;
}

.template-card {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-sidebar);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.template-card:hover {
  background-color: var(--bg-sidebar);
  border-color: #d8d4c9;
}

.template-card-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-coral);
  margin-bottom: 4px;
}

.template-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.template-card-snippet {
  font-size: 12px;
  color: var(--text-muted);
}

/* Message Rows (Claude style - NO AVATARS) */
.message-row {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* User Message: Warm Bubble Right-Aligned */
.message-row.user-row {
  align-items: flex-end;
}

.user-bubble-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 80%;
}

.user-bubble {
  background-color: var(--bg-user-bubble);
  color: var(--text-primary);
  padding: 11px 18px;
  border-radius: var(--radius-bubble);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}

.message-row:hover .message-actions {
  opacity: 1;
}

.user-time-stamp {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-msg-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-msg-action:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Assistant Message: Left-Aligned Full Width */
.message-row.assistant-row {
  align-items: flex-start;
}

.assistant-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Claude Style Collapsible Reasoning/Execution Box */
.reasoning-box {
  margin-bottom: 14px;
}

.reasoning-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  padding: 4px 10px;
  border-radius: 12px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-sidebar);
  transition: background var(--transition), color var(--transition);
}

.reasoning-summary:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.reasoning-chevron {
  transition: transform var(--transition);
}

.reasoning-box.expanded .reasoning-chevron {
  transform: rotate(90deg);
}

/* Claude.ai Signature Dual-Dot Thinking Animation (Image 6) */
.claude-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  padding: 2px 2px;
}

.claude-dot {
  border-radius: 50%;
  background-color: var(--accent-coral, #c96442);
  display: inline-block;
}

.claude-dot.dot-1 {
  width: 7.5px;
  height: 7.5px;
  animation: claudeDotPulse1 1.5s ease-in-out infinite;
}

.claude-dot.dot-2 {
  width: 5.5px;
  height: 5.5px;
  animation: claudeDotPulse2 1.5s ease-in-out infinite;
}

@keyframes claudeDotPulse1 {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

@keyframes claudeDotPulse2 {
  0%, 100% {
    transform: scale(1.25);
    opacity: 0.95;
  }
  50% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}

.reasoning-body {
  margin-top: 8px;
  padding: 12px 16px;
  border-left: 2px solid var(--accent-coral);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-radius: 0 8px 8px 0;
}

/* Content Typography */
.message-content {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-primary);
  word-break: break-word;
}

.message-content p {
  margin-bottom: 14px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content h1, .message-content h2, .message-content h3, .message-content h4 {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 22px;
  margin-bottom: 10px;
}

.message-content h2 { font-size: 18.5px; }
.message-content h3 { font-size: 16.5px; }

.message-content ul, .message-content ol {
  margin: 8px 0 14px 22px;
}

.message-content li {
  margin-bottom: 5px;
}

.message-content strong {
  font-weight: 600;
}

/* Tables */
.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.message-content th {
  text-align: left;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-sidebar);
  color: var(--text-primary);
}

.message-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.message-content tr:hover td {
  background-color: var(--bg-sidebar);
}

.message-content a {
  color: var(--accent-coral);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================
   CODE CARD & SYNTAX HIGHLIGHTING (Claude.ai - Image 5 style)
   ========================================================== */
.code-card {
  background-color: #ffffff;
  border: 1px solid var(--border-sidebar);
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: none;
}

:root[data-theme="dark"] .code-card {
  background-color: #1e1e1d;
  border-color: #363632;
}

.code-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px 16px;
  background: transparent;
  border: none;
}

.code-card-lang {
  display: flex;
  align-items: center;
}

.lang-text {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  text-transform: lowercase;
  font-weight: 400;
  user-select: none;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  padding: 0;
}

.copy-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.copy-btn.copied {
  color: #10a37f;
}

.code-card-body {
  padding: 4px 16px 14px 16px;
  overflow-x: auto;
  background: transparent;
}

.code-card-body pre {
  margin: 0;
  background: transparent;
}

.code-card-body code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
  padding: 0;
  display: block;
}

/* Claude.ai Syntax Color Palette (Image 5 exact match) */
.hljs-keyword,
.hljs-operator,
.hljs-selector-tag {
  color: #8b5cf6 !important; /* Vibrant Purple (import, from, as, try, except, etc.) */
  font-weight: 500;
}

.hljs-built_in,
.hljs-type {
  color: #8b5cf6 !important; /* Builtins (sorted, int, len, range, enumerate) */
}

.hljs-number,
.hljs-literal {
  color: #0284c7 !important; /* Teal / Cyan (448, 16, 8, 1e-5, 0.25, 1) */
}

.hljs-string {
  color: #b45309 !important; /* Warm Amber / Orange */
}

.hljs-comment {
  color: #87867f !important; /* Muted gray italic */
  font-style: italic;
}

.hljs-title,
.hljs-title.function_,
.hljs-title.class_ {
  color: #2563eb !important; /* Blue function / class names */
}

.hljs-variable,
.hljs-params {
  color: var(--text-primary) !important;
}

:root[data-theme="dark"] .hljs-keyword,
:root[data-theme="dark"] .hljs-operator,
:root[data-theme="dark"] .hljs-selector-tag,
:root[data-theme="dark"] .hljs-built_in,
:root[data-theme="dark"] .hljs-type {
  color: #c084fc !important;
}

:root[data-theme="dark"] .hljs-number,
:root[data-theme="dark"] .hljs-literal {
  color: #38bdf8 !important;
}

:root[data-theme="dark"] .hljs-string {
  color: #fbbf24 !important;
}

:root[data-theme="dark"] .hljs-comment {
  color: #828079 !important;
}

:root[data-theme="dark"] .hljs-title,
:root[data-theme="dark"] .hljs-title.function_,
:root[data-theme="dark"] .hljs-title.class_ {
  color: #60a5fa !important;
}

/* Inline code in chat messages */
.message-content :not(pre) > code {
  background-color: var(--bg-user-bubble);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.streaming-cursor {
  display: inline-block;
  width: 6px;
  height: 15px;
  background-color: var(--accent-coral);
  margin-left: 2px;
  vertical-align: -2px;
  animation: cursorBlink 700ms infinite;
}

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

/* Scroll To Bottom Button */
.btn-scroll-bottom {
  position: absolute;
  bottom: 140px;
  right: calc(50% - 20px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-sidebar);
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  z-index: 30;
  transition: all var(--transition);
}

.btn-scroll-bottom.visible {
  display: flex;
}

.btn-scroll-bottom:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* ==========================================================
   CLAUDE STYLE INPUT DOCK
   ========================================================== */
.input-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 14px 24px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-canvas) 35%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 25;
}

.claude-input-card {
  width: 100%;
  max-width: var(--chat-max-width);
  background-color: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 10px 14px 10px 14px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.claude-input-card:focus-within {
  border-color: #c9c5ba;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .claude-input-card:focus-within {
  border-color: #55534e;
}

.claude-input-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.btn-claude-attach {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 3px;
  transition: background var(--transition), color var(--transition);
}

.btn-claude-attach:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  max-height: 200px;
  padding: 6px 0;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
}

.claude-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

.claude-input-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-claude-mic, .btn-claude-audio {
  background: transparent;
  border: none;
  color: var(--text-muted);
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-claude-mic:hover, .btn-claude-audio:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-stop {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #1f1e1d;
  color: #fff;
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-stop.visible {
  display: flex;
}

.btn-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--btn-send-disabled);
  color: var(--btn-send-disabled-icon);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  transition: all var(--transition);
}

.btn-send:not(:disabled) {
  background-color: var(--btn-send-active);
  color: var(--btn-send-active-icon);
  cursor: pointer;
}

.claude-input-footer-row {
  width: 100%;
  max-width: var(--chat-max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  pointer-events: auto;
}

.claude-disclaimer {
  font-size: 11.5px;
  color: var(--text-muted);
}

.claude-model-badge {
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  transition: background var(--transition);
}

.claude-model-badge:hover {
  background-color: var(--bg-hover);
}

.model-badge-main {
  font-weight: 500;
  color: var(--text-primary);
}

.model-badge-sub {
  color: var(--text-muted);
}

/* ==========================================================
   EXAM TOKEN PROGRESS BAR (Mô phỏng môi trường thi 2K token)
   ========================================================== */
.exam-token-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 220px;
  max-width: 280px;
  padding: 5px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  user-select: none;
  transition: all var(--transition);
}

.exam-token-bar:hover {
  border-color: var(--border-medium);
}

.exam-token-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  line-height: 1.2;
}

.exam-token-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 500;
}

.exam-token-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10a37f;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 163, 127, 0.45);
  transition: background-color var(--transition), box-shadow var(--transition);
}

.exam-token-numbers {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.exam-token-percent {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.exam-token-progress {
  width: 100%;
  height: 5px;
  background-color: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.exam-token-progress-fill {
  height: 100%;
  border-radius: 999px;
  background-color: #10a37f;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

/* Trạng thái Warning (>= 70%) */
.exam-token-bar.warning .exam-token-progress-fill {
  background-color: var(--accent-amber);
}
.exam-token-bar.warning .exam-token-pulse {
  background-color: var(--accent-amber);
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.5);
}

/* Trạng thái Danger / Đạt trần 2,000 token (>= 90%) */
.exam-token-bar.danger .exam-token-progress-fill {
  background-color: var(--accent-red);
}
.exam-token-bar.danger .exam-token-pulse {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.exam-token-bar.danger .exam-token-numbers {
  color: var(--accent-red);
  font-weight: 600;
}
.exam-token-bar.danger .exam-token-percent {
  color: var(--accent-red);
}

/* ==========================================================
   CLAUDE LENGTH LIMIT TOAST (Thông báo chạm trần độ dài)
   ========================================================== */
.claude-limit-toast {
  width: 100%;
  max-width: var(--chat-max-width);
  margin: 0 auto 12px auto;
  padding: 16px 20px;
  background-color: #faf2ee;
  border: 1px solid #ebd9d2;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #792e24;
  box-shadow: 0 4px 18px rgba(121, 46, 36, 0.05);
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  box-sizing: border-box;
}

[data-theme="dark"] .claude-limit-toast {
  background-color: #2b1c19;
  border-color: #4a2923;
  color: #fca5a5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.claude-limit-toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #792e24;
}

[data-theme="dark"] .claude-limit-toast-icon {
  color: #f87171;
}

.claude-limit-toast-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.48;
  color: inherit;
  font-weight: 400;
  letter-spacing: -0.15px;
}

.claude-limit-toast-text .limit-link {
  text-decoration: underline;
  text-underline-offset: 3.5px;
  text-decoration-thickness: 1.2px;
  cursor: help;
  color: inherit;
  font-weight: 500;
}

.claude-limit-toast-text .limit-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3.5px;
  text-decoration-thickness: 1.2px;
  cursor: pointer;
  font-weight: 500;
  display: inline;
  transition: opacity var(--transition);
}

.claude-limit-toast-text .limit-link-btn:hover {
  opacity: 0.8;
}

.claude-limit-toast-close {
  background: transparent;
  border: none;
  color: #792e24;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), opacity var(--transition);
  opacity: 0.85;
}

[data-theme="dark"] .claude-limit-toast-close {
  color: #fca5a5;
}

.claude-limit-toast-close:hover {
  opacity: 1;
  background-color: rgba(121, 46, 36, 0.1);
}

.chat-textarea:disabled {
  background-color: var(--bg-hover);
  cursor: not-allowed;
  opacity: 0.7;
}

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .chat-inner {
    padding: 16px 14px 40px 14px;
  }

  .user-bubble-container {
    max-width: 90%;
  }

  .claude-disclaimer {
    display: none;
  }

  .exam-token-bar {
    min-width: 130px;
    max-width: 170px;
    padding: 3px 8px;
  }

  .exam-token-title span:last-child {
    display: none;
  }

  .claude-limit-toast {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 14px;
  }

  .claude-limit-toast-text {
    font-size: 13.5px;
  }
}
