/* Shared site header (landing page, docs, agents, policies). Rendered by /js/site-nav.js.
   Self-contained: does not depend on the host page's stylesheet. */

.sn-header, .sn-header * { box-sizing: border-box; }
.sn-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a; line-height: 1.4;
}
.sn-header a { text-decoration: none; color: inherit; }
.sn-header button { font-family: inherit; }
.sn-inner { max-width: 1140px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; justify-content: space-between; }

.sn-brand { display: flex; align-items: center; gap: 10px; }
.sn-brand-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
}
.sn-brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }

.sn-nav { display: flex; align-items: center; gap: 6px; }
.sn-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px; font-size: 14px; font-weight: 500; color: #64748b;
  border-radius: 7px; border: none; background: none; cursor: pointer; transition: color .15s, background .15s;
}
.sn-link:hover, .sn-link[aria-current="page"] { color: #0f172a; background: #f1f5f9; }
.sn-divider { width: 1px; height: 20px; background: #e2e8f0; margin: 0 6px; }
.sn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer; transition: background .15s, border-color .15s;
}
.sn-btn-ghost { background: none; color: #0f172a; border-color: #e2e8f0; }
.sn-btn-ghost:hover { border-color: #94a3b8; }
.sn-btn-primary { background: #1e40af; color: #fff; }
.sn-btn-primary:hover { background: #1d4ed8; }

/* Dropdowns */
.sn-dd { position: relative; }
.sn-caret { transition: transform .15s; }
.sn-menu {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px);
  padding-top: 10px; opacity: 0; visibility: hidden;
  transition: opacity .15s, transform .15s, visibility .15s; z-index: 60;
}
.sn-panel {
  width: 300px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 8px;
}
.sn-dd:hover .sn-menu, .sn-dd:focus-within .sn-menu, .sn-dd.open .sn-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.sn-dd:hover .sn-caret, .sn-dd:focus-within .sn-caret, .sn-dd.open .sn-caret { transform: rotate(180deg); }
/* Explicitly dismissed (click or Escape) — wins over hover/focus until both leave */
.sn-dd.closed .sn-menu { opacity: 0; visibility: hidden; transform: translate(-50%, 6px); }
.sn-dd.closed .sn-caret { transform: none; }
.sn-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; color: #0f172a; }
.sn-item:hover, .sn-item:focus-visible, .sn-item[aria-current="page"] { background: #f1f5f9; outline: none; }
.sn-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: #eff6ff;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.sn-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.sn-desc { display: block; font-size: 12.5px; color: #64748b; line-height: 1.4; margin-top: 2px; }

/* Mobile */
.sn-toggle {
  display: none; width: 40px; height: 40px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  background: #fff; cursor: pointer; align-items: center; justify-content: center;
}
.sn-mobile { display: none; border-top: 1px solid #e2e8f0; background: #fff; padding: 12px 16px 20px; max-height: calc(100vh - 64px); overflow-y: auto; }
.sn-mobile.open { display: block; }
.sn-mgroup { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.sn-mgroup:last-of-type { border-bottom: none; }
.sn-mlabel { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; padding: 6px 4px; }
.sn-mlink { display: block; padding: 10px 4px; font-size: 15px; font-weight: 500; color: #0f172a; }
.sn-mlink[aria-current="page"] { color: #1d4ed8; }
.sn-mcta { display: flex; gap: 8px; margin-top: 12px; }
.sn-mcta .sn-btn { flex: 1; padding: 10px 12px; }

@media (max-width: 900px) {
  .sn-nav .sn-link, .sn-nav .sn-dd, .sn-divider { display: none; }
  .sn-toggle { display: inline-flex; }
}
@media (max-width: 600px) { .sn-inner { padding: 0 16px; } }
@media (max-width: 520px) { .sn-nav > .sn-btn { display: none; } }

/* In-page anchors land below the sticky header */
[id] { scroll-margin-top: 80px; }

@media print { .sn-header { display: none; } }
