/* Reading pages of the knowledge library (LEND-29).
   No Figma layout exists: built from the site's own tokens (baza-znaniy.css :root) — Inter, ink #212121,
   soft surfaces #f4f6f8 with 16–24px radii, the baza-znaniy hero plate, blue pill CTA, white nav pills. */
.material {
  --m-tint: #eaf2ff;
  --m-edge: #d6e7ff;
  --m-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='2'/%3E%3Cpath d='M10.5 3.5V3A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v5A1.5 1.5 0 0 0 4 9.5h.5'/%3E%3C/svg%3E");
  --m-done: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8'/%3E%3C/svg%3E");
  --m-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3L5 8l5 5'/%3E%3C/svg%3E");
  --m-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11l6-6M6 5h5v5'/%3E%3C/svg%3E");
  --m-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  padding: 40px 0 96px;
  color: #212121;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.material [hidden] { display: none !important; }
.material .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.material :focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; }

/* ---------- hero: the baza-znaniy plate, compact ---------- */
.material-hero {
  padding: 28px 48px 44px;
  border-radius: 24px;
  background: #fff4eb url("../assets/vec/baza-znaniy-paint-291-722.svg") center / 100% 100% no-repeat;
}
.material-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.material-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px 11px 10px;
  background: #fff; border-radius: 56px; color: var(--blue-500);
  font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none;
  transition: background-color .18s ease;
}
.material-back::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--m-left) center / contain no-repeat; mask: var(--m-left) center / contain no-repeat; }
.material-back:hover { background: var(--m-tint); }
.material-logo { display: flex; align-items: center; padding: 8px 16px; background: #fff; border-radius: 16px; }
.material-logo img { height: 36px; width: auto; }
.material .nb { white-space: nowrap; }
.material h1 {
  margin: 0; max-width: 840px;
  font-size: 44px; line-height: 1.15; font-weight: 600; letter-spacing: -.6px; color: #212121;
  text-wrap: balance;
}
.material-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.material-download, .material-copy--hero, .material-clear {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 32px; border: 0; border-radius: 35px;
  font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.material-download { background: var(--blue-cta); color: #fff; }
.material-download:hover { background: #1c57b4; transform: translateY(-2px); }
.material-copy--hero, .material-clear { background: #fff; color: var(--blue-cta); }
.material-copy--hero:hover, .material-clear:hover:not(:disabled) { background: var(--m-tint); transform: translateY(-2px); }
.material-clear:disabled { color: var(--gray-500); cursor: default; }
.material-download[aria-busy] { opacity: .7; cursor: progress; }
.material-end { margin-top: 24px; }
.material-text .material-end .material-download, .material-text .material-end .material-download:hover { color: #fff; text-decoration: none; }
.material-end .material-actions { margin-top: 0; }
.material-download:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; }
.material-note { margin: 16px 0 0; max-width: 840px; font-size: 15px; line-height: 1.45; font-weight: 500; color: var(--gray-600); }

/* ---------- layout: 1120 container, aside + 780 reading column ---------- */
.material-layout { margin-top: 48px; }
.material-layout.has-aside { display: grid; grid-template-columns: 260px minmax(0, 780px); justify-content: space-between; align-items: start; }
.material-text { min-width: 0; max-width: 780px; margin-inline: auto; }
.has-aside .material-text { margin-inline: 0; width: 100%; }
.material-aside { position: sticky; top: 24px; z-index: 5; min-width: 0; }
.material-text > :first-child { margin-top: 0; }
.material-text h2 { margin: 56px 0 20px; font-size: 28px; line-height: 1.25; font-weight: 600; letter-spacing: -.3px; }
.material-text > h2:first-child { margin-top: 0; }
.material-text p { margin: 0 0 16px; }
.material-text a { color: var(--blue-cta); text-underline-offset: 3px; }
.material-text mark { padding: 0 4px; margin: 0 -1px; border-radius: 6px; background: var(--m-tint); color: var(--blue-900); font-weight: 500; }
.material-text .blank { color: var(--gray-400); }
.material-text strong { font-weight: 600; }
.material-list { margin: 0 0 16px; padding: 0; list-style: none; }
.material-list li { position: relative; margin: 0 0 10px; padding-left: 24px; }
.material-list li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-cta); }

/* ---------- aside: progress (checklist) ---------- */
.material-progress { padding: 24px; border-radius: 20px; background: var(--bg-soft); }
.progress-count { display: block; margin-bottom: 16px; font-size: 20px; line-height: 1.1; font-weight: 500; color: var(--gray-600); }
.progress-count b { font-size: 56px; font-weight: 600; letter-spacing: -1.5px; color: var(--blue-cta); }
.material progress { display: block; flex: 1; min-width: 0; width: 100%; height: 8px; border: 0; border-radius: 8px; background: #fff; color: var(--blue-cta); -webkit-appearance: none; appearance: none; overflow: hidden; }
.material progress::-webkit-progress-bar { background: #fff; border-radius: 8px; }
.material progress::-webkit-progress-value { background: var(--blue-cta); border-radius: 8px; transition: width .3s ease; }
.material progress::-moz-progress-bar { background: var(--blue-cta); border-radius: 8px; }

/* ---------- aside: section navigation ---------- */
.material-nav { padding: 12px; border-radius: 20px; background: var(--bg-soft); }
.material-nav summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--gray-600); list-style: none; pointer-events: none; }
.material-nav summary::-webkit-details-marker { display: none; }
.material-nav ol { max-height: calc(100vh - 48px - 76px); margin: 0; padding: 0 0 4px; list-style: none; overflow-y: auto; scrollbar-width: thin; }
.material-nav a { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 12px; color: #292929; font-size: 14px; line-height: 1.35; text-decoration: none; transition: background-color .18s ease; }
.material-nav a:hover { background: #fff; }
.material-nav a[aria-current="true"] { background: #fff; color: var(--blue-cta); font-weight: 500; }
.nav-no { flex: none; min-width: 20px; font-weight: 600; color: var(--blue-500); }
.nav-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* ---------- checklist ---------- */
.checklist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.check { position: relative; display: flex; align-items: flex-start; gap: 16px; padding: 18px 22px; border-radius: 16px; background: var(--bg-soft); cursor: pointer; transition: background-color .18s ease; }
.check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border: 2px solid var(--gray-400); border-radius: 8px; background: #fff; transition: background-color .18s ease, border-color .18s ease; }
.check-box::after { content: ""; width: 14px; height: 14px; background: #fff; -webkit-mask: var(--m-done) center / contain no-repeat; mask: var(--m-done) center / contain no-repeat; transform: scale(0); transition: transform .18s ease; }
.check:hover { background: #f2f7ff; }
.check:hover .check-box { border-color: var(--blue-cta); }
.check input:checked + .check-box { border-color: var(--blue-cta); background: var(--blue-cta); }
.check input:checked + .check-box::after { transform: scale(1); }
.check input:focus-visible + .check-box { outline: 3px solid var(--blue-600); outline-offset: 3px; }
.check:has(input:checked) { background: var(--m-tint); }
.check:has(input:checked) .check-text { color: var(--gray-600); }
.check-text { min-width: 0; line-height: 1.5; }

/* ---------- questionnaire ---------- */
.questions { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.question { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px 16px 16px; border-radius: 16px; background: var(--bg-soft); scroll-margin-top: 24px; transition: background-color .18s ease; }
.question:has(input:checked) { background: var(--m-tint); }
.question-no { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--blue-900); font-size: 16px; font-weight: 600; line-height: 1; }
.question-body { flex: 1; min-width: 0; }
.material-text .question-text { margin: 0; padding-top: 5px; font-size: 17px; line-height: 1.45; font-weight: 600; }
.material-text .question-note { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--gray-600); }
.options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.option { position: relative; display: inline-flex; cursor: pointer; }
.option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.option-text { display: inline-flex; align-items: center; padding: 10px 20px; border: 1px solid var(--m-edge); border-radius: 35px; background: #fff; color: var(--blue-500); font-size: 15px; font-weight: 600; line-height: 1.2; transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
.option:hover .option-text { border-color: var(--blue-cta); background: #f2f7ff; }
.option input:checked + .option-text { border-color: var(--blue-cta); background: var(--blue-cta); color: #fff; }
.option input:focus-visible + .option-text { outline: 3px solid var(--blue-600); outline-offset: 2px; }

/* typed answers: a soft field on the question's own surface; the focus state is a blue edge plus the shared ring */
.answer { position: relative; margin-top: 12px; }
.answer textarea {
  display: block; width: 100%; min-height: 76px; max-height: 70vh; margin: 0; padding: 12px 16px;
  border: 1px solid var(--m-edge); border-radius: 12px; background: #fff; color: #212121;
  font: 400 16px/1.5 var(--font); resize: vertical; field-sizing: content;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.answer textarea:hover { border-color: var(--blue-cta); }
.answer textarea:focus { border-color: var(--blue-cta); box-shadow: 0 0 0 3px var(--m-tint); }
.answer textarea:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 2px; }
.answer-print { display: none; }
.answer-count { position: absolute; right: 14px; bottom: 8px; font-size: 12px; line-height: 1; color: var(--gray-600); pointer-events: none; }
.question:has(.answer) .question-note { margin-top: 14px; }

/* ---------- prompts ---------- */
.prompts { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.prompt { padding: 12px; border-radius: 24px; background: var(--bg-soft); scroll-margin-top: 24px; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 12px 4px; }
.prompt-no { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--blue-900); font-size: 17px; font-weight: 600; line-height: 1; }
.prompt-text { padding: 20px 24px; border-radius: 16px; background: #fff; }
.prompt-text p { margin: 0; }
.prompt-text p + p { margin-top: 12px; }
.prompt-lead { font-size: 17px; font-weight: 500; }
.prompt-text .part strong { display: block; margin-bottom: 2px; }
.prompt-sub { margin-top: 20px !important; font-weight: 600; }
.sub-no { color: var(--blue-500); }
.sub-no.tight { margin-right: .3em; }
.prompt-text .part + .part { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { min-width: 0; }
.chips a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 12px 20px; border-radius: 35px; background: var(--bg-soft); color: var(--blue-cta); font-size: 15px; font-weight: 500; line-height: 1.3; text-decoration: none; transition: background-color .18s ease; }
.chips a::after { content: ""; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--m-out) center / contain no-repeat; mask: var(--m-out) center / contain no-repeat; }
.chips a:hover { background: var(--m-tint); }

/* ---------- one long prompt ---------- */
.sheet { padding: 8px 40px; border-radius: 24px; background: var(--bg-soft); }
.sheet .part { padding: 32px 0; border-top: 1px solid rgba(33, 33, 33, .1); scroll-margin-top: 24px; }
.sheet .part:first-child { border-top: 0; }
.material-text .sheet h2 { margin: 0 0 16px; font-size: 24px; }
.sheet h2.step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sheet .step-no { display: inline-flex; padding: 6px 14px; border-radius: 35px; background: #fff; color: var(--blue-900); font-size: 14px; font-weight: 600; line-height: 1.2; }
.sheet p:last-child, .sheet .material-list:last-child { margin-bottom: 0; }
.sheet mark { background: #fff; }

/* ---------- copy button (one place per card: top right of the head) ---------- */
.material-copy { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px 10px 14px; border: 0; border-radius: 35px; background: #fff; color: var(--blue-cta); font: 600 14px/1.2 var(--font); cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.material-copy::before { content: ""; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--m-copy) center / contain no-repeat; mask: var(--m-copy) center / contain no-repeat; }
.material-copy:hover { background: var(--m-tint); }
.material-copy[data-state="copied"], .material-copy[data-state="copied"]:hover { background: var(--blue-cta); color: #fff; }
.material-copy[data-state="copied"]::before { -webkit-mask-image: var(--m-done); mask-image: var(--m-done); }
.material-copy--hero { padding: 18px 32px 18px 26px; font: 500 16px/1 var(--font); }
.material-copy--hero[data-state="copied"], .material-copy--hero[data-state="copied"]:hover { background: var(--blue-cta); color: #fff; }

/* ---------- tablet and phone ---------- */
@media (max-width: 1099px) {
  .material-layout.has-aside { display: block; }
  .material-text, .has-aside .material-text { max-width: 780px; margin-inline: auto; }
  .material-aside { margin: 0 auto 24px; max-width: 780px; }
  .material-nav summary { pointer-events: auto; cursor: pointer; }
  .material-nav summary::after { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--m-down) center / contain no-repeat; mask: var(--m-down) center / contain no-repeat; transition: transform .18s ease; }
  .material-nav[open] summary::after { transform: rotate(180deg); }
  .material-nav ol { max-height: 50vh; }
  /* Progress follows the reader as a slim bar. */
  .material-aside:has(.material-progress) { top: 8px; margin-bottom: 16px; }
  .material-progress { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border: 1px solid var(--m-edge); background: #fff; box-shadow: 0 8px 24px rgba(32, 32, 34, .08); }
  .progress-count { flex: none; margin: 0; font-size: 16px; }
  .material-progress progress, .material-progress progress::-webkit-progress-bar { background: var(--m-tint); }
  .progress-count b { font-size: 28px; letter-spacing: -.5px; }
}
@media (max-width: 1099px) and (min-width: 701px) {
  .material-hero { padding: 28px 40px 40px; }
  .material h1 { font-size: 38px; }
}
@media (max-width: 700px) {
  .material { padding: 24px 0 56px; font-size: 16px; }
  .material-hero { padding: 16px 20px 24px; border-radius: 20px; }
  .material-hero-top { margin-bottom: 28px; gap: 12px; }
  .material-logo { padding: 6px 12px; border-radius: 12px; }
  .material-logo img { height: 28px; }
  .material h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.4px; }
  .material-actions { margin-top: 24px; }
  .material-download, .material-copy--hero, .material-clear { flex: 1 1 auto; padding: 16px 24px; }
  .answer textarea { padding: 10px 12px; }
  .material-layout { margin-top: 32px; }
  .material-text h2 { margin: 40px 0 16px; font-size: 22px; }
  .check { gap: 14px; padding: 14px 16px; }
  .question { gap: 12px; padding: 14px 14px 14px 12px; }
  .question-no { width: 32px; height: 32px; font-size: 15px; }
  .question-text { padding-top: 3px; font-size: 16px; }
  .prompt { padding: 8px; border-radius: 20px; }
  .prompt-head { padding: 0 2px 8px; }
  .prompt-no { width: 36px; height: 36px; font-size: 16px; }
  .prompt-text { padding: 16px 18px; }
  .prompt-lead { font-size: 16px; }
  .sheet { padding: 4px 20px; border-radius: 20px; }
  .sheet .part { padding: 24px 0; }
  .material-text .sheet h2 { font-size: 20px; }
  .chips a { padding: 11px 16px; }
}
@media (max-width: 380px) {
  .material-back { padding-right: 12px; }
  .material-logo { padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .material *, .material *::before, .material *::after { transition: none !important; }
  .material-download:hover, .material-copy--hero:hover, .material-clear:hover { transform: none; }
}

/* ---------- print: the checklist / questionnaire as a paper form ---------- */
@media print {
  .header, .footer, .material-back, .material-logo, .material-actions, .material-aside, .material-copy, .material-status { display: none !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0 !important; }
  .material { padding: 0; font-size: 11pt; line-height: 1.45; }
  .material-hero { padding: 0 0 16pt; background: none; border-radius: 0; }
  .material-hero-top { display: none; }
  .material h1 { font-size: 20pt; max-width: none; }
  .material-layout { margin-top: 0; }
  .material-text { max-width: none; }
  .check, .question, .prompt, .prompt-text, .sheet { background: #fff !important; border-radius: 0; }
  .check { padding: 7pt 0; border-bottom: 1px solid #bbb; break-inside: avoid; }
  .check-box, .check input:checked + .check-box { width: 14pt; height: 14pt; border: 1.5px solid #000; border-radius: 3pt; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .check input:checked + .check-box::after { background: #000; transform: scale(1); }
  .question { padding: 8pt 0; border-bottom: 1px solid #bbb; break-inside: avoid; }
  .question-no { background: none; width: auto; height: auto; min-width: 18pt; place-items: start; }
  .question:not(.question--choice) .question-body:not(:has(.answer:not([hidden])))::after { content: ""; display: block; height: 48pt; margin-top: 6pt; background: repeating-linear-gradient(to bottom, transparent 0, transparent 23pt, #999 23pt, #999 24pt); }
  .material-clear, .material-note, .material-end { display: none; }
  .answer { margin-top: 4pt; }
  .answer textarea { display: none; }
  .answer-print { display: block; min-height: 48pt; white-space: pre-wrap; color: #000; font: 11pt/24pt var(--font); background: repeating-linear-gradient(to bottom, transparent 0, transparent 23pt, #999 23pt, #999 24pt) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .answer-count { display: none; }
  .question .question-note { color: #000; }
  .option-text, .option input:checked + .option-text { padding: 3pt 10pt; border: 1px solid #000; background: #fff !important; color: #000; }
  .option input:checked + .option-text { font-weight: 700; text-decoration: underline; }
  .prompt { padding: 0 0 8pt; border-bottom: 1px solid #bbb; }
  .prompt-text { padding: 0; }
  .sheet { padding: 0; }
  .material-text a, .material-text mark { background: none; color: #000; padding: 0; }
}
