.tarva-book-skip,
.tarva-book-return {
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.tarva-book-skip {
  position: fixed;
  z-index: 10001;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  color: #1a191b;
  background: #fff;
  transform: translateY(-160%);
}

.tarva-book-skip:focus { transform: none; }

.tarva-book-return {
  position: sticky;
  z-index: 10000;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  background: rgba(26, 25, 27, .95);
  border-bottom: 1px solid #74685e;
  backdrop-filter: blur(14px);
}

.tarva-book-return a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #fff;
  text-underline-offset: .25em;
}

.lumos-chapter-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 20px;
  overflow-x: auto;
  background: #efede0;
  border-bottom: 1px solid #bdafa4;
  font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.lumos-chapter-nav span {
  color: #74685e;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.lumos-chapter-nav a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #723a17;
  border: 1px solid #bdafa4;
  border-radius: 999px;
  text-decoration: none;
}

.lumos-chapter-nav a[aria-current="page"] {
  color: #fff;
  background: #723a17;
  border-color: #723a17;
}

.frame-wrap + .frame-wrap { display: none !important; }


#src,
#lumos-page-title { scroll-margin-top: 72px; }

#lumos-page-title:focus { outline: none; }

#lumos-page-title:focus-visible,
.tarva-table-scroll:focus-visible {
  outline: 2px solid #a85522;
  outline-offset: 3px;
}


.tarva-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}


@media (min-width: 768px) and (max-width: 1980px) {
  :root {
    
    --lumos-reader-scale: .32;
    --lumos-reader-collapse: -734.4px;
  }

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  .desk {
    width: 100% !important;
    padding-inline: 4vw !important;
    align-items: stretch !important;
  }

  .deck-head,
  .frame-wrap {
    width: 100% !important;
    max-width: 1920px !important;
    min-width: 0 !important;
    align-self: center !important;
  }

  .frame-wrap {
    align-items: flex-start !important;
    overflow: hidden !important;
  }

  .frame-wrap .frame-tag {
    align-self: center;
  }

  .frame.landscape {
    flex: none !important;
    transform: scale(var(--lumos-reader-scale)) !important;
    transform-origin: top left !important;
    margin-bottom: var(--lumos-reader-collapse) !important;
  }
}

@media (min-width: 900px) and (max-width: 1099px) {
  :root { --lumos-reader-scale: .40; --lumos-reader-collapse: -648px; }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  :root { --lumos-reader-scale: .49; --lumos-reader-collapse: -550.8px; }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  :root { --lumos-reader-scale: .58; --lumos-reader-collapse: -453.6px; }
}

@media (min-width: 1440px) and (max-width: 1599px) {
  :root { --lumos-reader-scale: .68; --lumos-reader-collapse: -345.6px; }
}

@media (min-width: 1600px) and (max-width: 1799px) {
  :root { --lumos-reader-scale: .76; --lumos-reader-collapse: -259.2px; }
}

@media (min-width: 1800px) and (max-width: 1919px) {
  :root { --lumos-reader-scale: .85; --lumos-reader-collapse: -162px; }
}

@media (min-width: 1920px) and (max-width: 1980px) {
  :root { --lumos-reader-scale: .91; --lumos-reader-collapse: -97.2px; }
}

@media (max-width: 767px) {
  html,
  body {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .desk {
    width: 100% !important;
    padding: 22px 14px 72px !important;
    gap: 18px !important;
    align-items: stretch !important;
  }

  .deck-head,
  .frame-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .frame.landscape {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    transform: none !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .frame.landscape .slide {
    position: relative !important;
    inset: auto !important;
    min-height: 0 !important;
    padding: 28px 22px !important;
    overflow: visible !important;
  }

  .frame.landscape .display { font-size: clamp(2.6rem, 13vw, 4rem) !important; }
  .lead { font-size: 1rem !important; line-height: 1.45 !important; }
  .body { font-size: .9rem !important; }
  .grid,
  .two,
  .three,
  .cat-grid,
  [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .card { min-height: 0 !important; padding: 16px !important; }
  .tarva-table-scroll table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
  }
  .brandbar,
  .footer { flex-wrap: wrap !important; }
}




.tarva-slide-image { display: none; margin: 0; }

@media (max-width: 767px) {
  .tarva-book-return {
    flex-wrap: wrap;
    justify-content: flex-start;
    column-gap: 20px;
    padding: 0 14px;
  }
  .lumos-chapter-nav { padding: 8px 14px; }
  .lumos-chapter-nav a { min-height: 44px; padding: 0 14px; }

  .deck-head { flex-wrap: wrap; gap: 4px 16px; }
  .deck-head a,
  .frame.landscape .slide .pagenav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .frame.landscape .slide .pagenav a { font-size: 13px !important; }

  .frame-wrap .frame-tag { display: none !important; }
  .frame.landscape { box-shadow: none !important; background: transparent !important; }
  .frame.landscape .slide {
    padding: 0 !important;
    gap: 0 !important;
  }

  
  .frame.landscape .slide *:not(#lumos-page-title, #lumos-page-title *, .pagenav, .pagenav *):not(:has(#lumos-page-title, .pagenav)) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }
  
  .frame.landscape .slide *:has(#lumos-page-title, .pagenav) {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    position: static !important;
  }
  .frame.landscape .slide .footer {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 0 18px !important;
  }
  .frame.landscape .slide .pagenav { flex-direction: row !important; flex-wrap: wrap; gap: 0 18px !important; width: auto !important; }
  .frame.landscape #lumos-page-title {
    margin: 0 0 10px !important;
    font-size: clamp(2rem, 9.5vw, 3rem) !important;
    line-height: 1.05 !important;
  }

  .tarva-slide-image {
    display: block;
    width: 100%;
    order: 2;
  }
  .frame.landscape { order: 1; }
  
  .tarva-slide-image a { display: block; }
  .tarva-slide-image img {
    display: block;
    width: 100%;
    height: auto;
    background: #efede0;
    border: 1px solid #bdafa4;
  }
  .tarva-slide-image figcaption {
    margin-top: 10px;
    color: #4c453d;
    font: 400 13px/1.45 ui-sans-serif, system-ui, sans-serif;
  }
}
