:root {
  --bg: #ffffff;
  --text: #1a1a2e;
  --surface: #f8f9fa;
  --border: #e0e0e0;
  --accent: #6366f1;
  --code-bg: #f5f5f5;
}
[data-theme="dark"] {
  --bg: #0f0f1a;
  --text: #e8e8f0;
  --surface: #1a1a2e;
  --border: #2a2a3e;
  --accent: #818cf8;
  --code-bg: #1e1e2e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}
.toolbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; gap: 0.5rem; align-items: center;
  padding: 0.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.breadcrumb, #content { padding: 0 2rem; }
@media (min-width: 768px) {
  .breadcrumb, #content { padding: 0 4rem; }
}
@media (min-width: 1200px) {
  .breadcrumb, #content { padding: 0 6rem; }
}
.toolbar button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}
.toolbar button:hover { border-color: var(--accent); }
.breadcrumb { font-size: 0.85rem; opacity: 0.7; margin-bottom: 1rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
#content { padding-bottom: 4rem; }
#content h1, #content h2, #content h3, #content h4, #content h5, #content h6 {
  margin-top: 1.5em; margin-bottom: 0.5em; line-height: 1.3;
}
#content p { margin-bottom: 1em; }
#content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1em;
}
#content code { font-size: 0.9em; }
#content :not(pre) > code {
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 0.2em;
}
#content img { max-width: 100%; border-radius: 0.5rem; }
#content a { color: var(--accent); }
#content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  opacity: 0.85;
  margin-bottom: 1em;
}
#content table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
#content th, #content td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
}
.font-size-display { min-width: 3rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Landing page additions */
.landing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 0 2rem 4rem;
}
@media (min-width: 768px) {
  .landing-grid {
    grid-template-columns: 1fr 1fr;
    padding: 0 4rem 4rem;
  }
}
.tree h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
}
.tree ul { list-style: none; }
.tree li { margin: 0.4rem 0; }
.tree a { color: var(--accent); text-decoration: none; }
.tree a:hover { text-decoration: underline; }
.tree .category {
  margin-top: 1rem;
  font-weight: 600;
  text-transform: lowercase;
  opacity: 0.7;
}

/* Login page */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 80vh; padding: 1rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 24rem;
  width: 100%;
}
.login-card h1 { font-size: 1.2rem; margin-bottom: 1rem; }
.login-card input[type="password"] {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
}
.login-card button {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  cursor: pointer;
}
.login-error { color: #dc2626; font-size: 0.85rem; margin-top: 0.6rem; }
