/* CIS Reporting — user guide */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1c2430;
  --muted: #5b6573;
  --line: #d9dde3;
  --accent: #0f5c6b;
  --accent-soft: #e6f2f4;
  --sidebar-w: 260px;
  --toc-w: 210px;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.06);
  --radius: 10px;
  --font: "Segoe UI", "Liberation Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: auto;
  padding: 1.25rem 1rem 2rem;
  background: #12202a;
  color: #e8eef2;
}

.brand {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 0.25rem 0 1.25rem;
  color: #9eb0bc;
  font-size: 0.85rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  color: #d5e0e7;
  text-decoration: none;
  font-size: 0.92rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-link.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.back-to-app {
  display: block;
  margin-top: auto;
  padding: 1.1rem 0.7rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9eb0bc;
  text-decoration: none;
  font-size: 0.85rem;
}

.back-to-app:hover {
  color: #fff;
}

.content {
  width: 100%;
  min-width: 0;
  padding: 1.25rem 1.5rem 2.5rem;
}

.content--with-toc {
  display: grid;
  grid-template-columns: var(--toc-w) minmax(0, 1fr);
  column-gap: 1.75rem;
  align-items: start;
}

.content--with-toc .toc-spy {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.content--with-toc .doc,
.content--with-toc .footer {
  grid-column: 2;
}

.toc-spy {
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: 0.15rem 0 0.15rem 0;
}

.toc-spy-title {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc-spy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc-spy-list a {
  display: block;
  margin: 0;
  padding: 0.28rem 0.35rem 0.28rem 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.35;
  font-size: 0.82rem;
}

.toc-spy-list a:hover {
  color: var(--ink);
}

.toc-spy-list a.is-active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.doc {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.5rem 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.doc > :first-child {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  color: #121820;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.85rem;
}

h2 {
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.35rem;
  scroll-margin-top: 1rem;
}

h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.25rem;
}

blockquote {
  margin-left: 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: #eef1f4;
}

pre {
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: #18232c;
  color: #e8eef2;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  display: table;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

th,
td {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f5;
  font-weight: 600;
}

tr:nth-child(even) td {
  background: #fafbfc;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #fff;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.footer {
  width: 100%;
  max-width: none;
  margin: 1rem 0 0;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .content--with-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc-spy {
    display: none;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.25rem;
  }

  .back-to-app {
    margin-top: 1.25rem;
  }

  .content {
    padding: 1rem;
  }

  .doc {
    padding: 1.15rem;
  }
}

@media print {
  .sidebar,
  .footer,
  .toc-spy {
    display: none;
  }

  .layout {
    display: block;
  }

  .doc {
    border: 0;
    box-shadow: none;
    max-width: none;
  }

  img {
    box-shadow: none;
    break-inside: avoid;
  }
}
