/* CTXLIBRARY v2 — estetyka magazynowa */
:root {
  --cream: #f6f2ea;
  --paper: #fffdf8;
  --ink: #171411;
  --navy: #102a43;
  --gold: #b28a2e;
  --muted: #6f675d;
  --line: #ddd4c5;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, Arial, Helvetica, sans-serif;
  --display: 'Arial Black', 'Helvetica Bold', Impact, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==== TOPBAR ==== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px;
  background: var(--cream);
  border-bottom: 1px solid rgba(23,20,17,.08);
  gap: 20px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; font-weight: 900; font-size: 26px; color: var(--ink); letter-spacing: -.02em; }
.brand img { height: 56px; }
.brand span { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }
.topbar nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
  background: none; border: 0; cursor: pointer;
  font: inherit; color: var(--ink); font-weight: 700; font-size: 14px;
}
.topbar nav button { padding: 8px 14px; border: 1px solid rgba(23,20,17,.15); border-radius: 999px; }
.topbar nav button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ==== CONTAINER ==== */
.container { max-width: 1280px; margin: 0 auto; padding: 26px 40px 40px; }

/* ==== TYPOGRAFIA ==== */
h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 78px);
  line-height: .94;
  letter-spacing: -.06em;
  color: var(--ink);
  margin: 0 0 20px;
  font-weight: 900;
}
h1 em { font-style: italic; font-weight: 900; letter-spacing: -.06em; }
h2 {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -.04em;
  color: var(--ink);
  margin: 24px 0 12px;
  font-weight: 900;
}
h3 { font-family: var(--sans); font-weight: 900; font-size: 20px; letter-spacing: -.02em; }
.lead {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 28px;
}

/* ==== HERO ==== */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-bottom: 28px; }
.hero-copy h1 { margin-bottom: 20px; }
.hero-copy .lead { max-width: 520px; }
.hero-visual { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
.hero-visual h3 { font-family: var(--display); letter-spacing: -.03em; font-size: 20px; margin: 0 0 18px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 24px; } }

/* ==== BUTTONS ==== */
.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  letter-spacing: .01em;
}
.btn.secondary { background: var(--paper); color: var(--ink); border: 1px solid rgba(23,20,17,.15); }
.btn:hover { text-decoration: none; opacity: .92; }
.btn.danger { background: #b33a3a; color: #fff; }

/* ==== FEATURED ==== */
.featured-list { display: flex; flex-direction: column; gap: 12px; }
.featured-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(23,20,17,.08);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .15s;
}
.featured-item:hover { transform: translateY(-1px); text-decoration: none; border-color: rgba(23,20,17,.22); }
.featured-item img, .featured-item .cover {
  width: 90px; height: 68px;
  object-fit: cover;
  border-radius: 10px;
  background: #efe8dc;
  display: block;
}
.featured-item strong { display: block; font-weight: 900; color: var(--ink); font-size: 15px; letter-spacing: -.02em; margin-bottom: 3px; }
.featured-item span { display: block; font-size: 12px; color: var(--muted); }

/* ==== SEARCH ==== */
.search-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px 32px;
  margin-bottom: 28px;
}
.search-box h2 { margin-top: 0; }
.search-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: center; }
.search-grid select, .search-grid input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
@media (max-width: 900px) { .search-grid { grid-template-columns: 1fr 1fr; } }

/* ==== BOOKS GRID ==== */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin-top: 20px; }
.book-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .15s;
}
.book-card:hover { transform: translateY(-2px); text-decoration: none; }
.book-card .cover { width: 100%; height: 180px; object-fit: cover; background: #efe8dc; display: block; }
.book-card .body { padding: 18px; }
.book-card strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; font-weight: 900; letter-spacing: -.02em; }
.book-card span { color: var(--muted); font-size: 13px; }

.book-card .book-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.book-card .book-meta span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: #f0e9dc; color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.book-card .book-meta span.ai { background: #e8f0ff; color: #1c4f86; }
.book-card .book-meta span.lang { background: var(--ink); color: #fff; text-transform: uppercase; }
.book-card .book-meta span.time { background: #fff2cc; color: #6b5218; }
.books-all-link { display: inline-block; margin-top: 28px; font-weight: 900; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.books-all-link:hover { text-decoration: none; }

/* ==== LOGIN ==== */
.login-wrap { max-width: 440px; margin: 60px auto; padding: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; }
.login-wrap h2 { margin-top: 0; font-family: var(--display); }
.field { display: block; margin: 16px 0; }
.field label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.field input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; }
.error { background: #fff3f3; color: #8a1f11; border: 1px solid #f0bdb8; padding: 12px 14px; border-radius: 12px; margin-top: 14px; font-weight: 700; }

/* ==== READER ==== */
.reader-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px;
  max-width: 1440px; margin: 32px auto; padding: 0 40px; align-items: start;
}
.article { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 56px; }
.article h1 { font-size: clamp(36px, 4.5vw, 60px); margin-bottom: 8px; letter-spacing: -.05em; }
.article .subtitle { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); margin-bottom: 6px; }
.article .author { color: var(--gold); font-weight: 900; margin-bottom: 36px; font-size: 15px; }
.article section { margin-bottom: 52px; }
.article section h2 { font-size: 28px; margin-top: 0; }
.article p { font-family: var(--serif); font-size: 19px; line-height: 1.75; margin: 0 0 20px; color: #1c1814; }
.term { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.term.active { background: #fff2cc; border-radius: 4px; padding: 0 3px; }
.term .ctx-badge { font-family: Arial, Helvetica, sans-serif; font-size: 9px; font-weight: 900; letter-spacing: .05em; color: var(--gold); text-decoration: none; margin-left: 2px; vertical-align: super; line-height: 1; }

/* Cover w czytniku */
.reader-cover-hero { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: center; margin-bottom: 48px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.reader-cover-img { width: 100%; border-radius: 14px; overflow: hidden; background: #efe8dc; box-shadow: 0 10px 30px rgba(16,42,67,.15); }
.reader-cover-img img { width: 100%; display: block; aspect-ratio: 2/3; object-fit: cover; }
@media (max-width: 700px) { .reader-cover-hero { grid-template-columns: 1fr; gap: 20px; } }

.section-kicker { font-size: 11px; letter-spacing: .16em; font-weight: 900; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.section-summary { font-style: italic; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }

/* ==== LEKTOR (TTS) ==== */
.tts-panel {
  margin: 0 0 40px;
  padding: 22px 24px;
  background: linear-gradient(180deg, #fffdf8 0%, #f7f1e4 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(16,42,67,.06);
}
.tts-label {
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.tts-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tts-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 800 13px var(--sans);
  cursor: pointer;
  transition: all .12s;
}
.tts-btn:hover:not(:disabled) { background: var(--ink); color: #fff; border-color: var(--ink); }
.tts-btn:disabled { opacity: .4; cursor: not-allowed; }
.tts-btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.tts-btn.primary:hover:not(:disabled) { background: #333; border-color: #333; }
.tts-btn.danger { color: #b33a3a; border-color: rgba(179,58,58,.35); }
.tts-btn.danger:hover:not(:disabled) { background: #b33a3a; color: #fff; border-color: #b33a3a; }
.tts-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-bottom: 12px; }
.tts-field { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 800; color: var(--ink); }
.tts-field select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: 700 13px var(--sans);
  color: var(--ink);
  max-width: 240px;
}
.tts-rate-btn {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 800 12px var(--sans);
  cursor: pointer;
  transition: all .12s;
}
.tts-rate-btn:hover { border-color: var(--ink); }
.tts-rate-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tts-status {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid rgba(23,20,17,.06);
}

/* ==== MEDIA ==== */
.reader-media {
  margin: 32px auto;
  max-width: 720px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(16,42,67,.06);
}
.reader-media img { width: 100%; max-height: 480px; object-fit: contain; background: #f4f0e8; display: block; cursor: zoom-in; }
.reader-media video { width: 100%; max-height: 480px; background: #111; display: block; cursor: pointer; }
.reader-media audio { width: 100%; padding: 16px; background: var(--paper); }
.reader-media .caption { padding: 12px 16px; border-top: 1px solid var(--line); background: #faf7f2; font-size: 13px; color: var(--muted); line-height: 1.45; }
.reader-media .caption strong { color: var(--ink); display: block; margin-bottom: 2px; font-weight: 800; }

/* ==== LIGHTBOX ==== */
.ctx-lightbox { position: fixed; inset: 0; z-index: 999999; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; }
.ctx-lightbox img, .ctx-lightbox video { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 12px; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.ctx-lightbox audio { width: min(600px, 90vw); padding: 20px; background: #fff; border-radius: 12px; }
.ctx-lightbox-close { position: fixed; right: 22px; top: 18px; z-index: 1000000; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.55); color: #fff; border-radius: 999px; padding: 10px 16px; font: 900 14px var(--sans); cursor: pointer; }
.ctx-lightbox-close:hover { background: rgba(0,0,0,.85); }

/* ==== PANEL CTX ==== */
.ctx-panel { position: sticky; top: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 28px; min-height: 300px; }
.ctx-panel .label { font-size: 11px; letter-spacing: .16em; font-weight: 900; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.ctx-panel h3 { color: var(--ink); font-size: 22px; margin: 4px 0 12px; font-family: var(--display); letter-spacing: -.02em; }
.ctx-panel p { margin: 0 0 12px; color: var(--ink); font-family: var(--serif); font-size: 16px; line-height: 1.65; }
.ctx-panel .why { color: var(--muted); font-style: italic; font-size: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--serif); }

/* ==== EDU w czytniku ==== */
.edu-block { margin-top: 72px; padding-top: 40px; border-top: 3px double var(--line); }
.edu-label { font-size: 11px; letter-spacing: .18em; font-weight: 900; color: var(--gold); text-transform: uppercase; margin-bottom: 10px; }
.edu-block h2 { font-family: var(--display); font-size: 30px; margin: 0 0 16px; letter-spacing: -.03em; }
.edu-instructions { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 16px; margin-bottom: 20px; }
.edu-time { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* KARTA PRACY */
.edu-ws-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 24px; padding: 14px 16px; background: #faf7f2; border: 1px solid var(--line); border-radius: 14px; }
.edu-ws-btn { padding: 10px 18px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-weight: 900; cursor: pointer; font-size: 13px; }
.edu-ws-btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.edu-ws-btn:hover { opacity: .92; }
.edu-ws-hint { font-size: 12px; color: var(--muted); margin-left: auto; }
.edu-task { margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px dashed var(--line); }
.edu-task:last-child { border-bottom: 0; }
.edu-task-head { font-family: var(--display); font-size: 17px; font-weight: 900; margin-bottom: 8px; letter-spacing: -.01em; }
.edu-task-type { display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-left: 8px; padding: 2px 8px; background: #f0e9dc; border-radius: 999px; vertical-align: middle; }
.edu-task-prompt { font-family: var(--serif); font-size: 16px; line-height: 1.65; color: #2a2520; margin-bottom: 14px; }
.edu-answer {
  width: 100%; min-height: 120px; padding: 14px 16px;
  font: 16px/1.65 var(--serif); color: var(--ink); background: #fffefb;
  border: 1px solid var(--line); border-radius: 12px; resize: vertical;
  box-shadow: inset 0 1px 2px rgba(23,20,17,.03);
}
.edu-answer:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,20,17,.08); }
.edu-checklist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.edu-check-item { display: flex; gap: 10px; align-items: flex-start; font-family: var(--serif); font-size: 16px; line-height: 1.5; cursor: pointer; }
.edu-check-item input { margin-top: 4px; width: 18px; height: 18px; accent-color: #171411; flex: 0 0 auto; }

/* QUIZ */
.edu-quiz-score { font-family: var(--display); font-size: 16px; color: var(--ink); background: #fff2cc; padding: 10px 16px; border-radius: 999px; display: inline-block; margin-bottom: 20px; letter-spacing: -.01em; }
.edu-quiz-result { margin: 0 0 24px; }
.edu-quiz-result-box { background: linear-gradient(135deg,#102a43,#1c4f86); color: #fff; border-radius: 20px; padding: 28px; text-align: center; box-shadow: 0 16px 40px rgba(16,42,67,.25); }
.edu-quiz-result-emoji { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.edu-quiz-result-num { font-family: var(--display); font-size: 44px; letter-spacing: -.04em; line-height: 1; margin-bottom: 6px; }
.edu-quiz-result-pct { font-family: var(--display); font-size: 22px; color: #f0c96a; letter-spacing: -.02em; margin-bottom: 12px; }
.edu-quiz-result-msg { font-family: var(--serif); font-style: italic; font-size: 17px; opacity: .9; }

.edu-quiz-list { display: flex; flex-direction: column; gap: 24px; }
.edu-quiz-question { padding-bottom: 22px; border-bottom: 1px dashed var(--line); }
.edu-quiz-question:last-child { border-bottom: 0; }
.edu-quiz-qtext { font-family: var(--display); font-size: 16px; font-weight: 900; margin-bottom: 14px; letter-spacing: -.01em; line-height: 1.35; }
.edu-quiz-options { display: flex; flex-direction: column; gap: 8px; }
.edu-quiz-option { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; font-size: 15px; font-family: var(--serif); line-height: 1.5; transition: all .12s; }
.edu-quiz-option:hover { border-color: var(--ink); background: #faf7f2; }
.edu-quiz-letter { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font: 900 13px var(--sans); flex: 0 0 26px; }
.edu-quiz-option.correct { background: #eef8ee; border-color: #14a44d; }
.edu-quiz-option.correct .edu-quiz-letter { background: #14a44d; }
.edu-quiz-option.wrong { background: #fff3f3; border-color: #e53935; }
.edu-quiz-option.wrong .edu-quiz-letter { background: #e53935; }
.edu-quiz-option.answered { cursor: default; }
.edu-quiz-option.answered:hover { background: inherit; border-color: inherit; }
.edu-quiz-expl { margin-top: 12px; padding: 12px 16px; background: #faf7f2; border-radius: 12px; font-family: var(--serif); font-size: 14px; line-height: 1.6; color: #2a2520; }
.edu-quiz-expl .ok { color: #176b3a; font-weight: 900; }
.edu-quiz-expl .bad { color: #b33a3a; font-weight: 900; }

/* ==== RESPONSYWNE ==== */
@media (max-width: 980px) {
  .reader-layout { grid-template-columns: 1fr; padding: 0 20px; }
  .article { padding: 28px; }
  .ctx-panel { position: static; }
  .topbar { padding: 12px 20px; }
  .container { padding: 22px 20px 40px; }
  .brand img { height: 48px; }
  .tts-row { gap: 12px; }
  .tts-field select { max-width: 180px; }
}

/* ==== FOOTER ==== */
.site-footer {
  margin-top: 72px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 40px 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-col { min-width: 0; }
.footer-brand-col { display: flex; flex-direction: column; gap: 14px; }
.footer-brand { display: inline-flex; align-items: center; text-decoration: none; }
.footer-brand img { height: 44px; display: block; }
.footer-tagline {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  max-width: 360px;
}
.footer-heading {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: color .15s;
}
.footer-links a:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-bottom {
  max-width: 1280px;
  margin: 36px auto 0;
  padding: 22px 40px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}
.footer-bottom a { color: var(--ink); font-weight: 800; }
@media (max-width: 900px) {
  .site-footer { margin-top: 48px; }
  .footer-inner { grid-template-columns: 1fr 1fr; padding: 32px 20px 0; gap: 28px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { padding: 18px 20px 24px; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
@media print {
  .site-footer { display: none !important; }
}
/* ==== CTX MODAL (mobile) ==== */
.ctx-modal {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(16, 42, 67, .55);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
  animation: ctxModalFade .15s ease-out;
}
@keyframes ctxModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ctx-modal-inner {
  background: var(--paper);
  width: 100%;
  max-width: 720px;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, .35);
}
.ctx-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 900 22px Arial, sans-serif;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctx-modal-close:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.ctx-modal-label {
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-right: 50px;
}
.ctx-modal-title {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 16px;
  padding-right: 50px;
}
.ctx-modal-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}
.ctx-modal-expl {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: #1c1814;
  margin: 0 0 16px;
}
.ctx-modal-why {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}
.ctx-modal-actions {
  padding: 14px 0 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  justify-content: center;
}
.ctx-modal-btn {
  padding: 12px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 900 14px var(--sans);
  cursor: pointer;
  letter-spacing: .02em;
}
.ctx-modal-btn:hover {
  opacity: .92;
}
@media (min-width: 901px) {
  .ctx-modal {
    align-items: center;
    padding: 40px;
  }
  .ctx-modal-inner {
    height: auto;
    max-height: 80vh;
    border-radius: 24px;
    padding: 32px 36px 0;
  }
}

/* ==== MOBILNY SPIS ROZDZIALOW ==== */
.toc-mobile {
  display: none;
}
@media (max-width: 900px) {
  .toc-mobile {
    display: block;
    margin: 0 0 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
  }
  .toc-mobile-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 900;
    font-size: 14px;
    color: var(--ink);
    list-style: none;
    user-select: none;
  }
  .toc-mobile-summary::-webkit-details-marker { display: none; }
  .toc-mobile-icon {
    font-size: 18px;
    line-height: 1;
    color: var(--gold);
  }
  .toc-mobile-label {
    flex: 1;
    letter-spacing: -.01em;
  }
  .toc-mobile-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
  }
  .toc-mobile[open] .toc-mobile-summary {
    border-bottom: 1px solid var(--line);
  }
  .toc-mobile-list {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
  }
  .toc-mobile-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 18px;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink);
    cursor: pointer;
    border-bottom: 1px solid rgba(221, 212, 197, .4);
  }
  .toc-mobile-item:last-child {
    border-bottom: 0;
  }
  .toc-mobile-item:hover,
  .toc-mobile-item:active {
    background: #faf7f2;
  }
  .toc-mobile-num {
    font-weight: 900;
    color: var(--gold);
    flex: 0 0 auto;
  }
  .toc-mobile-name {
    flex: 1;
  }
  .toc-mobile-item.active {
    background: var(--ink);
    color: #fff;
  }
  .toc-mobile-item.active .toc-mobile-num {
    color: var(--gold);
  }
}
