:root {
      /* Архівна палітра фізичного практикуму (Вид-во «Наука» / Birkhäuser / Leybold Didactic) */
      --paper-bg: #f2ece1;
      --page-surface: #faf6ee;
      --page-inset: #efe8da;
      --page-hover: #e5dccb;

      --ink-primary: #181614;
      --ink-secondary: #3d3934;
      --ink-muted: #6e675f;

      --rule-light: #d5cbb8;
      --rule-strong: #8c8270;
      --rule-heavy: #181614;

      /* Інженерна берлінська лазур та кіновар штампів */
      --accent-oxford: #142e46;
      --accent-oxford-hover: #0d2032;
      --accent-crimson: #8f2419;
      --accent-crimson-soft: rgba(143, 36, 25, 0.08);

      /* Семантичні кольори осцилограм та векторних діаграм */
      --fig-green: #14532d;
      --fig-green-soft: rgba(20, 83, 45, 0.10);
      --fig-blue: #1e40af;
      --fig-amber: #9a3412;
      --fig-amber-soft: rgba(154, 52, 18, 0.10);
      --fig-red: #991b1b;

      --font-serif: 'Crimson Pro', 'Georgia', 'Times New Roman', serif;
      --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

      --radius-page: 0px;
      --radius-sm: 0px;

      --shadow-hard: 2px 2px 0px #181614;
      --shadow-hard-sm: 1px 1px 0px #181614;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      user-select: none;
      -webkit-font-smoothing: antialiased;
    }

    html, body {
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      background-color: var(--paper-bg);
      color: var(--ink-primary);
      font-family: var(--font-serif);
      font-size: 16px;
      line-height: 1.48;
    }

    /* 1. 3D-СТЕНД НА ВЕСЬ ЕКРАН */
    #canvas-container {
      position: fixed;
      inset: 0;
      z-index: 1;
    }

    /* 2. ВЕРХНІЙ АРХІВНИЙ КОЛОНТИТУЛ (Пристикована інструментальна шина без ШІ-заокруглень) */
    .book-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 48px;
      z-index: 30;
      display: flex;
      align-items: stretch;
      justify-content: space-between;
      gap: 0;
      padding: 0 12px;
      background: var(--page-surface);
      border-bottom: 2px solid var(--rule-heavy);
      box-shadow: inset 0 -1px 0 var(--rule-light);
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      position: relative;
      flex: 1;
      min-width: 0;
    }

    .book-spine-title {
      display: flex;
       flex-direction: row;
      align-items: center;
      gap: 9px;
      padding-right: 14px;
      height: 100%;
      border-right: 1.5px solid var(--rule-heavy);
      white-space: nowrap;
      flex-shrink: 0;
    }

    .book-spine-logo {
      width: 28px;
      height: 28px;
      flex-shrink: 0;
      display: block;
      filter: drop-shadow(1px 1px 0 rgba(24, 22, 20, 0.18));
    }

    .book-spine-text {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .book-spine-sub {
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 600;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--accent-crimson);
      line-height: 1.1;
    }

    .book-spine-main {
      font-family: var(--font-serif);
      font-size: 15.5px;
      font-weight: 700;
      color: var(--ink-primary);
      letter-spacing: -0.01em;
      line-height: 1.15;
    }

    .chapter-nav-group {
      display: flex;
      align-items: center;
      gap: 6px;
      position: relative;
      flex: 1;
      min-width: 0;
    }

    .chapter-step-btn {
      appearance: none;
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      color: var(--ink-primary);
      font-family: var(--font-mono);
      font-size: 15px;
      font-weight: 600;
      width: 30px;
      height: 32px;
      border-radius: 0;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: var(--shadow-hard-sm);
      transition: background-color 0.1s ease, transform 0.08s ease;
    }

    .chapter-step-btn:hover {
      background: var(--page-hover);
      color: var(--accent-oxford);
    }

    .chapter-step-btn:active {
      transform: translate(1px, 1px);
      box-shadow: none;
    }

    .exp-dropdown-wrapper {
      position: relative;
      flex: 1;
      min-width: 0;
      max-width: 450px;
    }

    .exp-dropdown-trigger {
      appearance: none;
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      border-left: 4px solid var(--accent-oxford);
      border-radius: 0;
      padding: 4px 10px;
      width: 100%;
      min-width: 0;
      height: 32px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      box-shadow: var(--shadow-hard-sm);
      font-family: var(--font-serif);
    }

    .exp-dropdown-trigger:hover,
    .exp-dropdown-wrapper.open .exp-dropdown-trigger {
      background: var(--page-hover);
    }

    .trigger-text-wrap {
      display: flex;
      align-items: baseline;
      gap: 7px;
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .trigger-sec-sym {
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 12.5px;
      color: var(--accent-crimson);
      flex-shrink: 0;
    }

    .trigger-title {
      font-family: var(--font-serif);
      font-weight: 700;
      font-size: 14.5px;
      color: var(--ink-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .trigger-cat-pill {
      font-family: var(--font-mono);
      font-size: 9.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 1px 6px;
      border-radius: 0;
      background: var(--page-inset);
      color: var(--accent-oxford);
      border: 1px solid var(--rule-strong);
      white-space: nowrap;
    }

    .trigger-chevron {
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--ink-primary);
      transition: transform 0.15s ease;
      flex-shrink: 0;
    }

    .exp-dropdown-wrapper.open .trigger-chevron {
      transform: rotate(180deg);
      color: var(--accent-crimson);
    }

    /* Випадаючий каталог-реєстр параграфів */
    .exp-dropdown-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      width: min(490px, calc(100vw - 24px));
      max-height: calc(100vh - 64px);
      overflow-y: auto;
      background: var(--page-surface);
      border: 2px solid var(--rule-heavy);
      border-radius: 0;
      box-shadow: 4px 4px 0px rgba(24, 22, 20, 0.9);
      padding: 12px;
      z-index: 100;
      display: none;
      flex-direction: column;
      gap: 10px;
    }

    .exp-dropdown-wrapper.open .exp-dropdown-menu {
      display: flex;
      animation: pageFadeIn 0.12s ease;
    }

    .dropdown-filter-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      padding-bottom: 8px;
      border-bottom: 1.5px solid var(--rule-heavy);
    }

    .filter-pill-btn {
      appearance: none;
      background: #fffdf9;
      border: 1px solid var(--rule-heavy);
      color: var(--ink-secondary);
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      padding: 4px 8px;
      border-radius: 0;
      cursor: pointer;
      transition: background-color 0.1s ease;
    }

    .filter-pill-btn:hover {
      background: var(--page-hover);
      color: var(--ink-primary);
    }

    .filter-pill-btn.active {
      background: var(--ink-primary);
      color: #fffdf9;
      border-color: var(--ink-primary);
      box-shadow: 2px 2px 0px var(--accent-crimson);
    }

    .dropdown-group-heading,
    .dropdown-group-title {
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent-crimson);
      padding: 6px 4px 3px;
      border-bottom: 1px solid var(--rule-strong);
    }

    .dropdown-exp-item {
      appearance: none;
      width: 100%;
      text-align: left;
      background: #fffdf9;
      border: 1px solid var(--rule-strong);
      border-left: 3px solid var(--rule-strong);
      border-radius: 0;
      padding: 7px 10px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      transition: background-color 0.1s ease, border-color 0.1s ease;
      min-width: 0;
    }

    .dropdown-exp-item:hover {
      background: var(--page-hover);
      border-color: var(--rule-heavy);
      border-left-color: var(--accent-oxford);
    }

    .dropdown-exp-item.active {
      background: var(--accent-oxford);
      border-color: var(--rule-heavy);
      border-left: 4px solid var(--accent-crimson);
      color: #ffffff;
    }

    .exp-item-left {
      display: flex;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }

    .exp-item-sec {
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 12.5px;
      color: var(--accent-crimson);
      min-width: 38px;
      flex-shrink: 0;
    }

    .dropdown-exp-item.active .exp-item-sec {
      color: #fde68a;
    }

    .exp-item-info {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }

    .exp-item-title {
      font-family: var(--font-serif);
      font-size: 14.5px;
      font-weight: 700;
      color: var(--ink-primary);
      line-height: 1.22;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .dropdown-exp-item.active .exp-item-title {
      color: #ffffff;
    }

    .exp-item-sub {
      font-family: var(--font-sans);
      font-size: 11px;
      color: var(--ink-muted);
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .dropdown-exp-item.active .exp-item-sub {
      color: rgba(255, 255, 255, 0.82);
    }

    .exp-item-badge {
      font-family: var(--font-mono);
      font-size: 9.5px;
      font-weight: 600;
      text-transform: uppercase;
      padding: 2px 6px;
      border-radius: 0;
      background: var(--page-inset);
      color: var(--ink-secondary);
      border: 1px solid var(--rule-strong);
      white-space: nowrap;
      flex-shrink: 0;
    }

    .dropdown-exp-item.active .exp-item-badge {
      background: rgba(255, 255, 255, 0.14);
      color: #fde68a;
      border-color: rgba(255, 255, 255, 0.35);
    }

    /* Центральний рекламний банер Google Ads (між бічними панелями, ніколи не перекриває текст чи панелі) */
    .ad-viewport-leaderboard {
      position: fixed;
      top: 56px;
      left: 416px;
      right: 376px;
      margin: 0 auto;
      z-index: 12;
      max-width: 560px;
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      border-left: 4px solid var(--accent-oxford);
      box-shadow: var(--shadow-hard-sm);
      padding: 6px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      pointer-events: auto;
    }

    .ad-viewport-leaderboard.ad-closed {
      display: none !important;
    }

    .ad-lb-left {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }

    .ad-lb-badge {
      background: var(--page-inset);
      color: var(--ink-primary);
      border: 1px solid var(--rule-heavy);
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 600;
      letter-spacing: 0.06em;
      padding: 1px 5px;
      text-transform: uppercase;
      flex-shrink: 0;
    }

    .ad-lb-copy {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }

    .ad-lb-headline {
      font-family: var(--font-serif);
      font-size: 13px;
      font-weight: 700;
      color: var(--ink-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .ad-lb-subline {
      font-family: var(--font-mono);
      font-size: 9.5px;
      color: var(--ink-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .ad-lb-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .ad-lb-close {
      appearance: none;
      background: var(--page-inset);
      border: 1px solid var(--rule-heavy);
      color: var(--ink-primary);
      width: 20px;
      height: 20px;
      font-family: var(--font-mono);
      font-size: 12px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .ad-lb-close:hover {
      background: var(--accent-crimson);
      color: #fffdf9;
    }

    /* Контейнер Google AdSense всередині рекламного блоку */
    ins.adsbygoogle {
      display: block;
      width: 100%;
    }

    ins.adsbygoogle:not([data-ad-status="filled"]) {
      display: none !important;
    }

    /* Коли Google AdSense завантажив реальний банер, приховуємо демо-заглушку */
    ins.adsbygoogle[data-ad-status="filled"] ~ .ad-fallback-content {
      display: none !important;
    }

    /* Бічні рекламні блоки у звичайному потоці документа (ніколи не перекривають контент) */
    .ad-sidebar-card {
      position: static;
      width: 100%;
      margin-top: auto;
      background: linear-gradient(180deg, rgba(247, 242, 231, 0.92) 0%, rgba(239, 232, 216, 0.96) 100%);
      border: 1px dashed var(--border-double);
      border-radius: 2px;
      padding: 8px 10px;
      flex-shrink: 0;
      box-sizing: border-box;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .ad-sidebar-card:hover {
      border-style: solid;
      border-color: var(--accent-gold);
      box-shadow: 0 2px 8px rgba(24, 21, 18, 0.06);
    }

    .ad-card-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-family: var(--font-mono);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--ink-muted);
      margin-bottom: 6px;
      border-bottom: 1px dotted var(--border-hairline);
      padding-bottom: 3px;
    }

    .ad-card-frame {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      background: rgba(255, 253, 248, 0.78);
      border: 1px solid var(--border-hairline);
      padding: 10px 8px;
      gap: 4px;
      position: relative;
      overflow: hidden;
      width: 100%;
      box-sizing: border-box;
    }

    .ad-card-frame.ad-rect-compact {
      min-height: 76px;
    }

    .ad-card-frame.ad-rect-mrec {
      min-height: 110px;
    }

    .ad-slot-title {
      font-family: var(--font-serif);
      font-size: 12.5px;
      font-weight: 700;
      color: var(--ink-primary);
      line-height: 1.25;
    }

    .ad-slot-sub {
      font-family: var(--font-sans);
      font-size: 11px;
      color: var(--ink-secondary);
      line-height: 1.35;
      max-width: 95%;
    }

    .ad-slot-spec {
      font-family: var(--font-mono);
      font-size: 9.5px;
      color: var(--accent-brass);
      background: rgba(154, 107, 22, 0.08);
      border: 1px solid rgba(154, 107, 22, 0.25);
      padding: 2px 7px;
      margin-top: 3px;
      border-radius: 2px;
    }

    /* Права частина верхнього колонтитула: Протокол етапів та перемикач мови */
    .header-right {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    .phase-breadcrumbs {
      display: flex;
      align-items: stretch;
      gap: 0;
      font-family: var(--font-mono);
      font-size: 10.5px;
      color: var(--ink-muted);
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      height: 32px;
    }

    .phase-breadcrumbs > span:not(.phase-crumb) {
      display: none;
    }

    .phase-crumb {
      padding: 0 10px;
      display: inline-flex;
      align-items: center;
      border-right: 1px solid var(--rule-strong);
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      cursor: pointer;
      transition: background-color 0.12s ease;
      white-space: nowrap;
    }

    .phase-crumb:last-child {
      border-right: none;
    }

    .phase-crumb:hover {
      color: var(--ink-primary);
      background: var(--page-hover);
    }

    .phase-crumb.current {
      background: var(--ink-primary);
      color: #fffdf9;
      font-weight: 600;
    }

    .phase-crumb.done {
      color: var(--fig-green);
      background: var(--fig-green-soft);
      font-weight: 600;
    }

    /* Нижня креслярська шкала проекцій 3D-камери (замість ШІ-пігулки) */
    .viewport-cam-dock {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      z-index: 20;
      display: flex;
      align-items: stretch;
      gap: 0;
      padding: 0;
      background: var(--page-surface);
      border: 1.5px solid var(--rule-heavy);
      border-bottom: none;
      border-radius: 0;
      box-shadow: 3px -3px 0px rgba(24, 22, 20, 0.18);
      max-width: calc(100vw - 24px);
      overflow-x: auto;
    }

    .cam-dock-label {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent-crimson);
      background: var(--page-inset);
      padding: 6px 10px;
      border-right: 1.5px solid var(--rule-heavy);
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
    }

    .view-projections {
      display: flex;
      align-items: stretch;
      gap: 0;
    }

    .proj-btn {
      appearance: none;
      background: #fffdf9;
      border: none;
      border-right: 1px solid var(--rule-strong);
      color: var(--ink-secondary);
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 6px 11px;
      border-radius: 0;
      cursor: pointer;
      transition: background-color 0.1s ease, color 0.1s ease;
      white-space: nowrap;
    }

    .proj-btn:last-child {
      border-right: none;
    }

    .proj-btn:hover {
      background: var(--page-hover);
      color: var(--ink-primary);
    }

    .proj-btn.active {
      background: var(--accent-oxford);
      color: #ffffff;
      font-weight: 600;
    }

    .lang-switcher {
      display: inline-flex;
      align-items: stretch;
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      border-radius: 0;
      padding: 0;
      gap: 0;
      height: 32px;
      flex-shrink: 0;
      box-shadow: var(--shadow-hard-sm);
    }

    .lang-btn {
      appearance: none;
      background: transparent;
      border: none;
      border-right: 1px solid var(--rule-strong);
      color: var(--ink-secondary);
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.05em;
      padding: 0 9px;
      border-radius: 0;
      cursor: pointer;
      transition: background-color 0.1s ease;
    }

    .lang-btn:last-child {
      border-right: none;
    }

    .lang-btn:hover {
      background: var(--page-hover);
      color: var(--ink-primary);
    }

    .lang-btn.active {
      background: var(--accent-oxford);
      color: #ffffff;
    }

    /* Механічні вушка згортання/розгортання бічних панелей */
    .panel-collapse-btn {
      position: fixed;
      top: 64px;
      z-index: 25;
      width: 22px;
      height: 48px;
      background: var(--page-surface);
      border: 1.5px solid var(--rule-heavy);
      color: var(--ink-primary);
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 2px 2px 0px rgba(24, 22, 20, 0.25);
      transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1), right 0.22s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.1s ease;
    }

    .panel-collapse-btn:hover {
      background: var(--page-hover);
      color: var(--accent-crimson);
    }

    .panel-collapse-left {
      left: 384px;
      border-left: none;
      border-radius: 0;
    }

    .panel-collapse-left.collapsed {
      left: 0;
      border-left: 1.5px solid var(--rule-heavy);
    }

    .panel-collapse-right {
      right: 344px;
      border-right: none;
      border-radius: 0;
    }

    .panel-collapse-right.collapsed {
      right: 0;
      border-right: 1.5px solid var(--rule-heavy);
    }

    /* 3. ЛІВА СТОРІНКА МОНОГРАФІЇ (Пристикований архівний аркуш із міліметровою сіткою) */
    .book-page-left {
      position: fixed;
      top: 48px;
      left: 0;
      bottom: 0;
      width: 384px;
      max-height: calc(100vh - 48px);
      overflow-y: auto;
      overflow-x: hidden;
      z-index: 15;
      background-color: var(--page-surface);
      background-image:
        linear-gradient(to right, rgba(140, 130, 112, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(140, 130, 112, 0.09) 1px, transparent 1px);
      background-size: 18px 18px;
      border-right: 2px solid var(--rule-heavy);
      border-radius: 0;
      padding: 16px 18px 24px;
      box-shadow: inset -4px 0 0 var(--page-inset);
      display: flex;
      flex-direction: column;
      gap: 14px;
      transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
    }

    .book-page-left.panel-hidden {
      transform: translateX(-100%);
      opacity: 0;
      pointer-events: none;
    }

    .book-page-left::-webkit-scrollbar,
    .book-page-right::-webkit-scrollbar {
      width: 6px;
    }
    .book-page-left::-webkit-scrollbar-track,
    .book-page-right::-webkit-scrollbar-track {
      background: var(--page-inset);
      border-left: 1px solid var(--rule-light);
    }
    .book-page-left::-webkit-scrollbar-thumb,
    .book-page-right::-webkit-scrollbar-thumb {
      background: var(--rule-strong);
      border-radius: 0;
    }

    .chapter-header {
      border-top: 2px solid var(--rule-heavy);
      border-bottom: 3px double var(--rule-heavy);
      padding: 8px 0 10px;
      min-width: 0;
      background: rgba(250, 246, 238, 0.88);
    }

    .chapter-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent-crimson);
      margin-bottom: 5px;
      padding-bottom: 4px;
      border-bottom: 1px solid var(--rule-light);
    }

    .chapter-title {
      font-family: var(--font-serif);
      font-size: 20px;
      font-weight: 700;
      color: var(--ink-primary);
      line-height: 1.18;
      letter-spacing: -0.01em;
      overflow-wrap: break-word;
    }

    .chapter-epigraph {
      margin-top: 6px;
      font-size: 13.8px;
      font-style: italic;
      color: var(--ink-secondary);
      line-height: 1.4;
      overflow-wrap: break-word;
    }

    /* Панель пульта керування стендом */
    .experiment-controls {
      display: flex;
      flex-direction: column;
      gap: 8px;
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      border-radius: 0;
      padding: 10px;
      box-shadow: var(--shadow-hard);
    }

    .btn-oxford-primary {
      appearance: none;
      width: 100%;
      padding: 8px 14px;
      border-radius: 0;
      border: 1.5px solid var(--rule-heavy);
      background: var(--accent-oxford);
      color: #ffffff;
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      cursor: pointer;
      box-shadow: var(--shadow-hard-sm);
      transition: background-color 0.1s ease, transform 0.08s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .btn-oxford-primary:hover {
      background: var(--accent-oxford-hover);
    }

    .btn-oxford-primary:active {
      transform: translate(1px, 1px);
      box-shadow: none;
    }

    .secondary-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
    }

    .btn-paper-secondary {
      appearance: none;
      padding: 4px 9px;
      border-radius: 0;
      border: 1px solid var(--rule-heavy);
      background: var(--page-inset);
      color: var(--ink-primary);
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      cursor: pointer;
      transition: background-color 0.1s ease;
      white-space: nowrap;
    }

    .btn-paper-secondary:hover {
      background: var(--page-hover);
    }

    .speed-group {
      display: inline-flex;
      border: 1px solid var(--rule-heavy);
      border-radius: 0;
      overflow: hidden;
      background: #fffdf9;
      flex-shrink: 0;
    }

    .speed-opt {
      appearance: none;
      background: transparent;
      border: none;
      border-right: 1px solid var(--rule-strong);
      color: var(--ink-secondary);
      font-family: var(--font-mono);
      font-size: 10.5px;
      padding: 4px 7px;
      cursor: pointer;
    }

    .speed-opt:last-child {
      border-right: none;
    }

    .speed-opt.active {
      background: var(--ink-primary);
      color: #fffdf9;
      font-weight: 600;
    }

    /* Крок 1: Контрольне запитання практикуму */
    .problem-box {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: #fffdf9;
      border: 1px solid var(--rule-heavy);
      border-left: 4px solid var(--accent-oxford);
      border-radius: 0;
      padding: 11px 13px;
      min-width: 0;
    }

    .problem-label {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent-oxford);
      border-bottom: 1px dashed var(--rule-light);
      padding-bottom: 3px;
    }

    .problem-question {
      font-family: var(--font-serif);
      font-size: 15px;
      color: var(--ink-primary);
      line-height: 1.45;
      overflow-wrap: break-word;
    }

    .options-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .book-option-btn {
      appearance: none;
      width: 100%;
      text-align: left;
      background: var(--page-surface);
      border: 1px solid var(--rule-strong);
      border-radius: 0;
      padding: 7px 9px;
      color: var(--ink-primary);
      font-family: var(--font-serif);
      font-size: 14.5px;
      line-height: 1.35;
      cursor: pointer;
      display: flex;
      align-items: flex-start;
      gap: 9px;
      transition: background-color 0.1s ease, border-color 0.1s ease;
      min-width: 0;
    }

    .book-option-btn:hover {
      background: var(--page-hover);
      border-color: var(--rule-heavy);
    }

    .book-option-btn.selected {
      background: #fffdf9;
      border-color: var(--rule-heavy);
      box-shadow: inset 3px 0 0 var(--accent-crimson), 2px 2px 0px var(--rule-heavy);
    }

    .option-letter {
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 11.5px;
      min-width: 20px;
      height: 20px;
      border-radius: 0;
      border: 1px solid var(--rule-heavy);
      background: var(--page-inset);
      color: var(--ink-primary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-top: 1px;
      flex-shrink: 0;
    }

    .book-option-btn.selected .option-letter {
      background: var(--accent-crimson);
      color: #ffffff;
      border-color: var(--accent-crimson);
    }

    /* Згорнутий рядок гіпотези (Крок 2 та 3) */
    .collapsed-hypothesis {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 7px 11px;
      background: var(--page-inset);
      border: 1px solid var(--rule-strong);
      border-left: 3px solid var(--accent-oxford);
      border-radius: 0;
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--ink-secondary);
      min-width: 0;
    }

    .collapsed-hypothesis.visible {
      display: flex;
    }

    .text-link-btn {
      background: none;
      border: none;
      color: var(--accent-crimson);
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
      flex-shrink: 0;
    }

    /* Крок 3: Доведення, теорема та живі математичні формули KaTeX */
    .proof-section {
      display: none;
      flex-direction: column;
      gap: 10px;
      padding-top: 12px;
      border-top: 1.5px solid var(--rule-heavy);
      animation: pageFadeIn 0.18s ease;
      min-width: 0;
    }

    .proof-section.visible {
      display: flex;
    }

    @keyframes pageFadeIn {
      from { opacity: 0; transform: translateY(3px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .proof-verdict {
      padding: 6px 10px;
      border-radius: 0;
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      line-height: 1.35;
    }

    .proof-verdict.correct {
      background: var(--fig-green-soft);
      color: var(--fig-green);
      border: 1px solid var(--fig-green);
      border-left: 4px solid var(--fig-green);
    }

    .proof-verdict.incorrect {
      background: var(--fig-amber-soft);
      color: var(--fig-amber);
      border: 1px solid var(--fig-amber);
      border-left: 4px solid var(--fig-amber);
    }

    .proof-text {
      font-family: var(--font-serif);
      font-size: 15px;
      color: var(--ink-primary);
      line-height: 1.48;
      overflow-wrap: break-word;
      background: rgba(255, 253, 249, 0.85);
      padding: 6px 8px;
      border: 1px solid var(--rule-light);
    }

    /* Академічний блок формул */
    .equation-card {
      background: #fffdf9;
      border: 1px solid var(--rule-heavy);
      border-left: 4px solid var(--accent-crimson);
      border-radius: 0;
      padding: 9px 11px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-width: 100%;
      overflow: hidden;
    }

    .equation-header {
      display: flex;
      justify-content: space-between;
      font-family: var(--font-mono);
      font-size: 9.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--ink-muted);
      border-bottom: 1px solid var(--rule-light);
      padding-bottom: 3px;
    }

    .katex-display-wrap {
      padding: 2px 0;
      color: var(--ink-primary);
      font-size: 14px;
      max-width: 100%;
      overflow: hidden;
    }

    .katex-live-sub {
      padding-top: 8px;
      border-top: 1px dashed var(--rule-strong);
      font-size: 12.5px;
      color: var(--accent-oxford);
      max-width: 100%;
      overflow: hidden;
    }

    /* Вертикальний стек рівнянь та адаптивне масштабування формул */
    .math-stack {
      display: flex;
      flex-direction: column;
      gap: 6px;
      width: 100%;
      align-items: center;
    }

    .math-fit-outer {
      width: 100%;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .math-fit-inner {
      display: inline-block;
      transform-origin: center center;
      white-space: nowrap;
    }

    .math-fit-inner .katex-display {
      margin: 0.15em 0 !important;
    }

    .math-chips-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
      width: 100%;
    }

    .math-chip {
      display: inline-flex;
      align-items: center;
      background: var(--page-inset);
      border: 1px solid var(--rule-strong);
      border-radius: 0;
      padding: 2px 6px;
      max-width: 100%;
      overflow: hidden;
      font-size: 12px;
    }

    /* Діаграма енергій, самописець та табличний журнал вимірювань */
    .figure-section {
      padding-top: 12px;
      border-top: 1.5px solid var(--rule-heavy);
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-width: 0;
    }

    .figure-caption-top {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 8px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--ink-primary);
    }

    .energy-bar-book {
      width: 100%;
      height: 9px;
      background: var(--page-inset);
      border: 1px solid var(--rule-heavy);
      border-radius: 0;
      overflow: hidden;
      display: flex;
    }

    .bar-ek { background: var(--fig-green); height: 100%; transition: width 0.06s linear; }
    .bar-ep { background: var(--fig-blue); height: 100%; transition: width 0.06s linear; }
    .bar-q  { background: var(--fig-amber); height: 100%; transition: width 0.06s linear; }

    /* Таблична сітка енергій із суцільними перегородками як у лабораторному протоколі */
    .energy-metrics-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 0;
      border: 1px solid var(--rule-heavy);
      background: #fffdf9;
    }

    .metric-box {
      background: #fffdf9;
      border-right: 1px solid var(--rule-strong);
      border-radius: 0;
      padding: 5px 7px;
      min-width: 0;
      overflow: hidden;
    }

    .metric-box:last-child {
      border-right: none;
    }

    .metric-label {
      display: flex;
      align-items: center;
      gap: 5px;
      font-family: var(--font-sans);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      color: var(--ink-muted);
      min-width: 0;
    }

    .metric-label span:last-child {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .swatch-dot {
      width: 7px;
      height: 7px;
      border-radius: 0;
      border: 1px solid rgba(0,0,0,0.35);
      flex-shrink: 0;
    }

    .metric-val {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums;
      font-size: 12px;
      font-weight: 600;
      color: var(--ink-primary);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #chart-canvas {
      width: 100%;
      height: 84px;
      background: #fffdf9;
      border: 1px solid var(--rule-heavy);
      border-radius: 0;
      display: block;
    }

    .figure-caption-bottom {
      font-family: var(--font-serif);
      font-style: italic;
      font-size: 12.5px;
      color: var(--ink-secondary);
      text-align: left;
      padding-left: 6px;
      border-left: 2px solid var(--rule-strong);
      line-height: 1.32;
      overflow-wrap: break-word;
    }

    /* Таблиця приладових показів (справжня лабораторна відомість без окремих «бульбашок») */
    .measurements-table {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0;
      border-top: 1px solid var(--rule-heavy);
      border-left: 1px solid var(--rule-heavy);
      background: #fffdf9;
    }

    .meas-cell {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      gap: 2px;
      padding: 5px 8px;
      background: #fffdf9;
      border-right: 1px solid var(--rule-heavy);
      border-bottom: 1px solid var(--rule-heavy);
      border-radius: 0;
      font-family: var(--font-sans);
      min-width: 0;
      overflow: hidden;
    }

    .meas-name {
      font-family: var(--font-mono);
      font-size: 9.5px;
      text-transform: uppercase;
      letter-spacing: 0.02em;
      color: var(--ink-muted);
      line-height: 1.2;
      width: 100%;
      overflow-wrap: break-word;
      word-break: break-word;
    }

    .meas-num {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums;
      font-size: 11.5px;
      font-weight: 600;
      color: var(--ink-primary);
      line-height: 1.25;
      width: 100%;
      overflow-wrap: break-word;
      word-break: break-word;
    }

    /* 4. ПРАВА СТОРІНКА: ПАСПОРТ УСТАНОВКИ ТА ВЕРНЬЄРНІ РЕГУЛЯТОРИ */
    .book-page-right {
      position: fixed;
      top: 48px;
      right: 0;
      bottom: 0;
      width: 344px;
      max-height: calc(100vh - 48px);
      overflow-y: auto;
      overflow-x: hidden;
      z-index: 15;
      background-color: var(--page-surface);
      background-image:
        linear-gradient(to right, rgba(140, 130, 112, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(140, 130, 112, 0.09) 1px, transparent 1px);
      background-size: 18px 18px;
      border-left: 2px solid var(--rule-heavy);
      border-radius: 0;
      padding: 16px 18px 24px;
      box-shadow: inset 4px 0 0 var(--page-inset);
      display: flex;
      flex-direction: column;
      gap: 15px;
      transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
    }

    .book-page-right.panel-hidden {
      transform: translateX(100%);
      opacity: 0;
      pointer-events: none;
    }

    .journal-section {
      display: flex;
      flex-direction: column;
      gap: 11px;
      min-width: 0;
    }

    .journal-section + .journal-section {
      padding-top: 13px;
      border-top: 1.5px solid var(--rule-heavy);
    }

    .section-heading-row {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 8px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent-crimson);
      border-bottom: 1px solid var(--rule-strong);
      padding-bottom: 3px;
    }

    /* Постійно видима картка основних законів параграфа */
    .laws-reference-box {
      background: #fffdf9;
      border: 1px solid var(--rule-heavy);
      border-left: 4px solid var(--accent-oxford);
      border-radius: 0;
      padding: 9px 10px;
      font-size: 13.5px;
      max-width: 100%;
      overflow: hidden;
      box-shadow: var(--shadow-hard-sm);
    }

    /* Механічні реостатні/верньєрні повзунки (прямокутні бігунки замість круглих крапель) */
    .param-control {
      display: flex;
      flex-direction: column;
      gap: 5px;
      min-width: 0;
      background: rgba(255, 253, 249, 0.86);
      border: 1px solid var(--rule-light);
      padding: 6px 8px 8px;
    }

    .param-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      min-width: 0;
    }

    .param-title {
      font-family: var(--font-serif);
      font-weight: 600;
      color: var(--ink-primary);
      flex: 1;
      min-width: 0;
      line-height: 1.22;
      overflow-wrap: break-word;
    }

    .param-readout {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums;
      font-size: 11px;
      font-weight: 600;
      color: var(--ink-primary);
      background: var(--page-inset);
      padding: 1px 6px;
      border-radius: 0;
      border: 1px solid var(--rule-heavy);
      flex-shrink: 0;
      white-space: nowrap;
    }

    input[type="range"].book-slider {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 6px;
      border-radius: 0;
      border: 1px solid var(--rule-heavy);
      background: linear-gradient(
        to right,
        var(--accent-oxford) 0%,
        var(--accent-oxford) var(--progress, 50%),
        var(--page-inset) var(--progress, 50%),
        var(--page-inset) 100%
      );
      outline: none;
      cursor: pointer;
    }

    input[type="range"].book-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 10px;
      height: 18px;
      border-radius: 0;
      background: #fffdf9;
      border: 1.5px solid var(--rule-heavy);
      box-shadow: 1px 1px 0px var(--rule-heavy);
      cursor: ew-resize;
    }

    input[type="range"].book-slider::-webkit-slider-thumb:hover {
      background: var(--accent-crimson);
      border-color: var(--rule-heavy);
    }

    /* Тумблери креслярських шарів (прямокутні приладові перемикачі) */
    .drawing-toggles {
      display: flex;
      flex-direction: column;
      gap: 0;
      border-top: 1px solid var(--rule-strong);
    }

    .toggle-line {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-family: var(--font-sans);
      font-size: 11.5px;
      color: var(--ink-primary);
      cursor: pointer;
      padding: 5px 4px;
      border-bottom: 1px solid var(--rule-light);
      background: rgba(255, 253, 249, 0.7);
    }

    .book-switch {
      appearance: none;
      width: 32px;
      height: 16px;
      background: var(--page-inset);
      border: 1px solid var(--rule-heavy);
      border-radius: 0;
      position: relative;
      cursor: pointer;
      flex-shrink: 0;
      transition: background-color 0.12s ease;
    }

    .book-switch::after {
      content: '';
      position: absolute;
      top: 1px;
      left: 1px;
      width: 13px;
      height: 12px;
      border-radius: 0;
      background: #fffdf9;
      border: 1px solid var(--rule-heavy);
      transition: transform 0.12s ease;
    }

    .book-switch:checked {
      background: var(--accent-oxford);
    }

    .book-switch:checked::after {
      transform: translateX(15px);
    }

    .legend-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px 8px;
      padding-top: 6px;
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--ink-secondary);
    }

    .legend-entry {
      display: flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
      overflow-wrap: break-word;
    }

    .legend-bar {
      width: 12px;
      height: 4px;
      border-radius: 0;
      border: 1px solid rgba(0,0,0,0.3);
      flex-shrink: 0;
    }

    @media (max-width: 1180px) {
      .ad-viewport-leaderboard { display: none; }
      .phase-breadcrumbs { display: none; }
      .book-spine-title { display: none; }
      .book-page-left { width: 340px; }
      .panel-collapse-left { left: 340px; }
      .book-page-right { width: 304px; }
      .panel-collapse-right { right: 304px; }
    }

    /* Екран для мобільних пристроїв: "Дана платформа не підтримується на даному пристрої" + нижній банер */
    .mobile-unsupported-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9999;
      background-color: var(--bg-parchment);
      background-image:
        linear-gradient(to right, rgba(140, 130, 112, 0.11) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(140, 130, 112, 0.11) 1px, transparent 1px);
      background-size: 18px 18px;
      padding: 20px 16px 14px;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      text-align: center;
      overflow-y: auto;
    }

    .mobile-unsupported-card {
      margin: auto 0;
      width: 100%;
      max-width: 380px;
      background: var(--page-surface);
      border: 2px solid var(--rule-heavy);
      box-shadow: var(--shadow-hard);
      padding: 24px 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }

    .mobile-unsupported-logo {
      width: 52px;
      height: 52px;
      flex-shrink: 0;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }

    .mobile-unsupported-toprow {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    .mobile-unsupported-badge {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--accent-crimson);
      background: var(--page-inset);
      border: 1px solid var(--rule-strong);
      padding: 3px 9px;
    }

    .mobile-unsupported-title {
      font-family: var(--font-serif);
      font-size: 22px;
      font-weight: 700;
      line-height: 1.24;
      color: var(--ink-primary);
      margin: 0;
      border-top: 1px solid var(--rule-light);
      border-bottom: 3px double var(--rule-heavy);
      padding: 10px 0;
      width: 100%;
    }

    .mobile-unsupported-sub {
      font-family: var(--font-sans);
      font-size: 13px;
      line-height: 1.5;
      color: var(--ink-secondary);
      margin: 0;
    }

    .mobile-unsupported-ad {
      width: 100%;
      max-width: 380px;
      flex-shrink: 0;
      margin-top: 16px;
      background: #f5efe3;
      border: 1.5px solid var(--rule-heavy);
      box-shadow: var(--shadow-hard-sm);
    }

    .mobile-ad-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 3px 8px;
      background: #e9e0cf;
      border-bottom: 1px solid var(--rule-strong);
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--ink-muted);
    }

    .mobile-ad-frame {
      position: relative;
      min-height: 90px;
      padding: 8px 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background:
        repeating-linear-gradient(
          -45deg,
          rgba(200, 190, 170, 0.14),
          rgba(200, 190, 170, 0.14) 6px,
          rgba(255, 253, 249, 0.55) 6px,
          rgba(255, 253, 249, 0.55) 12px
        );
      overflow: hidden;
    }

    .mobile-ad-frame ins.adsbygoogle {
      display: block;
      width: 100%;
      min-height: 70px;
      z-index: 2;
    }

    .mobile-ad-frame ins.adsbygoogle[data-ad-status="filled"] ~ .ad-fallback-content {
      display: none;
    }

    body.is-mobile-phone .mobile-unsupported-overlay {
      display: flex;
    }

    body.is-mobile-phone .book-header,
    body.is-mobile-phone .ad-viewport-leaderboard,
    body.is-mobile-phone .viewport-cam-dock,
    body.is-mobile-phone .panel-collapse-left,
    body.is-mobile-phone .panel-collapse-right,
    body.is-mobile-phone .book-page-left,
    body.is-mobile-phone .book-page-right,
    body.is-mobile-phone #canvas-container {
      display: none !important;
    }

    @media (max-width: 820px) {
      .mobile-unsupported-overlay {
        display: flex;
      }
      .book-header,
      .ad-viewport-leaderboard,
      .viewport-cam-dock,
      .panel-collapse-left,
      .panel-collapse-right,
      .book-page-left,
      .book-page-right,
      #canvas-container {
        display: none !important;
      }
    }


/* SEO Crawlable Directory & Link Reset */
a.dropdown-exp-item {
  text-decoration: none;
  color: inherit;
}
.sr-only-seo-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
