.guide-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
.guide-page .topbar {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-bottom: 10px;
}
.guide-page .brand { flex: 1 1 200px; min-width: 0; }
.guide-page .brand .title { line-height: 1.25; }
.guide-page .pills {
  margin-left: auto;
  width: auto;
  flex: 0 1 auto;
  justify-content: flex-end;
}
.guide-main {
  flex: 1;
  padding: 20px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ── Title hero ── */
.guide-title-hero {
  text-align: center;
  padding: 36px 24px 32px;
  margin-bottom: 24px;
  background: linear-gradient(165deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.guide-title-hero .logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.guide-title-hero .logo-wrap img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(56, 189, 248, 0.15));
}
.guide-title-hero .product-name {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.guide-title-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.guide-title-hero .tagline {
  font-size: 16px;
  color: var(--muted);
  margin: 0 auto 20px;
  max-width: 640px;
  line-height: 1.55;
}
.guide-title-hero .lead {
  font-size: 15px;
  color: var(--text);
  margin: 0 auto 24px;
  max-width: 720px;
  line-height: 1.65;
  text-align: left;
}
.guide-title-hero .lead strong { color: var(--accent-2); font-weight: 600; }
.guide-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.guide-cta-row .btn { text-decoration: none; }

/* ── Purpose / capabilities ── */
.guide-purpose {
  margin-bottom: 24px;
}
.guide-purpose h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 600;
}
.guide-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.guide-cap {
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.guide-cap h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--accent-2);
}
.guide-cap p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.guide-cap ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.guide-cap ul li { margin: 4px 0; }

.guide-audience {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  border: 1px solid var(--border);
  border-left-width: 3px;
}
.guide-audience p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.guide-audience strong { color: var(--text); }

.guide-section-divider {
  margin: 28px 0 20px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.guide-section-divider h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.guide-section-divider p { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

.guide-hero { margin-bottom: 20px; }
.guide-hero h1 { margin: 0 0 12px; font-size: 22px; font-weight: 700; }
.guide-hero p { margin: 0 0 16px; line-height: 1.6; color: var(--muted); max-width: 720px; }
.guide-hero strong { color: var(--text); }
.guide-cta { display: inline-block; text-decoration: none; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.guide-section h2 { margin-bottom: 10px; }
.guide-intro { margin: 0 0 14px; font-size: 13px; }
.guide-links { list-style: none; margin: 0; padding: 0; }
.guide-links li { margin: 6px 0; }
.guide-links a { color: var(--accent-2); text-decoration: none; font-size: 13px; }
.guide-links a:hover { color: var(--accent); text-decoration: underline; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tech-link {
  display: block; padding: 9px 12px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 12.5px;
  transition: border-color .15s;
}
.tech-link:hover { border-color: var(--accent); color: var(--accent); }

/* API docs landing */
.api-docs-page .guide-title-hero { margin-bottom: 28px; }
.api-docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 720px;
  margin: 0 auto 32px;
}
.api-docs-card {
  padding: 24px;
  text-align: center;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .1s;
}
.api-docs-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.api-docs-card h2 { margin: 0 0 8px; font-size: 18px; color: var(--accent-2); }
.api-docs-card p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.api-docs-card .btn { pointer-events: none; }

@media (max-width: 767px) {
  .guide-page .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .guide-page .pills {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .guide-main {
    padding: 14px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .guide-title-hero { padding: 24px 16px 20px; }
  .guide-title-hero .logo-wrap img { width: 64px; height: 64px; }
  .api-docs-cards { grid-template-columns: 1fr; max-width: none; }
  .guide-grid { grid-template-columns: 1fr; }
  .viewer-intro-bar { font-size: 12px; gap: 8px; }
  .viewer-intro-bar a { margin-left: 0; width: 100%; }
  .guide-page .site-footer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

/* Docs viewer */
.viewer-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
.viewer-intro-bar {
  display: flex; align-items: center; gap: 14px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 12px max(18px, env(safe-area-inset-left, 0px));
  background: var(--panel-2); border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
  flex-wrap: wrap;
}
.viewer-intro-bar img { width: 32px; height: 32px; }
.viewer-intro-bar strong { color: var(--text); }
.viewer-intro-bar a { color: var(--accent-2); text-decoration: none; margin-left: auto; white-space: nowrap; }
.viewer-intro-bar a:hover { color: var(--accent); }
.viewer-toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-wrap: wrap;
}
.viewer-toolbar a { color: var(--accent-2); text-decoration: none; font-size: 13px; }
.viewer-toolbar a:hover { color: var(--accent); }
.viewer-toolbar .doc-title { font-weight: 600; font-size: 14px; margin-left: 8px; }
.viewer-content {
  flex: 1; max-width: 860px; margin: 0 auto;
  padding: 28px max(24px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  width: 100%;
  line-height: 1.65; font-size: 15px;
  box-sizing: border-box;
}
.viewer-content h1, .viewer-content h2, .viewer-content h3 { margin-top: 1.4em; margin-bottom: .6em; }
.viewer-content h1 { font-size: 1.75em; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.viewer-content h2 { font-size: 1.35em; }
.viewer-content code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: 2px 6px; border-radius: 4px; }
.viewer-content pre { background: #05080f; border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; }
.viewer-content pre code { background: none; padding: 0; }
.viewer-content table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 13px; }
.viewer-content th, .viewer-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.viewer-content th { background: var(--panel-2); }
.viewer-content a { color: var(--accent-2); }
.viewer-content blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding-left: 16px; color: var(--muted); }
.viewer-error { color: var(--critical); padding: 24px; text-align: center; }
