:root {
  color-scheme: light;
  --bg: #fffaf0;
  --ink: #24202a;
  --muted: #716879;
  --line: #eadfd0;
  --paper: #ffffff;
  --rose: #e86f88;
  --coral: #ff8f68;
  --mint: #6dbb9f;
  --sky: #8cb5d8;
  --sun: #ffd66b;
  --lilac: #bba6ff;
  --violet: #6d5698;
  --leaf: #6da66f;
  --shadow: 0 18px 44px rgba(87, 61, 99, 0.13);
  --hand: "Segoe Print", "Bradley Hand ITC", "Lucida Handwriting", "Comic Sans MS", cursive;
  --serif: "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 22%, rgba(232, 111, 136, 0.1), transparent 18%),
    radial-gradient(circle at 82% 70%, rgba(187, 166, 255, 0.13), transparent 20%),
    linear-gradient(135deg, rgba(255, 214, 107, 0.28), transparent 34%),
    linear-gradient(225deg, rgba(187, 166, 255, 0.24), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 240, 0.94)),
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
}

button,
input,
textarea {
  font: inherit;
}

input,
textarea,
button {
  font-family: var(--sans);
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.app-shell:not(.is-admin) .admin-only {
  display: none !important;
}

/* На вкладке "Нажми" — открытка — прячем верхние технические кнопки */
.app-shell.is-wishes-view .top-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.app-shell:not(.is-wishes-view) .top-actions {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease 120ms, transform 240ms ease 120ms;
}

.app-shell.is-wishes-view .eyebrow:first-of-type {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
}

/* Лента воспоминаний — новый визуальный язык */

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 16px 22px;
  border: 1px solid rgba(91, 30, 63, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 240, 0.92));
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 18px rgba(87, 61, 99, 0.06);
  animation: timelineIn 420ms ease both;
  animation-delay: var(--delay);
  overflow: hidden;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--rose), var(--lilac));
  opacity: 0;
  transition: opacity 200ms ease;
}

.timeline-card:hover::before {
  opacity: 1;
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(87, 61, 99, 0.14);
  border-color: var(--rose);
}

.timeline-day {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 111, 136, 0.18), rgba(187, 166, 255, 0.18));
  color: var(--violet);
  text-align: center;
  flex-shrink: 0;
}

.timeline-day-num {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
}

.timeline-day-month {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.7;
}

.timeline-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.timeline-date {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  margin: 0;
}

.timeline-title {
  font-family: "Caveat", cursive;
  color: var(--violet);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 600;
  word-wrap: break-word;
  margin: 0;
}

.timeline-phrase {
  font-family: "Marck Script", cursive;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-media {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.timeline-mini {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #111;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.timeline-mini img, .timeline-mini video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-empty {
  margin: 40px auto;
  padding: 40px;
  text-align: center;
  border: 1px dashed rgba(91, 30, 63, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  max-width: 460px;
}

.timeline-empty p {
  font-family: "Marck Script", cursive;
  color: var(--ink-soft);
  font-size: 22px;
  margin: 0;
  line-height: 1.4;
}

.timeline-empty button {
  margin-top: 16px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--violet));
  color: #fff;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.gate-screen,
.postcard-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.heart-arrow {
  position: absolute;
  width: 54px;
  height: 48px;
  pointer-events: none;
  opacity: 0.42;
  transform: rotate(-12deg);
  filter: drop-shadow(0 10px 18px rgba(109, 86, 152, 0.14));
}

.heart-arrow::before,
.heart-arrow::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 42px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, rgba(232, 111, 136, 0.9), rgba(187, 166, 255, 0.72));
  transform-origin: 50% 100%;
}

.heart-arrow::before {
  left: 23px;
  transform: rotate(-45deg);
}

.heart-arrow::after {
  left: 4px;
  transform: rotate(45deg);
}

.heart-arrow {
  background:
    linear-gradient(112deg, transparent 50%, rgba(109, 86, 152, 0.72) 51% 55%, transparent 56%) 26px 19px / 80px 8px no-repeat;
}

.heart-one {
  left: 7%;
  bottom: 12%;
}

.heart-two {
  right: 8%;
  top: 14%;
  transform: rotate(18deg) scale(0.82);
}

.app-heart-one {
  position: fixed;
  left: 18px;
  bottom: 22px;
  opacity: 0.22;
}

.app-heart-two {
  position: fixed;
  right: 22px;
  top: 92px;
  opacity: 0.18;
  transform: rotate(16deg) scale(0.8);
}

.gate-screen::before,
.postcard-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 214, 107, 0.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(187, 166, 255, 0.14) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 72%);
  pointer-events: none;
}

.flower-field,
.postcard-flowers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flower {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow:
    0 -15px 0 3px rgba(232, 111, 136, 0.72),
    15px 0 0 3px rgba(187, 166, 255, 0.78),
    0 15px 0 3px rgba(109, 187, 159, 0.75),
    -15px 0 0 3px rgba(255, 143, 104, 0.72);
  opacity: 0.82;
  animation: flowerFloat 6s ease-in-out infinite;
}

.flower::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 19px;
  width: 3px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(var(--leaf), transparent);
  transform: rotate(12deg);
}

.postcard-flowers .flower-a,
.flower-a {
  left: 9%;
  top: 18%;
}

.postcard-flowers .flower-b,
.flower-b {
  right: 12%;
  top: 16%;
  transform: scale(0.78) rotate(18deg);
  animation-delay: -2s;
}

.postcard-flowers .flower-c,
.flower-c {
  left: 16%;
  bottom: 16%;
  transform: scale(0.62) rotate(-14deg);
  animation-delay: -3.4s;
}

.postcard-flowers .flower-d,
.flower-d {
  right: 18%;
  bottom: 14%;
  transform: scale(0.9) rotate(24deg);
  animation-delay: -1.2s;
}

.lock-card,
.postcard {
  position: relative;
  width: min(540px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(234, 223, 208, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 240, 0.9)),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lock-card::after,
.postcard::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(109, 86, 152, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.lock-card h1,
.postcard h1 {
  font-family: var(--hand);
  font-size: clamp(36px, 8vw, 72px);
  line-height: 1.02;
  font-weight: 600;
  color: var(--violet);
}

.gate-copy,
.postcard-line {
  position: relative;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.48;
}

.auth-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 24px;
  align-items: end;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--violet);
  font-size: 13px;
  font-weight: 850;
}

.auth-form input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
}

.auth-form input:focus,
.entry-form input[type="text"]:focus,
.entry-form textarea:focus {
  border-color: var(--lilac);
  box-shadow: 0 0 0 4px rgba(187, 166, 255, 0.22);
  outline: 0;
}

.auth-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #a23a4d;
  font-weight: 750;
}

.postcard {
  width: min(760px, 100%);
  text-align: center;
  transform-style: preserve-3d;
  animation: cardEnter 560ms ease both;
}

.postcard-screen.is-extra-soft .postcard {
  background:
    linear-gradient(155deg, rgba(255, 214, 107, 0.23), rgba(255, 255, 255, 0.92) 35%, rgba(187, 166, 255, 0.25)),
    var(--paper);
}

.postcard-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.admin-entry {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 5;
  border: 0;
  background: transparent;
  color: rgba(109, 86, 152, 0.62);
  font-size: 12px;
  letter-spacing: 0;
  opacity: 0.78;
}

.admin-entry:hover {
  color: var(--violet);
  opacity: 1;
}

.admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(36, 32, 42, 0.2);
  backdrop-filter: blur(7px);
}

.admin-card {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(234, 223, 208, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.admin-card h2 {
  font-family: var(--hand);
  color: var(--violet);
  font-size: 34px;
  line-height: 1;
}

.admin-card label {
  display: grid;
  gap: 7px;
  color: var(--violet);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 850;
}

.admin-card input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
}

.admin-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(187, 166, 255, 0.12);
  color: var(--violet);
  font-size: 22px;
  line-height: 1;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: var(--hand);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  font-weight: 600;
  color: var(--violet);
}

.topbar h1 {
  width: fit-content;
  color: var(--violet);
  background: none;
  -webkit-text-fill-color: var(--violet);
}

.topbar {
  background: linear-gradient(180deg, rgba(255, 244, 235, 0.45), transparent);
  padding: 14px 22px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.top-actions,
.form-actions,
.month-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -8px 0 18px;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.mode-btn.is-active {
  background: linear-gradient(135deg, rgba(187, 166, 255, 0.26), rgba(255, 214, 107, 0.2));
  color: var(--violet);
}

.mode-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn,
.primary-btn,
.danger-btn,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(32, 33, 36, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ghost-btn,
.primary-btn,
.danger-btn {
  padding: 0 16px;
  font-weight: 700;
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), #9b6fb5);
  color: #fff;
}

.danger-btn {
  color: #9f3340;
}

.ghost-btn:hover,
.primary-btn:hover,
.danger-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 86, 152, 0.42);
  box-shadow: 0 10px 24px rgba(87, 61, 99, 0.14);
}

.icon-btn {
  width: 44px;
  font-size: 30px;
  line-height: 1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.calendar-pane,
.detail-pane {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.88)),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calendar-pane {
  padding: 18px;
}

.detail-pane {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.month-controls {
  justify-content: space-between;
  margin-bottom: 18px;
}

.month-controls h2 {
  font-family: var(--serif);
  font-size: 28px;
}

#monthSubtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekday-row {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 0.82;
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.day-cell:hover,
.day-cell.is-selected {
  transform: translateY(-2px);
  border-color: var(--lilac);
  background: linear-gradient(160deg, #fff, rgba(255, 214, 107, 0.16));
  box-shadow: 0 12px 22px rgba(87, 61, 99, 0.1);
}

.day-cell.is-empty {
  visibility: hidden;
}

.day-number {
  font-size: 18px;
  font-weight: 900;
}

.day-chip {
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 4px 7px 3px;
  border-radius: 999px;
  background: rgba(187, 166, 255, 0.2);
  color: var(--violet);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-phrase {
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.favorite-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--rose);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(87, 61, 99, 0.1);
}

.favorite-btn.is-active {
  background: rgba(232, 111, 136, 0.12);
}

.detail-head h2 {
  font-family: "Caveat", "Marck Script", cursive;
  color: var(--violet);
  font-size: 32px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.phrase {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--sun);
  background: linear-gradient(135deg, rgba(255, 214, 107, 0.2), rgba(187, 166, 255, 0.12));
  border-radius: 0 8px 8px 0;
  font-size: 18px;
  line-height: 1.35;
}

.notes {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.media-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.remove-media {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(32, 33, 36, 0.76);
  color: #fff;
  font-weight: 900;
}

.entry-form {
  display: grid;
  gap: 12px;
}

.entry-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.entry-form input[type="text"],
.entry-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  resize: vertical;
}

.entry-form input[type="file"] {
  max-width: 100%;
}

.file-drop {
  padding: 12px;
  border: 1px dashed var(--lilac);
  border-radius: 8px;
  background: rgba(187, 166, 255, 0.1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(24px);
  max-width: min(520px, calc(100% - 24px));
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--violet);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.favorite-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--rose);
  font-size: 18px;
  line-height: 1;
}

.day-cell.is-favorite {
  border-color: rgba(232, 111, 136, 0.45);
  background: linear-gradient(160deg, #fff, rgba(232, 111, 136, 0.1));
}

.timeline-view {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.88));
  box-shadow: var(--shadow);
}

.timeline-head {
  margin-bottom: 18px;
}

.timeline-head h2 {
  font-family: var(--hand);
  color: var(--violet);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
}

.timeline-list {
  display: grid;
  gap: 12px;
}

/* Старый стиль timeline удалён — заменён новым .timeline-card в :app-shell header */

.wishes-view {
  position: relative;
  min-height: min(760px, 78vh);
  padding: clamp(16px, 3vw, 28px);
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.7), transparent 30%),
    radial-gradient(circle at 28% 24%, rgba(255, 214, 107, 0.24), transparent 24%),
    radial-gradient(circle at 72% 72%, rgba(187, 166, 255, 0.22), transparent 28%);
  box-shadow: none;
  overflow: hidden;
}

.wishes-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(232, 111, 136, 0.2) 0 2px, transparent 3px) 14% 20% / 110px 110px,
    radial-gradient(circle, rgba(187, 166, 255, 0.22) 0 2px, transparent 3px) 86% 64% / 120px 120px;
  opacity: 0.72;
  pointer-events: none;
}

.wishes-view::after {
  content: "♥  ♡  ♥  ♡  ♥";
  position: absolute;
  inset: auto 0 8%;
  z-index: 1;
  color: rgba(232, 111, 136, 0.24);
  font-size: clamp(38px, 6vw, 86px);
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    -32vw -28vh 0 rgba(187, 166, 255, 0.18),
    -18vw 18vh 0 rgba(255, 143, 104, 0.18),
    22vw -18vh 0 rgba(232, 111, 136, 0.18),
    34vw 14vh 0 rgba(187, 166, 255, 0.2);
  animation: floatingHearts 7s ease-in-out infinite;
  pointer-events: none;
}

.wishes-card {
  position: relative;
  z-index: 1;
}

.wishes-card h2 {
  font-family: var(--hand);
  color: var(--violet);
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1;
}

.wishes-lead {
  max-width: 760px;
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.wishes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wishes-grid article {
  min-height: 168px;
  padding: 16px;
  border: 1px solid rgba(234, 223, 208, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 240, 0.76)),
    var(--paper);
  box-shadow: 0 10px 24px rgba(87, 61, 99, 0.08);
}

.wishes-grid span {
  display: block;
  margin-bottom: 9px;
  font-family: var(--hand);
  color: var(--rose);
  font-size: 27px;
  line-height: 1.05;
}

/* ============================================================
   ОТКРЫТКА — новый дизайн: конверт + письмо + частицы
   ============================================================ */

/* Импорт рукописных шрифтов (graceful fallback если офлайн) */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Marck+Script&family=Inter:wght@400;500;700&display=swap');

/* CSS-переменные тематических стилей открытки */
.wishes-view {
  --ink-letter: #5b1e3f;
  --ink-soft: #8b4e6d;
  --paper: #fdf6e3;
  --paper-shadow: rgba(91, 30, 63, 0.18);
  --envelope: #c84a73;
  --envelope-dark: #9d2f56;
  --envelope-light: #e06890;
  --seal: #fff5fb;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(20px, 4vw, 48px);
  background:
    radial-gradient(120% 80% at 50% 0%, #fff1e8 0%, transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(255, 200, 220, 0.6) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(255, 220, 180, 0.5) 0%, transparent 65%),
    linear-gradient(180deg, #fff9f2 0%, #ffe4ec 100%);
  box-shadow: 0 24px 48px rgba(91, 30, 63, 0.08);
}

/* Темы фона открытки — переключается на data-heart контейнера */
.wishes-view[data-heart="classic"] {
  background:
    radial-gradient(120% 80% at 50% 0%, #ffe9d2 0%, transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(255, 200, 220, 0.55) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(255, 220, 180, 0.55) 0%, transparent 65%),
    linear-gradient(180deg, #fff3ea 0%, #ffd9d9 100%);
  --envelope: #c84a73;
  --envelope-dark: #9d2f56;
  --envelope-light: #e06890;
}
.wishes-view[data-heart="soft"] {
  background:
    radial-gradient(120% 80% at 50% 0%, #ece1ff 0%, transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(220, 200, 255, 0.6) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(255, 200, 220, 0.6) 0%, transparent 65%),
    linear-gradient(180deg, #f1e9ff 0%, #dcc9f2 100%);
  --envelope: #8865b8;
  --envelope-dark: #5e3f8e;
  --envelope-light: #b294d4;
  --ink-letter: #38235a;
}
.wishes-view[data-heart="spark"] {
  background:
    radial-gradient(120% 80% at 50% 0%, #fff1c2 0%, transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(255, 230, 150, 0.7) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(255, 200, 220, 0.55) 0%, transparent 65%),
    linear-gradient(180deg, #fff8e2 0%, #ffd8a8 100%);
  --envelope: #c98a2a;
  --envelope-dark: #8a5a14;
  --envelope-light: #e6ac4e;
  --ink-letter: #5a3a14;
  --paper: #fff8e8;
}
.wishes-view[data-heart="purple"] {
  background:
    radial-gradient(120% 80% at 50% 0%, #2a1d4f 0%, transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(140, 90, 220, 0.4) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(232, 111, 136, 0.32) 0%, transparent 65%),
    linear-gradient(180deg, #1f1640 0%, #3a1f54 100%);
  --envelope: #674d9e;
  --envelope-dark: #3d2870;
  --envelope-light: #9276c4;
  --ink-letter: #fce8ff;
  --ink-soft: #d3b5ea;
  --paper: #251a4a;
  --paper-shadow: rgba(0, 0, 0, 0.32);
}

/* ============ Парящие частицы-сердечки ============ */
.wish-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.wish-particle {
  position: absolute;
  bottom: -20px;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  will-change: transform, opacity;
  animation: wishParticleRise linear infinite;
  opacity: 0;
}

@keyframes wishParticleRise {
  0% {
    transform: translateY(0) translateX(0) rotate(-8deg) scale(0.6);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  50% {
    transform: translateY(-50vh) translateX(30px) rotate(8deg) scale(1);
  }
  90% {
    opacity: 0.65;
  }
  100% {
    transform: translateY(-110vh) translateX(-20px) rotate(-12deg) scale(0.7);
    opacity: 0;
  }
}

/* ============ Закрытая открытка — кнопка «Нажми меня» ============ */
.wish-intro {
  position: relative;
  z-index: 2;
  min-height: min(640px, 78vh);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  padding: 30px;
}

.wish-eyebrow {
  font-family: "Caveat", "Marck Script", cursive;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-letter);
  text-align: center;
  margin: 0;
  animation: wishFadeUp 600ms 100ms ease both;
}

.wish-hint {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.7;
  margin: 0;
  animation: wishFadeUp 600ms 360ms ease both;
}

.wish-press-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: auto;
  min-height: 72px;
  padding: 18px 38px 18px 32px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff85a8, #d94878);
  color: #fff;
  cursor: pointer;
  font-family: "Caveat", "Marck Script", cursive;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.02em;
  box-shadow:
    0 14px 28px rgba(151, 38, 84, 0.4),
    0 4px 8px rgba(151, 38, 84, 0.25),
    inset 0 -3px 6px rgba(91, 14, 50, 0.32),
    inset 0 2px 2px rgba(255, 230, 240, 0.32);
  animation: wishFadeUp 700ms 200ms ease both;
}

.wish-press-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 36px rgba(151, 38, 84, 0.48),
    0 6px 12px rgba(151, 38, 84, 0.3),
    inset 0 -3px 6px rgba(91, 14, 50, 0.32),
    inset 0 2px 2px rgba(255, 230, 240, 0.32);
}

.wish-press-btn:active {
  transform: translateY(0) scale(0.98);
}

.wish-press-icon {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
  animation: heartBeat 1.6s ease-in-out infinite;
  display: inline-block;
  text-shadow: 0 2px 4px rgba(91, 14, 50, 0.4);
}

.wish-press-label {
  display: inline-block;
  text-shadow: 0 2px 4px rgba(91, 14, 50, 0.4);
}

/* Тонкое расширяющееся кольцо — декоративный пульс, не мишень */
.wish-press-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  border: 2px solid rgba(217, 76, 121, 0.65);
  animation: pressRingSoft 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes pressGlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pressRingSoft {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.18); opacity: 0; }
}

@keyframes wishFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Открытая открытка — сцена ============ */
.wish-card-wrap {
  position: relative;
  z-index: 2;
  min-height: min(720px, 78vh);
  display: grid;
  place-items: center;
  padding: 60px 20px;
  animation: cardEnter 480ms ease both;
}

.wish-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 460px) auto;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 24px);
  perspective: 1400px;
  width: 100%;
  max-width: 720px;
}

.wish-letter {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-width: 460px;
  min-height: 540px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow:
    0 28px 60px var(--paper-shadow),
    0 10px 22px rgba(91, 30, 63, 0.1),
    inset 0 0 0 1px rgba(91, 30, 63, 0.06);
  transform-style: preserve-3d;
  transform: rotateX(2deg) rotateY(var(--tilt, 0deg));
  transition: transform 600ms cubic-bezier(0.2, 0.85, 0.32, 1.05);
  overflow: visible;
  isolation: isolate;
}

.wish-stage[data-direction="next"] .wish-letter {
  animation: letterSwipeNext 540ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.wish-stage[data-direction="prev"] .wish-letter {
  animation: letterSwipePrev 540ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.wish-letter.is-opening .letter-sheet {
  animation: letterPop 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes letterSwipeNext {
  0% {
    transform: translateX(40px) rotateY(-22deg) scale(0.92);
    opacity: 0;
    filter: blur(2px);
  }
  100% {
    transform: rotateX(2deg) rotateY(0deg) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes letterSwipePrev {
  0% {
    transform: translateX(-40px) rotateY(22deg) scale(0.92);
    opacity: 0;
    filter: blur(2px);
  }
  100% {
    transform: rotateX(2deg) rotateY(0deg) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes letterPop {
  0% {
    opacity: 0;
    transform: translateY(36px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Конверт рисуется поверх письма и уезжает при открытии */
.envelope {
  display: none;
}

.envelope-back, .envelope-front, .envelope-flap, .envelope-seal, .seal-heart {
  display: none;
}

/* Декоративная атласная лента поверх бумаги */
.letter-ribbon {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 28px;
  max-width: 86%;
  border-radius: 12px;
  background: linear-gradient(180deg, #f48bab, #c84a73);
  color: #fff;
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow:
    0 6px 14px rgba(91, 30, 63, 0.18),
    inset 0 -2px 4px rgba(91, 14, 50, 0.28),
    inset 0 1px 1px rgba(255, 230, 240, 0.32);
}

.letter-ribbon::before,
.letter-ribbon::after {
  display: none;
}

.letter-ribbon-text {
  white-space: nowrap;
}

/* ============ Содержимое письма ============ */
.letter-sheet {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  padding: clamp(28px, 5vw, 44px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 14px;
}

.letter-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 25% 25%, rgba(91, 30, 63, 0.04) 0, transparent 50%),
    radial-gradient(circle at 75% 80%, rgba(91, 30, 63, 0.05) 0, transparent 50%),
    repeating-linear-gradient(115deg, rgba(91, 30, 63, 0.018) 0 1px, transparent 1px 7px);
  pointer-events: none;
}

.letter-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink-soft);
  opacity: 0.42;
}

.letter-corner--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.letter-corner--tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.letter-corner--bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.letter-corner--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.letter-counter {
  align-self: end;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.7;
  margin: 0;
}

.letter-body {
  display: grid;
  align-content: center;
  gap: 14px;
  text-align: center;
  max-width: 360px;
  margin: 0 auto;
  padding: 8px 0;
}

.letter-title {
  font-family: "Caveat", "Marck Script", cursive;
  font-weight: 700;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  color: var(--ink-letter);
  margin: 0;
  word-wrap: break-word;
  hyphens: auto;
}

.letter-text {
  font-family: "Marck Script", "Caveat", cursive;
  font-size: clamp(18px, 2.6vw, 24px);
  line-height: 1.46;
  color: var(--ink-letter);
  margin: 0;
  white-space: pre-wrap;
}

.letter-text:not(:empty) {
  position: relative;
}

.letter-text:not(:empty)::before,
.letter-text:not(:empty)::after {
  content: "“";
  position: absolute;
  font-family: "Caveat", cursive;
  font-size: 3.4em;
  color: var(--envelope);
  opacity: 0.5;
  line-height: 0.6;
}

.letter-text:not(:empty)::before {
  top: -10px;
  left: -18px;
}

.letter-text:not(:empty)::after {
  content: "”";
  bottom: -22px;
  right: -8px;
}

.letter-photos {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 0;
}

.letter-photos:empty {
  display: none;
}

.letter-photo {
  width: clamp(72px, 18vw, 100px);
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #222;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 10px 22px rgba(91, 30, 63, 0.22);
  cursor: zoom-in;
  padding: 0;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.letter-photo:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 28px rgba(91, 30, 63, 0.3);
}

.letter-photo img,
.letter-photo video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.letter-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  padding-top: 6px;
}

.letter-dots:empty {
  display: none;
}

.letter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--envelope);
  opacity: 0.3;
  transition: opacity 200ms ease, transform 200ms ease;
}

.letter-dot.is-active {
  opacity: 1;
  transform: scale(1.4);
  background: var(--envelope-dark);
}

/* ============ Боковые навигационные кнопки ============ */
.wish-side {
  position: relative;
  width: 56px;
  height: 88px;
  border: 0;
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink-letter);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(91, 30, 63, 0.18);
  transition: transform 220ms ease, background 220ms ease, opacity 220ms ease;
  z-index: 5;
}

.wish-side:hover {
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-2px) scale(1.04);
}

.wish-side:active {
  transform: translateY(0) scale(0.95);
}

.wish-side:disabled {
  opacity: 0.22;
  cursor: not-allowed;
  pointer-events: none;
}

.wish-side-arrow {
  font-size: 56px;
  line-height: 1;
  font-family: "Inter", sans-serif;
  font-weight: 200;
}

/* Кнопка закрытия — крестик снизу */
.wish-close {
  position: absolute;
  bottom: -36px;
  left: 50%;
  margin-left: -22px;
  width: 44px;
  height: 44px;
  border: 0;
  background: rgba(91, 30, 63, 0.08);
  color: var(--ink-letter);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 200ms ease, background 200ms ease;
  z-index: 6;
}

.wish-close:hover {
  background: rgba(91, 30, 63, 0.18);
  transform: scale(1.1) rotate(90deg);
}

/* ============ Админ-секция (редактор) ============ */
.wish-admin {
  position: relative;
  z-index: 2;
  margin-top: 28px;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid rgba(91, 30, 63, 0.12);
  background: rgba(255, 255, 250, 0.78);
  box-shadow: 0 16px 32px rgba(91, 30, 63, 0.08);
}

.wish-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.wish-admin h2 {
  font-family: "Caveat", cursive;
  color: var(--ink-letter);
  font-size: 36px;
  line-height: 1;
  margin: 0;
}

.heart-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.heart-choice {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(91, 30, 63, 0.12);
  border-radius: 14px;
  background: #fff;
  font-size: 26px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.heart-choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(91, 30, 63, 0.12);
}

.heart-choice.is-active {
  border-color: var(--envelope);
  background: linear-gradient(135deg, var(--envelope-light), var(--envelope));
  color: #fff;
  box-shadow: 0 10px 20px rgba(151, 38, 84, 0.3);
}

.wish-editor-list {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.wish-editor-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(91, 30, 63, 0.12);
  background: #fff;
  box-shadow: 0 6px 14px rgba(91, 30, 63, 0.06);
}

.wish-editor-card label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wish-editor-card input[type="text"],
.wish-editor-card textarea {
  width: 100%;
  border: 1px solid rgba(91, 30, 63, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fdfaf6;
  color: var(--ink-letter);
  font-family: "Marck Script", cursive;
  font-size: 18px;
}

.wish-editor-card input:focus,
.wish-editor-card textarea:focus {
  outline: none;
  border-color: var(--envelope);
  box-shadow: 0 0 0 3px rgba(200, 74, 115, 0.18);
}

.wish-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wish-editor-row label {
  flex: 1 1 200px;
}

.wish-editor-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wish-editor-media {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(200, 74, 115, 0.14);
  color: var(--ink-letter);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.wish-editor-media button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(91, 30, 63, 0.16);
  color: var(--ink-letter);
  cursor: pointer;
  font-weight: 700;
}

.detail-pop {
  animation: detailPop 260ms ease;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 54px 76px;
  background: rgba(20, 17, 27, 0.86);
  backdrop-filter: blur(8px);
}

.lightbox-stage {
  width: min(100%, 1100px);
  height: min(100%, 760px);
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.lightbox-media {
  min-height: 0;
  display: grid;
  place-items: center;
}

.lightbox-media img,
.lightbox-media video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.lightbox-stage figcaption {
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--sans);
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(8px);
}

.lightbox-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  font-size: 28px;
}

.lightbox-nav {
  top: 50%;
  width: 52px;
  height: 68px;
  transform: translateY(-50%);
  font-size: 44px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-nav:disabled {
  opacity: 0.24;
}

@keyframes flowerFloat {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -12px;
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(16px) rotateX(6deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

@keyframes detailPop {
  from {
    opacity: 0.7;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timelineIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heartBeat {
  0%,
  100% {
    transform: translate(-50%, -46%) scale(1);
  }
  45% {
    transform: translate(-50%, -46%) scale(1.035);
  }
  62% {
    transform: translate(-50%, -46%) scale(0.99);
  }
}

@keyframes floatingHearts {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .detail-pane {
    position: static;
  }
}

@media (max-width: 620px) {
  .gate-screen,
  .postcard-screen {
    padding: 12px;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 12px, 1440px);
    padding: 12px 0 28px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .view-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mode-btn {
    min-width: 0;
    padding: 0 8px;
    font-size: 13px;
  }

  .top-actions .ghost-btn {
    min-width: 0;
    padding: 0 10px;
    font-size: 13px;
  }

  .calendar-pane,
  .detail-pane {
    padding: 12px;
  }

  .month-controls h2 {
    font-size: 23px;
  }

  .weekday-row,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .day-cell {
    aspect-ratio: auto;
    min-height: 68px;
    height: 68px;
    padding: 5px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    text-align: center;
  }

  .day-number {
    font-size: 15px;
    line-height: 1;
  }

  .day-chip {
    display: none;
  }

  .day-phrase {
    display: -webkit-box;
    max-width: 100%;
    font-size: 10px;
    line-height: 1.15;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .favorite-mark {
    top: 3px;
    right: 4px;
    font-size: 12px;
  }

  .media-gallery {
    grid-template-columns: 1fr;
  }

  .timeline-view {
    padding: 12px;
  }

  .timeline-card {
    padding: 13px;
  }

  .timeline-title {
    font-size: 19px;
  }

  .wishes-view {
    padding: 14px;
    border-radius: 18px;
  }

  /* На мобиле: открытка во всю ширину, стрелки по бокам */
  .wish-card-wrap {
    padding: 20px 4px 60px;
    min-height: 0;
  }

  .wish-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 100%;
  }

  .wish-letter {
    width: calc(100% - 100px);
    max-width: 340px;
    aspect-ratio: auto;
    min-height: 380px;
    border-radius: 12px;
  }

  .wish-side {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 64px;
    transform: translateY(-50%);
    border-radius: 18px;
  }

  .wish-side--prev {
    left: 6px;
  }

  .wish-side--next {
    right: 6px;
  }

  .wish-side-arrow {
    font-size: 36px;
  }

  .wish-close {
    bottom: -20px;
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .letter-sheet {
    padding: 22px 18px;
  }

  .letter-title {
    font-size: clamp(28px, 8vw, 40px);
    line-height: 1.08;
  }

  .letter-text {
    font-size: clamp(17px, 4.6vw, 22px);
    line-height: 1.45;
  }

  .letter-counter {
    font-size: 10px;
  }

  .letter-photos {
    gap: 6px;
  }

  .letter-photo {
    width: clamp(60px, 18vw, 78px);
  }

  .wish-admin {
    padding: 14px;
    border-radius: 14px;
  }

  .wish-admin h2 {
    font-size: 28px;
  }

  .wish-admin-head,
  .wish-editor-row {
    align-items: stretch;
    flex-direction: column;
  }

  .wish-eyebrow {
    font-size: clamp(24px, 7vw, 36px);
  }

  .wish-press-btn {
    min-height: 60px;
    padding: 12px 24px;
    font-size: 24px;
    gap: 10px;
  }

  .wish-press-icon {
    font-size: 24px;
  }

  .letter-ribbon {
    font-size: 13px;
    height: 30px;
    padding: 0 16px;
  }

  .lightbox {
    padding: 58px 10px 22px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 14px;
    width: 48px;
    height: 48px;
    font-size: 34px;
  }

  .lightbox-prev {
    left: 14px;
  }

  .lightbox-next {
    right: 14px;
  }

  .entry-form {
    gap: 10px;
  }

  .entry-form input[type="text"],
  .entry-form textarea,
  .auth-form input,
  .admin-card input {
    min-height: 48px;
    font-size: 16px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .danger-btn,
  .ghost-btn {
    min-height: 48px;
  }

  .admin-entry {
    right: 10px;
    bottom: 8px;
    font-size: 11px;
  }

  .heart-arrow {
    opacity: 0.24;
    transform: scale(0.72) rotate(-12deg);
  }
}
