/**
 * BIMA Design System — Documentation Site Styles
 * ───────────────────────────────────────────────────────────────────────────
 * Styling for the docs SITE chrome (header, sidebar, content shell, code
 * blocks, callouts). All colours resolve to the framework's --bima-* tokens
 * (dist/bima.css is loaded first), so the docs site stays on-brand with the
 * product it documents. The brand look — Quicksand display type, Manrope text, navy/sky
 * palette, soft navy-tinted shadows, generous rounding — mirrors index.html.
 */

/* ─── Docs-scoped variables (all derived from brand tokens) ───────────────── */
:root {
  --docs-sidebar-width: 17.5rem;
  --docs-toc-width: 14rem;
  --docs-header-height: 3.75rem;

  --docs-navy:          var(--bima-navy);
  --docs-blue:          var(--bima-blue);
  --docs-sky:           var(--bima-sky);
  --docs-page-bg:       var(--bima-surface-page);
  --docs-code-bg:       #0c1730;            /* deep navy-ink for code surfaces */
  --docs-sidebar-bg:    var(--bima-navy);
  --docs-sidebar-bg-2:  var(--bima-navy-deep);
--docs-sidebar-text:  rgba(255,255,255,0.82);
  --docs-sidebar-active:var(--bima-sky);
  --docs-border:        var(--bima-border-default);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--docs-header-height) + 1.25rem); }

body {
  margin: 0;
  font-family: var(--bima-font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--bima-text-primary);
  background: var(--docs-page-bg);
  -webkit-font-smoothing: antialiased;
}

/* ─── Top header ─────────────────────────────────────────────────────────── */
.docs-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--docs-header-height);
  background: linear-gradient(100deg, var(--bima-navy-deep) 0%, var(--bima-navy) 55%, #123072 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 6px 24px rgba(8,35,101,0.18);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.docs-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.docs-header__brand:hover { text-decoration: none; }
/* Brand mark — BIMA white logo on navy header */
.docs-header__logo {
  height: 1.75rem;
  width: auto;
  flex-shrink: 0;
}
.docs-header__name {
  font-family: var(--bima-font-display);
  font-weight: 700;
  font-size: var(--bima-text-h5);
  color: #fff;
  letter-spacing: -0.01em;
}
.docs-header__version {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--bima-sky);
  border: 1px solid rgba(151,204,231,0.4);
  border-radius: 999px;
  padding: 0.1em 0.55em;
  margin-left: 0.15rem;
}
.docs-header__nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
}
.docs-header__nav a, .docs-header__nav-link {
  font-size: var(--bima-text-small);
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.docs-header__nav a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.docs-header__nav a.is-active, .docs-header__nav-link.is-active {
  color: var(--bima-navy); background: var(--bima-sky); font-weight: 600;
}
.docs-header__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.docs-header__actions a {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.docs-header__actions a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.docs-header__theme-btn {
  width: 2rem; height: 2rem;
  border: 0; border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.78);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.docs-header__theme-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.docs-header__theme-btn .docs-theme-icon--sun { display: none; }
html[data-bima-theme="dark"] .docs-header__theme-btn .docs-theme-icon--moon { display: none; }
html[data-bima-theme="dark"] .docs-header__theme-btn .docs-theme-icon--sun { display: block; }
.docs-header__menu-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  padding: 0.25rem;
}
@media (max-width: 64rem) {
  .docs-header__nav { display: none; }
  .docs-header__menu-btn { display: block; }
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--docs-header-height);
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.docs-sidebar {
  position: fixed;
  top: var(--docs-header-height);
  left: 0;
  bottom: 0;
  width: var(--docs-sidebar-width);
  background: linear-gradient(180deg, var(--bima-navy) 0%, var(--bima-navy-deep) 100%);
  overflow-y: auto;
  z-index: 100;
  padding: 1.25rem 0 4rem;
  transition: transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(151,204,231,0.25) transparent;
  border-right: 1px solid rgba(255,255,255,0.05);
  overscroll-behavior: contain;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(151,204,231,0.22); border-radius: 3px; }
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(151,204,231,0.4); }

.docs-sidebar__section {
  padding: 0 0.85rem;
  margin-bottom: 0.1rem;
}
.docs-sidebar__heading {
  font-family: var(--bima-font-display);
  font-size: var(--bima-text-caption);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bima-sky);
  opacity: 0.9;
  padding: 0.85rem 0.75rem 0.3rem;
  margin: 0;
}
.docs-sidebar__link {
  display: block;
  position: relative;
  padding: 0.4rem 0.85rem;
  font-size: var(--bima-text-small);
  font-weight: 500;
  color: var(--docs-sidebar-text);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-sidebar__link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
  text-decoration: none;
}
.docs-sidebar__link.is-active {
  color: var(--bima-navy);
  background: var(--bima-sky);
  font-weight: 600;
}
.docs-sidebar__divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0.7rem 0.85rem;
}
.docs-sidebar__divider:last-child { display: none; }

@media (max-width: 64rem) {
  .docs-sidebar { transform: translateX(-100%); box-shadow: none; }
  .docs-sidebar.is-open { transform: none; box-shadow: 8px 0 40px rgba(8,35,101,0.45); }
}

/* ─── Main content ───────────────────────────────────────────────────────── */
.docs-main {
  margin-left: var(--docs-sidebar-width);
  flex: 1;
  min-width: 0;
}
.docs-content {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.75rem 2.5rem 5rem;
}
@media (max-width: 64rem) {
  .docs-main { margin-left: 0; }
}
@media (max-width: 48rem) {
  .docs-content { padding: 1.75rem 1.25rem 3.5rem; }
}

/* ─── Page header ────────────────────────────────────────────────────────── */
.docs-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--docs-border);
}
.docs-page-header__category {
  font-family: var(--bima-font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bima-text-link);
  margin-bottom: 0.5rem;
  display: block;
}
.docs-page-header h1 {
  font-family: var(--bima-font-display);
  font-size: clamp(1.9rem, 3vw, 2.35rem);
  font-weight: 700;
  color: var(--bima-text-primary);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.docs-page-header__lead {
  font-size: 1.0625rem;
  color: var(--bima-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ─── Section headings ───────────────────────────────────────────────────── */
.docs-content h2 {
  font-family: var(--bima-font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--bima-text-primary);
  margin: 2.75rem 0 0.85rem;
  padding-bottom: 0.5rem;
  letter-spacing: -0.015em;
  border-bottom: 1px solid var(--docs-border);
}
.docs-content h3 {
  font-family: var(--bima-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--bima-text-primary);
  margin: 1.9rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.docs-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bima-text-primary);
  margin: 1.35rem 0 0.4rem;
}
.docs-content p { margin: 0 0 1rem; color: var(--bima-text-secondary); }
/* Prose lists only. :where() drops these to zero specificity so any framework
   component list (.bima-list-group, .bima-nav, .bima-dropdown__menu, …) keeps its
   own styling instead of inheriting prose padding/margins inside the docs. */
:where(.docs-content ul, .docs-content ol) { color: var(--bima-text-secondary); padding-left: 1.25rem; }
:where(.docs-content ul, .docs-content ol) > :where(li) { margin-bottom: 0.35rem; }
.docs-content a { color: var(--bima-text-link); font-weight: 500; }
.docs-content a:hover { color: var(--bima-text-link-hover); }
.docs-content hr { border: 0; border-top: 1px solid var(--docs-border); margin: 2rem 0; }
.docs-content strong { color: var(--bima-text-primary); }

/* Anchor links on headings */
.docs-content h2 .heading-anchor,
.docs-content h3 .heading-anchor {
  margin-left: 0.5em;
  font-size: 0.7em;
  color: var(--bima-border-strong);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.docs-content h2:hover .heading-anchor,
.docs-content h3:hover .heading-anchor { opacity: 1; }

/* ─── Example block ──────────────────────────────────────────────────────── */
.docs-example {
  padding: 1.75rem;
  background: var(--bima-surface-card);
  border: 1px solid var(--docs-border);
  border-radius: 0.875rem 0.875rem 0 0;
  margin-top: 1.25rem;
  box-shadow: var(--bima-shadow-xs);
}
.docs-example + .docs-code-block {
  margin-top: 0;
  border-radius: 0 0 0.875rem 0.875rem;
}
/* When an example stands alone (no code block follows), round all corners */
.docs-example:not(:has(+ .docs-code-block)) { border-radius: 0.875rem; }
.docs-example--dark { background: var(--bima-navy); }
.docs-example--grid {
  background:
    repeating-linear-gradient(90deg,
      rgba(50,92,168,0.05) 0,
      rgba(50,92,168,0.05) calc(8.333% - 1px),
      rgba(50,92,168,0.09) calc(8.333% - 1px),
      rgba(50,92,168,0.09) 8.333%);
}
.docs-example .bima-row > .bima-col,
.docs-example .bima-row > [class^="bima-col-"],
.docs-example .bima-row > [class*=" bima-col-"] {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  background: rgba(50,92,168,0.09);
  border: 1px solid rgba(50,92,168,0.22);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bima-text-link);
  text-align: center;
}

/* ─── Code block ─────────────────────────────────────────────────────────── */
.docs-code-block {
  position: relative;
  margin-top: 1.25rem;
  border-radius: 0.875rem;
  overflow: hidden;
  background: var(--docs-code-bg);
  box-shadow: var(--bima-shadow-sm);
}
.docs-code-block pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  overflow-x: auto;
  font-family: var(--bima-font-mono), 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.75;
  color: #d9e2f3;
  tab-size: 2;
}
.docs-code-block__copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.7);
  font-family: var(--bima-font-body), system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.docs-code-block__copy:hover { background: rgba(255,255,255,0.16); color: #fff; }
.docs-code-block__copy.is-copied {
  background: rgba(27,183,146,0.25);
  border-color: rgba(27,183,146,0.4);
  color: #6ee7c0;
}

/* Inline code */
.docs-content code {
  font-family: var(--bima-font-mono), 'JetBrains Mono', monospace;
  font-size: 0.82em;
  background: var(--bima-state-selected);
  color: var(--bima-info-text);
  padding: 0.15em 0.4em;
  border-radius: 0.3rem;
}
.docs-code-block pre code {
  background: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit;
}

/* Syntax token colours */
.token-keyword     { color: var(--bima-sky); }
.token-string      { color: #9be8c6; }
.token-comment     { color: #6781a8; font-style: italic; }
.token-attr        { color: #fbbf24; }
.token-value       { color: #9be8c6; }
.token-tag         { color: var(--bima-sky); }
.token-punctuation { color: #8aa0c0; }
.token-class       { color: #f9a8d4; }

/* ─── Callout/note ───────────────────────────────────────────────────────── */
.docs-callout {
  padding: 1rem 1.25rem;
  border-left: 4px solid;
  border-radius: 0 0.6rem 0.6rem 0;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.docs-callout p { color: inherit; }
.docs-callout--info    { border-color: var(--bima-blue);    background: var(--bima-info-bg);    color: var(--bima-info-text); }
.docs-callout--warning { border-color: var(--bima-warning); background: var(--bima-warning-bg); color: var(--bima-warning-text); }
.docs-callout--tip     { border-color: var(--bima-success); background: var(--bima-success-bg); color: var(--bima-success-text); }
.docs-callout--danger  { border-color: var(--bima-error);   background: var(--bima-error-bg);   color: var(--bima-error-text); }
.docs-callout__title   { font-weight: 700; margin-bottom: 0.25rem; }
.docs-callout p:last-child { margin-bottom: 0; }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.docs-table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: 0.75rem; border: 1px solid var(--docs-border); box-shadow: var(--bima-shadow-xs); }
.docs-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background: var(--bima-surface-card); }
.docs-table thead th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bima-text-muted);
  background: var(--bima-mist);
  border-bottom: 1px solid var(--docs-border);
}
.docs-table tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: top;
  color: var(--bima-text-primary);
}
.docs-table tbody tr:last-child td { border-bottom: 0; }
.docs-table tbody tr:hover td { background: var(--bima-row-hover); }
.docs-table td code { white-space: nowrap; }

/* ─── On-this-page TOC ───────────────────────────────────────────────────── */
.docs-toc {
  position: sticky;
  top: calc(var(--docs-header-height) + 2rem);
  align-self: flex-start;
  width: var(--docs-toc-width);
  flex-shrink: 0;
  padding: 0 1rem 2rem;
  max-height: calc(100vh - var(--docs-header-height) - 3rem);
  overflow-y: auto;
  display: none;
}
@media (min-width: 75rem) { .docs-toc { display: block; } }
.docs-toc__heading {
  font-family: var(--bima-font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bima-text-muted);
  margin: 0 0 0.6rem;
}
.docs-toc__list { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--docs-border); }
.docs-toc__item a {
  display: block;
  padding: 0.22rem 0 0.22rem 1rem;
  font-size: 0.8125rem;
  color: var(--bima-text-muted);
  text-decoration: none;
  margin-left: -1px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.docs-toc__item a:hover { color: var(--bima-text-primary); }
.docs-toc__item a.is-active { color: var(--bima-text-link); border-left-color: var(--bima-text-link); font-weight: 600; }
.docs-toc__item--h3 a { padding-left: 1.75rem; font-size: 0.75rem; }

/* ─── With-TOC layout ────────────────────────────────────────────────────── */
.docs-content-wrap { display: flex; gap: 0; }
.docs-content-wrap .docs-content { flex: 1; min-width: 0; }

/* ─── Component metadata badges ──────────────────────────────────────────── */
.docs-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.docs-badge {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.2em 0.65em; border-radius: 999px; border: 1px solid;
}
.docs-badge--stable { background: var(--bima-success-bg); color: var(--bima-success-text); border-color: rgba(27,183,146,0.4); }
.docs-badge--js     { background: var(--bima-warning-bg); color: var(--bima-warning-text); border-color: rgba(250,140,22,0.4); }
.docs-badge--css    { background: var(--bima-info-bg);    color: var(--bima-info-text);    border-color: rgba(50,92,168,0.35); }

/* ─── Colour swatch (token tables) ───────────────────────────────────────── */
.docs-color-swatch {
  display: inline-block; width: 1.5rem; height: 1.5rem;
  border-radius: 0.3rem; vertical-align: middle; border: 1px solid rgba(0,0,0,0.08);
}

/* ─── Docs landing (introduction page) ───────────────────────────────────────
   A single centred column so the hero and the content below share one left
   edge (no full-bleed misalignment, no competing right rail). */
.docs-landing { max-width: 58rem; margin: 0 auto; padding: 2.25rem 2.5rem 5rem; }
@media (max-width: 48rem) { .docs-landing { padding: 1.5rem 1.25rem 3.5rem; } }

.docs-hero {
  position: relative; overflow: hidden;
  background: var(--bima-gradient-hero);
  color: #fff;
  border-radius: var(--bima-radius-2xl);
  padding: clamp(2.25rem, 5vw, 3.5rem);
  box-shadow: var(--bima-shadow-card);
}
.docs-hero::after {
  content: ""; position: absolute; right: -6%; top: -40%;
  width: 28rem; height: 28rem; pointer-events: none;
  background: radial-gradient(circle, rgba(151,204,231,0.35) 0%, transparent 60%);
}
.docs-hero__inner { position: relative; z-index: 1; max-width: 36rem; }
/* Inside the landing column, content fills the column (aligns with the hero) */
.docs-landing .docs-content { max-width: none; margin: 0; padding: 0; }
.docs-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; padding: 0.25em 0.85em;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 1.25rem;
}

/* Version badges stay hidden until the version has been fetched from npm */
.docs-hero__eyebrow:has([data-bima-version]:empty),
.docs-header__version:has([data-bima-version]:empty) { visibility: hidden; }
.docs-hero h1 {
  font-family: var(--bima-font-display);
  font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700;
  margin: 0 0 1rem; letter-spacing: -0.025em; line-height: 1.1; color: #fff;
}
.docs-hero p { font-size: 1.125rem; color: rgba(255,255,255,0.86); max-width: 38rem; line-height: 1.6; margin: 0 0 2rem; }
.docs-hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ─── Mobile sidebar overlay ─────────────────────────────────────────────── */
.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: var(--docs-header-height) 0 0;
  background: var(--bima-surface-overlay);
  z-index: 99;
}
.docs-sidebar-overlay.is-open { display: block; }

/* ─── Search ─────────────────────────────────────────────────────────────── */
.docs-search {
  position: relative;
  padding: 0.75rem 1rem 0.5rem;
}
.docs-search__input {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem 0 2.25rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.5rem;
  color: #fff;
  font-family: var(--bima-font-body);
  font-size: var(--bima-text-small);
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.docs-search__input::placeholder { color: rgba(255,255,255,0.4); }
.docs-search__input:focus {
  background: rgba(255,255,255,0.14);
  border-color: var(--bima-sky);
}
/* Hide the native WebKit clear button — our custom .docs-search__clear replaces it */
.docs-search__input::-webkit-search-cancel-button,
.docs-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.docs-search__icon {
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
}
.docs-search__clear {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.docs-search__clear.is-visible { display: flex; }
.docs-search__clear:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* Sidebar link hidden by search filter */
.docs-sidebar__link.is-hidden {
  display: none;
}
.docs-sidebar__section.is-empty {
  display: none;
}

/* ─── Back to top ──────────────────────────────────────────────────────── */
.docs-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bima-navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--bima-shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s, background 0.15s;
  z-index: 90;
}
.docs-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.docs-back-to-top:hover { background: var(--bima-blue); }
.docs-back-to-top svg { width: 1.125rem; height: 1.125rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
