@import url('/fonts/inter.css');

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
/* Jumps are instant: a chapter can be tens of thousands of pixels away, and an
   animated scroll over that distance is slow and, when interrupted, lands wrong. */
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a2e;
  background: #fff;
}
a { color: #16a085; }
code { font-family: ui-monospace, monospace; font-size: 0.9em; background: #f3f4f6; padding: 0.1em 0.35em; border-radius: 3px; }
img { max-width: 100%; height: auto; }

/* ── The dashboard's shell, so the manual reads as part of it: a fixed sidebar
   with the brand block as its header (logo square flush in the corner, two-line
   tagline, faint waveform) and the contents below; a page column with a bar
   (title, language switch) that scrolls away with the text, as the dashboard's
   page bar does. Tokens are the dashboard's clean-slate theme. ── */
:root {
  --sidebar: oklch(0.9670 0.0029 264.5419);
  --sidebar-foreground: oklch(0.2795 0.0368 260.0310);
  --sidebar-primary: oklch(0.5854 0.2041 277.1173);
  --sidebar-border: oklch(0.8717 0.0093 258.3382);
  --sidebar-accent: oklch(0.9299 0.0334 272.7879);
  --muted-foreground: oklch(0.5510 0.0234 264.3637);
  --sidebar-width: 224px;
  --topbar-height: 56px;
}
.sidebar {
  position: sticky; top: 0; align-self: start;
  display: flex; flex-direction: column;
  height: 100vh;
  background: var(--sidebar); border-right: 1px solid var(--sidebar-border);
}
.brand {
  display: flex; align-items: center; flex: 0 0 var(--topbar-height); height: var(--topbar-height);
  border-bottom: 1px solid var(--sidebar-border);
  color: var(--sidebar-foreground); text-decoration: none;
}
.brand-logo { height: 100%; width: auto; flex: 0 0 auto; }
.brand-logo .bg { fill: var(--sidebar-primary); }
.brand-logo .fg { fill: #fff; }
.brand-text { display: grid; margin-left: 10px; line-height: 1.25; }
.brand-line1 { font-size: 14px; font-weight: 600; }
.brand-line2 { font-size: 12px; color: var(--muted-foreground); }
.brand-wave { height: 24px; width: auto; margin: 0 12px 0 auto; opacity: 0.25; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--topbar-height); padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--sidebar-border);
}
.crumb { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--sidebar-foreground); }
.languages { display: flex; gap: 4px; }
.languages a { font-size: 13px; text-decoration: none; padding: 4px 8px; border-radius: 4px; color: var(--muted-foreground); }
.languages a[aria-current] { background: var(--sidebar-accent); color: var(--sidebar-primary); font-weight: 600; }

/* ── Two columns ── */
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.menu-toggle, .backdrop { display: none; }
.toc {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 8px 24px 8px;
  font-size: 14px;
}
.toc .group { margin: 20px 0 6px; padding: 0 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.toc .group:first-child { margin-top: 0; }
.toc a { display: block; padding: 6px 12px; border-radius: 6px; color: var(--sidebar-foreground); text-decoration: none; }
.toc a:hover { background: var(--sidebar-accent); }
.toc a[aria-current] { background: var(--sidebar-accent); color: var(--sidebar-foreground); font-weight: 500; }
.toc a[aria-current]::before { background: var(--sidebar-foreground); }
/* The two sidebar icons of the dashboard (Lucide layout-dashboard and file-text),
   drawn with the same stroke style, as a mask so they take the text colour. */
.toc a.page::before, .toc a.list::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin: 0 8px -2px 0;
  background: #9ca3af;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.toc a.page::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='9' x='3' y='3' rx='1'/%3E%3Crect width='7' height='5' x='14' y='3' rx='1'/%3E%3Crect width='7' height='9' x='14' y='12' rx='1'/%3E%3Crect width='7' height='5' x='3' y='16' rx='1'/%3E%3C/svg%3E"); }
.toc a.list::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M10 9H8'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E"); }
.content { padding: 28px 40px 80px; max-width: 880px; }

/* ── Chapters ── */
section + section { margin-top: 56px; padding-top: 40px; border-top: 1px solid #e5e7eb; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 32px 0 8px; }
h4 { font-size: 15px; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: #4b5563; }
.audience { display: inline-block; font-size: 12px; font-weight: 500; color: #16a085; background: #eef8f6; padding: 2px 8px; border-radius: 999px; margin-bottom: 12px; }
ul, ol { padding-left: 22px; margin: 0 0 12px; }
li { margin-bottom: 4px; }
li > ul { margin-top: 4px; }
.procedure li { margin-bottom: 8px; }
dl.fields { margin: 0 0 12px; }
dl.fields dt { font-weight: 600; margin-top: 10px; }
dl.fields dd { margin: 2px 0 0; }

/* ── Figures ── */
figure { margin: 20px 0 24px; text-align: center; }
figure img { display: block; margin: 0 auto; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
figcaption { margin-top: 8px; font-size: 13px; color: #6b7280; }

/* ── Callouts ── */
.callout { margin: 16px 0; padding: 12px 16px; border-left: 4px solid #16a085; background: #f0faf7; border-radius: 0 6px 6px 0; font-size: 15px; }
.callout.warning { border-left-color: #e67e22; background: #fdf3e9; }
.callout p:last-child { margin-bottom: 0; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
th { font-weight: 600; background: #f9fafb; }

/* ── Narrow screens ── */
/* Phones: the sidebar becomes a top bar (brand block and a menu button) and the
   contents a drawer that slides in over the text, as the dashboard's sidebar
   does on mobile. */
@media (max-width: 860px) {
  html { scroll-padding-top: calc(var(--topbar-height) + 16px); }
  /* minmax(0, …): a plain 1fr track refuses to shrink below the screenshots'
     intrinsic width, which laid the page out 880 px wide and zoomed it out. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .page, .content { min-width: 0; }
  table { display: block; overflow-x: auto; }
  .sidebar {
    position: sticky; top: 0; z-index: 20;
    flex-direction: row; align-items: center;
    height: var(--topbar-height);
    border-right: 0; border-bottom: 1px solid var(--sidebar-border);
  }
  .brand { flex: 1; min-width: 0; border-bottom: 0; }
  .brand-wave { display: none; }
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-right: 8px; border: 0; border-radius: 8px;
    background: none; color: var(--sidebar-foreground); cursor: pointer;
  }
  .menu-toggle svg { width: 22px; height: 22px; }
  .menu-toggle:hover, .sidebar.open .menu-toggle { background: var(--sidebar-accent); }
  .toc {
    position: fixed; top: var(--topbar-height); left: 0; bottom: 0; z-index: 20;
    width: min(80vw, 320px); padding: 12px 8px 24px;
    background: var(--sidebar); border-right: 1px solid var(--sidebar-border);
    box-shadow: 0 8px 24px rgb(0 0 0 / .15);
    transform: translateX(-100%); transition: transform .2s ease-out;
  }
  .sidebar.open .toc { transform: none; }
  .backdrop { position: fixed; top: var(--topbar-height); left: 0; right: 0; bottom: 0; z-index: 15; background: rgb(0 0 0 / .3); }
  .sidebar.open .backdrop { display: block; }
  .crumb { font-size: 16px; }
  .content { padding: 24px 20px 60px; }
}

/* ── Print ── */
@media print {
  .sidebar, .bar { display: none; }
  .shell { display: block; }
  .content { max-width: none; padding: 0; }
  section + section { break-before: page; border-top: 0; margin-top: 0; padding-top: 0; }
  figure img { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}
