@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #1d1d1d;
  --bg-subtle: #222223;
  --bg-muted: #2b2c2d;
  --bg-hover: #2f3031;
  --bg-active: #343536;
  --border-subtle: #383a3c;
  --border-default: #424446;
  --text-primary: #feffff;
  --text-secondary: #bec0c5;
  --text-muted: #7f8590;
  --primary: #346ddb;
  --primary-hover: #508bfc;
  --primary-subtle: rgba(52,109,219,0.15);
  --primary-bg: rgba(52,109,219,0.08);
  --success: #00c950;
  --success-bg: rgba(0,201,80,0.08);
  --success-border: rgba(0,201,80,0.2);
  --success-text: #9bd0a1;
  --warning: #fe9a00;
  --warning-bg: rgba(254,154,0,0.08);
  --warning-border: rgba(254,154,0,0.2);
  --warning-text: #e0b891;
  --danger: #fb2c36;
  --danger-bg: rgba(251,44,54,0.08);
  --danger-border: rgba(251,44,54,0.2);
  --danger-text: #f8a8a1;
  --info: #787878;
  --info-bg: rgba(120,120,120,0.08);
  --info-border: rgba(120,120,120,0.25);
  --info-text: #c0c0c0;
  --header-bg: #346ddb;
  --sidebar-width: 280px;
  --header-height: 64px;
  --content-max-width: 768px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-hover);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--text-primary); }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  background: rgba(29,29,29,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(254,255,255,0.06);
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--header-bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  overflow: hidden;
}
.header-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.header-logo-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.header-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}
.header-links a:hover { color: var(--text-primary); }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  margin-left: -0.5rem;
}
.menu-toggle svg { display: block; }

/* ── Layout ── */
.site-layout {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  padding: 0 2rem;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  overflow-y: auto;
  padding: 1.5rem 0 2rem 0;
  margin-right: 3rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 2px; }

.nav-group { margin-bottom: 0.25rem; }
.nav-group-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 1.25rem 0.75rem 0.5rem;
}
.nav-group:first-child .nav-group-title { padding-top: 0.25rem; }
.nav-link {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: rgba(254,255,255,0.55);
  border-radius: var(--radius-md);
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.4;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-link.active {
  background: var(--primary-subtle);
  color: var(--primary-hover);
  font-weight: 600;
  position: relative;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--primary);
  border-radius: 1px;
}
.nav-child { padding-left: 0.75rem; }
.nav-child .nav-link { font-size: 0.8125rem; padding: 0.3rem 0.75rem; }

/* ── Main Content ── */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max-width);
  padding: 2rem 0 4rem;
}

.page-header { margin-bottom: 2rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--primary-hover); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; }

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.page-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Content Typography ── */
.content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.content h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

.content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.content p { margin: 0.75rem 0; }
.content p + p { margin-top: 0.5rem; }

.content strong { color: var(--text-primary); font-weight: 600; }

.content ul, .content ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}
.content li { margin: 0.35rem 0; }
.content li::marker { color: var(--text-muted); }

/* ── Hint/Callout Boxes ── */
.hint {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.hint-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.hint-content { flex: 1; min-width: 0; }
.hint-content p { margin: 0.25rem 0; }
.hint-content p:first-child { margin-top: 0; }
.hint-content a { text-decoration: underline; text-underline-offset: 2px; }
.hint-content ul, .hint-content ol { margin: 0.5rem 0; padding-left: 1.25rem; }

.hint.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}
.hint.success .hint-icon { color: var(--success); }
.hint.success a { color: var(--success); }

.hint.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}
.hint.warning .hint-icon { color: var(--warning); }
.hint.warning a { color: var(--warning); }

.hint.danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}
.hint.danger .hint-icon { color: var(--danger); }
.hint.danger a { color: var(--danger); }

.hint.info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-text);
}
.hint.info .hint-icon { color: var(--info); }
.hint.info a { color: var(--info-text); }

/* ── Code ── */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--bg-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--text-secondary);
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead { background: var(--bg-muted); }
th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-subtle);
}
td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--bg-hover); }
td strong { color: var(--text-primary); }

/* ── Figure / Images ── */
figure {
  margin: 1.5rem 0;
  text-align: center;
}
figure img {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}
.content img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* ── Content Reference Cards ── */
.content-ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 0.75rem 0;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-secondary);
}
.content-ref:hover {
  border-color: var(--primary);
  color: var(--primary-hover);
}
.content-ref-title { font-size: 0.95rem; }
.content-ref-arrow {
  color: var(--text-muted);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}
.content-ref:hover .content-ref-arrow {
  transform: translateX(3px);
  color: var(--primary-hover);
}

/* ── Page Navigation (Prev/Next) ── */
.page-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
}
.page-nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.2s;
}
.page-nav-link:hover { border-color: var(--primary); }
.page-nav-link .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}
.page-nav-link .title {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.3;
}
.page-nav-link:hover .title { color: var(--primary-hover); }
.page-nav-link.next { justify-content: flex-end; text-align: right; }
.page-nav-link .arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.75rem;
}

/* ── Footer ── */
.page-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Numbered Steps ── */
.steps { counter-reset: step; }
.step {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin: 1.25rem 0;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary-subtle);
  color: var(--primary-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── PRO Badge ── */
.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #346ddb, #508bfc);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ── Resolved / Since-version Badge ── */
.resolved-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #1f7a3a, #2eaa55);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.resolved-badge a {
  color: inherit;
  text-decoration: none;
}
.resolved-badge a:hover {
  text-decoration: underline;
}

/* ── Flow Diagram ── */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.flow-step {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-weight: 500;
}
.flow-arrow { color: var(--text-muted); font-size: 1.25rem; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 40;
    background: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: calc(var(--header-height) + 1rem);
    margin-right: 0;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: block; }
  .site-layout { padding: 0 1rem; }
  .header-inner { padding: 0 1rem; }
  .header-links { gap: 1rem; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.65rem; }
  .content h2 { font-size: 1.3rem; }
  .content h3 { font-size: 1.1rem; }
  .header-links .hide-mobile { display: none; }
  .page-nav { flex-direction: column; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  .header-logo-text { font-size: 0.9rem; }
}

/* ── Horizontal Rule ── */
.content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2rem 0;
}

/* ── Anchor Hash Links ── */
.content h2[id], .content h3[id], .content h4[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}
.heading-anchor {
  color: var(--text-muted);
  opacity: 0;
  margin-left: 0.35em;
  font-weight: 400;
  transition: opacity 0.15s;
  text-decoration: none;
}
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor { opacity: 1; }

/* ── Search (placeholder styling) ── */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.4rem 0.75rem;
  gap: 0.5rem;
  min-width: 180px;
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  outline: none;
  width: 100%;
  font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); opacity: 0.6; }
.search-box kbd {
  font-family: inherit;
  font-size: 0.6875rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

/* ── Powered By ── */
.powered-by {
  margin-top: auto;
  padding: 1rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.powered-by a {
  color: var(--text-muted);
  text-decoration: none;
}
.powered-by a:hover { color: var(--text-secondary); }


/* ────────────────────────────────────────────────────────────────────────
   Mobile header — clean pattern (Brandon fix 2026-05-19)
   At ≤768px: ONLY hamburger + logo icon + ONE primary CTA visible.
   Other links live INSIDE the hamburger drawer (sidebar-cta section).
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-logo-text { display: none !important; }
    .header-links { gap: 0.5rem; }
    .header-links > a:not(.header-buy),
    .header-links > button:not(.header-buy) { display: none !important; }
    .header-links a.header-buy {
        display: inline-flex !important;
        align-items: center;
        padding: 0.4rem 0.85rem;
        background: var(--primary);
        color: #fff !important;
        font-size: 0.8rem;
        font-weight: 600;
        border-radius: var(--radius-md);
        white-space: nowrap;
        text-decoration: none;
    }
    .header-links a.header-buy:hover { background: var(--primary-hover); color: #fff !important; }
}

/* Drawer CTA section — appears INSIDE the sidebar drawer, below the nav */
.sidebar-cta { display: none; }
@media (max-width: 1024px) {
    .sidebar-cta {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0.75rem 1.5rem;
        margin-top: 1.5rem;
        border-top: 1px solid var(--border-subtle);
    }
    .sidebar-cta-label {
        font-size: 0.6875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        padding: 0 0.25rem 0.5rem;
    }
    .sidebar-cta a, .sidebar-cta button {
        display: block;
        padding: 0.65rem 1rem;
        text-align: center;
        border-radius: var(--radius-md);
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.15s;
        border: none;
        cursor: pointer;
        font-family: inherit;
        width: 100%;
    }
    .sidebar-cta .cta-primary { background: var(--primary); color: #fff; font-weight: 600; }
    .sidebar-cta .cta-primary:hover { background: var(--primary-hover); color: #fff; }
    .sidebar-cta .cta-secondary {
        background: var(--bg-subtle);
        color: var(--text-primary);
        border: 1px solid var(--border-subtle);
    }
    .sidebar-cta .cta-secondary:hover { border-color: var(--primary); color: var(--primary-hover); }
    .sidebar-cta .cta-tertiary { background: transparent; color: var(--text-muted); font-size: 0.8rem; }
    .sidebar-cta .cta-tertiary:hover { color: var(--text-primary); }
}


/* gp-docs: page-header contextual menu */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.page-header-main {
    flex: 1;
    min-width: 0;
}
