/* imPRESS Studio — dokumentacja / documentation — print-optimized stylesheet */
@page {
  size: A4;
  margin: 22mm 18mm 20mm 18mm;
}
* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #1b2430;
  line-height: 1.55;
  font-size: 10.6pt;
  margin: 0;
}
h1, h2, h3, h4 { color: #0f2747; line-height: 1.25; }
h1 { font-size: 23pt; margin: 0 0 4px 0; letter-spacing: -0.4px; }
h2 {
  font-size: 16pt;
  margin: 26px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid #2563eb;
  page-break-after: avoid;
}
h3 { font-size: 12.5pt; margin: 18px 0 6px 0; color: #16365f; page-break-after: avoid; }
h4 { font-size: 10.8pt; margin: 14px 0 4px 0; color: #294b76; page-break-after: avoid; }
p { margin: 6px 0; }
ul, ol { margin: 6px 0; padding-left: 22px; }
li { margin: 3px 0; }
strong { color: #0f2747; }
code, kbd, pre {
  font-family: "Consolas", "JetBrains Mono", monospace;
  font-size: 9.2pt;
}
code { background: #eef2f7; padding: 1px 5px; border-radius: 3px; color: #0a356b; }
kbd {
  display: inline-block; padding: 1px 6px; background: #f1f5f9;
  border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; color: #1b2430; font-size: 8.8pt;
}
pre {
  background: #0f1b2d; color: #e6edf3; padding: 12px 14px; border-radius: 6px;
  overflow-x: auto; font-size: 8.8pt; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
pre code { background: none; color: inherit; padding: 0; }
table {
  width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 9.3pt;
  page-break-inside: avoid;
}
th, td { border: 1px solid #d4dce6; padding: 5px 8px; text-align: left; vertical-align: top; }
th { background: #eaf0f9; color: #0f2747; font-weight: 600; }
tr:nth-child(even) td { background: #f7f9fc; }
.callout {
  border-left: 4px solid #2563eb; background: #eef4ff; padding: 9px 14px;
  border-radius: 0 6px 6px 0; margin: 12px 0; page-break-inside: avoid;
}
.callout.warning { border-color: #d97706; background: #fff7ed; }
.callout.success { border-color: #16a34a; background: #f0fdf4; }
.callout.danger  { border-color: #dc2626; background: #fef2f2; }
.callout .t { font-weight: 700; color: #0f2747; }
dl.gloss dt { font-weight: 700; color: #0f2747; margin-top: 8px; }
dl.gloss dd { margin: 2px 0 0 0; color: #36506f; }
.cover {
  page-break-after: always; text-align: center; padding-top: 60mm;
}
.cover .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 92px; height: 92px; border-radius: 22px; background: #2563eb; color: #fff;
  font-size: 54px; font-weight: 800; margin-bottom: 22px;
}
.cover h1 { font-size: 34pt; border: none; }
.cover .sub { font-size: 14pt; color: #46617f; margin-top: 6px; }
.cover .meta { margin-top: 40mm; font-size: 10pt; color: #5a7290; }
.cover .meta div { margin: 3px 0; }
.toc { page-break-after: always; }
.toc h2 { border-bottom: 2px solid #2563eb; }
.toc ol { list-style: none; padding-left: 0; counter-reset: tocc; }
.toc ol li { counter-increment: tocc; margin: 5px 0; font-size: 10.6pt; }
.toc ol li::before { content: counter(tocc) ". "; color: #2563eb; font-weight: 700; }
.toc ol ol { padding-left: 22px; counter-reset: tocs; }
.toc ol ol li { counter-increment: tocs; font-size: 9.8pt; color: #46617f; margin: 2px 0; }
.toc ol ol li::before { content: counter(tocc) "." counter(tocs) " "; color: #6b86a8; font-weight: 600; }
.toc a { color: #1b2430; text-decoration: none; }
section { page-break-inside: auto; }
h2 { page-break-before: auto; }
.chapter { page-break-before: always; }
.lead { font-size: 11.5pt; color: #36506f; }
.tag { display: inline-block; background: #2563eb; color: #fff; font-size: 8pt; padding: 1px 7px; border-radius: 10px; vertical-align: middle; margin-left: 6px; }
.tag.new { background: #16a34a; }
.muted { color: #6b7c90; }
hr { border: none; border-top: 1px solid #d4dce6; margin: 18px 0; }
footer.docfoot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #d4dce6; font-size: 8.6pt; color: #6b7c90; text-align: center; }

/* ---- figures / diagrams ---- */
figure.fig { margin: 16px 0 20px 0; page-break-inside: avoid; text-align: center; }
figure.fig svg {
  width: 100%; max-width: 600px; height: auto;
  border: 1px solid #d9e1ec; border-radius: 8px; background: #ffffff; padding: 10px;
}
figure.fig figcaption {
  font-size: 8.8pt; color: #5a7290; margin-top: 7px; font-style: italic; max-width: 600px;
  margin-left: auto; margin-right: auto;
}
figure.fig text { font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; }
figure.fig .ttl { fill: #0f2747; font-weight: 700; }
figure.fig .lbl { fill: #294b76; }
figure.fig .dim { fill: #6b7c90; }
figure.fig .pgn { fill: #0f2747; font-weight: 700; }
