/* WEMMS_DISPLAY_FIX_V2 */
:root {
  --paper: #f5f0e7;
  --paper-2: #fbf8f1;
  --ink: #202927;
  --muted: #7f8b93;
  --blue: #a9b6c7;
  --orange: #ef8043;
  --green: #314f46;
  --line: #cbd2d4;
  --shadow: 0 22px 60px rgba(48, 52, 49, .12);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.9), transparent 35%),
    linear-gradient(rgba(245,240,231,.94), rgba(245,240,231,.94)),
    repeating-radial-gradient(circle at 0 0, rgba(37,45,43,.045) 0 1px, transparent 1px 4px);
  font-family: var(--sans);
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.shell { width: min(1220px, calc(100% - 48px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px); background: rgba(245,240,231,.82); border-bottom: 1px solid rgba(32,41,39,.08); }
.header-inner { min-height: 88px; display: flex; align-items: center; gap: 34px; }
.brand { width: 235px; flex: 0 0 auto; }
.brand img { width: 165px; height: 52px; object-fit: contain; object-position: left center; }
.brand span { display: block; margin-top: -5px; text-transform: uppercase; letter-spacing: .13em; font-size: 8px; color: #6e746f; }
.desktop-nav { margin-left: auto; display: flex; gap: 30px; font-size: 14px; }
.desktop-nav a:hover { color: var(--orange); }
.pill { border: 0; border-radius: 999px; padding: 15px 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: .2s ease; }
.pill:hover { transform: translateY(-1px); }
.button-small { background: var(--green); color: #fff; font-size: 14px; padding: 13px 21px; }
.primary { background: var(--green); color: #fff; }
.secondary { background: transparent; color: var(--green); border: 1px solid rgba(49,79,70,.45); }
.pill:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.hero { min-height: 760px; display: grid; grid-template-columns: minmax(0, .93fr) minmax(480px, 1.07fr); gap: 72px; padding-top: 68px; padding-bottom: 72px; position: relative; }
.eyebrow { margin: 0 0 14px; color: #798186; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; }
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; }
h1 { font-size: clamp(48px, 4.7vw, 76px); line-height: .98; letter-spacing: -.045em; }
h1 em { font-style: normal; }
.orange-rule { width: 168px; height: 2px; background: var(--orange); margin: 22px 0 20px; }
.lead { font-family: var(--serif); font-size: 19px; line-height: 1.55; max-width: 600px; color: #37413e; margin: 0 0 28px; }
.upload-card { min-height: 208px; border: 1px dashed #9ca8ad; background: #faf9f0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 28px 180px 28px 36px; text-align: center; cursor: pointer; outline: none; transition: .2s ease; }
.upload-card:hover, .upload-card:focus, .upload-card.is-dragover { background: #fffaf3; border-color: var(--orange); box-shadow: inset 0 0 0 1px rgba(239,128,67,.12); }
.upload-icon { width: 42px; margin-bottom: 9px; }
.upload-card strong { font-family: var(--serif); font-weight: 400; font-size: 20px; }
.upload-card span { margin-top: 2px; font-family: var(--serif); font-size: 17px; }
.upload-card small { margin-top: 10px; color: #8c959a; font-size: 12px; }
.mascot-camera {
  position: absolute;
  right: 8px;
  bottom: -8px;
  width: 174px;
  mix-blend-mode: normal;
  pointer-events: none;
}
.thumbs-wrap { display: flex; align-items: stretch; gap: 9px; margin-top: 18px; }
.thumbs { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.thumb { aspect-ratio: 1.14; position: relative; overflow: hidden; border-radius: 7px; background: #e5e5e0; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; border: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(250,248,243,.95); color: #414845; cursor: pointer; line-height: 1; font-size: 14px; padding: 0; box-shadow: 0 1px 5px rgba(0,0,0,.12); }
.add-tile { min-width: 84px; border: 1px solid rgba(49,79,70,.18); background: rgba(255,255,255,.42); border-radius: 8px; cursor: pointer; color: var(--ink); }
.add-tile span { font-size: 27px; display: block; line-height: 1; }
.add-tile small { font-size: 11px; }
.add-tile[hidden] { display: none; }
.upload-meta { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.text-button { border: 0; padding: 0; background: transparent; cursor: pointer; color: #8a5140; }
.privacy-note { color: #91989b; font-size: 11px; margin: 10px 0 0; }
.preview-column {
  position: relative;
  align-self: start;
  padding: 0 74px 0 24px;
}

.a4-stage {
  width: min(100%, 560px);
  margin: 0 auto;
  position: relative;
  padding: 54px 48px 38px;
}

.a4-paper {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  background: #fbfaf7;
  box-shadow: var(--shadow);
  border: 1px solid rgba(32,41,39,.12);
  overflow: visible;
}

.a4-paper canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #f8f4ec;
}

/*
  Размеры теперь привязаны именно к листу A4.

  20 / 210 = 9.5238%
  12 / 210 = 5.7143%

  12 / 297 = 4.0404%
*/

.dimension {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  color: #38403d;
  font-size: 10px;
  text-align: center;
}

.dimension small {
  font-size: 9px;
}

/* ширина безопасной зоны — 178 мм */

.safe-width-dimension {
  left: 9.5238%;
  width: 84.7619%;
  top: -31px;

  border-top: 1px solid #505653;
  padding-top: 6px;
}

.safe-width-dimension span {
  background: var(--paper);
  padding: 1px 5px;
}

.safe-width-dimension::before,
.safe-width-dimension::after {
  content: '';
  position: absolute;
  top: -3px;

  width: 7px;
  height: 1px;

  background: #505653;
}

.safe-width-dimension::before {
  left: -1px;
  transform: rotate(-35deg);
}

.safe-width-dimension::after {
  right: -1px;
  transform: rotate(35deg);
}


/* 20 мм слева */

.left-margin-dimension {
  left: 0;
  top: 48%;

  width: 9.5238%;

  border-top: 1px solid #505653;
}

.left-margin-dimension span {
  position: absolute;

  right: calc(100% + 8px);
  top: -21px;

  width: 74px;

  text-align: right;
}


/* 12 мм справа */

.right-margin-dimension {
  right: 0;
  top: 48%;

  width: 5.7143%;

  border-top: 1px solid #505653;
}

.right-margin-dimension span {
  position: absolute;

  left: calc(100% + 8px);
  top: -7px;

  width: 42px;

  text-align: left;
}


/* 12 мм сверху */

.top-margin-dimension {
  left: 50%;
  top: 0;

  height: 4.0404%;

  border-left: 1px solid #505653;
}

.top-margin-dimension span {
  position: absolute;

  left: 7px;
  top: 2px;

  width: 42px;

  text-align: left;
}


/* 12 мм снизу */

.bottom-margin-dimension {
  left: 50%;
  bottom: 0;

  height: 4.0404%;

  border-left: 1px solid #505653;
}

.bottom-margin-dimension span {
  position: absolute;

  left: 7px;
  bottom: 2px;

  width: 42px;

  text-align: left;
}
.preview-caption { text-align: center; display: flex; flex-direction: column; gap: 5px; margin-top: 3px; font-size: 12px; }
.preview-caption span { color: #7e8787; }
.preview-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.preview-actions .pill { min-width: 190px; }
.hand-note { position: absolute; font-family: 'Brush Script MT', 'Segoe Script', cursive; color: #75818d; transform: rotate(-7deg); font-size: 18px; line-height: 1.15; }
.note-top { right: -5px; top: 5px; }
.travel-stamp { position: absolute; right: -1px; top: 170px; width: 74px; height: 84px; border: 1px solid #7d8fa2; color: #6f8498; font-family: var(--serif); font-size: 10px; letter-spacing: .12em; display: flex; align-items: center; justify-content: center; flex-direction: column; transform: rotate(4deg); background: rgba(255,255,255,.2); }
.travel-stamp:before { content: '⌁'; font-size: 32px; line-height: .75; }
.features { padding: 10px 0 74px; }
.section-line { border-top: 1px solid #bfc8c9; margin-bottom: 22px; }
.features h2, .closing h2 { font-size: 34px; letter-spacing: -.03em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 34px; }
.steps article { display: flex; gap: 16px; align-items: flex-start; }
.step-number { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 42px; background: #e9e1d5; font-family: var(--serif); font-size: 20px; }
.steps strong, .feature-grid strong { font-family: var(--serif); font-size: 17px; font-weight: 400; }
.steps p, .feature-grid p { margin: 4px 0 0; color: #889090; font-size: 12px; line-height: 1.45; }
.feature-grid { margin-top: 34px; border-top: 1px solid rgba(32,41,39,.08); padding-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr) 180px; gap: 26px; align-items: center; }
.feature-grid article { display: flex; gap: 14px; align-items: flex-start; }
.icon-circle { flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid #d6d3ca; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; }
.mascot-suitcase { width: 170px; mix-blend-mode: multiply; justify-self: end; }
.closing { min-height: 260px; border-top: 1px solid #c7cdcb; display: grid; grid-template-columns: 210px 1fr auto; gap: 34px; align-items: center; padding-top: 30px; padding-bottom: 40px; }
.closing-mascot { width: 190px; mix-blend-mode: multiply; }
.closing p:not(.eyebrow) { color: #737d7d; margin: 12px 0 0; }
footer { border-top: 1px solid rgba(32,41,39,.08); padding: 26px 0 38px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; color: #858d8c; font-size: 12px; }
.footer-inner img { width: 120px; height: 42px; object-fit: contain; object-position: left; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #24352f; color: white; border-radius: 999px; padding: 11px 18px; font-size: 13px; transition: .25s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1020px) {
  .shell { width: min(100% - 34px, 760px); }
  .desktop-nav { display: none; }
  .header-inner { min-height: 74px; }
  .brand { width: 185px; }
  .brand img { width: 145px; height: 45px; }
  .hero { grid-template-columns: 1fr; gap: 45px; padding-top: 42px; }
  .preview-column { padding: 0 58px; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .mascot-suitcase { display: none; }
  .closing { grid-template-columns: 160px 1fr; }
  .closing > .pill { grid-column: 2; justify-self: start; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 500px); }
  .site-header { position: static; }
  .header-inner { min-height: 68px; gap: 10px; }
  .brand { width: 150px; }
  .brand img { width: 126px; height: 39px; }
  .brand span { font-size: 6px; }
  .button-small { margin-left: auto; padding: 10px 13px; font-size: 11px; }
  .hero { padding-top: 30px; padding-bottom: 48px; gap: 28px; }
  h1 { font-size: clamp(40px, 13vw, 58px); }
  .lead { font-size: 17px; }
  .upload-card { min-height: 185px; padding: 24px 108px 24px 18px; }
  .upload-card strong { font-size: 18px; }
  .upload-card span { font-size: 15px; }
  .mascot-camera { width: 118px; right: 0; }
  .thumbs-wrap { gap: 6px; }
  .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .add-tile { min-width: 64px; }
  .preview-column { padding: 0 6px; }
  .a4-stage { padding: 44px 34px 32px; }
  .a4-stage {
    padding-left: 42px;
    padding-right: 42px;
  }

  .dimension {
    font-size: 9px;
  }

  .left-margin-dimension span {
    right: calc(100% + 5px);
    width: 62px;
  }

  .right-margin-dimension span {
    left: calc(100% + 5px);
    width: 36px;
  }
  .note-top, .travel-stamp { display: none; }
  .preview-actions { flex-direction: column; }
  .preview-actions .pill { width: 100%; }
  .features { padding-bottom: 45px; }
  .steps { grid-template-columns: 1fr; gap: 18px; }
  .steps article { border: 1px solid rgba(32,41,39,.09); padding: 13px; border-radius: 10px; background: rgba(255,255,255,.18); }
  .feature-grid { grid-template-columns: 1fr; gap: 18px; }
  .closing { grid-template-columns: 110px 1fr; gap: 16px; }
  .closing-mascot { width: 120px; }
  .closing h2 { font-size: 28px; }
  .closing > .pill { grid-column: 1 / -1; width: 100%; }
}

/* WEMMS_PHOTO_POSITIONING_V2 */

#previewCanvas {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#previewCanvas.is-cropping {
  cursor: grabbing;
}



/* =========================================================
   WEMMS_LOGO_MASCOT_ALIGN_V1
   ========================================================= */


/* ---------- HEADER / LOGO ---------- */

.header-inner {
  min-height: 94px;
  align-items: center;
}


/*
  Логотип + подпись теперь отдельная
  нормальная вертикальная композиция.
*/

.brand {
  width: 245px;
  flex: 0 0 245px;

  display: flex;
  flex-direction: column;

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

  gap: 5px;

  line-height: 1;
}


.brand img {
  display: block;

  width: 205px;
  height: auto;

  max-width: none;

  object-fit: contain;
  object-position: left center;

  margin: 0;
}


/*
  Убираем старый отрицательный margin,
  из-за которого текст залезал на горы.
*/

.brand span {
  display: block;

  margin: 0;
  padding: 0 0 0 2px;

  white-space: nowrap;

  font-size: 7.5px;
  line-height: 1.15;

  font-weight: 400;

  letter-spacing: .135em;

  text-transform: uppercase;

  color: #6e746f;
}



/* ---------- UPLOAD CARD ---------- */

.upload-card {
  overflow: hidden;
}


/*
  Маскот полностью находится внутри карточки,
  не касается рамки и не висит ниже блока.
*/

.mascot-camera {
  position: absolute;

  right: 22px;
  bottom: 12px;

  width: 158px;
  height: auto;

  max-width: none;

  pointer-events: none;

  /*
    У картинки светлый бумажный фон.
    multiply визуально сливает его
    с фоном страницы.
  */
  mix-blend-mode: multiply;

  transform: none;

  opacity: .98;
}



/* ---------- TABLET ---------- */

@media (max-width: 1020px) {

  .header-inner {
    min-height: 82px;
  }

  .brand {
    width: 215px;
    flex-basis: 215px;
    gap: 4px;
  }

  .brand img {
    width: 180px;
    height: auto;
  }

  .brand span {
    font-size: 6.6px;
  }


  .mascot-camera {
    width: 145px;

    right: 18px;
    bottom: 12px;
  }
}



/* ---------- MOBILE ---------- */

@media (max-width: 680px) {

  .header-inner {
    min-height: 72px;
    align-items: center;
  }


  .brand {
    width: 152px;
    flex-basis: 152px;

    gap: 2px;
  }


  .brand img {
    width: 128px;
    height: auto;
  }


  .brand span {
    margin: 0;

    padding-left: 1px;

    font-size: 4.8px;

    letter-spacing: .095em;

    line-height: 1.1;
  }


  .mascot-camera {
    width: 108px;

    right: 9px;
    bottom: 9px;
  }


  /*
    Оставляем тексту пространство,
    чтобы маскот на него не налезал.
  */

  .upload-card {
    padding-right: 112px;
  }
}


/* Очень узкие телефоны */

@media (max-width: 420px) {

  .brand {
    width: 137px;
    flex-basis: 137px;
  }


  .brand img {
    width: 116px;
  }


  .brand span {
    font-size: 4.3px;
  }


  .mascot-camera {
    width: 96px;

    right: 6px;
    bottom: 8px;
  }


  .upload-card {
    padding-right: 98px;
  }
}



/* =========================================================
   WEMMS_CROP_HINT_V1
   ========================================================= */

.crop-hint-note {
  position: absolute;
  top: -66px;
  left: 50%;
  transform: translateX(-50%);

  z-index: 6;
  pointer-events: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 6px 14px;

  border: 1px solid rgba(60, 67, 63, .12);
  border-radius: 999px;

  background: rgba(248, 244, 236, .96);
  box-shadow: 0 8px 22px rgba(32, 41, 39, .05);

  color: #6d7672;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.crop-hint-note::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e68a4a;
  flex: 0 0 7px;
}

@media (max-width: 1020px) {
  .crop-hint-note {
    top: -60px;
    font-size: 11px;
    padding: 6px 12px;
  }
}

@media (max-width: 680px) {
  .crop-hint-note {
    top: -52px;
    max-width: 220px;
    padding: 6px 10px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .crop-hint-note {
    top: -48px;
    max-width: 190px;
    font-size: 9px;
    padding: 5px 9px;
  }
}


/* =========================================================
   WEMMS_MOBILE_MASCOT_HINT_FIX_V1
   ========================================================= */

@media (max-width: 680px) {

  /* Подсказку убираем из absolute-режима и делаем обычным блоком */
  .crop-hint-note {
    position: static;
    top: auto;
    left: auto;
    transform: none;

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

    width: fit-content;
    max-width: calc(100% - 24px);

    margin: 0 auto 12px;
    padding: 7px 12px;

    font-size: 10px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .crop-hint-note::before {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
  }

  /* Немного уменьшаем верхний отступ у зоны A4 */
  .a4-stage {
    padding-top: 8px;
  }

  /* Маскот компактнее и аккуратнее внутри upload-card */
  .upload-card {
    padding-right: 106px;
    min-height: 170px;
  }

  .mascot-camera {
    width: 88px;
    right: 12px;
    bottom: 12px;
    opacity: .98;
  }
}

@media (max-width: 420px) {

  .crop-hint-note {
    max-width: calc(100% - 18px);
    margin-bottom: 10px;
    padding: 6px 10px;

    font-size: 9px;
    line-height: 1.2;
  }

  .upload-card {
    padding-right: 96px;
    min-height: 158px;
  }

  .mascot-camera {
    width: 78px;
    right: 10px;
    bottom: 10px;
  }
}



/* =========================================================
   WEMMS_MOBILE_FIX_V2
   ========================================================= */

@media (max-width: 680px) {

  /*
    UPLOAD CARD
    Оставляем текст слева, маскот делаем заметным справа.
  */

  .upload-card {
    position: relative !important;

    min-height: 188px !important;

    padding:
      32px
      148px
      30px
      22px !important;

    overflow: hidden !important;
  }


  .mascot-camera {
    position: absolute !important;

    width: 128px !important;
    height: auto !important;

    right: 10px !important;
    bottom: 6px !important;

    opacity: 1 !important;

    transform: none !important;

    mix-blend-mode: multiply !important;

    pointer-events: none !important;
  }


  /*
    Подсказка кадрирования:
    отдельная строка, НЕ плашка поверх линейки.
  */

  .crop-hint-note {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    width: calc(100% - 24px) !important;
    max-width: 420px !important;

    box-sizing: border-box !important;

    margin:
      6px
      auto
      22px !important;

    padding:
      11px
      14px !important;

    display: flex !important;

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

    gap: 8px !important;

    border:
      1px solid
      rgba(111, 123, 121, .18) !important;

    border-radius: 12px !important;

    background:
      rgba(248, 244, 236, .98) !important;

    box-shadow: none !important;

    color: #56615e !important;

    font-family:
      Arial,
      sans-serif !important;

    font-size: 13px !important;

    font-weight: 500 !important;

    line-height: 1.35 !important;

    letter-spacing: 0 !important;

    text-align: center !important;

    white-space: normal !important;

    z-index: 10 !important;
  }


  .crop-hint-note::before {
    content: "↔" !important;

    display: inline-block !important;

    width: auto !important;
    height: auto !important;

    flex: 0 0 auto !important;

    border-radius: 0 !important;

    background: none !important;

    color: #e98243 !important;

    font-size: 18px !important;

    font-weight: 600 !important;

    line-height: 1 !important;
  }


  /*
    Убираем лишний верхний отступ:
    сама подсказка уже занимает отдельную строку.
  */

  .a4-stage {
    padding-top: 0 !important;
  }


  /*
    Линейка 178 мм должна идти уже ПОСЛЕ подсказки,
    а не сквозь неё.
  */

  .safe-width-dimension {
    top: -30px !important;
  }
}


@media (max-width: 420px) {

  .upload-card {
    min-height: 178px !important;

    padding:
      28px
      132px
      26px
      18px !important;
  }


  .mascot-camera {
    width: 116px !important;

    right: 8px !important;
    bottom: 5px !important;
  }


  .crop-hint-note {
    width: calc(100% - 18px) !important;

    margin-bottom: 20px !important;

    padding:
      10px
      12px !important;

    font-size: 12.5px !important;
  }


  .crop-hint-note::before {
    font-size: 17px !important;
  }
}

