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

:root {
  --bg:        #0d0d0d;
  --bg-card:   #141414;
  --bg-hover:  #1a1a1a;
  --border:    #222;
  --border-hl: #2a2a2a;
  --green:     #3ddc84;
  --green-dim: #1a4a30;
  --text:      #e8e8e8;
  --text-mid:  #888;
  --text-dim:  #555;
  --mono:      'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
  --sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar:   260px;
}

html { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.7; }
body { display: flex; min-height: 100vh; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--mono); }

pre {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #c8c8c8;
}

code:not(pre code) {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 13px;
  color: var(--green);
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-logo {
  display: block;
  padding: 0 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  text-decoration: none;
  transition: opacity 0.15s;
}
.sidebar-logo:hover { opacity: 0.8; text-decoration: none; }

.sidebar-logo span { color: var(--text-dim); font-size: 11px; display: block; margin-top: 2px; letter-spacing: 0; }

.nav-group { margin-bottom: 0.25rem; }

.nav-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0.75rem 1.5rem 0.4rem;
  text-transform: uppercase;
}

.nav-link {
  display: block;
  padding: 0.35rem 1.5rem;
  font-size: 13.5px;
  color: var(--text-mid);
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
}

.nav-link:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.nav-link.active { color: var(--green); border-left-color: var(--green); background: var(--bg-hover); }

/* ── Main content ── */
.main {
  margin-left: var(--sidebar);
  flex: 1;
  max-width: 780px;
  padding: 4rem 4rem 6rem;
}

/* ── Page header ── */
.page-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--green);
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

/* ── Section divider ── */
.section {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-top: 2.5rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

p { color: var(--text-mid); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Cards / infoboxes ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.note {
  background: #0f1f17;
  border: 1px solid var(--green-dim);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 14px;
  color: #aac8b8;
}

.warn {
  background: #1a1400;
  border: 1px solid #3a3000;
  border-left: 3px solid #c8a000;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 14px;
  color: #c8b87a;
}

/* ── Coming soon / not yet deployed ── */
.soon-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 0.6rem;
  vertical-align: middle;
}

.coming-soon {
  opacity: 0.45;
  filter: grayscale(0.6);
  pointer-events: none;
  user-select: none;
}
.coming-soon a { color: var(--text-dim); }

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 1.5rem 0;
}

th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-align: left;
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.65rem 1rem 0.65rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
td:first-child, th:first-child { color: var(--text); }

.tag-yes { color: #3ddc84; font-family: var(--mono); font-size: 12px; }
.tag-no  { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }

/* ── Step list ── */
.steps { list-style: none; counter-reset: step; margin: 1.5rem 0; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.steps li::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  background: var(--green-dim);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
}
.steps li p { margin: 0; }
.steps li strong { color: var(--text); display: block; margin-bottom: 0.2rem; }

/* ── Address box ── */
.address-box {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}
.address-box code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  background: none;
  border: none;
  padding: 0;
  word-break: break-all;
}
.address-box .copy-btn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.address-box .copy-btn:hover { color: var(--green); border-color: var(--green); }

/* ── Nav breadcrumb ── */
.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  letter-spacing: 0.04em;
}
.breadcrumb span { margin: 0 0.4rem; }
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--green); text-decoration: underline; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 3rem;
}
.pag-link { font-size: 13.5px; color: var(--text-mid); }
.pag-link:hover { color: var(--green); text-decoration: none; }
.pag-label { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.06em; display: block; margin-bottom: 4px; }

/* ── Przełącznik języka (PL · EN) ── */
.lang-switch { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; }
.lang-switch button {
  background: none; border: none; padding: 2px 4px; cursor: pointer;
  color: var(--text-dim); font-family: inherit; font-size: inherit;
  letter-spacing: 0.04em; transition: color 0.15s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { color: var(--green); }
.lang-switch .sep { color: var(--border-hl); }
.sidebar-lang { padding: 0 1.5rem 1.25rem; margin-bottom: 0.25rem; }

.mt-right { display: flex; align-items: center; gap: 10px; }

/* ── Mobile topbar / drawer (hidden on desktop) ── */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

/* ── Responsive ── */
@media (max-width: 760px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 210;
  }
  .mt-brand {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--green);
    letter-spacing: 0.08em;
  }
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--border-hl);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-mid);
    margin: 0 auto;
    transition: transform 0.2s, opacity 0.2s;
  }
  .mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .sidebar {
    display: flex;
    top: 56px;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    width: min(82vw, 300px);
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 220;
    box-shadow: 20px 0 40px rgba(0,0,0,0.5);
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .nav-group:last-child { margin-bottom: 3rem; }

  .sidebar-backdrop {
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,0.75);
    z-index: 215;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .sidebar-backdrop.open { display: block; opacity: 1; pointer-events: auto; }

  .main { margin-left: 0; min-width: 0; padding: 4.5rem 1.5rem 4rem; }

  html { font-size: 17px; }
  .lead { font-size: 1.1rem; }
  p, li, td, .nav-link { font-size: 1rem; }
  .nav-link { padding: 0.6rem 1.5rem; }

  table { display: block; overflow-x: auto; }

  /* Listingi kodu zawijają się, żeby mieściły się w ramce */
  pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
  /* Diagramy ASCII / tabele kolumnowe zachowują wyrównanie i przewijają się poziomo */
  pre.diagram { white-space: pre; overflow-wrap: normal; word-break: normal; font-size: 12px; }

  .address-box { flex-wrap: wrap; }
  .address-box .copy-btn { margin-left: auto; }
}
