html,
body {
  height: 100%;
  margin: 0;
  background: whitesmoke !important;
  font-family: 'Montserrat', sans-serif;
}

* {
  font-family: 'Montserrat', sans-serif;
  font-display: swap;
}

.mobile-wrapper {
  max-width: 430px;
  min-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background-color: #fff;
}

.header {
  background: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-image: url(/img/bg.png);
  background-repeat: no-repeat;
  background-size: 125px;
}

.menu-icon {
  font-size: 1.5rem;
  cursor: pointer;
  color: #31313C;
}

.logo {
  width: 125px;
}

.generation-counter {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  color: #333;
  gap: 0.5rem;
  transition: opacity .4s;
}

.generation-counter .counter-label {
  font-weight:400;
  color: #33383F;
}

.generation-counter .counter-value {
  display: inline-block;
  padding: 0.0rem 0.7rem;
  background: #fff;
  color: #fb5286;
  border: solid #fb5286 2px;
  font-weight: 700;
  border-radius: 4px 10px;
  min-width: 2rem;
  text-align: center;
}

.main-title {
  font-weight: 700;
  font-size: 27px;
  color: #33383F;
  margin-bottom: 0.5rem;
}

.content-wrapper {
  max-width: 400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.highlight {
  background: linear-gradient(to bottom,
    #fb5286 50%,
    #fb497f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-weight: 500;
  font-size: 15px;
  color: rgba(51, 56, 63, 0.7);
  margin: 0;
  margin-top: 15px;
}

.upload-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  position: relative;
}

.upload-box {
  width: 180px;
  height: 180px;
  background: #F8F9FA;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s;
  position: relative;
  z-index: 1;
}

.upload-box .bi-upload {
  font-size: 2rem;
}

.upload-box.girl .bi-upload {
  color: #E91E63;
}

.upload-box.boy .bi-upload {
  color: #0D6EFD;
}

.upload-box h5 {
  margin-top: .5rem;
  margin-bottom: .25rem;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.8);
}

.upload-box p {
  margin: 0;
  color: #6C757D;
  font-size: .775rem;
}

.center-plus {
  width: 40px;
  height: 40px;
  background: rgba(83, 83, 83, 0.4);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 -15px;
  z-index: 2;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
  border: solid #8B8B8B 1px;
}

.center-plus .bi-plus-lg {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 700;
}

.child-selection {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 30px;
  padding: 0 20px 0 20px;
}

.selection-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.selection-group .form-label {
  font-size: 0.9rem;
  color: #333;
}

.gender-options,
.age-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.option {
  position: relative;
}

.option input {
  position: absolute;
  clip: rect(0 0 0 0);
  pointer-events: none;
}

.option label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: #555;
  font-size: 0.95rem;
  transition: color .2s;
}

.option label:hover {
  color: #000;
}

.radio-icon {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: border-color .2s;
}

.option input:checked+label .radio-icon {
  border-color: #28a745;
}

.option input:checked+label .radio-icon::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #28a745;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.gender-icon {
  width: 32px;
  height: 32px;
  background: #f8f9fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}

.footer-info p {
  font-size: 0.75rem;
  color: rgba(51, 56, 63, 0.6);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.footer-info hr {
  border: solid rgba(48, 78, 123, 0.25) 1px;
  margin: 0 0 1.5rem;
}

.footer-info .fw-semibold {
  font-weight: 600;
}

.gray-text {
  font-size: 0.675rem; 
  color: rgba(51, 56, 63, 0.7) !important;
}

.footer-info .row {
  align-items: start;
}
.footer-info .row .col-md-6.mb-3.mb-md-0 {
  margin-bottom: 0;
}

.payment-icon {
  width: 45px;
    height: 30px;
  padding: 0.5rem;
  background: #fff;
  border-radius: .5rem;
  box-shadow: 0px 2px 15px 0px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-icon img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.btn-custom {
  background: linear-gradient(to bottom,
      #fb5286 50%,
      #fb497f 100%);
  padding: 25px 30px;
  border-radius: 14px;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: filter 0.2s, transform 0.1s;
  margin-top: 30px;
}

.upload-box input[type="file"] {
                 position: absolute;
                 top: 0; left: 0;
                 width: 100%;
                 height: 100%;
                 opacity: 0;
                 cursor: pointer;
                 z-index: 10;
               }
.btn-upload input[type="file"] {
                 position: absolute;
                 top: 0; left: 0;
                 width: 100%;
                 height: 100%;
                 opacity: 0;
                 cursor: pointer;
                 z-index: 10;
               }

.btn-custom.loading {
    background: linear-gradient(
        90deg,
        #fb497f 25%,
        #ff6b98 50%,
        #fb497f 75%
    );
    background-size: 200% 100%;
    animation: bg-move 2s linear infinite;
}

@keyframes bg-move {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btn-custom:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.btn-custom:active {
  filter: brightness(0.95);
  transform: translateY(0);
}

body.no-scroll {
  overflow: hidden;
}

.popup-overlay {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;       /* строго по центру по вертикали */
      justify-content: center;   /* и по горизонтали */
      background: rgba(0,0,0,0.5);
      visibility: hidden;
      opacity: 0;
      transition: opacity .2s;
      z-index: 1000;
    }
    .popup-overlay.active {
      visibility: visible;
      opacity: 1;
    }

    /* Окно */
    .popup-window {
      visibility: hidden;
      position: fixed;           /* фиксируем относительно viewport */
      top: 50%; left: 50%;
      transform: translate(-50%, -50%) scale(0.8);
      transform-origin: center;
      background: #fff;
      border-radius: 8px;
      padding: 60px 20px 20px;   /* сверху оставляем место под эмодзи (60px) */
      width: 400px;
      max-width: 90%;
      overflow: visible;         /* эмодзи будет видно за краем */
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);
      opacity: 0;
      transition: opacity .2s, transform .2s;
      z-index: 1001;
    }
    .popup-window.active {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
      visibility: visible;
      transition-duration: .3s;
    }

    .popup-flex {
      display: flex;
      justify-content: center;
    }

    /* Эмодзи */
    .popup-emoji {
      position: absolute;
      top: -77px;                /* подвиньте, если нужно точнее */
      left: 50%;
      transform: translateX(-50%);
      pointer-events: none;
      z-index: 1002;
    }
    .popup-emoji img {
      display: block;
      width: 96px;
      height: 96px;
    }

    /* Контент с прокруткой */
    .popup-content {
      max-height: calc(100vh - 120px); 
      /* 100vh - (padding-top 60px + padding-bottom 20px + небольшой запас) */
      overflow-y: auto;
    }

.popup-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #000;
}

.popup-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: #33383F;
  text-align: center;
  margin: 0 0 8px;
}

.popup-subtitle {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #6C757D;
  text-align: center;
  margin: 0 0 1.85rem;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 30px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #212529;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.social-btn:hover {
  background: #f8f9fa;
  border-color: #d0d0d0;
}

.social-btn img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.auto-confirm {
  font-size: 11px;
  color: #6C757D;
  text-align: center;
  margin: 0;
}

.toast {
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transform: translateX(100%);
  transition:
    max-width 0.4s ease,
    opacity 0.4s ease,
    transform 0.4s ease;
}

.toast.show {
  max-width: 400px; 
  opacity: 1;
  transform: translateX(0);
  margin-bottom: 5px;
  background: rgba(255,255,255);

}

.toast.hide {
  opacity: 0;
  transform: translateY(-20px);
}

.toast-container-custom {
      position: fixed;
      top: 1.5rem;
      left: 50%;
  transform: translateX(-50%);
      z-index: 1055;

    }

    .custom-toast {
      position: relative;
      overflow: hidden;
      box-shadow: 0 0 10px rgba(0,0,0,0.05);
      background: white;
    }

    .custom-toast .toast-body {
      font-size: 0.8rem;
      color: #333;
      font-weight: 500;
    }

    .progress-bar-timer {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 2px;
      background-color: #28a745;
      animation: progressBar 5s linear forwards;
    }

    @keyframes progressBar {
      from { width: 100%; }
      to { width: 0%; }
    }

.animated {
  -webkit-animation-duration: 1s;
          animation-duration: 1s;
  -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
}

.animated.infinite {
  -webkit-animation-iteration-count: infinite;
          animation-iteration-count: infinite;
}

.animated.hinge {
  -webkit-animation-duration: 2s;
          animation-duration: 2s;
}

@-webkit-keyframes flipOutX {
  0% {
    -webkit-transform: perspective(400px);
            transform: perspective(400px);
  }

  30% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
            transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    opacity: 1;
  }

  100% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
            transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    opacity: 0;
  }
}

@keyframes flipOutX {
  0% {
    -webkit-transform: perspective(400px);
            transform: perspective(400px);
  }

  30% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
            transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    opacity: 1;
  }

  100% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
            transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    opacity: 0;
  }
}

.flipOutX {
  -webkit-animation-name: flipOutX;
          animation-name: flipOutX;
  -webkit-animation-duration: .75s;
          animation-duration: .75s;
  -webkit-backface-visibility: visible !important;
          backface-visibility: visible !important;
}

@-webkit-keyframes flipInX {
  0% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
            transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    -webkit-transition-timing-function: ease-in;
            transition-timing-function: ease-in;
    opacity: 0;
  }

  40% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
            transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    -webkit-transition-timing-function: ease-in;
            transition-timing-function: ease-in;
  }

  60% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
            transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
            transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }

  100% {
    -webkit-transform: perspective(400px);
            transform: perspective(400px);
  }
}

@keyframes flipInX {
  0% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
            transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    -webkit-transition-timing-function: ease-in;
            transition-timing-function: ease-in;
    opacity: 0;
  }

  40% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
            transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    -webkit-transition-timing-function: ease-in;
            transition-timing-function: ease-in;
  }

  60% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
            transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
            transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }

  100% {
    -webkit-transform: perspective(400px);
            transform: perspective(400px);
  }
}

.flipInX {
  -webkit-backface-visibility: visible !important;
          backface-visibility: visible !important;
  -webkit-animation-name: flipInX;
          animation-name: flipInX;
}

.wrapper {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      margin-top: 20px;
    }

    .waiting {
      width: 320px;
      height: 320px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: #F8F9FA;
      border: 1px solid #E0E0E0;
      border-radius: 8px;
      font-family: sans-serif;
      position: relative; 
      overflow: hidden; 
      margin-top: 20px;
    }


    .shimmer::after {
      content: "";
      position: absolute;
      top: 0; left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(
        90deg,
        rgba(255,255,255,0)   0%,
        rgba(0,0,0,0.035) 50%,
        rgba(0,0,0,0)   100%
      );
      animation: shimmer 2.5s infinite;
    }
    @keyframes shimmer {
      0%   { transform: translateX(-200%); }
      100% { transform: translateX(200%); }
    }

    /* → Спиннер */
    .spinner {
      width: 48px;
      height: 48px;
      position: relative;
      margin-bottom: 1.5rem;
    }
    .spinner div {
      box-sizing: border-box;
      position: absolute;
      width: 100%; height: 100%;
      border: 4px solid #ccc;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      border-color: #ccc transparent transparent transparent;
    }
    .spinner div:nth-child(1) { animation-delay: -0.45s; }
    .spinner div:nth-child(2) { animation-delay: -0.30s; }
    .spinner div:nth-child(3) { animation-delay: -0.15s; }
    @keyframes spin {
      0%   { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .waiting h2 {
      margin: 0;
      font-size: 1.25rem;
      font-weight: 600;
      color: rgba(0,0,0,0.8);
      text-align: center;
    }
    .waiting p {
      margin: .5rem 0 0;
      font-size: .875rem; 
      font-weight: 400;
      color: rgba(0,0,0,0.5);
      text-align: center;
    }


#popupPro {
        padding-bottom: 2.5rem;
  }
  .plan-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #ffffff;
  border: 2px solid #F2F2F2;
  border-radius: 8px;
  max-width: 480px;
  margin: 0 auto 1rem;
  font-family: sans-serif;
  cursor: pointer;
}

.plan-card .plan-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card.selected {
  border-color: #0066FF;
}

.plan-info {
  display: flex;
  flex-direction: column;
}

.plan-header {
  font-size: 0.725rem;
  color: #33383F;
  margin-bottom: 0.25rem;
}
.plan-name {
  font-weight: 600;
}
.plan-type {
  color: #6C757D;
  margin-left: 0.1rem;
}

.plan-price {
  display: flex;
  align-items: baseline;
}
.price-current {
  font-size: 1.3rem;
  font-weight: 600;
  color: #212529;
}
.price-unit {
  font-size: 0.8rem;
  color: #212529;
  margin-left: 0.25rem;
}
.price-old {
  font-size: 0.79rem;
  color: #6C757D;
  /*text-decoration: line-through;*/
  margin-left: 0.5rem;
}

.plan-benefit {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: #0066FF;
  font-weight: 500;
}

.fake-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #E0E0E0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
}

.fake-radio i {
  display: none;
  font-size: 0.75rem;
  color: #fff;
}

.plan-card .plan-radio:checked ~ .plan-select .fake-radio {
  border-color: #356BFF;
  background: #356BFF;
}
.plan-card .plan-radio:checked ~ .plan-select .fake-radio i {
  display: block;
  margin-top: 1px;
    margin-left: -1px;
}



.gradient-border {
  background: linear-gradient(
    to top right,
    #B1DEFE,
    #FDD4F1,
    #FFDB8F
  );
  border-radius: 8px;    
  padding: 2px;       
}

.plan-year {
  background: #fff;  
  border-radius: 6px; 
  border: none; margin: 0
}

.plan-badge {
  position: absolute;
  top: 0;
  right: 60px;
  transform: translate(50%, -50%);
  background: linear-gradient(
    to top right,
    #FF9D47,
    #FFC26E
  );
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 4px 10px;
  white-space: nowrap;
  z-index: 2;
}

.btn-custom--sm {
  padding: 12px 16px;       
  border-radius: 10px;       
  font-size: 0.875rem;      
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); 
  margin-top: 15px;       
}
.btn-custom--md {
  padding: 20px 24px;                 
  border-radius: 12px;                
  font-size: 1rem;                  
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  margin-top: 20px;                  
}


#popupGenerations {
      padding-bottom: 2.5rem;
    }

    .gen-card {
  position: relative;
  display: flex;
  align-items: center;     
  padding: 0.7rem 0.8rem;
  background: #fff;
  border: 2px solid #F2F2F2;
  border-radius: 8px;
  max-width: 480px;
  margin: 0 auto 0.5rem;
  font-family: sans-serif;
  cursor: pointer;     
}

    .gen-card .gen-radio {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .gen-card.selected {
      border-color: #0066FF;
    }

    .gen-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;      
}

.gen-header {
  font-size: 0.85rem;
  color: #33383F;
  margin: 0;           
}

.gen-count {
  font-weight: 600;
}

.gen-unit {
  color: #6C757D;
  margin-left: 0.25rem;
}

    .gen-card .gen-radio:checked ~ .gen-select .fake-radio {
      border-color: #356BFF;
      background: #356BFF;
    }
    .gen-card .gen-radio:checked ~ .gen-select .fake-radio i {
      display: block;
      margin-top: 1px;
      margin-left: -1px;
    }

    .gen-badge {
  display: inline-block;
  background: linear-gradient(bottom right, #FF9D47, #FFC26E);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 4px 10px;
  white-space: nowrap;
  margin-right: 7px;
  width: 87px;
  text-align: center;
}

    /* цена */
    .gen-select {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gen-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: #33383F;
  margin: 0;    
  width: 55px;  
  text-align: right;   
}

@media (max-width: 414px) {
  .gen-badge {
    display: none;
  }
}

  .action-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-top: 40px;
}

.btn-upload {
  background: #F8F9FA;
  border: 1px solid #E0E0E0;
  position: relative;
  border-radius: 8px;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-upload:hover {
  background: #fff;
  border-color: #ccc;
}
.btn-upload i {
  font-size: 1.5rem;
  color: #fb5286;
}

.preview-wrapper {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: visible; 
  flex-shrink: 0;
}
.preview-image-container {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;   
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  background: #ff4d4f;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background .2s;
  z-index: 10;        
}


.photos {
  width: 360px;
  height: 360px;
  display: grid;
  grid-template-areas:
    "main mini1"
    "main mini2"
    "main mini3";
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.block-gen {
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.block-gen {
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 0.9rem;
          color: #666;
          background-color: #f0f0f0;
          transition: background-image 0.2s ease-in-out, color 0.2s;
          background-size: cover;
          background-position: center;
          will-change: background-image
        }
.block-gen.loading::after {
          content: "";
          position: absolute;
          width: 24px;
          height: 24px;
          border: 3px solid #ccc;
          border-top-color: #666;
          border-radius: 50%;
          animation: spin 1s linear infinite;
        }
        @keyframes spin {
          to { transform: rotate(360deg); }
        }

/* Grid area targets */
.main  { grid-area: main; background: #F8F9FA; background-size: cover;
    background-position: center; position: relative;}
.mini1 { grid-area: mini1; background: #E0F7FA; background-size: cover;
    background-position: center; }
.mini2 { grid-area: mini2; background: #FFF3E0; background-size: cover;
    background-position: center; }
.mini3 { grid-area: mini3; background: #FCE4EC; background-size: cover;
    background-position: center; }


/* Кнопки — поверх блока */
/*.photos button {
  position: absolute;
  z-index: 10;
  background: rgba(255,255,255,0.8);
  border: none;
  border-radius: 20%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}*/

/*.block-gen {
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 0.9rem;
          color: #666;
          background-color: #f0f0f0;
          transition: background-image 0.5s ease-in-out, color 0.3s;
          background-size: cover;
          background-position: center;
        }

        .block-gen.waiting-gen::before {
          content: "В ожидании";
          position: absolute;
          z-index: 2;
          color: #555;
          font-size: 0.8rem;
        }

        .block-gen span {
          z-index: 1;
        }

        .block-gen.loading::after {
          content: "";
          position: absolute;
          width: 24px;
          height: 24px;
          border: 3px solid #ccc;
          border-top-color: #666;
          border-radius: 50%;
          animation: spin 1s linear infinite;
        }
        @keyframes spin {
          to { transform: rotate(360deg); }
        }

  .photos {
      width: 320px;
      height: 320px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows:    1fr 1fr;
      border: 1px solid #E0E0E0;
      border-radius: 8px;
      overflow: hidden;
    }

    .photos > div {
      width: 100%;
      height: 100%;
    }

    .photos .top-left     { background: #F8F9FA; }
    .photos .top-right    { background: #E0F7FA; }
    .photos .bottom-left  { background: #FFF3E0; }
    .photos .bottom-right { background: #FCE4EC; }*/

    /* Кнопка “назад” */
    .back-btn {
      position: absolute;
      bottom: 10px;
      right: 8px;
      width: 32px;
      height: 32px;
      background: #FFFFFF;
      border: 1px solid #E0E0E0;
      border-radius: 20%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0,0,0,0.03);
      transition: background .2s, transform .1s;
      color: #333333;
    }
    .back-download {
      position: absolute;
      top: 10px;
      right: 8px;
      width: 32px;
      height: 32px;
      background: #FFFFFF;
      border: 1px solid #E0E0E0;
      border-radius: 20%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0,0,0,0.03);
      transition: background .2s, transform .1s;
      color: #333333;
    }

        .back-magic {
      transform: scaleX(-1);
      position: absolute;
      top: 50px;
      right: 8px;
      width: 32px;
      height: 32px;
      background: #FFFFFF;
      border: 1px solid #E0E0E0;
      border-radius: 20%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0,0,0,0.03);
      transition: background .2s, transform .1s;
      color: #333333;
    }

    .loading-bg {
          animation: pulse-bg 1.5s infinite ease-in-out;
        }

        @keyframes pulse-bg {
          0%   { opacity: 1; }
          50%  { opacity: 0.8; }
          100% { opacity: 1; }
        }