/* TaskSultan documentation.
   Dark by default to match the product site, with a light theme when the reader's system asks for one.
   Layout: fixed top bar, a persistent sidebar, a prose column, and a table of contents rail on wide screens. */

:root {
  --bg: #020617;
  --bg-raised: #0b1220;
  --bg-panel: #0f172a;
  --border: #1e293b;
  --border-soft: #16233a;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --code-bg: #0b1220;
  --ok: #34d399;
  --warn: #fbbf24;
  --sidebar-w: 268px;
  --toc-w: 232px;
  --maxw: 780px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-raised: #f8fafc;
    --bg-panel: #f1f5f9;
    --border: #e2e8f0;
    --border-soft: #eef2f7;
    --text: #0f172a;
    --text-dim: #475569;
    --text-faint: #64748b;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --code-bg: #f8fafc;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--accent-strong);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand-name span:first-child { color: var(--text); }
.brand-accent { color: var(--accent); }
.brand-docs {
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search { position: relative; margin-left: auto; width: min(420px, 40vw); }
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 14px;
}
.search input:focus { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.search input::placeholder { color: var(--text-faint); }

.search-results {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.search-results a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a:focus { background: var(--bg-raised); }
.search-results .r-title { font-weight: 600; font-size: 14px; }
.search-results .r-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.search-results .r-snippet { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.search-results .r-snippet mark { background: transparent; color: var(--accent); font-weight: 600; }
.search-results .r-empty { padding: 12px 14px; color: var(--text-dim); font-size: 14px; }

.topbar-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.topbar-link:hover { color: var(--text); }

.menu-toggle { display: none; }

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 56px 24px 0;
}

.sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 26px 12px 60px 4px;
  font-size: 14px;
}

.nav-group { margin-bottom: 22px; }
.nav-group-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  line-height: 1.4;
}
.sidebar li a:hover { color: var(--text); background: var(--bg-raised); }
.sidebar li a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-weight: 600;
}

main {
  min-width: 0;
  max-width: var(--maxw);
  padding: 10px 0 80px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 28px;
  font-size: 17px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
}

.toc-rail {
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 34px 0 60px;
  font-size: 13px;
}
.toc-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
  display: block;
  padding: 3px 0 3px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-dim);
  text-decoration: none;
}
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }

/* ---------- prose ---------- */

.prose { font-size: 16px; }
.prose > *:first-child { margin-top: 0; }

.prose h2 {
  margin: 44px 0 14px;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding-top: 8px;
}
.prose h3 { margin: 30px 0 10px; font-size: 18px; }
.prose h4 { margin: 24px 0 8px; font-size: 16px; }

.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin: 5px 0; }
.prose li > p { margin: 0 0 8px; }

.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }

.prose strong { color: var(--text); font-weight: 650; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.prose pre {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 13.5px; }

.prose blockquote {
  margin: 0 0 20px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent-strong);
  color: var(--text-dim);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14.5px;
}
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); font-weight: 650; background: var(--bg-raised); }
.prose td { color: var(--text-dim); }

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }

.anchor {
  float: left;
  margin-left: -0.9em;
  padding-right: 0.35em;
  color: var(--text-faint);
  text-decoration: none;
  border: 0;
  opacity: 0;
  font-weight: 400;
}
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }

/* ---------- page navigation ---------- */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.page-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.page-nav a:hover { border-color: var(--accent-strong); background: var(--bg-raised); }
.page-nav a.next { text-align: right; }
.page-nav span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.page-nav strong { font-weight: 600; font-size: 14.5px; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc-rail { display: none; }
}

@media (max-width: 900px) {
  .search { width: auto; flex: 1; }
  .topbar-link { display: none; }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 0 7px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; background: var(--text-dim); }
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 56px 18px 0; }
  .sidebar {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: var(--bg);
    padding: 20px 18px 60px;
    border-right: 0;
  }
  .sidebar.open { display: block; }
  main { max-width: none; }
  h1 { font-size: 28px; }
}
