/* =====================================================================
   Rekkan.Ai — documentation bundle stylesheet
   Light, editorial, hairline-led: the same tokens as the control panel
   (web/styles.css) and the landing page, but with no external font load —
   the bundle has to work offline, so Inter is only *preferred*.
   ===================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-panel: #f5f5f5;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --ink: #0a0a0a;
  --ink-head: #252525;
  --ink-dim: #525252;
  --ink-mute: #737373;
  --accent: #0f7f5c;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'DM Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --nav-w: 286px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink-head); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- shell -------------------------------------------------------- */

.docs__shell { display: flex; align-items: flex-start; }

.docs__nav {
  position: sticky;
  top: 0;
  flex: 0 0 var(--nav-w);
  width: var(--nav-w);
  height: 100vh;
  overflow-y: auto;
  padding: 22px 18px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  font-size: 13px;
}

.docs__brand {
  display: block;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink-head);
  text-decoration: none;
  margin-bottom: 16px;
}
.docs__brand span { color: var(--ink-mute); font-weight: 400; }
.docs__brand b {
  font-weight: 500;
  color: var(--ink-mute);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.docs__search { position: relative; margin-bottom: 16px; }
.docs__search input {
  width: 100%;
  padding: 7px 9px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.docs__search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.docs__results {
  margin-top: 6px;
  max-height: 46vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.docs__results a {
  display: block;
  padding: 6px 9px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.docs__results a:last-child { border-bottom: 0; }
.docs__results a:hover { background: var(--bg-panel); }
.docs__results .docs__result-doc { display: block; color: var(--ink-mute); font-size: 11px; }
.docs__results p { margin: 8px 9px; color: var(--ink-mute); }

.docs__links { display: flex; flex-direction: column; gap: 1px; }
.docs__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  color: var(--ink-dim);
  text-decoration: none;
  border-radius: 6px;
}
.docs__links a:hover { background: var(--bg-panel); color: var(--ink-head); }
.docs__links a.is-active { background: var(--bg-panel); color: var(--ink-head); font-weight: 500; }
.docs__internal {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 4px;
}

.docs__foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docs__tier { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- document body ------------------------------------------------ */

.docs__main { flex: 1 1 auto; min-width: 0; padding: 40px 48px 96px; }
.doc { max-width: 780px; }

.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
  color: var(--ink-head);
  line-height: 1.25;
  margin: 1.9em 0 0.55em;
  scroll-margin-top: 18px;
}
.doc h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 0; }
.doc h2 { font-size: 21px; font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 17px; font-weight: 600; }
.doc h4 { font-size: 15px; font-weight: 600; color: var(--ink-dim); }
.doc p, .doc li { color: var(--ink-dim); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 3px 0; }
.doc strong { color: var(--ink-head); }

.doc-anchor {
  float: left;
  margin-left: -18px;
  color: var(--line-strong);
  text-decoration: none;
  font-weight: 400;
}
.doc-anchor:hover { color: var(--accent); }

.doc code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
}
.doc pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}
.doc pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-head);
}
.doc blockquote {
  margin: 1em 0;
  padding: 2px 14px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-mute);
}
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.doc-table { overflow-x: auto; margin: 1.1em 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.doc th, .doc td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.doc th { background: var(--bg-soft); color: var(--ink-head); font-weight: 600; }

.doc-link-gone { color: var(--ink-mute); border-bottom: 1px dotted var(--line-strong); }

.docs__cards { list-style: none; padding: 0; display: grid; gap: 10px; }
.docs__cards li { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.docs__cards a { font-weight: 500; text-decoration: none; }
.docs__cards p { margin: 4px 0 0; color: var(--ink-mute); font-size: 13.5px; }

@media (max-width: 860px) {
  .docs__shell { display: block; }
  .docs__nav { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .docs__main { padding: 24px 18px 64px; }
}

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