/* Dark theme colors */
[data-theme='dark'] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #404040;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --border-color: #404040;
  --link-color: #60a5fa;
  --link-hover: #93c5fd;
  --code-bg: #2d2d2d;
}

/* Dark theme alerts */
[data-theme='dark'] .markdown-alert-note {
  background: rgba(59, 130, 246, 0.15);
}

[data-theme='dark'] .markdown-alert-tip {
  background: rgba(16, 185, 129, 0.15);
}

[data-theme='dark'] .markdown-alert-important {
  background: rgba(139, 92, 246, 0.15);
}

[data-theme='dark'] .markdown-alert-warning {
  background: rgba(245, 158, 11, 0.15);
}

[data-theme='dark'] .markdown-alert-caution {
  background: rgba(239, 68, 68, 0.15);
}

/* Smooth theme transition */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Prevent transition on initial load */
.no-transition * {
  transition: none !important;
}

/* System preference detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --border-color: #404040;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --code-bg: #2d2d2d;
  }

  :root:not([data-theme='light']) .markdown-alert-note {
    background: rgba(59, 130, 246, 0.15);
  }

  :root:not([data-theme='light']) .markdown-alert-tip {
    background: rgba(16, 185, 129, 0.15);
  }

  :root:not([data-theme='light']) .markdown-alert-important {
    background: rgba(139, 92, 246, 0.15);
  }

  :root:not([data-theme='light']) .markdown-alert-warning {
    background: rgba(245, 158, 11, 0.15);
  }

  :root:not([data-theme='light']) .markdown-alert-caution {
    background: rgba(239, 68, 68, 0.15);
  }
}


/* Chat Widget Styles */

.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.chat-toggle {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--link-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-container {
  position: absolute;
  bottom: 5rem;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 4rem);
  height: 600px;
  max-height: calc(100vh - 10rem);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: var(--link-color);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 1rem 1rem 0 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.chat-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-info,
.chat-clear,
.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.chat-close {
  font-size: 1.5rem;
}

.chat-info:hover,
.chat-clear:hover,
.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-disclosure {
  padding: 1rem 1.25rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border-color);
}

.chat-disclosure p {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.chat-disclosure ul {
  margin: 0 0 0.75rem 0;
  padding-left: 1.25rem;
}

.chat-disclosure li {
  margin-bottom: 0.375rem;
}

.chat-disclosure-close {
  padding: 0.375rem 0.875rem;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
}

.chat-disclosure-close:hover {
  background: var(--link-hover);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 85%;
  animation: slideIn 0.3s ease;
}

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

.chat-message.user {
  align-self: flex-end;
}

.chat-message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.user .message-content {
  background: var(--link-color);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant .message-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 0.25rem;
}

/* Markdown content styling */
.message-content p {
  margin: 0.5rem 0;
}

.message-content p:first-child {
  margin-top: 0;
}

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

.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 1rem 0 0.5rem 0;
  font-weight: 600;
  line-height: 1.3;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child {
  margin-top: 0;
}

.message-content h1 {
  font-size: 1.25rem;
}

.message-content h2 {
  font-size: 1.125rem;
}

.message-content h3 {
  font-size: 1rem;
}

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

.message-content em {
  font-style: italic;
}

.message-content code {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875em;
}

[data-theme='dark'] .message-content code {
  background: rgba(255, 255, 255, 0.1);
}

.message-content pre {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

[data-theme='dark'] .message-content pre {
  background: rgba(255, 255, 255, 0.05);
}

.message-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  display: block;
}

.message-content a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.message-content a:hover {
  border-bottom-color: var(--link-color);
}

.message-content ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.message-content li {
  margin-bottom: 0.375rem;
}

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

.message-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1rem 0;
  opacity: 0.5;
}

.message-content br {
  display: block;
  content: "";
  margin-top: 0.25rem;
}

.message-citations {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.citations-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.citation-link {
  font-size: 0.75rem;
  color: var(--link-color);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: 1px solid transparent;
  display: block;
}

.citation-link:hover {
  background: var(--bg-primary);
  border-color: var(--link-color);
  text-decoration: none;
  transform: translateX(4px);
}

.chat-input-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  resize: none;
  max-height: 100px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--link-color);
}

.chat-send {
  padding: 0.75rem 1.5rem;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.chat-send:hover:not(:disabled) {
  background: var(--link-hover);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading-indicator {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 1rem;
  max-width: fit-content;
}

.loading-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

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

.chat-status {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--link-color);
  transition: width 0.3s ease;
}

.chat-consent p {
  margin: 0 0 0.75rem 0;
}

.chat-consent-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.chat-consent-download,
.chat-consent-retry {
  padding: 0.5rem 1rem;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
}

.chat-consent-download:hover,
.chat-consent-retry:hover {
  background: var(--link-hover);
}

.chat-consent-retry {
  margin-left: 0.5rem;
}

.chat-consent-decline {
  padding: 0.5rem 1rem;
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.8125rem;
}

.chat-consent-decline:hover {
  background: var(--bg-secondary);
}

/* AI Use Disclosure Banner (full-bleed, breaks out of .main-content padding) */
.ai-disclosure {
  margin: 3rem -3rem 0 -3rem;
  padding: 1rem 3rem;
  background: var(--link-color);
  color: var(--bg-primary);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Footer Attribution */
.botdocs-attribution {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

.ai-disclosure + .botdocs-attribution {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
}

.botdocs-attribution a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.botdocs-attribution a:hover {
  color: var(--link-color);
  text-decoration: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .chat-widget {
    bottom: 1rem;
    right: 1rem;
  }

  .chat-container {
    width: calc(100vw - 2rem);
    height: calc(100vh - 8rem);
    bottom: 4rem;
    right: 0;
  }

  .chat-toggle {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
  }

  .ai-disclosure {
    margin: 2rem -1.5rem 0 -1.5rem;
    padding: 0.875rem 1.5rem;
  }
}


/* Classic Theme - Clean, corporate, professional */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors - Light theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  --link-color: #3b82f6;
  --link-hover: #2563eb;
  --code-bg: #f8f9fa;
  --sidebar-width: 280px;
  --content-max-width: 800px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem;
  overflow-y: auto;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

.sidebar-header {
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.site-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sidebar-nav {
  margin-top: 1.5rem;
}

.nav-list {
  list-style: none;
}

.nav-list li {
  margin-bottom: 0.5rem;
}

.nav-list a {
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.nav-list a:hover {
  background: var(--bg-tertiary);
}

.nav-list a.active {
  background: var(--link-color);
  color: white;
  font-weight: 500;
}

.nav-list li.nav-group > a {
  font-weight: 600;
  position: relative;
  padding-right: 1.75rem;
}

.nav-list li.nav-group > a::after {
  content: '›';
  position: absolute;
  right: 0.75rem;
  transition: transform 0.2s;
}

.nav-list li.nav-group:has(> .nav-list) > a::after {
  transform: rotate(90deg);
}

.nav-list .nav-list {
  margin-top: 0.375rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
}

.nav-list .nav-list a {
  font-weight: 400;
  font-size: 0.9rem;
  padding: 0.375rem 0.75rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 3rem;
}

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
}

h2 {
  font-size: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Code */
code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

pre code {
  background: none;
  padding: 0;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--link-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* GitHub-style Alerts/Callouts */
.markdown-alert {
  padding: 1rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
  border-radius: 0.25rem;
  background: var(--bg-secondary);
}

.markdown-alert-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.markdown-alert-title svg {
  display: none;
}

.markdown-alert-title::before {
  font-size: 1.2rem;
}

.markdown-alert > *:last-child {
  margin-bottom: 0;
}

.markdown-alert-note {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.markdown-alert-note .markdown-alert-title {
  color: #3b82f6;
}

.markdown-alert-note .markdown-alert-title::before {
  content: 'ℹ️';
}

.markdown-alert-tip {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.markdown-alert-tip .markdown-alert-title {
  color: #10b981;
}

.markdown-alert-tip .markdown-alert-title::before {
  content: '💡';
}

.markdown-alert-important {
  border-left-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.markdown-alert-important .markdown-alert-title {
  color: #8b5cf6;
}

.markdown-alert-important .markdown-alert-title::before {
  content: '❗';
}

.markdown-alert-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.markdown-alert-warning .markdown-alert-title {
  color: #f59e0b;
}

.markdown-alert-warning .markdown-alert-title::before {
  content: '⚠️';
}

.markdown-alert-caution {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.markdown-alert-caution .markdown-alert-title {
  color: #ef4444;
}

.markdown-alert-caution .markdown-alert-title::before {
  content: '🔥';
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Task Lists */
.task-list-item {
  list-style: none;
  margin-left: -1.5rem;
}

.task-list-item-checkbox {
  margin-right: 0.5rem;
  margin-left: 0.25rem;
  cursor: pointer;
}

.task-list-item-checkbox[checked] {
  accent-color: var(--link-color);
}

/* Footnotes */
.footnotes {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footnotes-sep {
  display: none;
}

.footnotes ol {
  padding-left: 1.5rem;
}

.footnote-ref {
  text-decoration: none;
  font-weight: 600;
}

.footnote-ref a {
  color: var(--link-color);
  text-decoration: none;
}

.footnote-ref a:hover {
  text-decoration: underline;
}

.footnote-backref {
  text-decoration: none;
  margin-left: 0.25rem;
}

sup.footnote-ref {
  margin-left: 0.125rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Table of Contents */
.toc {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 2rem 0;
}

.toc ul {
  margin-left: 1rem;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 100;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: scale(1.1);
}

.theme-icon::before {
  content: '☀️';
  font-size: 1.5rem;
}

[data-theme='dark'] .theme-icon::before {
  content: '🌙';
}

/* Doc metadata */
.doc-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.doc-author {
  margin-left: 1rem;
}

/* Doc navigation (prev/next) */
.doc-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.nav-prev,
.nav-next {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color 0.2s;
}

.nav-prev:hover,
.nav-next:hover {
  background: var(--bg-tertiary);
}

.nav-next {
  margin-left: auto;
}

/* Home page */
.home-header {
  text-align: center;
  margin-bottom: 3rem;
}

.lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.link-card {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s;
}

.link-card:hover {
  border-color: var(--link-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.link-card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.link-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Chat Widget - Classic Style (Clean & Simple) */
.chat-toggle {
  background: var(--link-color);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chat-toggle:hover {
  background: var(--link-hover);
}

.chat-container {
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.chat-header {
  background: var(--link-color);
  border-radius: 0.5rem 0.5rem 0 0;
}

.chat-message.user .message-content {
  background: var(--link-color);
}

/* Dark mode chat styling */
[data-theme='dark'] .chat-container {
  background: #1f2937;
  border-color: #374151;
}

[data-theme='dark'] .chat-messages {
  background: #1f2937;
}

[data-theme='dark'] .chat-message.assistant .message-content {
  background: #374151;
  color: #f3f4f6;
}

[data-theme='dark'] .chat-input-container {
  background: #111827;
  border-top-color: #374151;
}

[data-theme='dark'] .chat-input {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .layout {
    flex-direction: column;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}


/* usr-wwelsh docs — paper/ink editorial theme, matching wwel.sh portfolio.
   Appended after bundle.css (see botdocs.config.json "customCss"), so
   same-specificity selectors here win the cascade over the base "classic"
   theme without !important. */

:root {
  --bg-primary: #fbfbf8;
  --bg-secondary: #f5f5f0;
  --bg-tertiary: #efefe8;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b66;
  --text-faint: #9a9a94;
  --border-color: #e3e3dd;
  --border-strong: #cbcbc2;
  --link-color: #1a1a1a;
  --link-hover: #1a1a1a;
  --code-bg: #f5f5f0;
  --content-max-width: 46rem;
}

/* themes.css defines dark values on [data-theme='dark'] and on a
   prefers-color-scheme media query, both at equal specificity to :root.
   Redefine both spots here (same selectors, later in the cascade) so the
   toggle and OS dark mode get this theme's dark palette instead of
   classic's blue-tinted one. */
[data-theme='dark'] {
  --bg-primary: #181815;
  --bg-secondary: #211f1c;
  --bg-tertiary: #2b2925;
  --text-primary: #eae7e0;
  --text-secondary: #a8a49a;
  --border-color: #34322c;
  --border-strong: #47443c;
  --link-color: #eae7e0;
  --link-hover: #ffffff;
  --code-bg: #211f1c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg-primary: #181815;
    --bg-secondary: #211f1c;
    --bg-tertiary: #2b2925;
    --text-primary: #eae7e0;
    --text-secondary: #a8a49a;
    --border-color: #34322c;
    --border-strong: #47443c;
    --link-color: #eae7e0;
    --link-hover: #ffffff;
    --code-bg: #211f1c;
  }
}

body {
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  letter-spacing: -0.01em;
}

h1 {
  font-weight: 400;
  letter-spacing: -0.02em;
}

h2, h3, h4 {
  font-weight: 600;
}

p {
  font-size: 1rem;
  line-height: 1.7;
}

a {
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  border-bottom-color: var(--text-primary);
}

/* Nav — underline instead of filled pills */
.nav-list a {
  border-radius: 0;
}

.nav-list a:hover {
  border-bottom: none;
}

.nav-list a.active {
  background: transparent;
  color: var(--text-primary);
  border-left: 2px solid var(--text-primary);
  border-radius: 0;
  padding-left: calc(0.75rem - 2px);
}

/* Code */
code {
  border: 1px solid var(--border-color);
}

/* Fenced code blocks are highlighted by Shiki with themes: {light, dark},
   which inlines style="background-color:...;color:..." straight on <pre>
   and each token <span> — that beats any plain CSS rule, including a
   background/color override here. Shiki also stashes the dark-theme
   colors as --shiki-dark / --shiki-dark-bg custom properties on those
   same elements for exactly this situation: flip to them under dark mode
   with !important, which is the one thing that *does* outrank an inline
   style without !important. */
[data-theme='dark'] .shiki,
[data-theme='dark'] .shiki span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shiki,
  :root:not([data-theme='light']) .shiki span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
  }
}

/* Blockquotes */
blockquote {
  border-left: 2px solid var(--border-strong);
}

/* Callouts — muted accents instead of saturated brand colors */
.markdown-alert-note {
  border-left-color: var(--text-primary);
  background: var(--bg-secondary);
}
.markdown-alert-note .markdown-alert-title { color: var(--text-primary); }

.markdown-alert-tip {
  border-left-color: #42734f;
  background: var(--bg-secondary);
}
.markdown-alert-tip .markdown-alert-title { color: #42734f; }

.markdown-alert-important {
  border-left-color: #6c5a8c;
  background: var(--bg-secondary);
}
.markdown-alert-important .markdown-alert-title { color: #6c5a8c; }

.markdown-alert-warning {
  border-left-color: #96772f;
  background: var(--bg-secondary);
}
.markdown-alert-warning .markdown-alert-title { color: #96772f; }

.markdown-alert-caution {
  border-left-color: #a34c4c;
  background: var(--bg-secondary);
}
.markdown-alert-caution .markdown-alert-title { color: #a34c4c; }

/* themes.css sets its own rgba(...) alert backgrounds under both
   [data-theme='dark'] and the prefers-color-scheme media query at higher
   specificity than a plain .markdown-alert-* rule beats — !important is
   the simplest way to win both without duplicating every selector. */
[data-theme='dark'] .markdown-alert-note,
[data-theme='dark'] .markdown-alert-tip,
[data-theme='dark'] .markdown-alert-important,
[data-theme='dark'] .markdown-alert-warning,
[data-theme='dark'] .markdown-alert-caution,
:root:not([data-theme='light']) .markdown-alert-note,
:root:not([data-theme='light']) .markdown-alert-tip,
:root:not([data-theme='light']) .markdown-alert-important,
:root:not([data-theme='light']) .markdown-alert-warning,
:root:not([data-theme='light']) .markdown-alert-caution {
  background: var(--bg-secondary) !important;
}

/* Tables — bottom rules only, no boxed grid */
th, td {
  border: none;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
}

/* Flatten card/button lift effects */
.link-card {
  transition: border-color 0.15s;
}

.link-card:hover {
  transform: none;
  box-shadow: none;
}

.nav-prev,
.nav-next {
  background: transparent;
  border: 1px solid var(--border-color);
}

.nav-prev:hover,
.nav-next:hover {
  background: transparent;
  border-color: var(--text-primary);
}

.chat-toggle {
  box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2);
}

/* omniMux's README has a raw <div style="...background: #0d1117;">
   callout hardcoded to GitHub's dark palette, which clashes with this
   site's light-mode theme. Inline styles beat external rules on any
   property they set themselves, so background/color need !important here
   to swap in the theme's own palette instead — without touching the
   source repo. */
div[style*="#0d1117"] {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* chat.css paints .ai-disclosure with background: var(--link-color) and
   hardcoded white text. This theme's dark --link-color is near-white, so
   flip the text to the page background to keep contrast in both modes. */
.ai-disclosure {
  color: var(--bg-primary);
}

