/* Новые возможности (features/): «Вернуться туда», «Семейное окно», «Смотреть вместе», рассвет, даты подарков.
   Тот же кинозал (style.css), «бумага» для писем и открыток, курсив Cormorant — голос человека. Контраст ≥ 4.5:1. */
:root { --paper: #f3ece0; --paper-ink: #2b2219; --paper-muted: #6d604f; --paper-red: #a3452f; --paper-tile: #e9dfcd; }

/* ---------- страницы /memory и /family ---------- */
.fwrap { max-width: 560px; margin: 0 auto; padding: 22px 16px 64px; }
.fwrap section + section { margin-top: 34px; }
.eyebrow { margin: 0; color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.voiceh { font: italic 600 clamp(34px, 8vw, 46px)/1.04 var(--voice); margin: 8px 0 10px; }
.fwrap .lead { margin: 0 0 18px; color: #d4d1ca; font-size: 17px; }
.fwrap h2 { font: 800 22px/1.2 var(--display); margin: 0 0 12px; }
.fform { display: grid; gap: 14px; }
.ff { display: grid; gap: 6px; font-size: 14px; color: var(--muted); border: 0; padding: 0; margin: 0; min-width: 0; }
.ff legend { padding: 0; margin-bottom: 6px; }
.ff input[type="text"], .ff input[type="date"], .ff textarea, .ff select, .gdate select, .gdate input { width: 100%; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 16px; min-height: 48px; }
.ff textarea { resize: vertical; }
.ff input[type="file"] { color: var(--fg); font-size: 15px; }
.ff input[type="file"]::file-selector-button { background: var(--bg3); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; margin-right: 10px; font: inherit; }
.frow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .frow2 { grid-template-columns: 1fr; } }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { border: 1px solid var(--line); background: var(--bg2); color: var(--fg); border-radius: 999px; padding: 10px 16px; min-height: 44px; font: inherit; }
.fchip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 600; }
.fmap { height: 260px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.mphoto { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; border: 6px solid #fcfaf5; transform: rotate(-2deg); }
.who { display: flex; gap: 12px; align-items: center; background: #1b1f17; border: 1px solid #34402a; border-radius: 16px; padding: 10px; }
.who img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.who p { margin: 0; font-size: 14px; color: #dfe6d6; }
.bigbtn { display: flex; justify-content: center; align-items: center; text-align: center; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 800 18px/1.2 var(--display); padding: 16px 22px; width: 100%; min-height: 56px; text-decoration: none; cursor: pointer; }
.bigbtn:disabled { opacity: .6; }
.ghostbtn { display: flex; justify-content: center; align-items: center; text-align: center; border: 1px solid #cdbfa8; background: transparent; color: var(--paper-ink); border-radius: 999px; padding: 14px; font-weight: 600; min-height: 52px; text-decoration: none; }
.fine { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.ferr { margin: 0; color: #ff9d8f; font-weight: 600; min-height: 1em; }
.mytrips ul { padding-left: 18px; margin: 6px 0; } .mytrips a { color: var(--accent); }
.steps3 { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; counter-reset: s; }
.steps3 li { display: grid; gap: 2px; padding: 12px 14px 12px 54px; position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; counter-increment: s; }
.steps3 li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; }
.steps3 span { color: var(--muted); font-size: 14px; }
.walkdemo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 480px) { .walkdemo { grid-template-columns: 1fr; } }
.walkdemo .frame { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 9 / 12; background: #000; }
.walkdemo .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.livepill { position: absolute; top: 10px; left: 10px; display: inline-flex; gap: 6px; align-items: center; background: #c8283a; color: #fff; font-weight: 800; font-size: 14px; padding: 4px 10px; border-radius: 6px; }
.livepill b { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.bubble { position: absolute; max-width: 82%; margin: 0; padding: 8px 12px; border-radius: 16px; font-size: 14px; }
.bubble.me { right: 10px; bottom: 74px; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; font-weight: 600; }
.bubble.them { left: 10px; bottom: 16px; background: rgba(13, 15, 19, .88); color: var(--fg); border-bottom-left-radius: 4px; }
.filmcard, .note-paper { background: var(--paper); color: var(--paper-ink); border-radius: 22px; padding: 16px; }
.filmcard .k, .note-paper .k { margin: 0 0 8px; font-size: 13px; color: var(--paper-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.strip img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; filter: sepia(.25); }
.quote { font: italic 600 24px/1.12 var(--voice); margin: 12px 0 0; }
.timeline { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 13px; }
.timeline li { padding: 10px 6px 0; border-top: 4px solid var(--line); color: var(--muted); }
.timeline li.done { border-color: var(--ok); color: var(--fg); }
.timeline li.now { border-color: var(--accent); color: var(--fg); font-weight: 700; }
.tstatus { font-size: 18px; margin: 4px 0 14px; }
.tacts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tacts .bigbtn { width: auto; flex: 1 1 220px; }
.filmbox { background: var(--paper); color: var(--paper-ink); border-radius: 22px; padding: 12px; margin: 10px 0 16px; }
.filmbox video { width: 100%; border-radius: 14px; background: #000; display: block; aspect-ratio: 4 / 5; }
.paycard { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.paycard b { font-size: 26px; } .paycard span { color: var(--muted); flex: 1 1 200px; } .paycard .note { flex-basis: 100%; margin: 0; }
.okline { color: var(--ok); font-weight: 700; }
.tshare { margin-top: 20px; }
.note-paper { padding: 18px; }
.postcard-img { width: 100%; height: auto; border-radius: 14px; display: block; margin-bottom: 14px; background: var(--paper-tile); aspect-ratio: 4 / 5; }
.fstats { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fstats li { background: var(--paper-tile); border-radius: 14px; padding: 10px; text-align: center; }
.fstats b { display: block; font-size: 24px; line-height: 1.1; } .fstats span { font-size: 13px; color: var(--paper-muted); }
.note-paper .note { color: var(--paper-muted); }
.voicemsg { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #fff8ec; border: 1px solid #dccdb3; border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.voicemsg > div { display: grid; gap: 4px; min-width: 0; flex: 1; }
.voicemsg small { color: var(--paper-muted); }
.voicemsg audio { width: 100%; height: 40px; }
.voicemsg .linkbtn { background: none; border: 0; color: var(--paper-red); text-decoration: underline; font: inherit; font-size: 14px; padding: 8px; min-height: 44px; }
.newdot { color: var(--paper-red); font-weight: 700; }
.frowbtns { display: grid; gap: 8px; margin: 6px 0 10px; }
.note-paper .fine { color: var(--paper-muted); }
.joinbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #23324a; color: #e4ecfb; border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; font-weight: 600; }
.fbox { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }

/* ---------- «Смотреть вместе»: ряд снизу ---------- */
.tgbar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(720px, calc(100% - 24px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: rgba(22, 25, 32, .96); border: 1px solid #3a404c; border-radius: 20px; padding: 10px 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
@media (max-width: 760px) { .tgbar { bottom: calc(74px + env(safe-area-inset-bottom)); } }
.tgwho { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.tgwho b { font-size: 14px; white-space: nowrap; }
.tgpeople { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; overflow-x: auto; }
.tgpeople li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.tgpeople i { width: 28px; height: 28px; border-radius: 50%; background: #2c3f5e; color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; }
.tgpeople li.me i { background: var(--accent); color: var(--accent-ink); }
.tgreact { display: flex; gap: 6px; }
.tgreact button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg3); font-size: 22px; }
.tgacts { display: flex; gap: 6px; }
.tgjoin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.tgjoin label { font-weight: 600; }
.tgjoin input { flex: 1 1 140px; min-height: 44px; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font: inherit; }
.tgtoast { flex-basis: 100%; margin: 0; font-size: 14px; color: #ffd9a0; }
.tg-float { position: absolute; bottom: 18%; z-index: 5; font-size: 34px; display: grid; justify-items: center; pointer-events: none; animation: tgup 2.6s ease-out forwards; }
.tg-float small { font-size: 14px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .7); border-radius: 999px; padding: 2px 8px; }
@keyframes tgup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-160px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tg-float { animation-duration: 1.4s; } }
body.together { padding-bottom: 96px; }

/* ---------- «Семейное окно» у бабушки ---------- */
.fwnote { margin: 0 0 16px; }
.fwnote .paper { background: var(--paper); color: var(--paper-ink); border-radius: 18px; padding: 12px 16px; transform: rotate(-1deg); box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.fwnote .paper span { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-red); }
.fwnote .paper p { margin: 2px 0 0; font: italic 600 26px/1.12 var(--voice); }
.fwbtns { display: grid; gap: 10px; margin-top: 14px; }
.fwb1, .fwb2 { display: flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 18px; padding: 18px; min-height: 64px; font: 800 21px/1.2 var(--display); text-decoration: none; text-align: center; cursor: pointer; }
.fwb1 { background: var(--accent); color: var(--accent-ink); }
.fwb1.rec { background: #c8283a; color: #fff; }
.fwb2 { background: #23324a; color: #e4ecfb; }
.fwfine { margin: 8px 0 0; font-size: 15px; color: var(--muted); text-align: center; }
.fwsent { color: var(--ok); font-weight: 700; text-align: center; margin: 8px 0 0; font-size: 18px; min-height: 1em; }
.fwgreet { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 8, .82); display: grid; place-items: center; padding: 16px; }
.fwgcard { background: var(--paper); color: var(--paper-ink); border-radius: 26px; padding: 18px; width: min(560px, 100%); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.fwgcard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; display: block; margin-bottom: 14px; }
.fwgcard h2 { font: italic 600 clamp(34px, 8vw, 48px)/1.05 var(--voice); margin: 0 0 8px; }
.fwgcard .g { font: italic 600 24px/1.2 var(--voice); margin: 0 0 6px; }
.fwgcard .f { margin: 0 0 16px; color: var(--paper-muted); font-size: 18px; }

/* ---------- «Рассвет по миру» ---------- */
.sunrise { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; background: linear-gradient(120deg, #2b1d10, #1a1d26 70%); border: 1px solid #4a3620; border-radius: 18px; padding: 12px; margin-bottom: 16px; }
.sunimg { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #3a2a18; }
.sunimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sunsun { position: absolute; left: 50%; bottom: -18px; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; background: radial-gradient(circle, #ffd27a 0 45%, rgba(255, 181, 74, .35) 60%, transparent 72%); }
.suntx h2 { margin: 2px 0 2px; font: 800 19px/1.2 var(--display); }
.suntx .note { margin: 0 0 8px; }
.sunacts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .sunrise { grid-template-columns: 1fr; } }
body.simple .sunrise h2 { font-size: 24px; } body.simple .sunacts .btn { font-size: 19px; padding: 14px 20px; }

/* ---------- подарок: дата и ссылка семьи ---------- */
.gdate { margin: 4px 0; }
.gdgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.gdgrid .gdwide { grid-column: 1 / -1; }
@media (max-width: 420px) { .gdgrid { grid-template-columns: 1fr; } }
.gfam { margin-top: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 6px; justify-items: start; }
.gfam p { margin: 0; }
.gdrenew { color: #ffd9a0; }
#mpin:empty { display: none; }

/* Срок подарка в «Окне» (gift-trial.js): строка с датой и мягкая просьба продлить */
.gtrial { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; }
.gtrial .gt-line { margin: 0; font-weight: 600; flex: 1 1 200px; }
.gtrial .note { flex-basis: 100%; margin: 0; }
.gtrial .note:empty { display: none; }
