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

:root {
  --font-fira: "Fira Sans", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-noto: "Noto Sans", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --color-primary: #295882;
  --color-primary-alt: #519ACD;
  --color-red: #FF4A37;
  --color-red-dark: #E2242B;
  --color-red-deep: #920E05;

  --color-light: #EDEDEF;
  --color-dark: #35373A;
  --color-white: #FFFFFF;
  --color-off-white: #F7F7F8;

  --color-bg: var(--color-white);
  --color-bg-soft: var(--color-off-white);
  --color-text: var(--color-dark);
  --color-text-secondary: #5A5C60;
  --color-text-muted: #8E9196;

  --color-border: rgba(53, 55, 58, 0.1);
  --color-border-solid: #D8D9DB;

  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(53, 55, 58, 0.06);
  --shadow-md: 0 4px 20px rgba(53, 55, 58, 0.1);
}

body {
  font-family: var(--font-fira);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

a { color: var(--color-red); text-decoration: none; }
a:hover { color: var(--color-primary-alt); text-decoration: underline; }

/* Top bar */
.docs-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4rem;
  height: 64px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.docs-brand {
  display: flex;
  font-size: 1rem;
  align-items: center;
  gap: 8px;
  color: var(--color-dark);
  text-decoration: none;
  font-family: var(--font-fira);
}

.docs-brand strong {
  line-height: 25.6px;
  letter-spacing: -.32px;
}

.docs-brand img {
  width: 45px;
  /* height: 45px; */
}
.docs-brand:hover { color: var(--color-dark); text-decoration: none; }

.docs-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(41, 88, 130, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.docs-topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.docs-topbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.85rem;
}

.docs-topbar-links a { color: var(--color-text-secondary); }
.docs-topbar-links a:hover { color: var(--color-primary); text-decoration: none; }

/* Search */
.docs-search {
  position: relative;
  width: 200px;
  height: 38px;
  flex-shrink: 0;
}

.docs-search-input {
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 38px;
  padding: 0 14px 0 34px;
  font-family: var(--font-noto);
  font-size: 0.85rem;
  color: var(--color-text);
  /* Magnifier icon anchored to the input's left edge so it stays put as the
     input expands (a background image tracks the input, not the topbar slot). */
  background-color: var(--color-bg-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238E9196' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cline x1='14' y1='14' x2='18' y2='18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
  border: 1px solid var(--color-border-solid);
  border-radius: var(--radius-sm);
  outline: none;
  transition: width 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.docs-search-input::placeholder { color: var(--color-text-muted); }
.docs-search-input:focus {
  width: 380px;
  background-color: var(--color-white);
  border-color: var(--color-primary-alt);
  box-shadow: 0 0 0 3px rgba(81, 154, 205, 0.15), var(--shadow-md);
}

.docs-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--color-white);
  border: 1px solid var(--color-border-solid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.docs-search-panel[hidden] { display: none; }

.docs-search-results { list-style: none; margin: 0; padding: 0; }

.docs-search-result {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
}
.docs-search-result:hover,
.docs-search-result.active {
  background: var(--color-bg-soft);
  text-decoration: none;
}

.docs-search-result-title {
  display: block;
  font-family: var(--font-fira);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.docs-search-result-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-noto);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.docs-search-result mark {
  background: rgba(255, 74, 55, 0.18);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.docs-search-hint,
.docs-search-empty {
  margin: 0;
  padding: 12px;
  font-family: var(--font-noto);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.docs-search-hint[hidden],
.docs-search-empty[hidden] { display: none; }

.docs-nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-dark);
  background: var(--color-white);
  border: 1px solid var(--color-border-solid);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}

.docs-nav-toggle-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  border-color: var(--color-dark) transparent transparent transparent;
  transition: transform 0.15s ease;
}
.docs-nav-toggle[aria-expanded="true"] .docs-nav-toggle-chevron { transform: rotate(180deg); }

/* Layout */
.docs-layout {
  display: flex;
  min-height: calc(100vh - 64px);
  max-width: 1280px;
  margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 32px 20px;
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
}

.docs-nav-section { margin-bottom: 24px; }

.docs-nav-section h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  padding-left: 12px;
}

.docs-nav-section a {
  display: block;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.docs-nav-section a:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
  text-decoration: none;
}

.docs-nav-section a.active {
  background: rgba(41, 88, 130, 0.08);
  color: var(--color-primary);
  font-weight: 700;
}

/* Content */
.docs-content {
  flex: 1;
  padding: 48px 60px;
  max-width: 800px;
}

.docs-content h1 {
  font-family: var(--font-fira);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--color-text);
}

.docs-content .docs-subtitle {
  font-family: var(--font-noto);
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.docs-content h2 {
  font-family: var(--font-fira);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--color-text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-solid);
}

.docs-content h3 {
  font-family: var(--font-fira);
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--color-text);
}

.docs-content p {
  font-family: var(--font-noto);
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--color-text-secondary);
}

.docs-content ul, .docs-content ol {
  font-family: var(--font-noto);
  margin: 0 0 16px 24px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.docs-content li { margin-bottom: 6px; }
.docs-content strong { color: var(--color-text); }

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-family: var(--font-noto);
  font-size: 0.9rem;
}

.docs-content th {
  text-align: left;
  border: 1px solid var(--color-border-solid);
  padding: 8px 12px;
  background: var(--color-bg-soft);
  color: var(--color-text);
}

.docs-content td {
  border: 1px solid var(--color-border-solid);
  padding: 8px 12px;
  color: var(--color-text-secondary);
  vertical-align: top;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-border-solid);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-red-deep);
}

.docs-content pre {
  background: var(--color-dark);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: var(--color-light);
  font-size: 0.85rem;
  line-height: 1.6;
}

.docs-callout {
  background: var(--color-bg-soft);
  border-left: 4px solid var(--color-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.docs-callout p { color: var(--color-text); margin-bottom: 0; }
.docs-callout p + p { margin-top: 8px; }
.docs-callout strong { color: var(--color-red-dark); }

.docs-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.docs-step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  margin-top: 2px;
}

.docs-step-content h3 { margin-top: 0; }

/* Mobile dropdown nav */
@media (max-width: 770px) {
  .docs-topbar { padding: 0 16px; height: 56px; }
  .docs-nav-toggle { display: inline-flex; }
  .docs-topbar-links { display: none; }

  /* Collapse the search to an icon that grows on focus so it fits the topbar */
  .docs-search { width: 40px; }
  .docs-search-input { width: 40px; padding: 0 8px 0 32px; }
  .docs-search-input:focus { width: min(76vw, 320px); }
  .docs-search-panel { width: min(84vw, 340px); }

  .docs-layout { flex-direction: column; max-width: 100%; }

  .docs-sidebar {
    display: none;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 56px);
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    z-index: 99;
    padding: 20px;
  }

  .docs-sidebar.open { display: block; }

  .docs-content { padding: 28px 20px; max-width: 100%; }
}
