* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0c0f; /* dark background */
  --panel: #111318;
  --text: #e6e7eb;
  --muted: #a1a5b0;
  --border: #23262d;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --bad: #ff4444;
  --ok: #6eedaf;
  --header-h: 88px; /* consistent header height for spacing & anchors */
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.wrap {
  max-width: 1600px;
  width: 100vw;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(
    to bottom,
    rgba(11, 12, 15, 0.95),
    rgba(11, 12, 15, 0.75)
  );
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.bar {
  display: flex;
  justify-content: space-between;
}
header .bar {
  display: flex;
  gap: 20px;
  align-items: center;
  min-height: var(--header-h);
}
header .logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
}
header h1 {
  margin: 0;
  font-size: 18px;
}
header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-top: 28px;
  padding-bottom: 28px;
  margin-top: calc(var(--header-h) + 12px);
}

.image-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  overflow: hidden; /* optional: ensures no scrollbars if image is larger */
}

.image-container img {
  width: 80%;
  height: auto;
  max-width: 100%;
  object-fit: contain; /* keeps aspect ratio */
  display: block; /* removes inline whitespace below images */
}

@media (min-width: 980px) {
  main {
    grid-template-columns: 260px 1fr;
  }
}

/* TOC */
.toc {
  max-width: 100vw;
}
nav.toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.toc a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.toc a:hover {
  background: var(--panel);
  border-color: var(--border);
}

/* Content */
section {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.panel {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  gap: 40px;
}
h2 {
  font-size: 24px;
  margin: 0 0 12px;
}
h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px;
}

li {
  position: relative;
  padding-left: 18px;
  list-style: none; /* hide default bullet */
}

li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em; /* aligns to first text line */
  transform: none; /* remove vertical centering */
  width: 6px;
  height: 6px;
  background: var(--accent); /* or var(--accent) */
  border-radius: 50%;
}

.bad-dot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em; /* aligns to first text line */
  transform: none; /* remove vertical centering */
  width: 6px;
  height: 6px;
  background: var(--bad); /* or var(--accent) */
  border-radius: 50%;
}

.lead {
  color: var(--text);
}
.muted {
  color: var(--muted);
}
.grid {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.grid > * {
  min-width: 0; /* allows items to shrink instead of overflowing */
  max-width: 100%;
  box-sizing: border-box;
}
.cols-2 {
  grid-template-columns: 1fr;
}
.cols-3 {
  grid-template-columns: 1fr;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 860px) {
  .cols-2 {
    grid-template-columns: 1fr 1fr;
  }
  .cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.kpis {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .kpis {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}
pre {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
}
footer {
  border-top: 1px solid var(--border);
  padding: 36px;
  display: flex;
  justify-items: center;
  align-items: center;
}
.small {
  font-size: 12px;
}
ul,
ol {
  padding-left: 20px;
  /* gap: 28px; */
}
.note {
  height: 100%;
  border-left: 3px solid var(--ok);
  padding-left: 12px;
}
@media (max-width: 979px) {
  /* Make header fully opaque on mobile to avoid see-through */
  header {
    background: var(--panel);
    backdrop-filter: none;
  }
  /* TOC should not overlay content on mobile; make it a solid card above content */
  nav.toc {
    position: static;
    top: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    margin-top: 8px;
  }
  .toc a {
    background: transparent;
  }
}
