/* Dokumentacja StaffKit — ciemny motyw z czerwonym akcentem, jak staffkit.pl */
:root {
  --bg: #070708;
  --bg-2: #0d0d0f;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --red: #e8303a;
  --red-2: #ff5a64;
  --red-3: #ffa0a6;
  --side: 270px;
  --toc: 220px;
  --top: 60px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  font-family: 'Rubik', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-2); text-decoration: none; }
a:hover { color: var(--red-3); text-decoration: underline; }
code, kbd, pre { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }
code { font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: #ffd5d7; overflow-wrap: anywhere; }
kbd { font-size: 0.82em; background: linear-gradient(#26262a, #18181b); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; border-radius: 6px; }

/* Pasek u góry */
.top {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(10, 10, 12, 0.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.14em; font-size: 14px; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand span { letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 14px; }
.brand img { filter: drop-shadow(0 0 10px rgba(232, 48, 58, 0.5)); }
.top-link { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.menu-btn { display: none; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: 24px; }
.search input { width: 100%; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.search input:focus { border-color: rgba(232, 48, 58, 0.5); outline: none; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 60vh; overflow: auto; background: #111113; border: 1px solid var(--border-strong); border-radius: 14px; padding: 6px; box-shadow: 0 20px 60px -20px #000; }
.results a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--text); font-size: 14px; }
.results a small { display: block; color: var(--dim); font-size: 12px; }
.results a:hover, .results a.sel { background: rgba(232, 48, 58, 0.14); text-decoration: none; }
.results p { margin: 8px 10px; color: var(--dim); font-size: 14px; }

/* Układ: menu, treść, spis */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); max-width: 1400px; margin: 0 auto; padding-top: var(--top); }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 24px 14px 40px 20px; border-right: 1px solid var(--border); }
.side ul { list-style: none; margin: 0 0 18px; padding: 0; }
.nav-title { margin: 0 0 6px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.side a { display: block; padding: 6px 10px; border-radius: 9px; color: var(--muted); font-size: 14.5px; }
.side a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.side a.active { color: var(--text); background: rgba(232, 48, 58, 0.14); box-shadow: inset 2px 0 0 var(--red); }
.content { padding: 36px 48px 40px; min-width: 0; }
article { max-width: 820px; }
.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 32px 16px; font-size: 13px; }
.toc p { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.toc a { display: block; padding: 3px 0 3px 10px; color: var(--dim); border-left: 1px solid var(--border); }
.toc a.h3 { padding-left: 22px; }
.toc a:hover, .toc a.on { color: var(--text); border-left-color: var(--red); text-decoration: none; }

/* Treść */
h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
h2 { font-size: 24px; letter-spacing: -0.01em; margin: 44px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
h3 { font-size: 18px; margin: 28px 0 8px; }
h2 a.anchor, h3 a.anchor { opacity: 0; margin-left: 8px; color: var(--dim); font-weight: 400; }
h2:hover a.anchor, h3:hover a.anchor { opacity: 1; }
p, li { color: #d4d4d8; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
strong { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.code, pre { background: #0b0b0d; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.55; color: #e4e4e7; }
pre .c { color: #71717a; }
.table { overflow-x: auto; margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); background: var(--surface); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td small { color: var(--dim); }
.note, .warn, .tip { border-radius: 12px; padding: 12px 16px; margin: 16px 0; border: 1px solid; font-size: 15px; }
.note { background: rgba(96, 165, 250, 0.07); border-color: rgba(96, 165, 250, 0.25); }
.warn { background: rgba(250, 204, 21, 0.07); border-color: rgba(250, 204, 21, 0.25); }
.tip { background: rgba(232, 48, 58, 0.07); border-color: rgba(232, 48, 58, 0.3); }
.note p, .warn p, .tip p { margin: 4px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 18px 0; }
.cards a { display: block; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.cards a:hover { border-color: rgba(232, 48, 58, 0.45); text-decoration: none; }
.cards b { display: block; margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: 14px; }
figure { margin: 18px 0; }
figure img { width: 100%; border-radius: 12px; border: 1px solid var(--border); display: block; }
figcaption { color: var(--dim); font-size: 13px; margin-top: 6px; }
.steps { counter-reset: s; list-style: none; padding-left: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 40px; margin: 12px 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(232, 48, 58, 0.18); color: var(--red-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.pager { display: flex; justify-content: space-between; gap: 12px; max-width: 820px; margin: 48px 0 0; }
.pager a { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; }
.pager a:hover { border-color: rgba(232, 48, 58, 0.45); text-decoration: none; }
.pager .next { margin-left: auto; }
footer { max-width: 820px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--dim); font-size: 13px; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: block; }
  .search { margin-left: 0; }
  .top-link, .brand span { display: none; }
  .side { position: fixed; top: var(--top); left: 0; width: min(300px, 85vw); z-index: 15; background: #0b0b0d; transform: translateX(-100%); transition: transform 0.25s; }
  body.menu-open .side { transform: none; box-shadow: 20px 0 60px #000; }
  .content { padding: 24px 16px 32px; }
}
