/* «Нежная пастель»: пудра, шалфей, полароиды, рукописные подписи */
:root {
  --bg: #fbeff0;
  --bg-2: #f6e3e5;
  --card: #ffffff;
  --ink: #4a3a3c;
  --muted: #9a8487;
  --line: #f0d8dc;
  --rose: #b56b78;
  --rose-deep: #a35565;
  --rose-soft: #f7dfe3;
  --sage: #a9bfa3;
  --sage-deep: #6f8a69;
  --sage-soft: #e6eee2;
  --heart: #d9687e;
  --radius: 20px;
  --script: 'Great Vibes', 'Segoe Script', cursive;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 10px 30px rgba(181, 107, 120, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }

/* ---------- Общие элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 15px 26px;
  background: var(--rose); color: #fff; font-weight: 600; font-size: 16px;
  transition: transform .15s, background .15s; text-decoration: none;
}
.btn:active { transform: scale(.97); background: var(--rose-deep); }
.btn:disabled { opacity: .5; }
.btn.gold { background: var(--rose); box-shadow: 0 10px 24px rgba(181, 107, 120, .3); }
.btn.ghost { background: var(--card); color: var(--rose-deep); border: 1.5px solid var(--line); }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 10px; }

.field {
  width: 100%; padding: 15px 18px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--card); outline: none; font-size: 16px;
}
.field:focus { border-color: var(--rose); box-shadow: 0 0 0 4px var(--rose-soft); }

.script { font-family: var(--script); font-weight: 400; }
.eyebrow { text-transform: uppercase; letter-spacing: .24em; font-size: 11px; color: var(--sage-deep); font-weight: 700; }

.screen { min-height: 100%; }

/* ---------- Экран установки ---------- */
.welcome {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; text-align: center; position: relative; overflow: hidden;
  padding: calc(40px + var(--safe-t)) 24px calc(28px + var(--safe-b));
  background:
    radial-gradient(70% 40% at 0% 0%, #f5d5da 0%, transparent 70%),
    radial-gradient(60% 35% at 100% 25%, var(--sage-soft) 0%, transparent 70%),
    radial-gradient(80% 40% at 50% 100%, #f8e4e1 0%, transparent 70%),
    var(--bg);
}
.welcome > * { position: relative; z-index: 1; }
.petals { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.welcome .hero { margin-top: 3vh; }
.rings { width: 120px; height: 120px; margin: 0 auto 14px; }
.welcome h1 { font-family: var(--script); font-weight: 400; font-size: calc(56px * var(--script-scale, 1)); line-height: 1.05; margin: 6px 0 4px; color: var(--rose); }
.welcome .sub { color: var(--muted); font-size: 15px; margin: 0; }
.welcome .date {
  display: inline-block; margin-top: 14px; font-family: var(--serif); font-size: 19px; color: var(--ink);
  padding: 4px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.welcome .welcome-text { font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.35; max-width: 340px; margin: 16px auto 0; color: var(--ink); white-space: pre-line; }
.post .status-tag {
  display: table; margin: 10px auto 0; padding: 4px 12px; border-radius: 999px;
  background: #fff3d6; color: #8a6414; font-size: 12px; font-weight: 700;
}
.post.is-pending .photo-wrap { opacity: .75; }
.welcome .actions { width: 100%; max-width: 380px; display: grid; gap: 10px; }
.features { display: grid; gap: 12px; text-align: left; max-width: 340px; margin: 28px auto 0; }
.features div {
  display: flex; gap: 14px; align-items: center; background: color-mix(in srgb, var(--card) 70%, transparent);
  border-radius: 16px; padding: 10px 14px 10px 10px; font-size: 14px;
}
.features span.ic {
  flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--sage-soft);
  color: var(--sage-deep); display: grid; place-items: center;
}
.features div:nth-child(2) span.ic { background: var(--rose-soft); color: var(--rose); }
.ios-hint {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px; text-align: left;
  box-shadow: var(--shadow); font-size: 14px;
}
.ios-hint ol { margin: 8px 0 0; padding-left: 20px; }
.ios-hint li { margin: 4px 0; }
.share-ic { display: inline-block; vertical-align: -3px; }

/* ---------- Знакомство ---------- */
.name-card { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.name-card h2 { font-family: var(--script); font-weight: 400; font-size: calc(46px * var(--script-scale, 1)); margin: 0; color: var(--rose); }

/* ---------- Основной экран ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(8px + var(--safe-t)) 16px 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 {
  font-family: var(--script); font-weight: 400; font-size: calc(34px * var(--script-scale, 1)); line-height: 1.25; margin: 0; color: var(--rose);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.live.off i { background: #d6c8ca; box-shadow: none; }
.chips { display: flex; gap: 8px; padding: 6px 0 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 0; background: color-mix(in srgb, var(--card) 75%, transparent); color: var(--muted); border-radius: 999px;
  padding: 8px 15px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip.on { background: var(--rose); color: #fff; }

main { padding-bottom: calc(110px + var(--safe-b)); }
.feed { max-width: 520px; margin: 0 auto; padding: 4px 18px; }

.outbox {
  margin: 10px 18px 0; padding: 10px 14px; border-radius: 14px; background: var(--sage-soft); color: var(--sage-deep);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.new-pill {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(110px + var(--safe-t)); z-index: 25;
  background: var(--rose); color: #fff; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 13px;
  box-shadow: 0 8px 24px rgba(181,107,120,.35);
}

/* Карточка-полароид */
.post {
  background: var(--card); margin: 22px 0 30px; padding: 12px 12px 6px; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(74,58,60,.06), 0 12px 32px rgba(181,107,120,.14);
  transform: rotate(-1deg);
}
.post:nth-child(even) { transform: rotate(1deg); }
.photo-wrap { position: relative; background: var(--bg-2); border-radius: 3px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.big-heart { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.big-heart.go { animation: pop .9s ease forwards; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.3); }
  15% { opacity: 1; transform: scale(1.15); }
  30% { transform: scale(.95); }
  45% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}
.post .caption {
  font-family: var(--script); font-size: calc(27px * var(--script-scale, 1)); line-height: 1.2; text-align: center;
  color: var(--ink); padding: 10px 6px 0; overflow-wrap: anywhere;
}
.post-meta { display: flex; align-items: center; gap: 2px; padding: 8px 0 0; }
.post-meta .avatar { width: 28px; height: 28px; font-size: 12px; margin-right: 8px; }
.post-meta .who { flex: 1; min-width: 0; line-height: 1.25; }
.post-meta .name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta .time { font-size: 11px; color: var(--muted); }
.post-meta .count { font-size: 13px; font-weight: 600; color: var(--muted); min-width: 10px; margin-right: 4px; }
.post-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 0 2px; }
.post .more { color: var(--muted); background: none; border: 0; padding: 6px 0; font-size: 13px; }
.post-foot .tools { display: flex; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px; flex: none;
}
.icon-btn { background: none; border: 0; padding: 7px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.icon-btn:active { background: var(--rose-soft); }
.post-foot .icon-btn { color: var(--muted); padding: 6px; }
.like-btn.on svg { fill: var(--heart); stroke: var(--heart); animation: bump .35s ease; }
.like-btn.on + .count { color: var(--heart); }
@keyframes bump { 50% { transform: scale(1.25); } }

.empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty .empty-ic { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; background: var(--card); display: grid; place-items: center; color: var(--rose); box-shadow: var(--shadow); }
.empty h3 { font-family: var(--script); font-size: calc(38px * var(--script-scale, 1)); font-weight: 400; color: var(--rose); margin: 16px 0 4px; }
.loader { text-align: center; padding: 22px; color: var(--muted); font-size: 13px; }

/* Нижняя навигация */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: var(--card); border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 30px rgba(181,107,120,.12);
}
.tab { background: none; border: 0; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: #c9a9af; padding: 4px 6px; min-width: 56px; }
.tab.on { color: var(--rose); }
.shutter-tab {
  width: 62px; height: 62px; margin-top: -34px; border-radius: 50%; border: 5px solid var(--card);
  background: var(--sage); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(111,138,105,.4);
}
.shutter-tab:active { transform: scale(.94); }

/* ---------- Камера ---------- */
.camera { position: fixed; inset: 0; z-index: 100; background: #1d1718; color: #fff; display: flex; flex-direction: column; }
.camera video, .camera .shot { flex: 1; width: 100%; min-height: 0; object-fit: cover; background: #1d1718; }
.camera .shot { object-fit: contain; padding: 16px; }
.camera .mirror { transform: scaleX(-1); }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: calc(12px + var(--safe-t)) 14px; z-index: 2; }
.cam-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cam-bottom { display: flex; align-items: center; justify-content: space-around; padding: 22px 20px calc(26px + var(--safe-b)); background: #1d1718; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid var(--rose-soft); background: #fff; box-shadow: inset 0 0 0 4px #1d1718; }
.shutter:active { transform: scale(.92); background: var(--rose-soft); }
.shutter { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .2s, background .2s; }
.shutter.rec { background: var(--heart); transform: scale(1.12); box-shadow: inset 0 0 0 4px #1d1718, 0 0 0 8px rgba(217,104,126,.35); }
.cam-timer { position: absolute; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: var(--heart); color: #fff; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-variant-numeric: tabular-nums; z-index: 2; }
.cam-welcome {
  position: absolute; left: 0; right: 0; top: 0; bottom: 140px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(80px + var(--safe-t)) 24px 24px; text-align: center; pointer-events: none;
  background: linear-gradient(rgba(29,23,24,.55), transparent 40%, transparent 70%, rgba(29,23,24,.45));
}
.cam-welcome .w-title { font-family: var(--script); font-size: calc(54px * var(--script-scale, 1)); line-height: 1; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.cam-welcome .w-sub { font-size: 15px; color: #fff; opacity: .92; margin-top: 8px; max-width: 280px; }
.cam-welcome .w-count {
  font-family: var(--serif); font-weight: 600; font-size: 140px; line-height: 1; color: #fff;
  text-shadow: 0 4px 30px rgba(0,0,0,.4); min-height: 140px; margin-top: auto; margin-bottom: auto;
}
.cam-welcome .w-count.tick { animation: tick .9s ease-out; }
@keyframes tick { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { opacity: .85; } }
.cam-welcome .btn { pointer-events: auto; color: #fff; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.cam-hint { text-align: center; font-size: 12px; color: #c9b5b8; background: #1d1718; padding-top: 8px; }
.ch-pick.frames .chip.on { background: var(--rose); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .35s ease; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cam-error { flex: 1; display: grid; place-items: center; text-align: center; padding: 30px; color: #e6d6d8; }
.review { padding: 16px 16px calc(18px + var(--safe-b)); background: var(--bg); color: var(--ink); display: grid; gap: 12px; border-radius: 24px 24px 0 0; }
.review .row { display: flex; gap: 10px; }
.review .row .btn { flex: 1; }

/* ---------- Комментарии (шторка) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(74,58,60,.35); z-index: 90; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 80dvh;
  background: var(--bg); border-radius: 26px 26px 0 0; display: flex; flex-direction: column;
  animation: up .25s ease; max-width: 640px; margin: 0 auto;
}
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 4px; }
.sheet h3 { text-align: center; margin: 0 0 8px; font-family: var(--script); font-weight: 400; font-size: calc(32px * var(--script-scale, 1)); color: var(--rose); }
.sheet .list { overflow-y: auto; padding: 0 16px; flex: 1; min-height: 120px; }
.comment { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.comment .avatar { width: 30px; height: 30px; font-size: 12px; }
.comment .t { font-size: 14px; background: var(--card); padding: 8px 12px; border-radius: 4px 16px 16px 16px; }
.comment .t small { color: var(--muted); margin-left: 6px; }
.sheet form { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); }
.sheet form .field { padding: 12px 16px; border-radius: 999px; }
.sheet form .btn { padding: 12px 18px; }

.sheet.dialog { padding: 0 18px calc(18px + var(--safe-b)); gap: 12px; }
.sheet.dialog .dlg-text { margin: 0; text-align: center; color: var(--muted); }
.dlg-actions { display: flex; gap: 10px; }
.dlg-actions .btn { flex: 1; }
.btn.danger { background: #c4566b; }

/* ---------- Моменты / коллажи ---------- */
.moments { max-width: 520px; margin: 0 auto; padding: 8px 18px; }
.moments h2 { font-family: var(--script); font-weight: 400; font-size: calc(46px * var(--script-scale, 1)); margin: 2px 0 0; color: var(--rose); line-height: 1.2; }
.moments .lead { color: var(--muted); margin: 0 0 16px; }
.collage-frame { background: var(--card); border-radius: 6px; padding: 12px; box-shadow: 0 12px 32px rgba(181,107,120,.16); transform: rotate(-.6deg); }
.collage-frame img { width: 100%; border-radius: 3px; }
.collage-frame .ph { aspect-ratio: 4/5; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; background: var(--bg-2); border-radius: 3px; }
.collage-actions { display: flex; gap: 10px; margin: 20px 0 26px; }
.collage-actions .btn { flex: 1; padding: 13px; font-size: 15px; }
.section-title { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); margin: 22px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 18px; padding: 14px 8px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1; color: var(--rose); }
.stat:nth-child(2) b { color: var(--sage-deep); }
.stat span { font-size: 12px; color: var(--muted); }
.highlight { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 18px; padding: 10px; margin-bottom: 10px; }
.highlight img { width: 62px; height: 62px; border-radius: 4px; object-fit: cover; flex: none; border: 4px solid #fff; box-shadow: 0 3px 10px rgba(181,107,120,.25); transform: rotate(-3deg); }
.highlight .h-t { font-size: 11px; color: var(--sage-deep); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.highlight .h-v { font-weight: 600; }

/* ---------- Задания ---------- */
.ch-progress { background: var(--card); border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; }
.ch-progress .bar { height: 8px; border-radius: 4px; background: var(--rose-soft); overflow: hidden; margin-top: 8px; }
.ch-progress .bar i { display: block; height: 100%; background: var(--sage); border-radius: 4px; transition: width .4s; }
.ch-progress b { color: var(--rose); }
.ch-card { background: var(--card); border-radius: 18px; padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; }
.ch-card .top { display: flex; align-items: center; gap: 12px; }
.ch-card .num {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--rose-soft); color: var(--rose); font-family: var(--serif); font-weight: 600; font-size: 18px;
}
.ch-card.done .num { background: var(--sage); color: #fff; }
.ch-card .text { flex: 1; font-weight: 600; line-height: 1.3; }
.ch-card .meta { font-size: 12px; color: var(--muted); font-weight: 500; }
.ch-card .go { padding: 9px 14px; font-size: 13px; flex: none; }
.ch-card.done .go { background: var(--sage-soft); color: var(--sage-deep); }
.ch-card .covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ch-card .covers img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 4px; cursor: pointer; }
.ch-pick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.ch-pick::-webkit-scrollbar { display: none; }
.ch-pick .chip { background: var(--card); color: var(--muted); }
.ch-pick .chip.on { background: var(--sage); color: #fff; }
.post .ch-tag {
  display: table; margin: 10px auto 0; padding: 4px 12px; border-radius: 999px;
  background: var(--sage-soft); color: var(--sage-deep); font-size: 12px; font-weight: 700;
}

/* ---------- Мои ---------- */
.me-head { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 20px; padding: 14px; margin-bottom: 16px; }
.me-head .avatar { width: 54px; height: 54px; font-size: 22px; }
.me-head > div:nth-child(2) { flex: 1; min-width: 0; }
.me-name { font-family: var(--script); font-size: calc(34px * var(--script-scale, 1)); color: var(--rose); line-height: 1.1; }
.me-stats { font-size: 13px; color: var(--muted); }
.grid-mine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-mine button { padding: 4px; background: var(--card); border: 0; border-radius: 4px; box-shadow: 0 4px 12px rgba(181,107,120,.15); }
.grid-mine img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 2px; }

.photo-wrap video { display: block; width: 100%; height: 100%; object-fit: cover; }
.sound-btn {
  position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(29,23,24,.45); color: #fff; font-size: 15px; display: grid; place-items: center;
}
.grid-mine button { position: relative; }
.grid-mine button.is-video::after {
  content: '▶'; position: absolute; right: 9px; top: 7px; color: #fff; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.viewer-slide video { max-width: 100%; max-height: 100%; }

/* ---------- Просмотр на весь экран ---------- */
.viewer { position: fixed; inset: 0; z-index: 120; background: #1d1718; color: #fff; animation: fade .2s; }
.viewer-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; overflow: auto; display: grid; place-items: center; }
.viewer-slide img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s; }
.viewer-slide.zoom img { max-width: none; max-height: none; width: 200%; }
.viewer-slide.zoom { place-items: start; }
.viewer-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--safe-t)) 14px; font-size: 13px; color: #e6d6d8; pointer-events: none; }
.viewer-top button { pointer-events: auto; }
.viewer-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 18px calc(18px + var(--safe-b)); background: linear-gradient(transparent, rgba(29,23,24,.85)); pointer-events: none; }
.viewer-bottom .cap { font-family: var(--script); font-size: calc(30px * var(--script-scale, 1)); line-height: 1.2; }
.viewer-bottom .by { font-size: 13px; color: #e6d6d8; margin-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%);
  background: #2b2324; color: #fff; padding: 11px 18px; border-radius: 14px; z-index: 200;
  font-size: 14px; box-shadow: 0 10px 30px rgba(74,58,60,.25); animation: fade .2s; max-width: calc(100% - 32px);
}

/* ---------- Лендинг организатора ---------- */
.landing { max-width: 520px; margin: 0 auto; padding: 48px 20px 60px; }
.landing h1 { font-family: var(--script); font-weight: 400; font-size: calc(76px * var(--script-scale, 1)); line-height: 1.1; margin: 4px 0 8px; text-align: center; color: var(--rose); }
.landing .lead { text-align: center; color: var(--muted); margin: 0 0 30px; font-size: 16px; }
.panel { background: var(--card); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); display: grid; gap: 12px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.panel label { font-size: 13px; font-weight: 600; color: var(--muted); display: grid; gap: 6px; }
.code-big { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 34px; letter-spacing: .2em; text-align: center; font-weight: 700; color: var(--rose); }
.qr { width: 220px; margin: 0 auto; }
.copy-row { display: flex; gap: 8px; }
.copy-row .field { font-size: 13px; padding: 11px 14px; }
.copy-row .btn { padding: 11px 16px; font-size: 14px; }
.warn { background: var(--sage-soft); color: #4f6a4a; border-radius: 14px; padding: 12px 14px; font-size: 13px; }

/* Постер для печати */
.poster { max-width: 520px; margin: 0 auto; padding: 50px 30px; text-align: center; }
.poster h1 { font-family: var(--script); font-weight: 400; font-size: calc(72px * var(--script-scale, 1)); margin: 6px 0; line-height: 1.1; color: var(--rose); }
.poster .qr { width: 280px; margin: 30px auto; padding: 16px; background: #fff; border-radius: 6px; box-shadow: 0 12px 32px rgba(181,107,120,.16); }
.poster p { font-size: 18px; color: var(--muted); }
@media print { .no-print { display: none !important; } body { background: #fff; } }

/* ---------- Вечерний режим (тёмная тема) ---------- */
:root[data-night] {
  --bg: #1c1718; --bg-2: #2a2224; --card: #272022; --ink: #f2e6e7; --muted: #b3a0a3;
  --line: #3b3033; --rose-soft: #3d2a2f; --sage-soft: #263028;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-night] body { background: var(--bg); }
:root[data-night] .welcome {
  background: radial-gradient(70% 40% at 0% 0%, #3a2328 0%, transparent 70%),
    radial-gradient(60% 35% at 100% 25%, #223024 0%, transparent 70%), var(--bg);
}
:root[data-night] .post { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35); }
:root[data-night] .tab { color: #8f7c80; }
:root[data-night] .tab.on { color: var(--rose); }
:root[data-night] .field { color: var(--ink); }
:root[data-night] .status-tag { background: #3d3420; color: #f0d68a; }
:root[data-night] .post .ch-tag { color: #b9d2b3; }

/* ---------- Новые снимки появляются плавно ---------- */
.post.appear { animation: appear .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes appear {
  from { opacity: 0; transform: translateY(-18px) scale(.96) rotate(0deg); }
}
.post.appear .photo-wrap::after {
  content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
  animation: shine 1.1s ease-out .15s;
}
@keyframes shine { 0% { opacity: .55; } 100% { opacity: 0; } }

/* ---------- «Наши гости» ---------- */
.guests-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.guest-tile { background: #fff; padding: 4px 4px 0; border-radius: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.12); border: 0; text-align: center; }
.guest-tile:nth-child(odd) { transform: rotate(-1.5deg); }
.guest-tile:nth-child(even) { transform: rotate(1.5deg); }
.guest-tile img { aspect-ratio: 3/4; width: 100%; object-fit: cover; border-radius: 2px; }
.guest-tile span { display: block; font-family: var(--script); font-size: calc(18px * var(--script-scale, 1)); color: #4a3a3c; padding: 2px 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Управление (внутри приложения) ---------- */
.tab { position: relative; }
.tab-badge {
  position: absolute; top: 0; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--heart); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center;
}
.manage h2 { margin-bottom: 2px; }
.mg-me { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.mg-me b { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; color: var(--ink); }
.mg-me .link { padding: 4px; font-size: 13px; }
.mg-claim { display: grid; gap: 10px; background: var(--card); border: 2px solid var(--rose); border-radius: 18px; padding: 14px; margin-top: 12px; }
.mg-sec { background: var(--card); border-radius: 18px; margin-bottom: 10px; overflow: hidden; }
.mg-sec summary {
  list-style: none; cursor: pointer; padding: 15px 16px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.mg-sec summary::-webkit-details-marker { display: none; }
.mg-sec summary::after { content: '›'; margin-left: auto; font-size: 22px; color: var(--muted); transition: transform .2s; line-height: 1; }
.mg-sec[open] summary::after { transform: rotate(90deg); }
.mg-sec summary em { font-style: normal; background: var(--heart); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.mg-sec summary .saved { font-weight: 600; }
.mg-body { display: grid; gap: 10px; padding: 0 16px 16px; }
.mg-body > label, .mg-body label:not(.switch) { font-size: 13px; font-weight: 600; color: var(--muted); display: grid; gap: 6px; }
.mg-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mg-row .btn { flex: 1; }
.mg-links { gap: 8px; }
.btn.small { padding: 9px 14px; font-size: 13px; flex: none !important; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.err { color: #b3384e; font-size: 13px; font-weight: 600; margin: 0; }
.saved { color: var(--sage-deep); font-size: 13px; font-weight: 600; }
textarea.field { resize: vertical; min-height: 80px; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; }
.switch input { width: 46px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 13px; position: relative; transition: .2s; flex: none; cursor: pointer; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--rose); }
.switch input:checked::after { left: 23px; }
.mod-tabs { display: flex; gap: 8px; }
.mod-tabs .chip { background: var(--bg); }
.mod-tabs .chip.on { background: var(--rose); color: #fff; }
.mod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mod-item { background: var(--bg); border-radius: 8px; padding: 6px; display: grid; gap: 6px; }
.mod-item .m { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 4px; background: var(--bg-2); }
.mod-item .who { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-item .cap { font-family: var(--script); font-size: calc(18px * var(--script-scale, 1)); line-height: 1.1; }
.mod-item .row { display: flex; gap: 6px; }
.mod-item .row .btn { flex: 1; padding: 8px 4px; font-size: 12px; }
.themes { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { border: 2px solid transparent; border-radius: 16px; padding: 7px 11px 7px 7px; background: var(--bg); color: var(--ink); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.swatch i { width: 24px; height: 24px; border-radius: 50%; display: block; }
.swatch.on { border-color: var(--ink); }
.fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.font-opt { border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 8px 8px; text-align: center; min-width: 0; }
.font-opt.on { border-color: var(--ink); }
.font-opt b { display: block; color: var(--rose); font-weight: 400; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-opt span { font-size: 11px; color: var(--muted); }
.seg { display: flex; background: var(--bg); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 9px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--rose); color: #fff; }
.ch-edit { display: grid; gap: 8px; }
.ch-edit .r { display: flex; gap: 4px; align-items: center; }
.ch-edit .r .n { width: 22px; text-align: center; color: var(--muted); font-weight: 700; flex: none; }
.ch-edit .r .field { padding: 10px 12px; font-size: 15px; }
.ch-edit .r .icon-btn { flex: none; color: var(--muted); }
.guests { width: 100%; border-collapse: collapse; font-size: 14px; }
.guests th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 4px; }
.guests td { padding: 8px 4px; border-top: 1px solid var(--line); }
.guests .num { text-align: right; font-variant-numeric: tabular-nums; }
.org { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.org:first-child { border-top: 0; }
.org .avatar { width: 36px; height: 36px; background: var(--rose); }
.org .who { flex: 1; min-width: 0; }
.org .who b { display: block; }
.org .who span { font-size: 12px; color: var(--muted); }

/* вход организатора во вкладке «Мои» */
.org-card { display: grid; gap: 10px; margin-top: 22px; background: var(--card); border: 1.5px dashed var(--line); border-radius: 18px; padding: 16px; }
.org-card.is-org { border-style: solid; border-color: var(--rose); }
.org-title { font-weight: 700; font-size: 15px; }

/* модерация прямо в ленте */
.post .mod-actions { display: flex; gap: 8px; padding-top: 10px; }
.post .mod-actions .btn { flex: 1; padding: 10px; font-size: 14px; }
