:root {
  --cv-accent: #e40362;
  --cv-accent-dark: #c4024f;
  --cv-dark: #0f0f0f;
  --cv-light: #f4f5f7;
  --cv-muted: #8a8a8a;
  --cv-line: #e6e6e6;
  --cv-font: "Work Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--cv-light);
  font-family: var(--cv-font);
  color: var(--cv-dark);
}

.cv {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--cv-light);
  overflow: hidden;
}

.cv svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cv button {
  font: inherit;
}

.cv-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.cv-header {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
  padding: 0 28px;
  background: var(--cv-dark);
  color: #fff;
  flex-shrink: 0;
}

.cv-logo {
  display: flex;
  flex-shrink: 0;
}

.cv-logo img {
  display: block;
  height: 42px;
  width: auto;
}


.cv-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 8px;
}

.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 21px;
  background: var(--cv-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}

.cv-download:hover {
  background: var(--cv-accent-dark);
}

.cv-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cv-dark);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.cv-icon:hover:not(:disabled) {
  color: var(--cv-accent);
  background: rgba(228, 3, 98, 0.08);
}

.cv-icon:disabled {
  color: #c9c9c9;
  cursor: default;
}

.cv-icon--light {
  color: #fff;
}

.cv-icon--light:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.cv-main {
  position: relative;
  flex: 1;
  min-height: 0;
}

.cv-stage {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.cv--zoomed .cv-stage {
  overflow: auto;
  cursor: grab;
  touch-action: none;
}

.cv--zoomed .cv-stage:active {
  cursor: grabbing;
}

.cv-book {
  --book-offset: 0;
  --slide: 0px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, var(--page-width));
  height: var(--page-height);
  margin: auto;
  perspective: 2600px;
  translate: calc(var(--book-offset) * var(--page-width)) 0;
  transition: translate 0.75s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.18s, transform 0.18s;
  opacity: 0;
}

.cv--ready .cv-book {
  opacity: 1;
}

.cv--zoomed .cv-book {
  margin: auto;
  flex-shrink: 0;
}

.cv--single .cv-book {
  grid-template-columns: var(--page-width);
}

.cv--single .cv-slot--left {
  display: none;
}

.cv--ready .cv-book.cv-book--hidden {
  opacity: 0;
  transform: translateX(var(--slide));
}

.cv-book--instant {
  transition: none;
}

.cv-slot {
  position: relative;
  cursor: pointer;
}

.cv--zoomed .cv-slot {
  cursor: inherit;
}

.cv-page {
  position: absolute;
  inset: 0;
  background: #fff;
}

.cv-page canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cv-page--pending canvas {
  opacity: 0;
}

.cv-page--empty {
  background: transparent;
}

.cv-slot .cv-page:not(.cv-page--empty) {
  box-shadow: 0 18px 40px -18px rgba(15, 15, 15, 0.35), 0 2px 6px rgba(15, 15, 15, 0.08);
}

.cv--spread .cv-slot .cv-page:not(.cv-page--empty)::after,
.cv-leaf .cv-page::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  pointer-events: none;
}

.cv--spread .cv-slot--left .cv-page::after,
.cv-leaf--backward .cv-leaf-front::after,
.cv-leaf--forward .cv-leaf-back::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
}

.cv--spread .cv-slot--right .cv-page::after,
.cv-leaf--forward .cv-leaf-front::after,
.cv-leaf--backward .cv-leaf-back::after {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
}

.cv-links {
  position: absolute;
  inset: 0;
}

.cv-links a {
  position: absolute;
  border-radius: 2px;
  transition: background-color 0.2s;
}

.cv-links a:hover {
  background: rgba(228, 3, 98, 0.12);
}

.cv-leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 3;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
  pointer-events: none;
}

.cv-leaf--forward {
  left: 50%;
  transform-origin: left center;
}

.cv-leaf--backward {
  left: 0;
  transform-origin: right center;
}

.cv-leaf--forward.cv-leaf--turning {
  transform: rotateY(-180deg);
}

.cv-leaf--backward.cv-leaf--turning {
  transform: rotateY(180deg);
}

.cv-leaf .cv-page {
  backface-visibility: hidden;
  box-shadow: 0 10px 30px rgba(15, 15, 15, 0.2);
}

.cv-leaf .cv-page--empty {
  box-shadow: none;
}

.cv-leaf-back {
  transform: rotateY(180deg);
}

.cv-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border: 1px solid var(--cv-line);
  border-radius: 50%;
  background: #fff;
  color: var(--cv-dark);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 15, 15, 0.08);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}

.cv-nav svg {
  width: 24px;
  height: 24px;
}

.cv-nav:hover:not(:disabled) {
  background: var(--cv-accent);
  border-color: var(--cv-accent);
  color: #fff;
}

.cv-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.cv-nav--prev {
  left: 28px;
}

.cv-nav--next {
  right: 28px;
}

.cv-thumbs {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  width: 300px;
  padding: 20px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--cv-line);
  box-shadow: 12px 0 32px rgba(15, 15, 15, 0.08);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0.3s;
}

.cv--thumbs-open .cv-thumbs {
  transform: none;
  visibility: visible;
}

@media (min-width: 900px) {
  .cv-stage,
  .cv-nav--prev {
    transition: left 0.3s ease;
  }

  .cv--thumbs-open .cv-stage {
    left: 300px;
  }

  .cv--thumbs-open .cv-nav--prev {
    left: 328px;
  }
}

.cv-thumbs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 14px;
}

.cv-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--cv-light);
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.2s;
}

.cv-thumb canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.2s;
}

.cv-thumb--ready canvas {
  opacity: 1;
}

.cv-thumb span {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 10px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: var(--cv-muted);
  box-shadow: 0 1px 4px rgba(15, 15, 15, 0.12);
}

.cv-thumb:hover {
  outline-color: var(--cv-line);
}

.cv-thumb--active,
.cv-thumb--active:hover {
  outline-color: var(--cv-accent);
}

.cv-thumb--active span {
  background: var(--cv-accent);
  color: #fff;
}

.cv-loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--cv-light);
  transition: opacity 0.3s, visibility 0.3s;
}

.cv--ready .cv-loader {
  opacity: 0;
  visibility: hidden;
}

.cv-loader-text {
  margin: 0;
  font-size: 15px;
  color: var(--cv-muted);
}

.cv-progress {
  width: 220px;
  height: 3px;
  border-radius: 2px;
  background: var(--cv-line);
  overflow: hidden;
}

.cv-progress span {
  display: block;
  width: 8%;
  height: 100%;
  background: var(--cv-accent);
  transition: width 0.2s;
}

.cv--error .cv-progress {
  display: none;
}

.cv-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  background: #fff;
  border-top: 1px solid var(--cv-line);
  flex-shrink: 0;
}

.cv-thumbs-toggle {
  justify-self: start;
}

.cv--thumbs-open .cv-thumbs-toggle {
  color: #fff;
  background: var(--cv-accent);
}

.cv--thumbs-open .cv-thumbs-toggle:hover {
  color: #fff;
  background: var(--cv-accent-dark);
}

.cv-pager {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cv-page-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px;
  font-size: 14px;
  color: var(--cv-muted);
}

.cv-page-input {
  width: 64px;
  height: 36px;
  border: 1px solid var(--cv-line);
  border-radius: 18px;
  background: var(--cv-light);
  font: inherit;
  font-weight: 600;
  color: var(--cv-dark);
  text-align: center;
  transition: border-color 0.2s;
}

.cv-page-input:focus {
  outline: none;
  border-color: var(--cv-accent);
  background: #fff;
}

.cv-zoom {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cv-zoom-value {
  min-width: 52px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.cv--fullscreen .cv-header {
  height: 56px;
}

@media (max-width: 899px) {
  .cv-header {
    height: 60px;
    gap: 14px;
    padding: 0 16px;
  }

  .cv-logo img {
    height: 34px;
  }

  .cv-download {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .cv-download span {
    display: none;
  }

  .cv-nav {
    display: none;
  }

  .cv-thumbs {
    width: 100%;
  }

  .cv-thumbs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cv-toolbar {
    grid-template-columns: auto 1fr auto;
    height: 60px;
    padding: 0 8px;
  }

  .cv-pager {
    justify-self: center;
  }

  .cv-pager [data-action="first"],
  .cv-pager [data-action="last"],
  .cv-zoom-value {
    display: none;
  }

  .cv-page-field {
    margin: 0 4px;
  }
}
