/* Рукописные фразы SeenPlace — декоративный слой, не UI-лейблы */
.hn-note {
  --hn-rot: -6deg;
  --hn-opacity: 0.9;
  --hn-color: #3a2a22;

  position: absolute;
  z-index: 4;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  outline: none;
  pointer-events: none;
  user-select: none;
  font-family: "Caveat", "Segoe Print", cursive;
  font-weight: 700;
  font-style: normal;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--hn-color);
  opacity: var(--hn-opacity);
  transform: rotate(var(--hn-rot));
  transform-origin: center center;
  white-space: normal;
  max-width: min(12.5em, 46vw);
  text-align: left;
  top: var(--hn-top, auto);
  right: var(--hn-right, auto);
  bottom: var(--hn-bottom, auto);
  left: var(--hn-left, auto);
}

.hn-note--sm {
  font-size: clamp(1.05rem, 1.7vw, 1.32rem);
}

.hn-note--md {
  font-size: clamp(1.22rem, 2.15vw, 1.68rem);
}

.hn-note--lg {
  font-size: clamp(1.4rem, 2.7vw, 2.02rem);
}

.hn-note--warm {
  --hn-color: #b4532a;
}

.hn-note--grey {
  --hn-color: #8a8f8c;
}

.hn-note-edit {
  display: inline;
  pointer-events: auto;
  margin: 0 0 0 0.12em;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.78em;
  line-height: 1;
  vertical-align: 0.45em;
  cursor: pointer;
  opacity: 0.9;
}
.hn-note-edit:hover {
  opacity: 1;
  color: #5c615e;
}

.hn-note-wrap {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
  transform: rotate(var(--hn-rot, -6deg));
  transform-origin: center center;
  opacity: var(--hn-opacity, 0.9);
  max-width: min(12.5em, 46vw);
  top: var(--hn-top, auto);
  right: var(--hn-right, auto);
  bottom: var(--hn-bottom, auto);
  left: var(--hn-left, auto);
}
.hn-note.hn-note--wash,
.hn-note-wrap.hn-note--wash {
  background-color: transparent;
  background-image: var(--hn-wash);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}
.hn-note--wash-h {
  padding: 0.42em 0.72em 0.5em;
}
.hn-note--wash-v {
  padding: 0.62em 0.7em 0.72em;
}

.hn-note-wrap .hn-note--in-wrap {
  position: static;
  transform: none;
  margin: 0;
  max-width: none;
  pointer-events: none;
  opacity: 1;
}

/* Shared note edit modal (profile + homepage) */
.hn-note-modal {
  position: fixed;
  inset: 0;
  z-index: 20050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hn-note-modal[hidden] {
  display: none !important;
}
.hn-note-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 18, 0.4);
}
.hn-note-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 18px 18px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 20, 18, 0.22);
}
.hn-note-modal__title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1f1c;
}
.hn-note-modal__input {
  display: block;
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 10px 12px;
  border: 1.5px solid #d7dbd7;
  border-radius: 12px;
  font-family: "Caveat", "Segoe Print", cursive;
  font-size: 1.3rem;
  line-height: 1.15;
  color: #8a8f8c;
  background: #fff;
  box-sizing: border-box;
}
.hn-note-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.hn-note-modal__btn {
  appearance: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.hn-note-modal__btn--ghost {
  border: 1.5px solid #cfd4cf;
  background: #fff;
  color: #1a1f1c;
}
.hn-note-modal__btn--primary {
  border: 1.5px solid #1a1f1c;
  background: #1a1f1c;
  color: #fff !important;
}
.hn-note-modal__btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.hn-note--cool {
  --hn-color: #2b6cb0;
}

.hn-note--ink {
  --hn-color: #2a241c;
}

.hn-note--clip::before,
.hn-note--pin::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

/* Скрепка */
.hn-note--clip::before {
  top: -0.55em;
  left: 0.2em;
  width: 0.52em;
  height: 0.92em;
  border: 1.6px solid currentColor;
  border-radius: 40% 40% 28% 28%;
  transform: rotate(-22deg);
  opacity: 0.5;
}

/* Булавка / круглая кнопка */
.hn-note--pin::before {
  top: -0.42em;
  left: 0.55em;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.42;
  box-shadow: 0 0.32em 0 -0.13em currentColor;
}

.hhc,
.hne,
.hkids-wrap,
.hsport-wrap,
.hme,
.pub-hero {
  position: relative;
}

/* Главная: размер Caveat как у hhc__scribble в макете (цвет — variant) */
.hhc .hn-note,
.hhc .hn-note-wrap,
.hne .hn-note,
.hne .hn-note-wrap,
.hkids-wrap .hn-note,
.hkids-wrap .hn-note-wrap,
.hsport-wrap .hn-note,
.hsport-wrap .hn-note-wrap,
.hme .hn-note,
.hme .hn-note-wrap {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  max-width: min(10.5em, 40vw);
  line-height: 1.12;
  font-weight: 700;
}

.hhc .hn-note--lg,
.hhc .hn-note-wrap .hn-note--lg,
.hne .hn-note--lg,
.hne .hn-note-wrap .hn-note--lg,
.hkids-wrap .hn-note--lg,
.hkids-wrap .hn-note-wrap .hn-note--lg,
.hsport-wrap .hn-note--lg,
.hsport-wrap .hn-note-wrap .hn-note--lg,
.hme .hn-note--lg,
.hme .hn-note-wrap .hn-note--lg {
  font-size: clamp(1.12rem, 1.95vw, 1.48rem);
}

/* Hero: свободное место у коллажа */
.hhc .hn-note--slot-a {
  top: 7%;
  left: 34%;
}

.hhc .hn-note--slot-b {
  top: 18%;
  right: 4%;
  left: auto;
}

.hhc .hn-note--slot-c {
  bottom: 8%;
  left: 6%;
}

/* Nearby: нижний край, чуть вылезает к детям */
.hne .hn-note--slot-a {
  right: 7%;
  bottom: -0.35rem;
  left: auto;
}

.hne .hn-note--slot-b {
  top: 1.2rem;
  right: 5%;
  left: auto;
}

.hne .hn-note--slot-c {
  left: 8%;
  bottom: 0.4rem;
}

/* Kids: в белом поле полоски, у края */
.hkids-wrap .hn-note--slot-a {
  top: 0.15rem;
  left: 5%;
}

.hkids-wrap .hn-note--slot-b {
  top: 0.2rem;
  right: 8%;
  left: auto;
}

.hkids-wrap .hn-note--slot-c,
.hkids-wrap .hn-note--sec-between_kids_sport {
  bottom: 0.1rem;
  right: 10%;
  left: auto;
}

/* Sport: воздух над/сбоку полоски */
.hsport-wrap .hn-note--slot-a {
  top: 0.1rem;
  right: 14%;
  left: auto;
}

.hsport-wrap .hn-note--slot-b {
  top: 0.15rem;
  left: 28%;
}

.hsport-wrap .hn-note--slot-c {
  bottom: 0.05rem;
  left: 6%;
}

/* Memories: справа от заголовка */
.hme .hn-note--slot-a {
  top: 1.6rem;
  right: 6%;
  left: auto;
}

.hme .hn-note--slot-b {
  top: 2.2rem;
  left: 32%;
}

.hme .hn-note--slot-c {
  bottom: 1rem;
  right: 8%;
  left: auto;
}

/* Публичный / мой профиль — фраза на белой шапке коллажа */
.phc > .hn-note,
.phc .hn-note--slot-a {
  top: 10%;
  right: 6%;
  left: auto;
  z-index: 4;
  color: #b4532a;
  --hn-color: #b4532a;
  max-width: min(11em, 38vw);
}

/* Площадка — заметка на полях на белом Hero-коллаже */
.vhc > .hn-note,
.vhc .hn-note--slot-a {
  top: 10%;
  right: 6%;
  left: auto;
  z-index: 4;
  color: #b4532a;
  --hn-color: #b4532a;
  max-width: min(11em, 38vw);
}

/* Публичный профиль — одна фраза в воздухе баннера */
.pub-hero > .hn-note,
.pub-hero .hn-note--slot-a {
  top: 22%;
  right: 7%;
  left: auto;
  z-index: 3;
  color: #f4e4c8;
  --hn-color: #f4e4c8;
  text-shadow: 0 1px 10px rgba(15, 23, 42, 0.45);
  max-width: min(11em, 38vw);
}

@media (max-width: 960px) {
  .hhc .hn-note--slot-a {
    top: 4%;
    left: auto;
    right: 6%;
  }
}

@media (max-width: 720px) {
  .hn-note--sm,
  .hn-note--md,
  .hn-note--lg {
    font-size: clamp(0.98rem, 4.1vw, 1.18rem);
    max-width: min(9.5em, 42vw);
  }

  .hn-note--hide-mobile {
    display: none !important;
  }

  body.homepage-redesign .hn-note-wrap.hn-note--hide-mobile {
    display: inline-flex !important;
  }

  body.homepage-redesign p.hn-note.hn-note--hide-mobile {
    display: block !important;
  }

  /* Hero: заметка справа от названия события */
  .hhc .hn-note--slot-a,
  .hhc .hn-note--move-mobile.hn-note--sec-hero,
  .hhc .hn-note-wrap.hn-note--slot-a,
  .hhc .hn-note-wrap.hn-note--move-mobile.hn-note--sec-hero {
    top: auto !important;
    right: 8px !important;
    left: auto !important;
    bottom: 8.4rem !important;
    max-width: 6.4em !important;
    font-size: clamp(0.86rem, 3.5vw, 1.02rem);
    z-index: 4;
  }

  .hhc .hn-note,
  .hhc .hn-note-wrap,
  .hne .hn-note,
  .hne .hn-note-wrap {
    color: #2b6cb0;
    --hn-color: #2b6cb0;
  }

  .hne .hn-note-wrap,
  .hkids-wrap .hn-note-wrap,
  .hsport-wrap .hn-note-wrap,
  .hme .hn-note-wrap {
    display: inline-flex;
  }

  .hne p.hn-note,
  .hkids-wrap p.hn-note,
  .hsport-wrap p.hn-note,
  .hme p.hn-note,
  .hne .hn-note,
  .hkids-wrap .hn-note,
  .hsport-wrap .hn-note,
  .hme .hn-note {
    font-size: clamp(0.98rem, 4.4vw, 1.18rem);
  }

  .hkids-wrap .hn-note,
  .hkids-wrap .hn-note-wrap,
  .hsport-wrap .hn-note,
  .hsport-wrap .hn-note-wrap,
  .hme .hn-note,
  .hme .hn-note-wrap {
    color: #8a8f8c;
    --hn-color: #8a8f8c;
  }

  .pub-hero > .hn-note,
  .pub-hero .hn-note--slot-a {
    top: 12%;
    right: 4%;
    max-width: 7.5em;
    font-size: 0.98rem;
  }

  .phc > .hn-note,
  .phc .hn-note--slot-a {
    top: auto;
    right: auto;
    left: 0.85rem;
    bottom: 0.4rem;
  }

  .vhc > .hn-note,
  .vhc .hn-note--slot-a {
    top: auto;
    right: auto;
    left: 0.85rem;
    bottom: 0.4rem;
  }
}

@media (max-width: 560px) {
  .pub-hero > .hn-note,
  .pub-hero .hn-note--hide-mobile,
  .pub-hero .hn-note--slot-a,
  .phc > .hn-note,
  .phc .hn-note--hide-mobile,
  .phc .hn-note--slot-a,
  .vhc > .hn-note,
  .vhc .hn-note--hide-mobile,
  .vhc .hn-note--slot-a {
    display: none !important;
  }

  /* Редизайн профиля: заметки в слотах остаются видимыми */
  body.profile-design-page .phc--design .prd-note-slot .hn-note,
  body.profile-design-page .phc--design .prd-note-slot .hn-note-wrap,
  body.profile-design-page .prd .prd-note-slot .hn-note,
  body.profile-design-page .prd .prd-note-slot .hn-note-wrap {
    display: block !important;
  }
  body.profile-design-page .phc--design .prd-note-slot .hn-note-wrap {
    display: inline-flex !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hn-note {
    transition: none;
  }
}
