.lp-pdfjs-shell {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d5dce5;
  border-radius: 4px;
  background: #eef2f6;
  color: #162235;
}

.lp-pdfjs-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 48px;
  padding: 8px 10px;
  border-top: 1px solid #d5dce5;
  background: #ffffff;
}

.lp-pdfjs-page-count {
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.lp-pdfjs-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lp-pdfjs-zoom-button,
.lp-pdfjs-zoom-fit {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #aeb9c7;
  border-radius: 4px;
  color: #162235;
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.lp-pdfjs-zoom-fit {
  min-width: auto;
  font-size: 12px;
}

.lp-pdfjs-zoom-button:hover:not(:disabled),
.lp-pdfjs-zoom-button:focus-visible:not(:disabled),
.lp-pdfjs-zoom-fit:hover:not(:disabled),
.lp-pdfjs-zoom-fit:focus-visible:not(:disabled) {
  border-color: #1f5f99;
  color: #1f5f99;
  background: #f2f7fb;
}

.lp-pdfjs-zoom-button:disabled,
.lp-pdfjs-zoom-fit:disabled {
  opacity: 0.45;
  cursor: default;
}

.lp-pdfjs-zoom-value {
  min-width: 54px;
  color: #34465c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.lp-pdfjs-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.lp-pdfjs-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #1f5f99;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.lp-pdfjs-action--primary {
  color: #ffffff !important;
  background: #1f5f99;
}

.lp-pdfjs-action--secondary {
  color: #1f5f99 !important;
  background: #ffffff;
}

.lp-pdfjs-action:hover,
.lp-pdfjs-action:focus-visible {
  text-decoration: underline;
}

.lp-pdfjs-stage {
  position: relative;
}

.lp-pdfjs-status {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 50%;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d5dce5;
  border-radius: 4px;
  color: #4c5d72;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(18, 35, 54, 0.12);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.lp-pdfjs-status[hidden] {
  display: none !important;
}

.lp-pdfjs-status[data-error="true"] {
  color: #7a1f1f;
  border-color: #dca5a5;
  background: #fff5f5;
}

.lp-pdfjs-pages {
  box-sizing: border-box;
  height: min(80dvh, 780px);
  min-height: 600px;
  overflow: auto;
  padding: 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.lp-pdfjs-page {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0 auto 2px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(18, 35, 54, 0.18);
}

.lp-pdfjs-page:last-child {
  margin-bottom: 0;
}

.lp-pdfjs-page canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
}

/* Tablets in portrait: video first, continuous PDF reader underneath. */
@media (min-width: 600px) and (orientation: portrait) {
  .c1-study {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
  }

  .c1-video {
    margin-bottom: 0 !important;
  }

  .lp-pdfjs-pages {
    height: 75dvh;
    min-height: 560px;
  }
}

/* Phones: no embedded document and no unnecessary PDF.js/PDF download. */
@media (max-width: 599px) {
  .lp-pdfjs-shell {
    border: 0;
    background: transparent;
  }

  .lp-pdfjs-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .lp-pdfjs-page-count,
  .lp-pdfjs-zoom,
  .lp-pdfjs-status,
  .lp-pdfjs-pages {
    display: none;
  }

  .lp-pdfjs-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .lp-pdfjs-action {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    font-size: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  .lp-pdfjs-shell {
    border-color: #244463;
    background: #0b2038;
    color: #f4f7fb;
  }

  .lp-pdfjs-toolbar,
  .lp-pdfjs-status {
    border-color: #244463;
    background: #102a46;
  }

  .lp-pdfjs-status {
    color: #dce7f3;
  }

  .lp-pdfjs-status[data-error="true"] {
    color: #ffd6d6;
    border-color: #8e4b4b;
    background: #3b2028;
  }

  .lp-pdfjs-zoom-button,
  .lp-pdfjs-zoom-fit {
    color: #dce7f3;
    border-color: #4f83b8;
    background: #153556;
  }

  .lp-pdfjs-zoom-value {
    color: #f4f7fb;
  }

  .lp-pdfjs-pages {
    background: #071627;
  }

  .lp-pdfjs-action--secondary {
    color: #dce7f3 !important;
    border-color: #4f83b8;
    background: #153556;
  }
}
