:root {
  --bg: #0b1020;
  --panel: #111831;
  --panel-2: #0f162d;
  --line: #263252;
  --text: #f7f9ff;
  --text-2: #c8d0e7;
  --muted: #8f9bb9;
  --brand: #3da9fc;
  --brand-2: #66c2ff;
  --ok: #16a34a;
  --warn: #f59e0b;
  --info: #2563eb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top right, #1b2750, var(--bg) 45%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.docs-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 120px), var(--panel-2);
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1rem 1rem .8rem;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #00122a;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.brand h1 {
  margin: 0;
  font-size: .95rem;
  line-height: 1.2;
}

.brand p {
  margin: 0;
  font-size: .76rem;
  color: var(--muted);
}

.search-wrap {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.search-wrap input {
  width: 100%;
  background: #0c1328;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: .68rem .75rem;
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.18);
}

.nav-group {
  padding: .75rem .75rem .35rem;
}

.nav-group h3 {
  margin: .3rem .45rem;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.nav-link {
  display: block;
  margin: .18rem 0;
  padding: .52rem .55rem;
  border-radius: 8px;
  color: var(--text-2);
  font-size: .88rem;
}

.nav-link:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.nav-link.active {
  background: rgba(61, 169, 252, .17);
  color: #dff2ff;
  border: 1px solid rgba(61, 169, 252, .45);
}

.content {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
  background: rgba(11, 16, 32, 0.78);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.2rem;
}

.breadcrumb {
  color: var(--muted);
  font-size: .83rem;
}

.top-actions {
  display: flex;
  gap: .6rem;
  align-items: center;
}

.btn {
  border: 1px solid var(--line);
  background: #121b36;
  color: var(--text-2);
  border-radius: 8px;
  font-size: .82rem;
  padding: .45rem .65rem;
  cursor: pointer;
}

.btn:hover { color: var(--text); }

.doc {
  max-width: 920px;
  padding: 1.3rem 1.4rem 4rem;
}

.doc h1 {
  margin: 1rem 0 .8rem;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  line-height: 1.2;
}

.doc h2 {
  margin-top: 1.5rem;
  font-size: 1.15rem;
  color: #ebf2ff;
}

.doc p,
.doc li {
  color: var(--text-2);
  line-height: 1.7;
}

.doc ul,
.doc ol { padding-left: 1.1rem; }

.doc code {
  background: #0e1630;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .07rem .35rem;
}

.callout {
  border: 1px solid var(--line);
  border-left-width: 4px;
  padding: .8rem .9rem;
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  margin: 1rem 0;
}

.callout.info { border-left-color: var(--info); }
.callout.warn { border-left-color: var(--warn); }
.callout.success { border-left-color: var(--ok); }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin-top: .6rem;
}

.card-link {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111b38;
  padding: .75rem .85rem;
  color: #d8e4ff;
  font-weight: 600;
}

.card-link:hover { border-color: var(--brand); }

.doc-footer-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: .8rem;
}

.doc-footer-nav a {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  min-width: 180px;
  background: #111a35;
}

.doc-footer-nav small { color: var(--muted); display: block; }

.mobile-toggle {
  display: none;
}

@media (max-width: 980px) {
  .docs-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 340px);
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 20;
  }

  .sidebar.open { transform: translateX(0); }

  .mobile-toggle {
    display: inline-flex;
  }
}
