@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #0f0f11;
  --surface: #18181c;
  --border: #2a2a32;
  --accent: #4fc3f7;
  --text: #dcdce4;
  --muted: #888890;
  --cat1: #e06c75;
  --cat2: #56b6c2;
  --cat3: #98c379;
  --cat4: #c678dd;
  --cat5: #e5c07b;
  --cat6: #61afef;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

header {
  color: var(--text);
  display: flex;
  background-color: rgb(35,35,35);
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 { font-family: 'Montserrat', monospace; font-size: 1.3rem; color: var(--text); letter-spacing: .05em; }
header .version { font-family: 'Montserrat', monospace; font-size: 1rem; color: var(--text); padding: 2px 8px; border: 0px; }
header .controls { margin-left: auto; display: flex; gap: 10px; }
header button { font-family: 'Montserrat', monospace; font-size: .75rem; padding: 5px 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; transition: border-color .2s, color .2s; }
header button:hover { border-color: var(--accent); color: var(--accent); }

.search-bar { padding: 10px; justify-content: center; color: var(--text); display: flex; align-items: center; gap: 10px; }
.search-bar input { width: 360px; padding: 7px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: 'Montserrat', sans-serif; font-size: .875rem; outline: none; transition: border-color .2s; }
.search-bar input:focus { border-color: var(--accent); }
.search-bar label { font-size: .8rem; color: var(--muted); }

.container { display: flex; min-height: calc(100vh - 100px); justify-content: center; }

nav.toc { width: 260px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: 100px; height: calc(100vh - 100px); overflow-y: auto; }
nav.toc::-webkit-scrollbar { width: 4px; }
nav.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
nav.toc h3 { font-family: 'Montserrat', monospace; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; padding: 0 20px 10px; }
nav.toc a { display: block; padding: 4px 20px; font-size: .8rem; color: var(--muted); text-decoration: none; transition: color .15s, background .15s; }
nav.toc a:hover { color: var(--text); background: rgba(255,255,255,.03); }
nav.toc a.cat { color: var(--accent); font-weight: 500; margin-top: 6px; font-size: .78rem; }
nav.toc a.sub { padding-left: 32px; font-size: .75rem; }

main { flex: 1; padding: 36px 48px; max-width: 1000px; }

.section { margin-bottom: 20px; border-radius: 15px; border: 1px solid var(--border); background-color: rgb(35,35,35); }
.section-title { font-family: 'Montserrat', monospace; font-size: 1rem; font-weight: 600; color: var(--accent); padding: 10px 0; margin-left: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.section-title .toggle { margin-left: auto; margin-right: 10px; font-size: .7rem; transition: transform .2s; }
.section-title.collapsed .toggle { transform: rotate(-90deg); }
.section, .category {
  scroll-margin-top: 70px;
}

.category { margin-bottom: 28px; border: 1px solid var(--border); overflow: hidden; }
.cat-header { font-family: 'Montserrat', monospace; font-size: .8rem; font-weight: 600; padding: 10px 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; transition: background .15s; }
.cat-header:hover { background: rgba(255,255,255,.04); }
.cat-header .badge { font-size: .65rem; padding: 1px 7px; border-radius: 10px; font-weight: 500; }
.cat-header .toggle { margin-left: auto; font-size: .7rem; color: var(--muted); transition: transform .2s; }
.cat-header.collapsed .toggle { transform: rotate(-90deg); }
.cat-body { padding: 6px 0 12px; }
.cat-body.hidden { display: none; }

.item { display: grid; grid-template-columns: 230px 1fr; gap: 0; padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,.04); transition: background .12s; }
.item:last-child { border-bottom: none; }
.item:hover { background: rgba(255,255,255,.025); }
.item-name { font-family: 'Montserrat', monospace; font-size: .78rem; color: var(--text); font-weight: 600; padding-top: 1px; padding-right: 16px; }
.item-name .fr { display: block; font-size: .65rem; color: var(--muted); font-weight: 400; margin-top: 1px; }
.item-desc { font-size: .83rem; color: var(--text); line-height: 1.55; }
.item-desc a { color: var(--accent); text-decoration: none; }
.item-desc a:hover { text-decoration: underline; }

.sublist { margin-top: 6px; padding-left: 0; list-style: none; }
.sublist li { padding: 4px 0 4px 12px; border-left: 2px solid var(--border); margin-bottom: 4px; font-size: .8rem; color: var(--muted); }
.sublist li strong { color: var(--cat5); font-weight: 600; }

.sec-files .cat-header  { border-left: 3px solid var(--cat1); background: color-mix(in srgb, var(--cat1) 8%, var(--surface)); }
.sec-func .cat-header   { border-left: 3px solid var(--cat2); background: color-mix(in srgb, var(--cat2) 8%, var(--surface)); }
.sec-out .cat-header    { border-left: 3px solid var(--cat3); background: color-mix(in srgb, var(--cat3) 8%, var(--surface)); }
.sec-set .cat-header    { border-left: 3px solid var(--cat4); background: color-mix(in srgb, var(--cat4) 8%, var(--surface)); }
.sec-status .cat-header { border-left: 3px solid var(--cat5); background: color-mix(in srgb, var(--cat5) 8%, var(--surface)); }

footer { border-top: 1px solid var(--border); padding: 24px 48px; font-size: .78rem; color: var(--muted); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
footer a { color: var(--accent); text-decoration: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media print {
  header, nav.toc, .search-bar { display: none !important; }
  main { padding: 20px; max-width: 100%; }
  .cat-body.hidden { display: block !important; }
  body { background: white; color: black; }
}