/* Dissertation reading layout */
.diss-body { background: var(--bg-0); }

/* Header search — pinned in dissertation page nav */
.header-search-wrap {
  flex: 1;
  max-width: 380px;
  position: relative;
  margin: 0 18px;
}
.header-search {
  width: 100%;
  padding: 8px 14px 8px 38px;
  font-size: 14px;
  font-family: var(--sans);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238a7e6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 12px center;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  backdrop-filter: blur(10px);
}
.header-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.16);
}
.header-search::placeholder { color: var(--ink-mute); }

/* Dropdown of search hits */
.header-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 6px;
  z-index: 80;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.04);
  font-family: var(--sans);
}
.header-search-results li { margin: 0; padding: 0; }
.header-search-results a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.4;
  transition: background .12s, color .12s;
}
.header-search-results a:hover,
.header-search-results a.active {
  background: var(--accent);
  color: var(--btn-primary-fg);
}
.header-search-results .level-l1 { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink); }
.header-search-results .level-l2 { padding-left: 26px; }
.header-search-results .level-l3 { padding-left: 42px; font-size: 13px; color: var(--ink-mute); }
.header-search-results a:hover .level-l1,
.header-search-results a:hover.level-l1,
.header-search-results .level-l1:hover { color: var(--btn-primary-fg); }
.header-search-results .empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-mute);
  font-style: italic;
  font-size: 13.5px;
}
.header-search-results mark {
  background: rgba(217, 119, 87, 0.30);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

@media (max-width: 880px) {
  .header-search-wrap { margin: 0 10px; }
  .header-search { font-size: 13.5px; padding: 7px 12px 7px 34px; background-position: 10px center; }
}
@media (max-width: 540px) {
  /* Hide search on very narrow screens — TOC sidebar still has its own search */
  .header-search-wrap { display: none; }
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 100;
  transition: width .1s linear;
  pointer-events: none;
}

/* Stats line under header */
.diss-hdr-stats {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.diss-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  max-width: 1400px;
  margin: 0 auto;
  gap: 0;
  align-items: start;
}

/* TOC sidebar */
.diss-toc {
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 32px 22px 80px 28px;
  border-right: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background .3s, border-color .3s;
}
.diss-toc::-webkit-scrollbar { width: 6px; }
.diss-toc::-webkit-scrollbar-thumb { background: rgba(217, 119, 87, 0.3); border-radius: 999px; }
.toc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
/* TOC search input */
.toc-search {
  width: 100%;
  margin-bottom: 14px;
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  font-family: var(--sans);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--glass) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a7e6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 10px center;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
.toc-search:focus { border-color: var(--accent); }
.toc-search::placeholder { color: var(--ink-mute); }
.toc-list li.toc-hidden { display: none; }
.toc-mins {
  float: right;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
  font-family: var(--sans);
  background: rgba(217, 119, 87, 0.08);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 8px;
  letter-spacing: 0.02em;
}
.toc-pdf {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 6px 0;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--glass);
  color: var(--ink-soft);
  font-size: 13px;
  font-family: var(--sans);
  text-decoration: none;
  transition: all .15s;
}
.toc-pdf:hover { border-color: var(--accent); color: var(--accent-soft); }
.toc-eyebrow {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.toc-close {
  display: none;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.toc-list li {
  position: relative;
  padding: 6px 0 6px 0;
  border-bottom: 1px dashed var(--line);
}
.toc-list li:last-child { border-bottom: 0; }
.toc-list a {
  display: block;
  padding: 4px 6px 4px 8px;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  border-radius: 0 6px 6px 0;
}
.toc-list a:hover {
  color: var(--ink);
  background: rgba(217, 119, 87, 0.08);
  border-left-color: var(--accent);
}
.toc-list a.active {
  color: var(--accent-soft);
  border-left-color: var(--accent);
  background: rgba(217, 119, 87, 0.06);
}
.toc-l1 a { font-weight: 600; color: var(--ink); font-family: var(--serif); font-size: 15px; letter-spacing: 0.2px; }
.toc-l2 a { padding-left: 22px; }
.toc-l3 a { padding-left: 38px; font-size: 12.5px; }
.toc-l4 a { padding-left: 54px; font-size: 12px; color: var(--ink-mute); font-style: italic; }

/* Collapsible group: h3 with h4 children (Module → Lessons) */
.toc-list li.has-children { position: relative; }
.toc-list li.has-children > a { padding-right: 30px; }
.toc-expand {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: transform .15s ease, color .15s, background .15s, border-color .15s;
}
.toc-expand:hover { color: var(--accent); border-color: var(--accent); background: rgba(217, 119, 87, 0.08); }
.toc-expand svg { transition: transform .2s ease; }
.toc-list li.expanded .toc-expand svg { transform: rotate(180deg); }
.toc-list li.expanded .toc-expand { color: var(--accent); border-color: var(--accent); }

/* Hidden child items by default (also via [hidden] attribute) */
.toc-list li.toc-child[hidden] { display: none; }
/* When search is active, force-show all matching items regardless of collapse */
.toc-list.searching li.toc-child[hidden] { display: list-item; }

/* Content — full grid-column width; reading column constrained per-element */
.diss-content {
  padding: 56px 80px 140px;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
}
/* Constrain text-bearing elements to a comfortable reading column */
.diss-content > .diss-hdr,
.diss-content > h1,
.diss-content > h2,
.diss-content > h3,
.diss-content > p,
.diss-content > ul,
.diss-content > ol {
  max-width: 760px;
  margin-left: 0;
  margin-right: auto;
}
.diss-hdr {
  border-bottom: 1px solid var(--line);
  padding-bottom: 32px;
  margin-bottom: 40px;
}
.diss-hdr-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.diss-hdr-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin: 0 0 20px;
  color: var(--ink);
}
.diss-hdr-title em { color: var(--accent); font-style: italic; }
.diss-hdr-author {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.diss-hdr-meta {
  font-size: 13.5px;
  color: var(--ink-mute);
  line-height: 1.6;
}

.diss-content h1, .diss-content h2, .diss-content h3, .diss-content h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  scroll-margin-top: 100px;
}
.diss-content h1 {
  font-size: clamp(28px, 3.4vw, 36px);
  margin: 90px 0 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--accent);
  line-height: 1.2;
}
.diss-content h1::before {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 16px;
}
.diss-content h1:first-of-type { margin-top: 24px; }
.diss-content h2 {
  font-size: 26px;
  margin: 64px 0 20px;
  color: var(--accent-soft);
  font-weight: 600;
  line-height: 1.25;
}
.diss-content h3 {
  font-size: 20px;
  margin: 44px 0 16px;
  color: var(--ink);
  font-weight: 500;
  font-style: italic;
  line-height: 1.3;
}
.diss-content h4 {
  font-size: 17px;
  margin: 32px 0 14px;
  color: var(--accent-deep);
  font-weight: 600;
  font-style: normal;
  font-family: var(--sans);
  letter-spacing: 0.01em;
  line-height: 1.35;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}

/* Paragraphs — Lora is more readable for body Cyrillic than Cormorant */
.diss-content p {
  font-family: "Lora", "Charter", Georgia, serif;
  font-size: 17.5px;
  line-height: 1.78;
  margin: 0 0 1.1em;
  color: var(--ink);
  text-align: left;
  hyphens: none;
  word-spacing: 0.01em;
}
.diss-content p strong {
  color: var(--accent-deep);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Author's own definitions — visually highlighted callouts
   ("пропонується розуміти", "визначаємо як", "у нашому розумінні", тощо) */
.diss-content p.diss-callout {
  position: relative;
  padding: 18px 24px 18px 28px;
  margin: 28px 0 32px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(
    90deg,
    rgba(217, 119, 87, 0.10) 0%,
    rgba(217, 119, 87, 0.04) 60%,
    transparent 100%);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}
.diss-content p.diss-callout::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -3px;
  width: 3px;
  height: 28px;
  background: var(--accent-soft);
  box-shadow: 0 0 12px rgba(217, 119, 87, 0.6);
}
[data-theme="light"] .diss-content p.diss-callout {
  background: linear-gradient(
    90deg,
    rgba(194, 93, 54, 0.10) 0%,
    rgba(194, 93, 54, 0.03) 60%,
    transparent 100%);
}
.diss-content p.diss-callout strong { color: var(--accent); }

/* Inline glossary cross-references — first occurrence per chapter */
.diss-content .gloss-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(217, 119, 87, 0.55);
  transition: color .15s, border-color .15s, background .15s;
  cursor: help;
}
.diss-content .gloss-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(217, 119, 87, 0.08);
}
/* Programme principles & methods — extra-prominent variant of gloss-link */
.diss-content .gloss-link[href*="g-principle-"],
.diss-content .gloss-link[href*="g-method-"] {
  font-weight: 600;
  color: var(--accent-deep);
  border-bottom: none;
  background: rgba(217, 119, 87, 0.10);
  padding: 1px 8px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  margin-left: -2px;
}
.diss-content .gloss-link[href*="g-principle-"]:hover,
.diss-content .gloss-link[href*="g-method-"]:hover {
  background: var(--accent);
  color: var(--btn-primary-fg);
  border-left-color: var(--accent-soft);
}
[data-theme="light"] .diss-content .gloss-link[href*="g-principle-"],
[data-theme="light"] .diss-content .gloss-link[href*="g-method-"] {
  background: rgba(194, 93, 54, 0.12);
}
[data-theme="light"] .diss-content .gloss-link {
  border-bottom-color: rgba(194, 93, 54, 0.55);
}
[data-theme="light"] .diss-content .gloss-link:hover {
  background: rgba(194, 93, 54, 0.08);
}

/* Variable chips — when author enumerates variables/factors after «такими ..., як» */
.diss-content p .var-chip {
  display: inline-block;
  padding: 1px 11px;
  margin: 0 1px;
  border-radius: 999px;
  background: rgba(217, 119, 87, 0.10);
  border: 1px solid rgba(217, 119, 87, 0.28);
  color: var(--accent-deep);
  font-weight: 500;
  font-size: 0.96em;
  font-family: inherit;
  line-height: 1.6;
}
[data-theme="light"] .diss-content p .var-chip {
  background: rgba(194, 93, 54, 0.09);
  border-color: rgba(194, 93, 54, 0.32);
}
/* Gloss-links inside chips look the same colour, no extra underline */
.diss-content p .var-chip .gloss-link {
  border-bottom: 1px dashed rgba(217, 119, 87, 0.55);
  color: inherit;
}

/* Inline reference markers: [13], [13; 24] */
.ref-link {
  display: inline-block;
  padding: 0 6px;
  margin: 0 1px;
  font-size: 0.78em;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--accent-deep);
  background: rgba(217, 119, 87, 0.10);
  border: 1px solid rgba(217, 119, 87, 0.20);
  border-radius: 999px;
  text-decoration: none;
  vertical-align: 0.15em;
  line-height: 1.5;
  letter-spacing: 0.02em;
  transition: all .12s;
  white-space: nowrap;
}
.ref-link:hover {
  background: var(--accent);
  color: var(--btn-primary-fg);
  border-color: var(--accent);
}
[data-theme="light"] .ref-link {
  background: rgba(194, 93, 54, 0.10);
  border-color: rgba(194, 93, 54, 0.30);
  color: var(--accent-deep);
}

/* Bibliography numbered list */
.diss-content .biblio-list {
  font-family: "Lora", "Charter", Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  list-style: none;
  padding: 0;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  counter-reset: biblio;
}
.diss-content .biblio-list li {
  position: relative;
  padding: 8px 0 8px 44px;
  margin: 0;
  border-bottom: 1px dashed var(--line);
  scroll-margin-top: 90px;
}
.diss-content .biblio-list li::before {
  content: attr(value) ".";
  position: absolute;
  left: 0;
  top: 8px;
  width: 36px;
  text-align: right;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.diss-content .biblio-list li.is-target,
.diss-content .biblio-list li:target {
  background: rgba(217, 119, 87, 0.18);
  margin: 0 -12px;
  padding: 8px 12px 8px 56px;
  border-radius: 8px;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: refHighlight 2.2s ease-out;
}
.diss-content .biblio-list li.is-target::before,
.diss-content .biblio-list li:target::before { left: 12px; }
@keyframes refHighlight {
  0%   { background: rgba(217, 119, 87, 0.45); }
  60%  { background: rgba(217, 119, 87, 0.25); }
  100% { background: rgba(217, 119, 87, 0.10); }
}
/* Same effect on any heading anchor jump */
.diss-content h1.is-target,
.diss-content h2.is-target,
.diss-content h3.is-target {
  animation: headingFlash 1.8s ease-out;
}
@keyframes headingFlash {
  0% { background: rgba(217, 119, 87, 0.18); }
  100% { background: transparent; }
}
.diss-content p em {
  color: var(--ink);
  font-style: italic;
}
/* Lead emphasis — bold phrase at start of paragraph gets a slightly bigger feel */
.diss-content p > strong:first-child {
  display: inline-block;
  margin-right: 4px;
  color: var(--accent);
  font-weight: 600;
}

/* Drop cap on the first paragraph after a chapter heading */
.diss-content h1 + p::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  font-weight: 600;
  float: left;
  line-height: 0.9;
  margin: 0.05em 0.08em 0 0;
  color: var(--accent);
}

/* Lists */
.diss-content ul, .diss-content ol {
  font-family: "Lora", "Charter", Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  padding-left: 0;
  margin: 8px 0 1.4em;
  list-style: none;
}
.diss-content ul li, .diss-content ol li {
  position: relative;
  padding: 4px 0 4px 30px;
  margin-bottom: 8px;
}
.diss-content ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.85em;
  width: 14px;
  height: 1px;
  background: var(--accent);
}
.diss-content ol {
  counter-reset: ref;
}
.diss-content ol li {
  counter-increment: ref;
}
.diss-content ol li::before {
  content: counter(ref) ".";
  position: absolute;
  left: 0;
  top: 4px;
  font-feature-settings: "tnum" 1, "lnum" 1;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--sans);
  font-size: 14px;
  min-width: 28px;
}

/* Bibliography list — smaller, denser */
.diss-content ol.biblio {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.diss-content ol.biblio li { margin-bottom: 12px; padding-left: 38px; }
.diss-content ol.biblio li::before { font-size: 13px; min-width: 32px; }

/* Tighter spacing between consecutive paragraphs in same logical block */
.diss-content p + ul, .diss-content p + ol { margin-top: -0.4em; }
.diss-content ul + p, .diss-content ol + p { margin-top: 0.4em; }

/* Inclusion / exclusion criteria — visually distinct lists */
.diss-content ul.criteria-include,
.diss-content ul.criteria-exclude {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 14px 0 24px;
}
.diss-content ul.criteria-include li,
.diss-content ul.criteria-exclude li {
  position: relative;
  padding: 12px 16px 12px 48px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-left: 3px solid;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}
.diss-content ul.criteria-include li::before,
.diss-content ul.criteria-exclude li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: currentColor;
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
}
/* Inclusion — green check */
.diss-content ul.criteria-include li {
  border-left-color: #6ba368;
  background: rgba(107, 163, 104, 0.06);
}
.diss-content ul.criteria-include li::before {
  background-color: #6ba368;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}
/* Exclusion — accent-deep cross */
.diss-content ul.criteria-exclude li {
  border-left-color: var(--accent-deep);
  background: rgba(217, 119, 87, 0.07);
}
.diss-content ul.criteria-exclude li::before {
  background-color: var(--accent-deep);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
}
/* Light theme tweaks */
[data-theme="light"] .diss-content ul.criteria-include li {
  background: rgba(107, 163, 104, 0.08);
}
[data-theme="light"] .diss-content ul.criteria-exclude li {
  background: rgba(194, 93, 54, 0.08);
}

/* Figures — chart/diagram images extracted from the docx */
.diss-figure {
  margin: 36px auto 40px;
  max-width: 660px;
  text-align: center;
}
.diss-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 6px 18px -8px rgba(0,0,0,0.18);
}
[data-theme="dark"] .diss-figure img {
  background: #faf7f0;
  box-shadow: 0 0 0 1px rgba(244, 236, 223, 0.15), 0 8px 28px -10px rgba(0,0,0,0.6);
}
.diss-figure figcaption {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
  padding: 0 12px;
}
.diss-figure figcaption .cap-label {
  font-weight: 600;
  color: var(--accent-deep);
  font-style: normal;
  margin-right: 4px;
}
@media (max-width: 980px) {
  .diss-figure { margin: 24px auto 28px; max-width: 100%; }
  .diss-figure figcaption { font-size: 13px; padding: 0 4px; }
}

/* Tables — span the entire content column (extend into article padding) */
.diss-table-wrap {
  margin: 32px -40px 36px -40px;
  width: calc(100% + 80px);
  max-width: calc(100% + 80px);
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  /* No overflow:hidden — would break sticky thead.
     Border-radius corners on contained table are achieved via the wrapper. */
}
.diss-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink);
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}
.diss-table thead th {
  text-align: center;
  padding: 8px 10px;
  background: var(--bg-1);
  border: 1px solid var(--table-border);
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  vertical-align: middle;
  line-height: 1.3;
  position: sticky;
  top: 64px;  /* below the nav */
  z-index: 2;
}
[data-theme="light"] .diss-table thead th {
  background: var(--bg-1);
}
[data-theme="light"] .diss-table thead th {
  background: rgba(194, 93, 54, 0.1);
}
.diss-table tbody td {
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  vertical-align: middle;
  color: var(--ink-soft);
  font-feature-settings: "tnum" 1, "lnum" 1;
  text-align: center;
}
/* First column of body — left-aligned text labels, never hyphenate */
.diss-table tbody td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--ink);
  white-space: normal;
  word-break: keep-all;
  hyphens: none;
  min-width: 90px;
}
/* First column header (Автор/Показники) — same width treatment */
.diss-table thead th:first-child {
  min-width: 90px;
}
.diss-table tbody tr:last-child td { border-bottom: 0; }
.diss-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="light"] .diss-table tbody tr:nth-child(even) td {
  background: rgba(42, 31, 21, 0.025);
}
/* Mobile fallback */
@media (max-width: 980px) {
  .diss-table-wrap {
    margin: 24px -16px 28px;
    width: calc(100% + 32px);
    overflow-x: auto;
    border-radius: 0;
  }
  .diss-table { font-size: 11.5px; min-width: 600px; }
  .diss-table thead th { padding: 8px 8px; font-size: 10.5px; }
  .diss-table tbody td { padding: 6px 8px; }
}

/* TOC toggle button (mobile) */
.toc-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--btn-primary-fg);
  border: 0;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}
/* Reading-progress ring (replaces ↑ button — clicking still scrolls to top) */
.reading-ring {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  z-index: 60;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0;
  transition: background .3s, border-color .15s, transform .15s;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35);
}
.reading-ring:hover { border-color: var(--accent); transform: translateY(-1px); }
.reading-ring svg {
  position: absolute;
  inset: 0;
  width: 56px; height: 56px;
  transform: rotate(-90deg);
}
.reading-ring .ring-track {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 3;
}
.reading-ring .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 150.7;   /* circumference 2*pi*r = 2*pi*24 ≈ 150.7 */
  stroke-dashoffset: 150.7;  /* fully empty initially */
  transition: stroke-dashoffset .15s linear;
}
.reading-ring .ring-pct {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.02em;
}
.reading-ring.complete .ring-pct {
  font-size: 18px;
  color: var(--accent);
}

/* Print stylesheet — academic users print */
@media print {
  body::before, body::after { display: none !important; }
  .nav, .diss-toc, .toc-toggle, .to-top, .reading-progress, .menu-btn, .menu-backdrop { display: none !important; }
  body, .diss-body { background: #fff !important; color: #000 !important; }
  .diss-content { padding: 0; max-width: 100%; }
  .diss-content > h1, .diss-content > h2, .diss-content > h3, .diss-content > p, .diss-content > ul, .diss-content > ol { max-width: 100%; }
  .diss-content h1 { page-break-before: always; border-bottom: 2px solid #000; color: #000; }
  .diss-content h1:first-of-type { page-break-before: auto; }
  .diss-content h2, .diss-content h3 { color: #000; }
  .diss-content p { color: #000; orphans: 3; widows: 3; }
  .diss-content p strong { color: #000; }
  .diss-table-wrap { page-break-inside: avoid; border: 1px solid #000; background: #fff !important; margin: 16px 0; }
  .diss-table thead th { background: #eee !important; color: #000 !important; border: 1px solid #000 !important; position: static !important; }
  .diss-table tbody td { color: #000 !important; border: 1px solid #000 !important; }
  .diss-figure { page-break-inside: avoid; background: #fff !important; border: 1px solid #ccc; }
  .diss-figure img { background: #fff !important; }
  a { color: #000; text-decoration: none; }
}

@media (max-width: 980px) {
  .diss-shell { grid-template-columns: minmax(0, 1fr); }
  .diss-toc {
    position: fixed;
    top: 0;
    left: 0;
    width: 86%;
    max-width: 380px;
    height: 100vh;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .25s ease;
    border-right: 1px solid var(--line-strong);
    background: var(--bg-1);
  }
  .diss-toc.open { transform: translateX(0); }
  .toc-close { display: block; }
  .toc-toggle { display: inline-flex; }
  .diss-content { padding: 24px 22px 100px; }
  .diss-content h1 { font-size: 26px; margin-top: 56px; }
  .diss-content h2 { font-size: 22px; }
  .diss-content h3 { font-size: 18px; }
  .diss-content p { font-size: 16.5px; line-height: 1.72; }
  .diss-content ul, .diss-content ol { font-size: 16px; }
}
