@font-face {
  font-family: "Arial";
  src: url("./assets/fonts/Arial.ttf") format("truetype");
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Arial Black";
  src: url("./assets/fonts/Arial Black.ttf") format("truetype");
  font-weight: 900;
  font-display: block;
}

@font-face {
  font-family: "Courier New";
  src: url("./assets/fonts/Courier New.ttf") format("truetype");
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Courier New Bold";
  src: url("./assets/fonts/Courier New Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: block;
}

@font-face {
  font-family: "Times New Roman";
  src: url("./assets/fonts/Times New Roman.ttf") format("truetype");
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Times New Roman Bold";
  src: url("./assets/fonts/Times New Roman Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: block;
}

@font-face {
  font-family: "Alegreya Sans SC";
  src: url("./assets/fonts/Alegreya Sans SC.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Denistina";
  src: url("./assets/fonts/denistina.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/Inter.otf") format("opentype");
  font-display: block;
}


.page-slot.drop-target {
  outline: 3px solid #ff5181;
  outline-offset: 4px;
}





.loading-title {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: #242428;
  text-align: center;
}

.loading-subtitle {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
  color: #949494;
  text-align: center;
}

.loading-note {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
  color: #949494;
  text-align: center;
}




.spine-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.spine-modal.open {
  display: flex;
}

.spine-modal-box {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
}

.spine-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.spine-modal-input {
  width: 100%;
  height: 48px;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
}

.spine-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.spine-modal-actions button {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
}

.spine-modal-cancel {
  background: #f3f3f3;
  color: #333;
}

.spine-modal-save {
  background: #ff5a8a;
  color: #fff;
}






#loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(255, 255, 255, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", Arial, sans-serif;
}

.loading-box {
  background: #ffffff;
  padding: 26px 32px;
  border-radius: 22px;
  box-shadow: 0 14px 45px rgba(255, 160, 186, 0.35);
  font-size: 18px;
  font-weight: 600;
  color: #2b2b2b;
  text-align: center;
  min-width: 240px;
}

.loading-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #ffe1ea;
  border-top-color: #ffa0ba;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

#loadingOverlayText {
  font-family: "Montserrat", Arial, sans-serif;
  letter-spacing: -0.2px;
}

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





.upload-toast {
  position: fixed;

  right: 20px;
  bottom: 20px;

  width: 240px;

  padding: 14px;

  background: rgba(255, 255, 255, 0.92);

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  border-radius: 16px;

  box-shadow:
    0 8px 32px rgba(0,0,0,0.12);

  z-index: 999999999;

  opacity: 0;

  transform: translateY(30px);

  pointer-events: none;

  transition: all 0.25s ease;
}

.upload-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.upload-toast-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;

  color: #222;

  margin-bottom: 10px;
}

.upload-toast-bar {
  height: 6px;

  border-radius: 999px;

  overflow: hidden;

  background: rgba(0,0,0,0.08);
}

.upload-toast-progress {
  width: 40%;
  height: 100%;

  border-radius: 999px;

  background: #FF5181;

  animation: uploadMove 1s infinite linear;
}

@keyframes uploadMove {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(350%);
  }
}

.photo-upload-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
}

.photo-upload-badge.error {
  background: rgba(255,59,48,0.88);
}

.page-slot {
  position: absolute;
}




.project-delete-btn:hover {
  background: #ffd9d9;
}

.project-delete-btn svg {
  width: 25px;
  height: 25px;
}





.leave-warning-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  z-index: 999999999;
}

.leave-warning-modal.open {
  display: flex;
}

.leave-warning-card {
  width: 320px;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}

.leave-warning-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.leave-warning-text {
  margin-top: 10px;
  font-size: 14px;
  color: #777;
  line-height: 1.4;
}

.leave-warning-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

#stayOnEditorBtn,
#leaveAnywayBtn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 11px 10px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}

#stayOnEditorBtn {
  background: #f3f3f3;
  color: #444;
}

#leaveAnywayBtn {
  background: #FF5181;
  color: #fff;
}


.save-status-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.75);
  z-index: 99999999;
}

.save-status-modal.open {
  display: flex;
}

.save-status-card {
  width: 300px;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  font-family: 'Montserrat', sans-serif;
}

.save-status-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 3px solid #f1d4dc;
  border-top-color: #FF5181;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.save-status-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.save-status-text {
  margin-top: 8px;
  font-size: 14px;
  color: #777;
}

.save-status-modal.done .save-status-spinner {
  animation: none;
  border: none;
}

.save-status-modal.done .save-status-spinner::before {
  content: "✓";
  display: block;
  font-size: 34px;
  color: #FF5181;
  line-height: 34px;
}


#projectLoader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 99999999;
}

.editor-header {
  height: 50px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;
  box-sizing: border-box;
}

.editor-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 25px;
  font-weight: 500;
  color: #ff5f8a; 
  text-decoration: none;
}

.editor-project-name {
  margin-top: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #444;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-header-actions {
  display: flex;
  gap: 24px;
}

.header-btn {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  color: #FFA0BA;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
}

.header-btn svg {
  width: 15px;
  height: 15px;
}

.header-btn:hover {
  opacity: 0.8;
}

.projects-modal-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 700;
  font-family: Arial, sans-serif;
}

.projects-modal-card p {
  margin: 0 0 20px;
  color: #666;
  line-height: 1.4;
  
}

.projects-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  font-family: inherit;
  font-family: Arial, sans-serif;
}

.projects-modal.open {
  display: flex;
}

.projects-modal-card {
  width: 90%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  position: relative;
}


.project-item button,
#createNewProjectBtn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  background: #FF5181;
  color: white;
  cursor: pointer;
}




.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}


.project-item > div:first-child {
  flex: 1;
  min-width: 0;
}


.project-actions {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.project-open-btn {
  width: auto !important;
  height: 45px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;

  border: none;
  border-radius: 12px;
  padding: 0 18px;
  background: #FF5181;
  color: white;
  cursor: pointer;
}

.project-delete-btn {
  width: 45px !important;
  height: 45px !important;
  padding: 0 !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  border: none;
  border-radius: 12px;

  background: #FF5181;
  color: white;

  cursor: pointer;
}






#createNewProjectBtn {
  width: 100%;
  margin-top: 18px;
}

.projects-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 32px;
  height: 32px;

  border: none;
  background: transparent;

  cursor: pointer;
  color: #999;

  display: flex;
  align-items: center;
  justify-content: center;
}

.projects-modal-close:hover {
  color: #333;
}
  

  
    #photoBookApp {
      width: 100%;
      height: 100vh;
      background: #f5f5f5;
      font-family: Arial, sans-serif;
      display: grid;
      grid-template-columns: 280px 1fr 220px;
      overflow: hidden;
    }

    .left-panel {
      background: #fff;
      border-right: 1px solid #ddd;
      padding: 16px;
      overflow-y: auto;
    }

    .center-panel {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }
    
    

    .right-panel {
      background: #fff;
      border-left: 1px solid #ddd;
      padding: 14px;
      overflow-y: auto;
    }

.top-actions {
  position: absolute;

  top: 15px;
  left: 15px;
  right: 15px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  z-index: 20;
}

.text-toolbar {
  display:flex;
  gap:10px;
  align-items:center;
}

.export-toolbar {
  display:flex;
  gap:10px;
  align-items:center;
}

    .save-btn {
      background: #FF5181;
      color: #fff;
      border: none;
      padding: 11px 18px;
      border-radius: 10px;
      font-size: 15px;
      cursor: pointer;
    }

    .templates-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 14px;
    }

    .templates-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .template-card {
      height: 120px;
      background: #fafafa;
      border: 2px solid #e5e5e5;
      border-radius: 4px;
      position: relative;
      cursor: pointer;
    }

    .template-card.active {
      border-color: #FFA0BA;
    }

.template-slot-preview {
  position: absolute;
  background: #d6d6d6;
  border: 0.5px solid rgba(120,120,120,.35);
  box-sizing: border-box;
}

    .book-spread {
      display: flex;
      background: #fff;
      border: 1px solid #ddd;
      box-shadow: 0 6px 20px rgba(0,0,0,.06);
    }

.page-slot.selected {
  box-shadow: inset 0 0 0 1px #FF5181;
  z-index: 1000 !important;
}

    .page {
      width: 360px;
      height: 406px;
      background: #fff;
      position: relative;
      overflow: hidden;
      border: 0.5px solid transparent;
      cursor: pointer;
    }

  .page-number {
  cursor: pointer;
}

    .page-slot {
      position: absolute;
      overflow: hidden;
      background: #d8d8d8;
      border: none;
    }

    .page-slot img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      user-select: none;
      cursor: grab;
      transform-origin: center center;
    }

    .add-photo {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 52px;
      height: 52px;
      transform: translate(-50%, -50%);
      border-radius: 50%;
      background: rgba(255,255,255,.9);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 34px;
      cursor: pointer;
      color: #222;
    }
    
    .page-slot img {
  touch-action: none;
  -webkit-user-drag: none;
}

.history-btn {
  width: 38px;
  height: 38px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.history-btn svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-box {
  touch-action: none;
}

    .page-numbers {
      display: flex;
      gap: 330px;
      margin-top: 16px;
      justify-content: center;
    }

    .page-number {
      width: 42px;
      height: 42px;
      border-radius: 6px;
      background: #fff;
      border: 1px solid #ccc;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
    }

    .page-number.active {
      background: #FF5181;
      color: #fff;
      border-color: #FF5181;
    }

    .thumb-spread {
      display: flex;
      gap: 4px;
      margin-bottom: 14px;
      cursor: pointer;
      justify-content: center;
    }

    .thumb-page {
      width: 78px;
      height: 104px;
      background: #eee;
      border: 1px solid #ddd;
      position: relative;
      overflow: hidden;
    }

    .thumb-page.active {
      border: 2px solid #FF5181;
    }

    .thumb-slot {
      position: absolute;
      background: #cfcfcf;
    }

    .thumb-label {
      text-align: center;
      font-size: 12px;
      color: #555;
      margin-top: -8px;
      margin-bottom: 12px;
    }
    
    .mobile-bottom-menu,
.mobile-more-panel {
  display: none;
}

.client-input {
  width: 100%;
  height: 48px;
  margin-bottom: 10px;
  border: none;
  border-radius: 16px;
  background: #f5f5f5;
  padding: 0 14px;
  font-size: 16px;
  box-sizing: border-box;
}

  .export-toolbar .save-btn:not(:last-child) {
    background: #f1f1f1;
    color: #222;
  }

  .export-toolbar .history-btn svg {
    stroke: #555;
  }
  
  .selected-cover-box{
  margin-bottom:16px;
  padding:12px;
  background:#f5f5f5;
  border-radius:16px;
}

.selected-cover-title{
  font-size:13px;
  color:#777;
  margin-bottom:8px;
}

.selected-cover-box img{
  width:100%;
  border-radius:12px;
  display:block;
}

.selected-cover-name{
  margin-top:8px;
  font-size:14px;
  font-weight:600;
  color:#222;
}

.cover-photo-slot{
  position:absolute;
  background:linear-gradient(#f8f8f8, #999);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#777;
  font-size:28px;
  z-index:300;
  cursor:pointer;
}

.templates-switch{
  display:flex;
  gap:6px;
  margin-bottom:14px;
}

.templates-tab{
  flex:1;
  height:38px;
  border:none;
  border-radius:12px;
  background:#f1f1f1;
  color:#222;
  font-size:14px;
  cursor:pointer;
}

.templates-tab.active{
  background:#FF5181;
  color:#fff;
}


#coverEditorWrap{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding-top:70px;
  box-sizing:border-box;
}

#coverCanvas{
  width:815px;
  height:483px;
  position:relative;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.cover-safe-zone{
  position:absolute;
  left:29.5px;
  width:756px;
  top:31.5px;
  height:420px;
  border:1px solid #ff5a6f;
  box-sizing:border-box;
  pointer-events:none;
  z-index:500;
}

.cover-spine-zone{
  position:absolute;
  left:396.5px;
  width:21.7px;
  top:31.5px;
  height:420px;
  border-left:1px solid #ff5a6f;
  border-right:1px solid #ff5a6f;
  box-sizing:border-box;
  pointer-events:none;
  z-index:501;
}



.templates-grid.cover-mode{
  grid-template-columns: 1fr;
}

.templates-grid.cover-mode .template-card{
  width:190px !important;
  height:111px !important;
}



.cover-sidebar-item{
  width:100%;
  margin-bottom:22px;
  cursor:pointer;
}

.cover-sidebar-preview{
  display:flex;
  width:100%;
  aspect-ratio: 2 / 1.35;
  border:2px solid transparent;
  overflow:hidden;
  box-sizing:border-box;
}

.cover-sidebar-item.active .cover-sidebar-preview{
  border-color:#FF5181;
}

.cover-sidebar-half{
  width:50%;
  height:100%;
  position:relative;
}

.cover-sidebar-front{
  background:#cfcfcf;
}

.cover-sidebar-labels{
  display:flex;
  width:100%;
  margin-top:6px;
  font-size:12px;
  color:#666;
}

.cover-sidebar-labels span{
  width:50%;
  text-align:center;
}

.cover-sidebar-preview-real{
  width:190px;
  height:119px;
  position:relative;
  overflow:hidden;
  border:2px solid #FF5181;
  box-sizing:border-box;
  background:#f5c4d3;
}


.cover-template-card{

  width:190px !important;
  height:111px !important;

  aspect-ratio:auto !important;

  min-height:auto !important;

  position:relative;

  overflow:hidden;

  background:#f5c4d3;

  border:2px solid #e5e5e5;

  border-radius:12px;

  box-sizing:border-box;
}

.cover-template-card.active{
  border-color:#FF5181;
}



    
    .export-page {
  width: 1800px !important;
  height: 2030px !important;
  background: #fff;
  position: relative;
  overflow: hidden;
  border: none !important;
  flex: 0 0 1800px;
}

.export-page .page-slot {
  border: none !important;
}

.export-page .add-photo {
  display: none !important;
}

.text-box {
  position:absolute;
  /*min-width:120px;
  min-height:30px;*/
  cursor:move;
  font-size:22px;
  color:black;
  font-family:Arial;
  z-index:50;
  user-select:none;
  white-space:nowrap;
  will-change: transform;
}
.text-box.selected {
  box-shadow: 0 0 0 1px #FF5181;
  border-radius: 6px;
}
.delete-selected-btn {
  display: none;
}

.messenger-modal {

  position: fixed;
  inset: 0;

  background: rgba(0,0,0,.35);

  z-index: 99999;

  display: none;

  align-items: center;
  justify-content: center;
}

.messenger-modal.open {
  display: flex;
}

.messenger-box {

  position: relative;

  width: min(
    420px,
    calc(100vw - 30px)
  );

  background: white;

  border-radius: 24px;

  padding: 20px;

  box-sizing: border-box;
}

.messenger-close-icon {

  position: absolute;

  top: 14px;
  right: 14px;

  width: 34px;
  height: 34px;

  border: none;

  background: transparent;

  color: #999;

  font-size: 20px;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.messenger-close-icon:hover {
  color: #222;
}



.messenger-title {

  font-size: 22px;
  font-weight: 600;

  margin-bottom: 8px;

  text-align: center;
}

.messenger-subtitle {

  font-size: 15px;

  color: #666;

  text-align: center;

  margin-bottom: 14px;
}

.messenger-copy-btn,
.messenger-close-btn {

  width: 100%;

  height: 48px;

  border: none;

  border-radius: 16px;

  cursor: pointer;
}

.messenger-copy-btn {

  width: 100%;

  height: 48px;

  border: none;

  border-radius: 16px;

  cursor: pointer;

  background: #FF5181;

  color: white;

  margin-bottom: 12px;

  font-size: 15px;

  font-weight: 600;
}

.messenger-close-btn {

  background: #e9e9e9;
}

.messenger-buttons {

  display: flex;

  gap: 8px;

  margin-bottom: 12px;
}

.messenger-buttons a {

  flex: 1;

  height: 46px;

  background: #f5f5f5;

  border-radius: 16px;

  display: flex;

  align-items: center;
  justify-content: center;

  text-decoration: none;

  color: #222;
}

.messenger-email-btn {

  width: 100%;

  height: 48px;

  margin-bottom: 12px;

  border-radius: 16px;

  background: #f5f5f5;

  color: #222;

  text-decoration: none;

  display: flex;

  align-items: center;
  justify-content: center;

  font-size: 17px;

  font-weight: 500;
}

.cover-color-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: #f1f1f1;
  color: #222;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.cover-color-btn input {
  width: 28px;
  height: 28px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.desktop-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}





.add-book-btn{
  width:100%;
  height:78px;
  margin:20px 0 34px;
  padding:0 18px;

  display:flex;
  align-items:center;
  gap:14px;

  background:#f7f7f7;
  border-radius:22px;
  box-sizing:border-box;
  text-decoration:none;
  overflow:hidden;
}

.add-book-btn img{
  width:48px;
  height:48px;
  border-radius:10px;
  object-fit:cover;
  background:#fff;
}

.add-book-info{
  flex:1;
  text-align:left;
  min-width:0;
}

.add-book-info span{
  display:block;
  font-size:18px;
  line-height:1.15;
  font-weight:700;
  color:#111;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.add-book-info strong{
  display:block;
  margin-top:5px;
  font-size:18px;
  font-weight:800;
  color:#ff477b;
}

.add-book-plus{
  width:42px;
  height:42px;
  border-radius:50%;
  background:#ff477b;
  color:#fff;

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:28px;
  line-height:1;
  font-weight:700;
  flex-shrink:0;
}







































#editorLoader {
  position: fixed;
  inset: 0;
  background: #f6f1ec;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  color: #111;
}

.loaderBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transform: translateY(-20px);
}

.loaderLogo {
  width: 72px;
  height: 72px;
  border-radius: 24px;

  background: #FF5181;
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 38px;
  font-weight: 800;
  font-family: "Alegreya Sans SC", Arial, sans-serif;

  margin-bottom: 22px;

  box-shadow: 0 18px 40px rgba(255, 81, 129, 0.25);
}

.loaderSpinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;

  border: 4px solid rgba(255, 81, 129, 0.18);
  border-top-color: #FF5181;

  animation: loaderSpin 0.8s linear infinite;

  margin-bottom: 22px;
}

.loaderTitle {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.loaderText {
  font-size: 15px;
  color: #777;
}

#editorLoader.hidden {
  display: none;
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== MODAL: MAKET READY FINAL ===== */

/* Checkout modal */

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.35);
font-family: Arial, sans-serif;
  
}

.checkout-modal.open {
  display: flex;
}

.checkout-modal__box {
  position: relative;

  width: 420px;
  max-width: calc(100vw - 40px);

  background: #ffffff;

  border-radius: 34px;

  padding: 28px;

  box-sizing: border-box;
}

.checkout-modal__close {
  position: absolute;
  top: 8px;
  right: 18px;

  width: 15px;
  height: 15px;

  border: none;
  background: transparent;

  color: #999;

  font-size: 15px;
  line-height: 15px;

  padding: 0;
  cursor: pointer;
}

.checkout-modal__title {
  text-align: center;

  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;

  color: #000;

  margin-bottom: 32px;
}

.checkout-modal__text {
  text-align: center;

  font-size: 16px;
  line-height: 1.16;
  font-weight: 400;

  color: #666;

  margin-bottom: 20px;
}

.checkout-modal__id-row {
  position: relative;

  width: 100%;

  margin-bottom: 16px;
}

.checkout-modal__id-input {
  width: 100%;
  height: 58px;

  
  border: 1px solid #d8d8d8;
  border-radius: 20px;

  padding: 0 92px 0 28px;

  box-sizing: border-box;

  background: #fff;
  color: #000;

  font-size: 18px;
  font-weight: 500;

  outline: none;
}

.checkout-modal__copy {
  position: absolute;
  top: 50%;
  right: 16px;

  transform: translateY(-50%);

  width: 32px;
  height: 32px;

  border: none;
  background: transparent;

  color: #999;
  font-size: 24px;
  font-weight: 400;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-modal__order-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 58px;

  border-radius: 20px;

  background: #ff4f83;
  color: #fff;

  text-decoration: none;

  font-size: 20px;
  font-weight: 500;
}

.checkout-modal__problem {
  margin-top: 24px;
  margin-bottom: 16px;

  text-align: center;

  font-size: 16px;
  line-height: 1.2;

  color: #666;
}

.checkout-modal__mail-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 58px;

  border-radius: 20px;

  background: #f5f5f5;
  color: #111;

  text-decoration: none;

  font-size: 18px;
  font-weight: 500;
}









.cover-icon-mini-panel {
  position: absolute;
  transform: translateX(-50%);
  z-index: 99999;

  display: flex;
  gap: 4px;

  padding: 4px;

  background: #fff;
  border-radius: 999px;

  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  pointer-events: auto;
}

.cover-icon-panel-btn {
  width: 24px;
  height: 24px;

  border: none;
  border-radius: 50%;

  background: #FF5181;
  color: white;

  font-size: 15px;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}







@media (max-width: 768px) {
  .checkout-modal__box {
    width: calc(100vw - 28px);

    padding: 38px 22px 32px;

    border-radius: 28px;
  }

  .checkout-modal__close {
    top: 18px;
    right: 18px;

    width: 36px;
    height: 36px;

    font-size: 34px;
  }

  .checkout-modal__title {
    font-size: 34px;
    margin-bottom: 26px;
  }

  .checkout-modal__text {
    font-size: 24px;
    margin-bottom: 32px;
  }

  .checkout-modal__id-input {
    height: 76px;

    border-radius: 18px;

    padding-left: 18px;
    padding-right: 66px;

    font-size: 23px;
  }

  .checkout-modal__copy {
    right: 16px;

    width: 42px;
    height: 42px;

    font-size: 32px;
  }

  .checkout-modal__order-btn {
    height: 76px;

    border-radius: 18px;

    font-size: 28px;
  }

  .checkout-modal__problem {
    margin-top: 58px;
    margin-bottom: 20px;

    font-size: 24px;
  }

  .checkout-modal__mail-btn {
    height: 70px;

    border-radius: 18px;

    font-size: 25px;
  }
}





@media(max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
    background: #f5f5f5;
  }

  .desktop-toolbar {
    display: none !important;
  }




.upload-toast {
  position: fixed;
  top: 30px;

  width: 130px;
  height: 40px;

  right: 20px;
  bottom: 20px;

  padding: 12px;

  background: rgba(255,255,255,0.95);

  border-radius: 14px;

  box-sizing: border-box;
}

  .upload-toast-title {
    font-size: 11px;
    margin-bottom: 4px;
    line-height: 1;
  }

  .upload-toast-bar {
    height: 3px;
  }




  .editor-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 12px;
  }

  .editor-logo {
    font-size: 13px;
    max-width: 95px;
    line-height: 1.1;
  }

  .editor-project-name {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-top: 0;

    font-size: 13px;
    max-width: 120px;
    text-align: center;
    display: none;
  }

  .editor-header-actions {
    gap: 10px;
  }

  .header-btn {
    font-size: 10px;
    gap: 2px;
  }

  .header-btn svg {
    width: 20px;
    height: 20px;
  }





  #photoBookApp {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    height: auto;

    display: grid;
    grid-template-columns: 1fr;

    background: #f5f5f5;
    overflow-x: hidden;
    overflow-y: visible;

    box-sizing: border-box;
  }

  .center-panel {
    width: 100vw;
    max-width: 100vw;

    min-height: calc(100vh - 74px);
    height: auto;

    padding: 180px 0 170px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    overflow-x: hidden;
    overflow-y: visible;

    box-sizing: border-box;
  }

  .top-actions {
    position: fixed !important;
    top: 58px !important;
    left: 12px !important;
    right: 12px !important;

    z-index: 9999 !important;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    pointer-events: none;
  }

  .export-toolbar {
    width: 100% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 8px !important;

    pointer-events: auto;
  }

  .export-toolbar button:first-child {
    display: none !important;
  }

  .export-toolbar button:last-child {
    margin-left: auto !important;
  }

  .export-toolbar .save-btn {
    height: 44px;
    padding: 0 20px;

    border-radius: 14px;

    font-size: 14px;
    font-weight: 500;

    flex: 0 0 auto;
  }

  .export-toolbar .history-btn {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    padding: 0;

    border-radius: 12px;
    background: #dedede;
  }

  .export-toolbar .history-btn svg {
    width: 22px;
    height: 22px;
    stroke: #ababab;
  }

  .book-spread {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);

    margin: 0 auto;

    display: flex;
    flex-shrink: 0;

    overflow: hidden;
    box-sizing: border-box;
  }

  .page {
    width: 50%;
    height: calc(((100vw - 32px) / 2) * 1.127);

    box-sizing: border-box;
  }

  .page-numbers {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);

    display: flex;
    justify-content: space-between;

    gap: 0;

    margin: 10px auto 12px;

    flex-shrink: 0;
    box-sizing: border-box;
  }

  .page-number {
    width: 34px;
    height: 34px;

    font-size: 12px;
  }

  .add-photo {
    width: 38px;
    height: 38px;

    font-size: 26px;
  }

  .left-panel {
    position: fixed;

    left: 10px;
    right: 10px;
    bottom: 84px;

    height: 125px;

    z-index: 110;

    display: none;

    padding: 10px;

    overflow-x: auto;
    overflow-y: hidden;

    background: #fff;

    border-radius: 16px;

    box-shadow: 0 8px 24px rgba(0,0,0,.16);

    box-sizing: border-box;
  }

  .left-panel.open {
    display: block;
  }

  .templates-title,
  .templates-switch,
  #selectedCoverBox {
    display: none !important;
  }

  .templates-grid {
    display: flex;
    gap: 10px;

    width: max-content;
  }

  .template-card {
    width: 82px;
    height: 105px;

    flex: 0 0 auto;
  }

  .right-panel {
    position: fixed;

    left: 10px;
    right: 10px;
    bottom: 76px;

    height: 92px;

    z-index: 110;

    display: none;

    padding: 10px 12px;

    gap: 10px;

    overflow-x: auto;
    overflow-y: hidden;

    background: #fff;

    border-radius: 16px;

    box-shadow: 0 8px 24px rgba(0,0,0,.16);

    box-sizing: border-box;

    -webkit-overflow-scrolling: touch;
  }

  .right-panel.open {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
  }

  #coverSidebar,
  #pagesSidebar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;

    gap: 10px !important;

    width: max-content !important;
    min-width: max-content !important;

    flex: 0 0 auto !important;
  }

  .thumb-spread,
  .thumb-item,
  .cover-sidebar-item {
    flex: 0 0 auto !important;
  }

  .thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .thumb-spread {
    margin-bottom: 0;
  }

  .thumb-page {
    width: 42px !important;
    height: 58px !important;
  }

  .thumb-label {
    display: block;

    min-width: 90px;

    margin: 4px 0 0;

    font-size: 10px;
    color: #777;
    text-align: center;
  }

  .mobile-bottom-menu {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    height: 74px;

    z-index: 130;

    display: flex;

    background: #fff;

    border-top: 1px solid #ddd;
  }

  .mobile-nav-btn {
    flex: 1;

    border: none;
    background: transparent;

    color: #222;

    font-size: 14px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;
  }

  .mobile-nav-icon {
    font-size: 24px;
    line-height: 1;
  }

  .mobile-nav-btn.active {
    color: #FF5181;
  }

  .mobile-more-panel {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 74px;

    z-index: 140;

    display: none;
    flex-direction: column;

    gap: 14px;
    padding: 18px;

    background: #fff;

    border-top: 1px solid #ddd;

    box-shadow: 0 -8px 24px rgba(0,0,0,.08);

    box-sizing: border-box;
  }

  .mobile-more-panel.open {
    display: flex;
  }

  .mobile-more-row {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 8px;
  }

  .mobile-more-row select,
  .mobile-more-row input {
    height: 46px;

    border: none;
    border-radius: 14px;

    background: #f1f1f1;

    color: #222;

    font-size: 16px;

    padding: 0 8px;

    min-width: 0;

    box-sizing: border-box;
  }

  .mobile-more-row select {
    flex: 1;
    max-width: 110px;
  }

  .mobile-more-row input {
    width: 46px;
    text-align: center;
  }

  .mobile-more-icon-btn {
    width: 46px;
    height: 46px;

    flex-shrink: 0;

    border: none;
    border-radius: 14px;

    background: #f1f1f1;

    color: #222;

    font-size: 22px;
    font-weight: 600;
  }

  .mobile-more-action {
    width: 100%;
    height: 52px;

    padding: 0 16px;

    border: none;
    border-radius: 16px;

    background: #f1f1f1;

    color: #222;

    font-size: clamp(14px, 3.5vw, 18px);
    font-weight: 500;

    display: flex;
    align-items: center;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    box-sizing: border-box;
  }

  .mobile-color-icon-btn {
    width: 74px;
    height: 46px;

    flex-shrink: 0;

    border-radius: 14px;
    background: #f1f1f1;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-color-icon-btn input {
    width: 42px;
    height: 42px;

    border: none;
    padding: 0;

    background: transparent;
  }

  .mobile-cover-color-btn {
    justify-content: space-between;
  }

  .mobile-cover-color-btn input {
    width: 46px;
    height: 46px;

    flex-shrink: 0;

    border: none;
    border-radius: 14px;
    padding: 0;

    background: transparent;
  }

  .center-panel.cover-mode {
  width: 100vw !important;
  max-width: 100vw !important;

  min-height: calc(100vh - 74px) !important;
  height: auto !important;

  padding: 180px 0 170px !important;

  justify-content: flex-start !important;

  overflow-x: hidden !important;
  overflow-y: visible !important;
}

  .center-panel.cover-mode #coverEditorWrap {
    display: flex !important;
  }

  #coverEditorWrap {
  position: relative !important;
  inset: auto !important;

  width: 100vw !important;
  max-width: 100vw !important;

  height: 240px !important;

  display: none;

  align-items: flex-start !important;
  justify-content: center !important;

  padding: 0 !important;

  overflow: visible !important;

  box-sizing: border-box !important;
}

  #coverCanvas {
    position: absolute !important;

    left: 50% !important;
    top: 0 !important;

    width: 815px !important;
    height: 483px !important;

    transform: translateX(-50%) scale(0.46) !important;
    transform-origin: top center !important;

    max-width: none !important;

    overflow: hidden !important;

    margin: 0 !important;
  }

  .cover-sidebar-labels {
    font-size: 6px;
    margin-top: 4px;
  }

  .cover-sidebar-labels span {
    width: 46px;
    text-align: center;
  }

  .cover-sidebar-preview-real {
    width: 92px !important;
    height: 58px !important;

    overflow: hidden !important;

    position: relative;
  }

  .cover-sidebar-preview-real > * {
    width: 815px !important;
    height: 483px !important;

    transform: scale(0.111);
    transform-origin: top left;
  }

  #fontSizeInputMobile,
  #fontSelectMobile,
  #textColorSelectMobile {
    font-size: 16px;
  }

  .cover-icon-mini-panel {
    gap: 8px;
    padding: 7px;
  }

  .cover-icon-panel-btn {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}


/* =========================
   MOBILE PROJECT FLOW
========================= */

#mobileProjectFlow {
  display: none;
}

@media(max-width: 768px) {
  .center-panel.mobile-flow-mode > .book-spread,
  .center-panel.mobile-flow-mode > #coverEditorWrap {
    display: none !important;
  }


  .center-panel.mobile-flow-mode #mobileProjectFlow {
    display: flex;
    flex-direction: column;
    gap: 28px;

    width: 100%;
    padding: 0 16px 120px;

    box-sizing: border-box;
  }

  .mobile-flow-mode .page.active {
  outline: 3px solid #ff4fa3;
  outline-offset: 4px;
}



  .mobile-flow-spread {
    width: 100%;
  }

  .mobile-flow-pages {
    display: flex;
    width: 100%;

    background: #fff;
    overflow: hidden;
  }

  .mobile-flow-pages .page {
    width: 50%;
    height: calc(((100vw - 32px) / 2) * 1.127);
  }

}

