/* SiroPing Docs — first-class documentation surface.
   Tokens mirror the app (blue primary, slate text, navy dark). No AI-style decoration. */

:root {
  --docs-bg: #ffffff;
  --docs-bg-soft: #f7f9fc;
  --docs-text: #0f172a;
  --docs-text-muted: #64748b;
  --docs-border: #e2e8f0;
  --docs-primary: #2563eb;
  --docs-primary-strong: #1d4ed8;
  --docs-topbar-bg: #ffffff;
  --docs-code-bg: #0f172a;
  --docs-code-text: #e2e8f0;
  --docs-sidebar-hover: #f1f5f9;
  --docs-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
body.dark {
  --docs-bg: #0f172a;
  --docs-bg-soft: #1e293b;
  --docs-text: #e2e8f0;
  --docs-text-muted: #94a3b8;
  --docs-border: #1e293b;
  --docs-primary: #3b82f6;
  --docs-primary-strong: #60a5fa;
  --docs-topbar-bg: #0f172a;
  --docs-code-bg: #020617;
  --docs-code-text: #e2e8f0;
  --docs-sidebar-hover: #1e293b;
  --docs-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--docs-bg);
  color: var(--docs-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--docs-primary); text-decoration: none; }
a:hover { color: var(--docs-primary-strong); }
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--docs-primary); color: #fff; padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- topbar ---------- */
.docs-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--docs-topbar-bg);
  border-bottom: 1px solid var(--docs-border);
}
.docs-topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 20px;
}
.docs-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--docs-text); }
.docs-brand-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.docs-nav { display: flex; gap: 18px; margin-left: 8px; }
.docs-nav a { color: var(--docs-text-muted); font-size: 14px; font-weight: 500; }
.docs-nav a:hover, .docs-nav a.is-active { color: var(--docs-text); }
.docs-nav a.is-active { font-weight: 600; }
.docs-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.docs-search-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--docs-border); border-radius: 8px;
  background: var(--docs-bg-soft); color: var(--docs-text-muted);
  padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.docs-search-trigger span { min-width: 92px; text-align: left; }
kbd {
  font-family: inherit; font-size: 11px; padding: 1px 6px;
  border: 1px solid var(--docs-border); border-radius: 5px; color: var(--docs-text-muted); background: var(--docs-bg);
}
.docs-dark-toggle, .docs-drawer-toggle {
  border: 1px solid var(--docs-border); background: transparent; color: var(--docs-text-muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.docs-open-app {
  border: 1px solid var(--docs-border); border-radius: 8px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--docs-text);
}
.docs-drawer-toggle { display: none; }
body.dark .docs-dark-toggle i.fa-moon::before { content: "\f185"; }

/* ---------- layout ---------- */
.docs-layout {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 200px; gap: 40px;
}
.docs-sidebar { padding: 28px 0 48px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.docs-main { padding: 28px 0 64px; min-width: 0; }
.docs-toc-col { padding: 28px 0 48px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }

/* ---------- sidebar ---------- */
.docs-sidebar-section { margin-bottom: 22px; }
.docs-sidebar-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--docs-text-muted); margin-bottom: 8px;
}
.docs-sidebar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-sidebar-link {
  display: block; padding: 5px 10px; border-radius: 6px;
  font-size: 13.5px; color: var(--docs-text-muted); font-weight: 500;
}
.docs-sidebar-link:hover { background: var(--docs-sidebar-hover); color: var(--docs-text); }
.docs-sidebar-link.is-active { background: rgba(37, 99, 235, 0.1); color: var(--docs-primary); font-weight: 600; }

/* ---------- article typography ---------- */
.docs-article { max-width: 760px; }
.docs-article-header { margin-bottom: 28px; }
.docs-edition-badge {
  display: inline-block; margin-bottom: 14px;
  font-size: 12px; font-weight: 600; color: var(--docs-primary);
  border: 1px solid currentColor; border-radius: 999px; padding: 3px 11px;
}
.docs-article h1 { font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.docs-article-description { font-size: 18px; color: var(--docs-text-muted); margin: 0; }

.docs-article-body { font-size: 16px; line-height: 1.7; color: var(--docs-text); }
.docs-article-body h2 { font-size: 26px; font-weight: 700; margin: 40px 0 14px; letter-spacing: -0.01em; scroll-margin-top: 76px; }
.docs-article-body h3 { font-size: 19px; font-weight: 700; margin: 30px 0 10px; scroll-margin-top: 76px; }
.docs-article-body p { margin: 0 0 16px; }
.docs-article-body ul, .docs-article-body ol { margin: 0 0 16px; padding-left: 22px; }
.docs-article-body li { margin-bottom: 6px; }
.docs-article-body strong { font-weight: 650; }
.docs-article-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.875em; background: var(--docs-bg-soft); border: 1px solid var(--docs-border);
  border-radius: 5px; padding: 1px 6px;
}

/* ---------- code blocks ---------- */
.docs-article-body pre {
  margin: 0 0 20px; border-radius: 10px; overflow: hidden;
  background: var(--docs-code-bg); color: var(--docs-code-text);
  font-size: 13.5px; line-height: 1.65;
}
.docs-codebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px; color: #94a3b8;
}
.docs-copy {
  border: none; background: rgba(255, 255, 255, 0.08); color: #cbd5e1;
  border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.docs-copy:hover { background: rgba(255, 255, 255, 0.16); }
.docs-copy.copied { color: #4ade80; }
.docs-article-body pre code {
  display: block; padding: 16px; background: transparent; border: none; font-size: inherit; color: inherit;
  overflow-x: auto; white-space: pre;
}

/* ---------- tables ---------- */
.docs-article-body table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; }
.docs-article-body th, .docs-article-body td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--docs-border);
}
.docs-article-body th { font-weight: 600; background: var(--docs-bg-soft); }
.docs-article-body tr:last-child td { border-bottom: none; }

/* ---------- callouts ---------- */
.docs-article-body .callout {
  border-radius: 10px; padding: 14px 16px; margin: 0 0 20px;
  border: 1px solid; font-size: 14.5px;
}
.docs-article-body .callout-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.docs-article-body .callout h4 { margin: 0 0 4px; font-size: 15px; }
.callout-note { background: rgba(59, 130, 246, 0.07); border-color: rgba(59, 130, 246, 0.35); }
.callout-note .callout-title { color: #3b82f6; }
.callout-tip { background: rgba(16, 185, 129, 0.07); border-color: rgba(16, 185, 129, 0.35); }
.callout-tip .callout-title { color: #10b981; }
.callout-warning { background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.4); }
.callout-warning .callout-title { color: #f59e0b; }
.callout-important { background: rgba(239, 68, 68, 0.07); border-color: rgba(239, 68, 68, 0.4); }
.callout-important .callout-title { color: #ef4444; }

/* ---------- prev / next ---------- */
.docs-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--docs-border); }
.docs-prevnext-link {
  display: block; border: 1px solid var(--docs-border); border-radius: 10px;
  padding: 12px 16px; color: var(--docs-text); transition: border-color 0.15s;
}
.docs-prevnext-link:hover { border-color: var(--docs-primary); }
.docs-prevnext-label { display: block; font-size: 12px; color: var(--docs-text-muted); margin-bottom: 4px; }
.docs-prevnext-title { font-size: 14px; font-weight: 600; }
.docs-prevnext-next { text-align: right; }

/* ---------- feedback ---------- */
.docs-feedback { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 13.5px; color: var(--docs-text-muted); }
.docs-feedback button {
  border: 1px solid var(--docs-border); border-radius: 8px; background: var(--docs-bg);
  color: var(--docs-text); padding: 5px 14px; cursor: pointer; font-size: 13px;
}
.docs-feedback button:hover { border-color: var(--docs-primary); color: var(--docs-primary); }
.docs-feedback-thanks { color: #10b981; }

/* ---------- TOC ---------- */
.docs-toc-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--docs-text-muted); margin-bottom: 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-toc a { font-size: 13px; color: var(--docs-text-muted); padding: 4px 8px; border-radius: 6px; display: block; }
.docs-toc a:hover { color: var(--docs-text); background: var(--docs-sidebar-hover); }
.docs-toc-l2 { padding-left: 0; }
.docs-toc-l3 { padding-left: 14px; }
.docs-toc-mobile, .docs-toc-dropdown { display: none; }

/* ---------- home ---------- */
.docs-home { max-width: 760px; padding-top: 16px; }
.docs-home-title { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.docs-home-sub { font-size: 18px; color: var(--docs-text-muted); margin: 0 0 26px; }
.docs-home-search {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--docs-border); border-radius: 12px; background: var(--docs-bg-soft);
  padding: 14px 18px; font-size: 15px; color: var(--docs-text-muted); cursor: pointer; margin-bottom: 40px;
}
.docs-home-search:hover { border-color: var(--docs-primary); }
.docs-home-search span { flex: 1; text-align: left; }
.docs-home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }
.docs-home-card { border: 1px solid var(--docs-border); border-radius: 12px; padding: 20px; }
.docs-home-card h2 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.docs-home-card p { font-size: 14px; color: var(--docs-text-muted); margin: 0 0 12px; }
.docs-home-card ul { list-style: none; margin: 0; padding: 0; }
.docs-home-card li { margin-bottom: 6px; }
.docs-home-card a { font-size: 14px; font-weight: 500; }
.docs-home-popular h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.docs-home-popular ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.docs-home-popular a { font-size: 14px; font-weight: 500; }

/* ---------- search modal ---------- */
.docs-search-modal {
  position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center;
  background: rgba(15, 23, 42, 0.5); padding: 12vh 16px 16px;
}
.docs-search-modal.is-open { display: flex; }
.docs-search-shell {
  width: 100%; max-width: 620px; background: var(--docs-bg);
  border: 1px solid var(--docs-border); border-radius: 14px; box-shadow: var(--docs-shadow); overflow: hidden;
}
.docs-search-input-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--docs-border);
}
.docs-search-input-row i { color: var(--docs-text-muted); }
.docs-search-input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; color: var(--docs-text); }
.docs-search-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.docs-search-empty { padding: 20px; text-align: center; color: var(--docs-text-muted); font-size: 14px; }
.docs-search-item { display: block; padding: 10px 12px; border-radius: 8px; }
.docs-search-item:hover, .docs-search-item.is-selected { background: var(--docs-sidebar-hover); }
.docs-search-item-title { font-size: 14.5px; font-weight: 600; color: var(--docs-text); }
.docs-search-item-meta { font-size: 12.5px; color: var(--docs-text-muted); margin-top: 2px; }
.docs-search-item-group { color: var(--docs-primary); font-size: 12px; font-weight: 600; }

/* ---------- drawer / scrim ---------- */
.docs-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 60; display: none; }
.docs-scrim.is-open { display: block; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .docs-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
  .docs-toc-col { display: none; }
}
@media (max-width: 820px) {
  .docs-layout { grid-template-columns: 1fr; padding: 0 16px; }
  .docs-sidebar {
    position: fixed; inset: 56px auto 0 0; width: 280px; max-width: 85vw; z-index: 70;
    background: var(--docs-bg); border-right: 1px solid var(--docs-border);
    transform: translateX(-105%); transition: transform 0.2s ease; box-shadow: var(--docs-shadow);
  }
  .docs-sidebar.is-open { transform: translateX(0); }
  .docs-nav { display: none; }
  .docs-search-trigger span, .docs-search-trigger kbd { display: none; }
  .docs-drawer-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .docs-open-app { display: none; }
  .docs-article { max-width: 100%; }
  .docs-article h1 { font-size: 30px; }
  .docs-home-title { font-size: 32px; }
  .docs-home-cards { grid-template-columns: 1fr; }
  .docs-home-popular ul { grid-template-columns: 1fr; }
  .docs-prevnext { grid-template-columns: 1fr; }
  .docs-prevnext-next { text-align: left; }
  /* mobile TOC dropdown */
  .docs-toc-mobile {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--docs-border); border-radius: 9px;
    background: var(--docs-bg-soft); color: var(--docs-text); font-size: 13.5px; font-weight: 600; cursor: pointer;
  }
  .docs-toc-dropdown { display: none; margin: 0 0 20px; border: 1px solid var(--docs-border); border-radius: 9px; padding: 8px; }
  .docs-toc-dropdown.is-open { display: block; }
  .docs-toc-dropdown ul { list-style: none; margin: 0; padding: 0; }
  .docs-toc-dropdown a { display: block; padding: 7px 10px; font-size: 14px; color: var(--docs-text-muted); border-radius: 6px; }
  .docs-toc-dropdown a:hover { background: var(--docs-sidebar-hover); color: var(--docs-text); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
