/* QuikChat site chrome — shared across all pages */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  line-height: 1.6;
  background: #fafafa;
}

/* ── Shared layout width ──────────────────────────────── */
.wrap,
.site-nav-inner,
.site-footer-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Site nav ─────────────────────────────────────────── */
.site-nav {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.92rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-nav .site-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a1a1a;
  text-decoration: none;
  margin-right: 4px;
  letter-spacing: -0.02em;
}
.site-nav .site-version {
  font-size: 0.75rem;
  color: #999;
  margin-left: -16px;
  margin-right: 4px;
  font-weight: 500;
}
.site-nav a {
  color: #555;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: #000;
}

/* ── Layout ───────────────────────────────────────────── */
section { padding: 40px 0; }
section + section { border-top: 1px solid #eaeaea; }

/* ── Typography ───────────────────────────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
h3 { font-size: 1rem; font-weight: 600; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
a { color: #0066cc; text-decoration: none; transition: color 0.15s; }
a:hover { color: #004499; }

/* ── Hero / header ────────────────────────────────────── */
.site-header {
  padding: 28px 0 20px;
}
.site-header .tagline {
  color: #555;
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.5;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}
.btn:hover { background: #f5f5f5; border-color: #bbb; }
.btn:active { background: #eee; }
.btn.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }

/* ── Demo controls row ────────────────────────────────── */
.demo-controls {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.demo-controls .sep {
  width: 1px;
  height: 20px;
  background: #d0d0d0;
  margin: 0 6px;
}

/* ── Demo containers ──────────────────────────────────── */
.demo-row { display: flex; gap: 20px; margin-bottom: 16px; }
.demo-box {
  flex: 1;
  height: 380px;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}
@media (max-width: 640px) { .demo-row { flex-direction: column; } .demo-box { height: 300px; } }

/* ── Code blocks ──────────────────────────────────────── */
pre {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
}
code { font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; }
p code, li code, td code {
  background: #f0f0f2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #c7254e;
}

/* ── Tables ───────────────────────────────────────────── */
.api-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.api-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
}
.api-table td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
.api-table tr:hover td { background: #f8f8fa; }

/* ── Lists ────────────────────────────────────────────── */
.features { columns: 2; column-gap: 32px; margin: 0; padding: 0; list-style: none; }
.features li { padding: 4px 0; break-inside: avoid; }
.features li::before { content: "\2022"; color: #0066cc; margin-right: 8px; font-weight: 700; }
@media (max-width: 560px) { .features { columns: 1; } }

.example-list { list-style: none; padding: 0; margin: 0; }
.example-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.example-list li:last-child { border-bottom: none; }
.example-list a { color: #0066cc; text-decoration: none; font-weight: 500; }
.example-list a:hover { color: #004499; }
.example-list .desc { color: #777; font-size: 0.88rem; }

/* ── Badges ───────────────────────────────────────────── */
.badges { margin-top: 12px; }
.badges img { vertical-align: middle; margin-right: 6px; }
.badges a { display: inline-block; }

/* ── Site footer ──────────────────────────────────────── */
.site-footer {
  border-top: 1px solid #e0e0e0;
  background: #fff;
  margin-top: 32px;
  font-size: 0.82rem;
  color: #999;
}
.site-footer-inner {
  padding-top: 24px;
  padding-bottom: 24px;
}
.site-footer a { color: #666; text-decoration: none; }
.site-footer a:hover { color: #333; }

/* ── Site dark theme ──────────────────────────────────── */
/* Toggle with: document.body.classList.toggle('site-dark') */

.site-dark {
  background: #111;
  color: #d8d8d8;
}

.site-dark .site-nav {
  background: #1a1a1a;
  border-bottom-color: #2a2a2a;
}
.site-dark .site-nav .site-version { color: #666; }
.site-dark .site-nav .site-logo { color: #e0e0e0; }
.site-dark .site-nav a { color: #999; }
.site-dark .site-nav a:hover { color: #fff; }

.site-dark .site-header .tagline { color: #999; }

.site-dark section + section { border-top-color: #222; }

.site-dark a { color: #5ea8d8; }
.site-dark a:hover { color: #7cbce8; }

.site-dark .btn {
  background: #1e1e1e;
  color: #ccc;
  border-color: #3a3a3a;
}
.site-dark .btn:hover { background: #2a2a2a; border-color: #555; }
.site-dark .btn:active { background: #333; }
.site-dark .btn.active { background: #e0e0e0; color: #111; border-color: #e0e0e0; }

.site-dark .demo-controls .sep { background: #3a3a3a; }
.site-dark .demo-box { box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2); }

.site-dark pre {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #d0d0d0;
}
.site-dark p code,
.site-dark li code,
.site-dark td code {
  background: #1e1e1e;
  color: #e8a0b0;
}

.site-dark .api-table th { border-bottom-color: #333; color: #888; }
.site-dark .api-table td { border-bottom-color: #1e1e1e; }
.site-dark .api-table tr:hover td { background: #1a1a1a; }

.site-dark .features li::before { color: #5ea8d8; }
.site-dark .example-list li { border-bottom-color: #1e1e1e; }
.site-dark .example-list a { color: #5ea8d8; }
.site-dark .example-list .desc { color: #777; }

.site-dark .site-footer {
  background: #1a1a1a;
  border-top-color: #2a2a2a;
  color: #555;
}
.site-dark .site-footer a { color: #777; }
.site-dark .site-footer a:hover { color: #aaa; }
