/* Claude Clone Design System & Aesthetics */
:root {
  /* Warm Ivory Light Palette (Claude signature theme) */
  --bg-primary: #FAF9F5;
  --bg-secondary: #F3EFE6;
  --bg-sidebar: #F2EFE9;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-hover: #EBE6DC;
  --bg-active: #E4DFD4;
  --bg-tertiary: #F8F6F0;
  
  --text-primary: #2B2523;
  --text-secondary: #6B635B;
  --text-muted: #968D84;
  --text-light: #B4ACA4;
  
  --border-subtle: #ECE6DC;
  --border-medium: #DDD6C9;
  --border-focus: #CC5A36;
  
  /* Claude Terracotta Accent */
  --accent-primary: #CC5A36;
  --accent-hover: #B84A28;
  --accent-light: #FBF0EB;
  --accent-border: #F3D2C4;
  --accent-glow: rgba(204, 90, 54, 0.16);

  /* Web Scrape Green/Cyan Badges */
  --scrape-active: #10B981;
  --scrape-bg: #ECFDF5;
  --scrape-border: #A7F3D0;
  
  --shadow-sm: 0 1px 2px rgba(43, 37, 35, 0.04);
  --shadow-md: 0 4px 12px rgba(43, 37, 35, 0.07);
  --shadow-lg: 0 12px 32px rgba(43, 37, 35, 0.1);
  --shadow-input: 0 4px 20px rgba(43, 37, 35, 0.06);

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Consolas, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --sidebar-width: 270px;
  --artifact-width: 520px;
  --header-height: 56px;
}

[data-theme="dark"] {
  --bg-primary: #19191B;
  --bg-secondary: #222226;
  --bg-sidebar: #1E1E22;
  --bg-card: #25252A;
  --bg-input: #232328;
  --bg-hover: #2E2E35;
  --bg-active: #373740;
  --bg-tertiary: #1D1D21;
  
  --text-primary: #ECE7E1;
  --text-secondary: #AAA49C;
  --text-muted: #7E7870;
  --text-light: #5A554E;
  
  --border-subtle: #2F2F36;
  --border-medium: #3E3E47;
  --border-focus: #E2734E;
  
  --accent-primary: #E2734E;
  --accent-hover: #EE8360;
  --accent-light: #34241F;
  --accent-border: #5C3A2E;
  --accent-glow: rgba(226, 115, 78, 0.22);

  --scrape-active: #34D399;
  --scrape-bg: #064E3B;
  --scrape-border: #059669;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);
  --shadow-input: 0 6px 24px rgba(0, 0, 0, 0.35);
}

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

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

/* App Layout Grid */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease;
  z-index: 50;
}

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

.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.new-chat-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.new-chat-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-focus);
}

.close-sidebar-btn {
  display: none;
}

.sidebar-history-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.history-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 12px 6px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
}

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

.history-item.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

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

.history-item-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.history-item:hover .history-item-delete {
  opacity: 1;
}

.history-item-delete:hover {
  color: #EF4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--bg-sidebar);
}

.reach-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background-color: var(--scrape-bg);
  border: 1px solid var(--scrape-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-primary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--scrape-active);
  box-shadow: 0 0 6px var(--scrape-active);
  animation: pulse-dot 2s infinite ease-in-out;
}

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

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.theme-toggle-btn .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle-btn .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle-btn .moon-icon { display: block; }

/* Main Container */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Top Navigation */
.top-nav {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
  z-index: 10;
}

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

.mobile-menu-btn {
  display: none;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Model Picker */
.model-picker-container {
  position: relative;
}

.model-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.model-picker-btn:hover {
  border-color: var(--border-focus);
}

.model-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
}

.model-dropdown.open {
  display: flex;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

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

.model-option.active {
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
}

.model-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.option-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-hover);
  color: var(--text-secondary);
}

.option-tag.power {
  background-color: #FEF3C7;
  color: #D97706;
}

[data-theme="dark"] .option-tag.power {
  background-color: #78350F;
  color: #FDE68A;
}

/* Nav Artifact Toggle */
.nav-artifact-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.nav-artifact-toggle-btn.active {
  background-color: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent-primary);
}

.artifact-count-badge {
  background-color: var(--accent-primary);
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Welcome Screen */
.welcome-screen {
  max-width: 780px;
  margin: auto;
  padding: 40px 24px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.claude-avatar-large {
  color: var(--accent-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-light);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--accent-border);
  box-shadow: 0 4px 18px var(--accent-glow);
}

.welcome-heading {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.25;
}

.welcome-subtext {
  font-size: 15.5px;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 36px;
}

.prompt-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

.suggestion-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.suggestion-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.suggestion-card .card-icon {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.suggestion-card .card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.suggestion-card .card-text strong {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 600;
}

.suggestion-card .card-text span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chat Messages */
.messages-container {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.2s ease-out;
}

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

/* User Message */
.chat-message.user-message {
  align-self: flex-end;
  max-width: 85%;
}

.user-message-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Assistant Message */
.chat-message.assistant-message {
  align-self: flex-start;
  width: 100%;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assistant-avatar {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.assistant-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.message-model-tag {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 6px;
  background-color: var(--bg-hover);
  border-radius: 4px;
}

/* Thinking & Tool-use Accordion */
.thinking-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  overflow: hidden;
  margin: 6px 0 14px;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  background-color: var(--bg-secondary);
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: background-color 0.12s ease;
  user-select: none;
}

.thinking-header:hover {
  background-color: var(--bg-hover);
}

.thinking-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thinking-sparkle {
  color: var(--accent-primary);
  animation: rotate-sparkle 4s linear infinite;
}

@keyframes rotate-sparkle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.thinking-duration {
  font-size: 11px;
  color: var(--text-muted);
}

.thinking-content {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scrape-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.step-status-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-status-icon.success {
  background-color: var(--scrape-active);
  color: #FFF;
}

.step-status-icon.loading {
  border: 2px solid var(--accent-primary);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

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

.scrape-step-text {
  color: var(--text-primary);
}

.scrape-step-url {
  color: var(--accent-primary);
  text-decoration: underline;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Assistant Markdown Body */
.message-body {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.68;
}

.message-body p {
  margin-bottom: 12px;
}

.message-body h1, .message-body h2, .message-body h3 {
  font-family: var(--font-serif);
  margin: 18px 0 10px;
  color: var(--text-primary);
  line-height: 1.3;
}

.message-body h1 { font-size: 22px; }
.message-body h2 { font-size: 19px; }
.message-body h3 { font-size: 16px; }

.message-body ul, .message-body ol {
  margin: 8px 0 14px 24px;
}

.message-body li {
  margin-bottom: 4px;
}

.message-body a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-primary);
}

.message-body a:hover {
  border-bottom-style: solid;
}

.message-body blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 14px;
  margin: 12px 0;
  color: var(--text-secondary);
  font-style: italic;
  background-color: var(--bg-hover);
  padding: 8px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.message-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--accent-primary);
}

.message-body pre {
  margin: 14px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-medium);
  background-color: #1E1E22;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background-color: #161618;
  color: #9E9E9E;
  font-size: 12px;
  font-family: var(--font-mono);
}

.copy-code-btn {
  background: none;
  border: none;
  color: #AAA;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
}

.copy-code-btn:hover {
  background-color: #2A2A2E;
  color: #FFF;
}

.message-body pre code {
  display: block;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  color: #E6E6E6;
}

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

.message-body th, .message-body td {
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  text-align: left;
}

.message-body th {
  background-color: var(--bg-secondary);
  font-weight: 600;
}

.message-body tr:nth-child(even) {
  background-color: var(--bg-tertiary);
}

/* Sources & Citations Grid */
.sources-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-medium);
}

.source-pill-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  max-width: 240px;
}

.source-pill-card:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.source-favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

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

/* Artifact Card Preview inside message */
.artifact-snippet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  margin: 12px 0;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.artifact-snippet-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.snippet-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.snippet-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--accent-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.snippet-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snippet-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.snippet-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
}

/* Floating Input Box Area */
.input-area-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 20px 16px;
  background: linear-gradient(180deg, rgba(250, 249, 245, 0) 0%, var(--bg-primary) 35%);
  pointer-events: none;
  z-index: 20;
}

[data-theme="dark"] .input-area-wrapper {
  background: linear-gradient(180deg, rgba(25, 25, 27, 0) 0%, var(--bg-primary) 35%);
}

.input-card {
  max-width: 820px;
  margin: 0 auto;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  box-shadow: var(--shadow-input);
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 10px;
  pointer-events: auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 6px 24px var(--accent-glow);
}

/* Active Scrape Indicator Bar */
.active-scrape-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-primary);
}

.spinner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.scrape-target-pill {
  font-family: var(--font-mono);
  font-weight: 500;
  background-color: rgba(204, 90, 54, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.input-main-row {
  display: flex;
  align-items: center;
}

.prompt-textarea {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  resize: none;
  max-height: 180px;
  line-height: 1.5;
}

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

.input-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

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

.control-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background-color: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.control-toggle-btn.active {
  background-color: var(--scrape-bg);
  border-color: var(--scrape-border);
  color: var(--scrape-active);
  font-weight: 600;
}

.pill-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background-color: var(--scrape-active);
  color: #FFF;
}

.token-counter {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.send-message-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.send-message-btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
  transform: scale(1.05);
}

.send-message-btn:disabled {
  background-color: var(--border-medium);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.input-disclaimer {
  max-width: 820px;
  margin: 6px auto 0;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Artifact Drawer (Right Panel) */
.artifact-drawer {
  width: var(--artifact-width);
  height: 100vh;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--shadow-lg);
  z-index: 40;
  transition: width 0.2s ease;
}

.artifact-drawer.open {
  display: flex;
}

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

.artifact-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.artifact-icon {
  color: var(--accent-primary);
}

.artifact-heading-group {
  display: flex;
  flex-direction: column;
}

.artifact-tag {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
}

.artifact-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Artifact Tabs */
.artifact-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
  padding: 0 12px;
  gap: 4px;
}

.artifact-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.artifact-tab:hover {
  color: var(--text-primary);
}

.artifact-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
  background-color: var(--bg-card);
}

/* Artifact Body */
.artifact-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background-color: var(--bg-card);
}

.artifact-pane {
  display: none;
  height: 100%;
}

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

.artifact-rendered-content {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-primary);
}

.artifact-raw-markdown {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border-medium);
}

.artifact-sources-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-item-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.source-item-card a {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}

.source-item-card span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-select, .settings-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.settings-select:focus, .settings-input:focus {
  border-color: var(--border-focus);
}

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

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

.toggle-visibility-btn {
  position: absolute;
  right: 6px;
}

.modal-footer {
  padding: 14px 22px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary {
  background: none;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
}

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

.btn-primary {
  background-color: var(--accent-primary);
  border: none;
  color: #FFF;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

/* Responsive Styles */
@media (max-width: 900px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

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

  .close-sidebar-btn {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .prompt-suggestions-grid {
    grid-template-columns: 1fr;
  }

  .artifact-drawer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100vw;
  }
}
