/**
 * Documentoved Design System
 * Layer: Base (global resets, typography, foundational elements)
 *
 * Depends on: design-tokens.css
 */

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

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-md);
  line-height: var(--ds-line-height-normal);
  color: var(--ds-color-text-primary);
  letter-spacing: var(--ds-letter-spacing-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* shell takes over */
}

/* Typography scale using tokens */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--ds-font-weight-semibold);
  line-height: var(--ds-line-height-tight);
  margin: 0 0 var(--ds-space-3);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* Utility */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #b8c4d1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #93a4b7;
}

/* Material Symbols icon font */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/material-symbols-rounded.ttf') format('truetype');
}

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.material-symbols-rounded--sm { font-size: 16px; }
.material-symbols-rounded--md { font-size: 18px; }

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--ds-color-accent);
  outline-offset: 2px;
  border-radius: var(--ds-radius-sm);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Base prose styles (used inside assistant messages) */
.prose {
  max-width: none;
  color: var(--ds-color-text-secondary);
  font-size: var(--ds-font-size-md);
  line-height: var(--ds-line-height-relaxed);
}

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p { margin: 0 0 0.85em; }
.prose ul { list-style: disc; padding-left: 1.4em; margin-bottom: 0.85em; }
.prose ol { list-style: decimal; padding-left: 1.4em; margin-bottom: 0.85em; }
.prose h1 { font-size: 1.35em; font-weight: var(--ds-font-weight-bold); margin: 1em 0 0.6em; }
.prose h2 { font-size: 1.2em; font-weight: var(--ds-font-weight-bold); margin: 1em 0 0.6em; }
.prose h3 { font-size: 1.05em; font-weight: var(--ds-font-weight-semibold); margin: 1em 0 0.6em; }

.prose pre {
  background: #f2f5f9;
  color: #1e293b;
  padding: var(--ds-space-4);
  border-radius: var(--ds-radius-md);
  overflow: auto;
  margin: 1em 0;
  border: 1px solid var(--ds-color-line);
}

.prose code {
  background: var(--ds-color-accent-soft);
  color: var(--ds-color-accent);
  padding: 0.1em 0.35em;
  border-radius: var(--ds-radius-xs);
  font-size: 0.9em;
  font-family: var(--ds-font-mono);
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.prose blockquote {
  border-left: 3px solid var(--ds-color-accent);
  padding-left: var(--ds-space-3);
  color: var(--ds-color-text-muted);
  margin: 1em 0;
}
