* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #e5edf8;
  background: #0f172a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e7ebf2;
  color: #3d4b63;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong {
  margin: 0;
  color: #f8fafc;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.viewer {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 100vh;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92)),
    #0f172a;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(16px);
}

.document-title {
  display: grid;
  min-width: 220px;
  max-width: 380px;
}

.document-title span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-title strong {
  overflow: hidden;
  color: #f8fafc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar button,
.download-link {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.82);
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.toolbar button:hover:not(:disabled),
.download-link:hover {
  border-color: rgba(191, 219, 254, 0.55);
  background: rgba(51, 65, 85, 0.96);
  transform: translateY(-1px);
}

.toolbar button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.divider {
  width: 1px;
  height: 34px;
  margin: 0 4px;
  background: rgba(148, 163, 184, 0.22);
}

.download-link {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.document-stage {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 72px);
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(59, 130, 246, 0.16), transparent 34rem),
    linear-gradient(180deg, #e7ebf2 0%, #cfd6e2 100%);
}

#pdfFrame {
  display: block;
  width: 100%;
  height: calc(100vh - 108px);
  border: 0;
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(15, 23, 42, 0.08),
    0 24px 70px rgba(15, 23, 42, 0.34);
  background: #ffffff !important;
  background-color: #ffffff !important;
}

.loading {
  position: fixed;
  top: 88px;
  left: 50%;
  z-index: 3;
  padding: 9px 15px;
  border-radius: 999px;
  color: #eff6ff;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
  transform: translateX(-50%);
}

.fullscreen-gesture-layer {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.fullscreen-gesture-layer[hidden] {
  display: none;
}

.fullscreen-gesture-prompt {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(191, 219, 254, 0.24);
  border-radius: 26px;
  color: #dbeafe;
  text-align: center;
  background: #0f172a;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.42);
  pointer-events: none;
}

.fullscreen-gesture-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.fullscreen-gesture-prompt h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  color: #eff6ff;
}

.fullscreen-gesture-prompt p:last-child {
  margin: 0;
  color: #bfdbfe;
  line-height: 1.5;
}

.email-gate {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
}

.email-dialog {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(191, 219, 254, 0.24);
  border-radius: 26px;
  color: #dbeafe;
  background: #0f172a;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.42);
}

.email-kicker {
  margin: 0 0 12px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.email-dialog h2 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 34px;
  letter-spacing: -0.05em;
  line-height: 1;
}

.email-dialog p {
  color: #cbd5e1;
  line-height: 1.6;
}

.email-dialog label {
  display: block;
  margin: 18px 0 8px;
  color: #e2e8f0;
  font-weight: 800;
}

.email-dialog input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.92);
  outline: none;
}

.email-dialog input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.16);
}

.email-error {
  min-height: 22px;
  margin: 8px 0 12px;
  color: #fecaca;
  font-size: 14px;
  font-weight: 800;
}

.email-dialog button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  color: #0f172a;
  background: #bfdbfe;
  font-weight: 900;
  cursor: pointer;
}

.viewer-error {
  max-width: 520px;
  margin: 60px auto;
  padding: 18px 20px;
  border: 1px solid #f0c5c1;
  border-radius: 16px;
  color: #9f1f17;
  background: #fff5f4;
  text-align: center;
  box-shadow: 0 14px 36px rgba(24, 34, 54, 0.08);
}

.training-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #ffffff;
  background: #2f7db3;
}

.training-overlay.windows-11-style {
  background: #000000;
}

.training-overlay.windows-11-style .training-ribbon {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

body.windows-11-style .training-modal .training-dialog {
  background: #000000;
}

.training-ribbon {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 21;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.16);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.simulation-screen {
  display: grid;
  justify-items: center;
  width: min(620px, 100%);
  text-align: center;
}

.dot-spinner {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 22px;
}

.dot-spinner span {
  position: absolute;
  top: 39px;
  left: 39px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 18px rgba(219, 234, 254, 0.72);
  animation: orbitDots 3.8s linear infinite;
  opacity: 0;
  transform: rotate(0deg) translateX(34px) scale(0.65);
  transform-origin: 4px 4px;
}

.training-overlay .dot-spinner > span {
  border: 0 !important;
  background: radial-gradient(circle, #ffffff 0 62%, #dbeafe 63% 100%) !important;
  background-color: #ffffff !important;
  color: #ffffff !important;
  forced-color-adjust: none;
}

.dot-spinner span:nth-child(2) {
  animation-delay: 220ms;
}

.dot-spinner span:nth-child(3) {
  animation-delay: 440ms;
}

.dot-spinner span:nth-child(4) {
  animation-delay: 660ms;
}

.dot-spinner span:nth-child(5) {
  animation-delay: 880ms;
}

.scan-percent {
  color: #ffffff;
  font-size: 1px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.scan-status {
  margin: 0;
  color: #ffffff;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 600;
  text-align: center;
}

.update-message,
.update-footer {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 500;
  line-height: 1.45;
}

.update-footer {
  margin-top: 70px;
  font-size: clamp(15px, 1.8vw, 19px);
  letter-spacing: 0.01em;
  opacity: 0.92;
}

@keyframes orbitDots {
  0% {
    opacity: 0;
    transform: rotate(-22deg) translateX(34px) scale(0.45);
  }

  10% {
    opacity: 0;
    transform: rotate(8deg) translateX(34px) scale(0.55);
  }

  18% {
    opacity: 1;
    transform: rotate(40deg) translateX(34px) scale(0.92);
  }

  56% {
    opacity: 1;
    transform: rotate(190deg) translateX(34px) scale(1);
  }

  78% {
    opacity: 0.82;
    transform: rotate(292deg) translateX(34px) scale(0.9);
  }

  90% {
    opacity: 0;
    transform: rotate(342deg) translateX(34px) scale(0.52);
  }

  100% {
    opacity: 0;
    transform: rotate(382deg) translateX(34px) scale(0.45);
  }
}

.red-flags {
  max-width: 720px;
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid rgba(254, 240, 138, 0.5);
  border-radius: 20px;
  background: rgba(113, 63, 18, 0.24);
}

.red-flags span {
  display: block;
  margin-bottom: 8px;
  color: #fef3c7;
  font-weight: 900;
}

.red-flags ul {
  margin: 0;
  padding-left: 20px;
  color: #fff7ed;
  line-height: 1.7;
}

.training-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(8px);
  animation: modalBackdropIn 220ms ease-out both;
}

.training-dialog {
  width: min(560px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 20px;
  color: #ffffff;
  background: #2f7db3;
  box-shadow: 0 22px 70px rgba(2, 6, 23, 0.42);
  text-align: center;
  animation: modalDialogIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.training-dialog .simulation-kicker {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.84);
}

.training-dialog h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(28px, 1.8vw, 38px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.training-dialog p,
.training-dialog ol {
  color: #ffffff;
}

.training-dialog > p:not(.simulation-kicker):not(.clipboard-status) {
  width: min(480px, 100%);
  margin: 0 auto 20px;
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 500;
}

.training-dialog ol {
  display: grid;
  gap: 8px;
  width: min(500px, 100%);
  margin: 0 auto 18px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.training-dialog li {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  font-size: clamp(14px, 1.5vw, 17px);
}

.clipboard-status {
  width: min(500px, 100%);
  margin: 0 auto 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.14);
  font-size: 14px;
  font-weight: 800;
}

.training-dialog button {
  min-height: 40px;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 900;
  cursor: pointer;
}

.training-dialog button:hover {
  background: rgba(255, 255, 255, 0.24);
}

@keyframes modalBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalDialogIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 820px) {
  .toolbar {
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .document-title {
    flex-basis: 100%;
    max-width: none;
  }

  .download-link {
    margin-left: 0;
  }

  .document-stage {
    min-height: calc(100vh - 120px);
    padding: 10px;
  }

  #pdfFrame {
    height: calc(100vh - 140px);
  }

  .simulation-screen h2 {
    font-size: 38px;
  }
}
