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

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
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; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 20px;
  background: #fff; border-bottom: 1px solid #e5e7eb;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.brand img { border-radius: 6px; }
.languages { display: flex; gap: 4px; }
.languages a { font-size: 13px; text-decoration: none; padding: 4px 8px; border-radius: 4px; color: #6b7280; }
.languages a[aria-current] { background: #eef8f6; color: #16a085; font-weight: 600; }

/* ── Two columns ── */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1120px; margin: 0 auto; }
.toc {
  position: sticky; top: 56px; align-self: start;
  height: calc(100vh - 56px); overflow-y: auto;
  padding: 24px 16px 24px 20px;
  border-right: 1px solid #e5e7eb;
  font-size: 14px;
}
.toc .group { margin: 20px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280; }
.toc .group:first-child { margin-top: 0; }
.toc a { display: block; padding: 5px 8px; border-radius: 6px; color: #374151; text-decoration: none; }
.toc a:hover { background: #f3f4f6; }
.toc a.page::before { content: '▦ '; color: #9ca3af; }
.toc a.list::before { content: '▤ '; color: #9ca3af; }
.content { padding: 32px 40px 80px; max-width: 800px; }

/* ── 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; }
figure img { display: block; 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 ── */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .toc { position: static; height: auto; border-right: 0; border-bottom: 1px solid #e5e7eb; padding: 16px 20px; }
  .content { padding: 24px 20px 60px; }
}

/* ── Print ── */
@media print {
  .topbar, .toc { 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; }
}
