/* Знакора: подарки (js/gifts.js) */
.gift-overlay { display: flex; }
.gift-overlay--top { z-index: 10050; }
.gift-dialog { width: min(620px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); display: flex; flex-direction: column; overflow: hidden; outline: 0; }
.gift-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 18px 20px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.gift-content { min-height: 160px; }
.gift-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--surface, rgba(127, 127, 127, .1)); position: sticky; top: 0; z-index: 1; box-shadow: 0 -14px 0 var(--surface-raised, var(--surface)); }
.gift-tab { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-sec); font: inherit; font-size: 14px; font-weight: 500; padding: 10px 6px; border-radius: 16px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .18s, color .18s; }
.gift-tab[aria-selected="true"] { background: var(--surface-raised); color: var(--text-main); font-weight: 600; box-shadow: 0 1px 6px rgba(0, 0, 0, .1); }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gift-grid--small { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.gift-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 14px 10px 12px; border: 0; border-radius: 22px; background: var(--surface, rgba(127, 127, 127, .08)); color: var(--text-main); font: inherit; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.gift-card:hover { background: var(--surface-raised); }
.gift-card:active { transform: scale(.96); }
.gift-card strong { font-size: 14px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-card small { font-size: 12px; color: var(--text-sec); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-card.is-hidden .gift-picture, .gift-picture.is-hidden { opacity: .4; }
.gift-hidden-mark { position: absolute; right: 10px; top: 10px; color: var(--text-sec); }
.gift-picture { width: 104px; height: 104px; object-fit: contain; display: block; }
.gift-grid--small .gift-picture { width: 78px; height: 78px; }
.gift-picture--big { width: 148px; height: 148px; margin: 0 auto; }
.gift-price { display: inline-flex; gap: 7px; align-items: baseline; color: var(--primary); font-weight: 700; font-size: 15px; }
.gift-price s { color: var(--text-sec); font-weight: 400; font-size: 13px; }
.gift-discount { position: absolute; left: 10px; top: 10px; padding: 2px 8px; border-radius: 10px; background: var(--primary); color: var(--on-primary, #fff); font-size: 12px; font-style: normal; font-weight: 700; }
.gift-note { margin: 12px 0 0; text-align: center; color: var(--text-sec); font-size: 13px; line-height: 1.45; }
.gift-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--text-sec); font-size: 14px; }
.gift-one, .gift-order { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.gift-order > .gift-price { align-self: center; font-size: 20px; }
.gift-from { margin: 0; color: var(--text-sec); font-size: 15px; }
.gift-message { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--surface, rgba(127, 127, 127, .08)); color: var(--text-main); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.gift-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 0; border-radius: 18px; background: var(--surface, rgba(127, 127, 127, .08)); color: var(--text-main); font: inherit; font-size: 15px; text-align: start; cursor: pointer; }
.gift-person span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-chevron { font-style: normal; color: var(--text-sec); font-size: 20px; line-height: 1; }
.gift-text { width: 100%; resize: vertical; min-height: 64px; max-height: 160px; font-size: 16px; }
.gift-anonymous { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: start; cursor: pointer; }
.gift-anonymous span { display: flex; flex-direction: column; gap: 2px; }
.gift-anonymous b { font-weight: 500; font-size: 15px; }
.gift-anonymous small { color: var(--text-sec); font-size: 13px; }
.gift-anonymous input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--primary); }
.gift-error { margin: 0; color: var(--text-main); font-size: 14px; line-height: 1.4; }
.gift-error:empty { display: none; }
.gift-pay { min-height: 48px; }
.gift-people { max-width: 440px; }
.gift-people > .input { margin: 4px 18px 10px; width: auto; font-size: 16px; }
.gift-people-list { overflow: auto; padding: 0 10px 14px; min-height: 180px; }
.gift-person-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--text-main); font: inherit; font-size: 15px; text-align: start; cursor: pointer; }
.gift-person-row:hover { background: var(--surface, rgba(127, 127, 127, .08)); }
.gift-person-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.gift-person-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-profile { padding: 12px 14px; }
.gift-profile[hidden] { display: none; }
.gift-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.gift-profile-title { display: inline-flex; align-items: center; gap: 10px; color: var(--text-main); }
.gift-profile-title b { font-weight: 500; font-size: 15px; }
.gift-profile-title small { color: var(--text-sec); font-size: 14px; }
.gift-strip { display: flex; gap: 6px; width: 100%; padding: 8px 0 2px; border: 0; background: transparent; overflow-x: auto; cursor: pointer; scrollbar-width: none; }
.gift-strip::-webkit-scrollbar { display: none; }
.gift-strip .gift-picture { width: 62px; height: 62px; flex: 0 0 auto; }
.gift-arrival { position: fixed; inset: 0; z-index: 10060; display: grid; place-items: center; padding: 24px; background: rgba(8, 10, 20, .6); animation: gift-fade .24s ease; }
.gift-arrival-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(340px, 100%); max-height: calc(100dvh - 48px); overflow: visible; padding: 26px 24px 18px; border-radius: 28px; background: var(--surface-raised); color: var(--text-main); text-align: center; animation: gift-pop .42s cubic-bezier(.2, 1.35, .4, 1); }
.gift-arrival-card h2 { margin: 0; font-size: 21px; font-weight: 500; }
.gift-arrival-card .btn { width: 100%; }
.gift-arrival-picture { animation: gift-sway 2.6s ease-in-out 2; }
.gift-confetti { position: absolute; left: 50%; top: 40%; width: 8px; height: 13px; border-radius: 3px; background: var(--c); pointer-events: none; animation: gift-fly 2.3s cubic-bezier(.1, .7, .3, 1) var(--d) both; }
@keyframes gift-fade { from { opacity: 0; } }
@keyframes gift-pop { from { opacity: 0; transform: scale(.82) translateY(16px); } }
@keyframes gift-sway { 25% { transform: rotate(-4deg) translateY(-5px); } 75% { transform: rotate(4deg) translateY(5px); } }
@keyframes gift-fly { from { opacity: 1; transform: none; } 60% { opacity: 1; } to { opacity: 0; transform: translate(var(--x), calc(var(--y) + 190px)) rotate(640deg); } }
@media (prefers-reduced-motion: reduce) { .gift-arrival, .gift-arrival-card, .gift-arrival-picture { animation: none; } .gift-card { transition: none; } }
@media (max-width: 600px) { .gift-dialog { width: 100vw; max-height: calc(100dvh - 12px - env(safe-area-inset-top)); align-self: flex-end; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); } }

/* A gift inside a conversation */
.bubble.gift-bubble { width: 264px; max-width: 100%; }
.gift-message-card { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 8px 6px 4px; border: 0; background: transparent; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.gift-message-card b { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.gift-message-card strong { font-size: 16px; font-weight: 700; }
.gift-message-card small { font-size: 13px; opacity: .8; overflow-wrap: anywhere; }
.gift-message-card .gift-picture { width: 136px; height: 136px; }
.gift-message-words { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.gift-message-action { width: 100%; margin-top: 4px; padding: 9px 12px; border-radius: 14px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: 14px; font-weight: 600; transition: background .16s; }
.gift-message-card:hover .gift-message-action { background: color-mix(in srgb, currentColor 18%, transparent); }
.gift-message-card:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 14px; }

.gift-shelf { margin: 18px 2px 10px; font-size: 17px; font-weight: 600; }
.gift-feed { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.gift-feed-row { display: flex; align-items: center; gap: 14px; padding: 8px 14px 8px 10px; border: 0; border-radius: 20px; background: var(--surface, rgba(127, 127, 127, .08)); color: var(--text-main); font: inherit; text-align: start; cursor: pointer; }
.gift-feed-row:hover { background: var(--surface-raised); }
.gift-feed-row .gift-picture { width: 58px; height: 58px; flex: 0 0 auto; }
.gift-feed-row span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gift-feed-row b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.gift-feed-row small { color: var(--text-sec); font-size: 13px; }
a.gift-note { text-decoration: underline; text-underline-offset: 3px; }
