/* FraudLens docs shell — left nav + right article (IPQS-style layout, our brand) */
:root {
  --docs-side: 17.5rem;
  --docs-max: 72rem;
}

body.docs-body {
  background: var(--bg);
}

.docs-shell {
  width: min(100% - 1.25rem, var(--docs-max));
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: var(--docs-side) minmax(0, 1fr);
  gap: 0;
  border: 1.5px solid #000;
  background: #fff;
  box-shadow: var(--shadow);
  min-height: calc(100vh - 7.5rem);
  position: relative;
  z-index: 1;
}

.docs-side {
  border-right: 1.5px solid #000;
  background: #f7f7f7;
  padding: 1rem 0 1.5rem;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}

.docs-side-top {
  padding: 0 1rem 0.85rem;
  border-bottom: 1px solid #ddd;
  margin-bottom: 0.65rem;
  position: relative;
}

.docs-side-top .eyebrow {
  margin: 0 0 0.2rem;
}

.docs-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.docs-side-search {
  width: 100%;
  border: 1.5px solid #000;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.5rem 0.55rem;
  margin-top: 0.55rem;
}

.docs-side-search:focus {
  outline: 2px solid #000;
  outline-offset: 1px;
}

.docs-search-hits {
  margin-top: 0.55rem;
  border: 1.5px solid #000;
  background: #fff;
  max-height: 14rem;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.docs-search-count,
.docs-search-empty {
  margin: 0;
  padding: 0.4rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid #ddd;
}

.docs-search-empty {
  border-bottom: none;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.docs-search-hit {
  display: block;
  text-decoration: none;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid #eee;
}

.docs-search-hit:last-child {
  border-bottom: none;
}

.docs-search-hit:hover {
  opacity: 1;
  background: #f4f4f4;
}

.docs-search-hit strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

.docs-search-hit span {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #444;
}

.docs-nav-group.is-hidden,
.docs-nav li.is-hidden {
  display: none !important;
}

.docs-nav-section {
  margin: 0.85rem 0 0.15rem;
  padding: 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.docs-nav {
  list-style: none;
  margin: 0;
  padding: 0 0.55rem;
}

.docs-nav a {
  display: block;
  text-decoration: none;
  padding: 0.42rem 0.55rem;
  font-size: 0.88rem;
  line-height: 1.3;
  color: #111;
  border: 1.5px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.docs-nav a:hover {
  opacity: 1;
  background: #fff;
  border-color: #000;
}

.docs-nav a.active {
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: 2px 2px 0 #000;
}

.docs-nav a[hidden] {
  display: none;
}

.docs-main {
  padding: 1.35rem 1.5rem 2.5rem;
  min-width: 0;
}

.docs-crumb {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.docs-crumb a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.docs-crumb a:hover {
  border-bottom-color: #000;
  opacity: 1;
}

.docs-article {
  opacity: 0;
  transform: translateY(12px);
  animation: docsEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes docsEnter {
  to {
    opacity: 1;
    transform: none;
  }
}

.docs-article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.25rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 0.65rem;
}

.docs-lede {
  font-size: 1.05rem;
  color: #333;
  max-width: 42rem;
  margin: 0 0 1.35rem;
}

.docs-article h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 2rem 0 0.7rem;
  padding-top: 0.35rem;
  border-top: 1.5px solid #000;
  scroll-margin-top: 1.25rem;
}

.docs-article h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-article h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 1.4rem 0 0.5rem;
}

.docs-article p,
.docs-article li {
  color: #222;
  max-width: 44rem;
}

.docs-article ul,
.docs-article ol {
  padding-left: 1.2rem;
}

.docs-article pre {
  border: 1.5px solid #000;
  background: #111;
  color: #f2f2f2;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
  margin: 0.85rem 0 1.1rem;
}

.docs-article code {
  font-family: var(--font-mono);
  font-size: 0.84em;
}

.docs-article pre code {
  font-size: inherit;
  background: none;
  padding: 0;
}

.docs-callout {
  border: 1.5px solid #000;
  background: #f7f7f7;
  box-shadow: var(--shadow-sm);
  padding: 0.95rem 1.05rem;
  margin: 1.1rem 0;
  max-width: 44rem;
  animation: docsCall 0.6s ease both;
  animation-delay: 0.12s;
}

@keyframes docsCall {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.docs-callout strong {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.docs-callout.warn {
  background: #fff8e8;
}

.docs-callout.ok {
  background: #eef7f2;
}

.docs-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.4rem;
  max-width: 44rem;
}

.docs-steps li {
  counter-increment: step;
  position: relative;
  padding: 0.85rem 0.95rem 0.85rem 3.2rem;
  border: 1.5px solid #000;
  border-bottom: none;
  background: #fff;
}

.docs-steps li:last-child {
  border-bottom: 1.5px solid #000;
  box-shadow: var(--shadow-sm);
}

.docs-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0.75rem;
  top: 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.docs-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1.5px solid #000;
  box-shadow: var(--shadow-sm);
  margin: 1rem 0 1.4rem;
  max-width: 44rem;
  overflow: hidden;
}

.docs-flow > div {
  padding: 0.95rem 1rem;
  border-right: 1.5px solid #000;
  background: #fff;
}

.docs-flow > div:last-child {
  border-right: none;
  background: #111;
  color: #fff;
}

.docs-flow .tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.35rem;
}

.docs-flow h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.docs-flow p {
  margin: 0;
  font-size: 0.86rem;
  max-width: none;
}

.docs-flow > div:last-child p {
  color: #ddd;
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid #000;
  flex-wrap: wrap;
}

.docs-pager a {
  text-decoration: none;
  border: 1.5px solid #000;
  padding: 0.65rem 0.85rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease;
  max-width: 48%;
}

.docs-pager a:hover {
  opacity: 1;
  transform: translate(-2px, -2px);
  background: #f7f7f7;
}

.docs-pager .dir {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.docs-pager .title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.92rem;
}

.docs-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 40;
  border: 1.5px solid #000;
  background: #111;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.docs-backdrop {
  display: none;
}

@media (max-width: 920px) {
  .docs-shell {
    grid-template-columns: 1fr;
    width: min(100% - 1rem, var(--docs-max));
  }

  .docs-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 18rem);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow);
    max-height: none;
  }

  body.docs-nav-open .docs-side {
    transform: none;
  }

  .docs-mobile-toggle {
    display: inline-block;
  }

  .docs-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.docs-nav-open .docs-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .docs-flow {
    grid-template-columns: 1fr;
  }

  .docs-flow > div {
    border-right: none;
    border-bottom: 1.5px solid #000;
  }

  .docs-flow > div:last-child {
    border-bottom: none;
  }

  .docs-pager a {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-article,
  .docs-callout {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.docs-article .table-wrap {
  margin: 0.85rem 0 1.2rem;
  max-width: 48rem;
}

.docs-article .table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.docs-article .table-wrap th,
.docs-article .table-wrap td {
  border: 1px solid #ccc;
  padding: 0.55rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.docs-article .table-wrap th {
  background: #efefef;
  border-bottom: 1.5px solid #000;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-inline-nav,
.docs-article .doc-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  max-width: 44rem;
}

.docs-inline-nav a,
.docs-article .doc-toc a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.docs-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1.5px solid #000;
  margin: 1rem 0 1.35rem;
  max-width: 44rem;
  box-shadow: var(--shadow-sm);
}

.docs-band > div {
  padding: 0.85rem 0.9rem;
  border-right: 1.5px solid #000;
}

.docs-band > div:last-child {
  border-right: none;
}

.docs-band .g {
  background: #eef7f2;
}
.docs-band .y {
  background: #fff8e8;
}
.docs-band .r {
  background: #f8ecec;
}

.docs-band .lbl {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.docs-band strong {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .docs-band {
    grid-template-columns: 1fr;
  }
  .docs-band > div {
    border-right: none;
    border-bottom: 1.5px solid #000;
  }
  .docs-band > div:last-child {
    border-bottom: none;
  }
}
