.gpfq-standalone-page {
  margin: 0;
  overflow: hidden;
  background: #0b1320;
}

.gpfq-standalone-main {
  min-height: 100vh;
}

.gpfq-viewer,
.gpfq-viewer * {
  box-sizing: border-box;
}

.gpfq-viewer {
  --gpfq-blue: #0786d8;
  --gpfq-green: #70c41f;
  --gpfq-ink: #e8f1f8;
  position: relative;
  display: grid;
  width: 100%;
  height: var(--gpfq-height, 86vh);
  min-height: 480px;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  color: var(--gpfq-ink);
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 6%, rgba(11, 154, 211, 0.2), transparent 30%),
    radial-gradient(circle at 92% 96%, rgba(112, 196, 31, 0.14), transparent 32%),
    #0b1320;
  box-shadow: 0 18px 50px rgba(5, 15, 26, 0.22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

.gpfq-standalone-main > .gpfq-viewer {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: 0;
}

.admin-bar .gpfq-standalone-main > .gpfq-viewer {
  --gpfq-height: calc(100vh - 32px) !important;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
}

.gpfq-toolbar {
  z-index: 20;
  display: grid;
  min-height: 60px;
  padding: 9px 14px;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 15, 27, 0.9);
  backdrop-filter: blur(16px);
}

.gpfq-toolbar__title {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpfq-toolbar__nav,
.gpfq-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gpfq-toolbar__actions {
  justify-content: flex-end;
}

.gpfq-button,
.gpfq-viewer a.gpfq-button {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #eaf5fb;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.gpfq-button:hover,
.gpfq-button:focus-visible,
.gpfq-viewer a.gpfq-button:hover,
.gpfq-viewer a.gpfq-button:focus-visible {
  color: #fff;
  border-color: rgba(63, 190, 242, 0.72);
  background: rgba(13, 134, 208, 0.22);
}

.gpfq-button:focus-visible {
  outline: 2px solid #63d1ff;
  outline-offset: 2px;
}

.gpfq-button:active {
  transform: translateY(1px);
}

.gpfq-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gpfq-button--accent,
.gpfq-viewer a.gpfq-button--accent {
  color: #06111e;
  border-color: transparent;
  background: linear-gradient(120deg, var(--gpfq-green), #24b6b6, var(--gpfq-blue));
  font-weight: 700;
}

.gpfq-page-status {
  min-width: 64px;
  color: #bfd0dc;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.gpfq-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 18px 30px 24px;
}

.gpfq-book {
  opacity: 0;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.33));
  translate: 0 var(--gpfq-book-offset-y, 0);
  transition: opacity 240ms ease;
}

.gpfq-viewer.is-ready .gpfq-book {
  opacity: 1;
}

.gpfq-page {
  position: relative;
  overflow: hidden;
  color: #111827;
  background: #fff;
}

.gpfq-page canvas,
.gpfq-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.gpfq-page__placeholder {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(13, 134, 208, 0.08), transparent),
    #f7fafc;
  background-size: 200% 100%;
  animation: gpfq-shimmer 1.3s linear infinite;
}

.gpfq-page.has-render-error::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  content: "!";
  color: #b91c1c;
  background: #fff;
  font-size: 32px;
}

.gpfq-loading {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dceaf3;
}

.gpfq-loading[hidden] {
  display: none;
}

.gpfq-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #31baf0;
  border-radius: 50%;
  animation: gpfq-spin 0.8s linear infinite;
}

.gpfq-fallback {
  max-width: 420px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.gpfq-fallback__link {
  display: inline-flex;
  margin-top: 8px;
  padding: 10px 16px;
  color: #07111c;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--gpfq-green), var(--gpfq-blue));
  font-weight: 700;
  text-decoration: none;
}

.gpfq-qr-panel {
  position: absolute;
  z-index: 30;
  top: 18px;
  right: 18px;
  display: grid;
  width: min(320px, calc(100% - 32px));
  padding: 22px;
  place-items: center;
  gap: 12px;
  color: #142334;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
}

.gpfq-qr-panel[hidden] {
  display: none;
}

.gpfq-qr-canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.gpfq-qr-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #374151;
  border: 0;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}

.gpfq-download-qr {
  padding: 9px 14px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: #087ed5;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.gpfq-accessible-pdf {
  position: absolute;
  z-index: 12;
  bottom: 8px;
  left: 12px;
  padding: 5px 9px;
  color: #c9d9e5;
  border-radius: 6px;
  background: rgba(7, 15, 27, 0.72);
  font-size: 12px;
  text-decoration: none;
}

.gpfq-accessible-pdf:hover,
.gpfq-accessible-pdf:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.gpfq-toast {
  position: absolute;
  z-index: 40;
  bottom: 18px;
  left: 50%;
  padding: 9px 14px;
  color: #fff;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.gpfq-noscript {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 50;
  transform: translate(-50%, -50%);
}

.gpfq-noscript a {
  color: #fff;
}

.gpfq-error {
  padding: 16px;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
}

.gpfq-viewer:fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: 0;
}

@keyframes gpfq-spin {
  to { transform: rotate(360deg); }
}

@keyframes gpfq-shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 760px) {
  .gpfq-viewer {
    min-height: 440px;
    border-radius: 10px;
  }

  .gpfq-toolbar {
    min-height: 54px;
    padding: 7px 8px;
    grid-template-columns: auto 1fr auto;
    gap: 5px;
  }

  .gpfq-toolbar__title {
    max-width: 36px;
    color: transparent;
  }

  .gpfq-toolbar__title::first-letter {
    color: var(--gpfq-green);
  }

  .gpfq-toolbar__nav {
    justify-content: center;
  }

  .gpfq-toolbar__actions {
    gap: 4px;
  }

  .gpfq-button,
  .gpfq-viewer a.gpfq-button {
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
  }

	.gpfq-button__text {
    display: none;
  }

	.gpfq-button--accent {
	  max-width: 96px;
	  overflow: hidden;
	  text-overflow: ellipsis;
	  white-space: nowrap;
	}

  .gpfq-stage {
    padding: 12px 8px 18px;
  }
}

@media (max-width: 760px) {
  .gpfq-book {
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.3));
  }
}

@media (max-width: 782px) {
  .admin-bar .gpfq-standalone-main > .gpfq-viewer {
    --gpfq-height: calc(100vh - 46px) !important;
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
    min-height: calc(100vh - 46px);
    min-height: calc(100dvh - 46px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gpfq-button,
  .gpfq-book {
    transition: none;
  }

  .gpfq-page__placeholder,
  .gpfq-spinner {
    animation-duration: 2.2s;
  }
}
