/* Telegram iOS-style context presentation for long-press on a chat row.
   Mobile only. Desktop keeps the anchored context menu. */
.chat-list-preview-overlay{position:fixed!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:max(calc(env(safe-area-inset-top) + 10px),18px) 14px max(calc(env(safe-area-inset-bottom) + 10px),18px)!important;background:rgba(10,15,24,.22)!important;-webkit-backdrop-filter:blur(22px) saturate(1.12)!important;backdrop-filter:blur(22px) saturate(1.12)!important;opacity:0;transition:opacity .18s ease;touch-action:none;overscroll-behavior:none}
.chat-list-preview-overlay.is-presented{opacity:1}.chat-list-preview-overlay.is-closing{opacity:0;transition-duration:.16s}
.chat-list-preview-stage{width:min(430px,calc(100vw - 28px));height:min(760px,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 22px));max-height:100%;display:flex;flex-direction:column;justify-content:center;gap:9px;pointer-events:none;transform:translateZ(0)}
.chat-list-preview-card,.chat-list-preview-menu{pointer-events:auto}
.chat-list-preview-card{flex:1 1 auto;min-height:210px;max-height:calc(100% - 210px);display:flex;flex-direction:column;overflow:hidden;border-radius:16px;background:var(--background-primary,var(--panel));box-shadow:0 18px 55px rgba(0,0,0,.28),0 0 0 .5px rgba(127,127,127,.16);transform-origin:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.chat-list-preview-header{height:50px;min-height:50px;display:flex;align-items:center;padding:0 12px;background:color-mix(in srgb,var(--background-primary,var(--panel)) 96%,transparent);border-bottom:.5px solid var(--separator,var(--line));position:relative;z-index:2}
.chat-list-preview-header-inner{display:flex;align-items:center;gap:9px;min-width:0;width:100%}.chat-list-preview-avatar{width:34px!important;height:34px!important;min-width:34px!important;font-size:14px!important}.chat-list-preview-header-meta{display:flex;flex-direction:column;min-width:0;line-height:1.12}.chat-list-preview-header-meta strong{font-size:16px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--label-primary,var(--text))}.chat-list-preview-header-meta small{font-size:11.5px;color:var(--label-secondary,var(--muted));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.chat-list-preview-messages{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;gap:3px;padding:10px 9px;background:var(--bg-chat);background-position:center;background-size:cover;position:relative}
.chat-list-preview-messages[data-chat-wp="1"]{background-image:radial-gradient(ellipse at 20% 20%,rgba(59,158,255,.12),transparent 50%),radial-gradient(ellipse at 80% 70%,rgba(167,139,250,.1),transparent 45%)}
.chat-list-preview-messages[data-chat-wp="2"]{background-image:linear-gradient(160deg,rgba(20,40,80,.5),rgba(10,20,40,.2)),radial-gradient(circle at 30% 40%,rgba(74,222,128,.08),transparent 40%)}
.chat-list-preview-messages[data-chat-wp="3"]{background-image:radial-gradient(circle at 70% 20%,rgba(244,114,182,.1),transparent 40%),radial-gradient(circle at 20% 80%,rgba(251,191,36,.08),transparent 35%)}
.chat-list-preview-messages[data-chat-wp="4"]{background-image:linear-gradient(180deg,rgba(12,20,40,.55),rgba(8,12,24,.35)),repeating-linear-gradient(0deg,transparent,transparent 24px,rgba(59,158,255,.04) 24px,rgba(59,158,255,.04) 25px),repeating-linear-gradient(90deg,transparent,transparent 24px,rgba(167,139,250,.03) 24px,rgba(167,139,250,.03) 25px)}
.chat-list-preview-messages[data-chat-wp="5"]{background:radial-gradient(circle at 10% 20%,rgba(34,211,238,.12),transparent 35%),radial-gradient(circle at 90% 80%,rgba(244,114,182,.1),transparent 40%),radial-gradient(circle at 50% 50%,rgba(59,158,255,.06),transparent 50%),var(--bg-chat)}
.chat-list-preview-messages[data-chat-wp="6"]{background-image:linear-gradient(135deg,rgba(15,25,45,.7),rgba(10,15,30,.4)),url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 20 L50 20 L38 30 L43 45 L30 35 L17 45 L22 30 L10 20 L25 20 Z' fill='none' stroke='%233b9eff' stroke-opacity='0.07'/%3E%3C/svg%3E");background-size:auto,60px 60px}
.chat-list-preview-msg{display:flex;width:100%;flex:none}.chat-list-preview-msg.own{justify-content:flex-end}.chat-list-preview-msg.their{justify-content:flex-start}.chat-list-preview-bubble{position:relative;max-width:76%;min-width:54px;padding:7px 9px 5px;border-radius:14px 14px 14px 5px;background:var(--in-solid,var(--background-primary));border:.5px solid var(--separator,var(--line));box-shadow:0 3px 10px rgba(0,0,0,.1);color:var(--label-primary,var(--text));font-size:13px;line-height:1.28;overflow:hidden}.chat-list-preview-msg.own .chat-list-preview-bubble{background:var(--out);color:var(--own-tx,#fff);border:0;border-radius:14px 14px 5px 14px}.chat-list-preview-sender{display:block;color:var(--accent);font-size:10.5px;margin-bottom:2px}.chat-list-preview-text{display:block;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.chat-list-preview-meta{display:block;text-align:right;font-size:9.5px;line-height:1;margin-top:3px;opacity:.62}.chat-list-preview-thumb{display:block;width:min(180px,100%);max-height:108px;object-fit:cover;border-radius:9px;margin-bottom:4px}.chat-list-preview-vnote{display:block;width:92px;height:92px;border-radius:50%;object-fit:cover;background:#000;margin:0 auto 4px}.chat-list-preview-voice{display:flex;align-items:center;gap:7px;min-width:132px;padding:1px 0}.chat-list-preview-play{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:#fff}.chat-list-preview-play svg{width:15px;height:15px;fill:currentColor;stroke:none}.chat-list-preview-wave{display:flex;align-items:center;gap:2px;height:25px;flex:1}.chat-list-preview-wave i{display:block;width:2px;border-radius:99px;background:currentColor;opacity:.45}.chat-list-preview-wave i:nth-child(1){height:7px}.chat-list-preview-wave i:nth-child(2){height:15px}.chat-list-preview-wave i:nth-child(3){height:10px}.chat-list-preview-wave i:nth-child(4){height:20px}.chat-list-preview-wave i:nth-child(5){height:13px}.chat-list-preview-wave i:nth-child(6){height:18px}.chat-list-preview-wave i:nth-child(7){height:9px}.chat-list-preview-wave i:nth-child(8){height:16px}.chat-list-preview-wave i:nth-child(9){height:7px}.chat-list-preview-empty{margin:auto;padding:12px 16px;border-radius:14px;background:color-mix(in srgb,var(--background-primary,var(--panel)) 88%,transparent);color:var(--label-secondary,var(--muted));font-size:12px;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.chat-list-preview-composer{height:43px;min-height:43px;display:flex;align-items:center;gap:7px;padding:6px 8px;background:var(--background-primary,var(--panel));border-top:.5px solid var(--separator,var(--line))}.chat-list-preview-composer span{height:31px;flex:1;border-radius:16px;background:var(--background-secondary,var(--panel-2));border:.5px solid var(--separator,var(--line))}.chat-list-preview-composer i{width:31px;height:31px;border-radius:50%;background:var(--accent);position:relative}.chat-list-preview-composer i::after{content:"";position:absolute;inset:8px;border:2px solid #fff;border-left:0;border-bottom:0;transform:rotate(45deg);border-radius:1px}
.chat-list-preview-menu{flex:0 0 auto;max-height:min(43vh,340px);overflow:auto;-webkit-overflow-scrolling:touch;border-radius:15px;background:color-mix(in srgb,var(--background-primary,var(--panel)) 86%,transparent);-webkit-backdrop-filter:blur(24px) saturate(1.2);backdrop-filter:blur(24px) saturate(1.2);box-shadow:0 14px 42px rgba(0,0,0,.22),0 0 0 .5px rgba(127,127,127,.15);overscroll-behavior:contain}.chat-list-preview-action{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px;border:0;border-bottom:.5px solid var(--separator,var(--line));background:transparent;color:var(--label-primary,var(--text));font:inherit;font-size:16px;text-align:left;-webkit-tap-highlight-color:transparent}.chat-list-preview-action:last-child{border-bottom:0}.chat-list-preview-action:active{background:color-mix(in srgb,var(--label-primary,var(--text)) 7%,transparent)}.chat-list-preview-action-icon{width:22px;height:22px;display:grid;place-items:center;flex:none}.chat-list-preview-action-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.chat-list-preview-action.danger{color:var(--danger,#ff3b30)}.chat-list-preview-menu-separator{height:7px;background:color-mix(in srgb,var(--separator,var(--line)) 38%,transparent);border-top:.5px solid var(--separator,var(--line));border-bottom:.5px solid var(--separator,var(--line))}
.row-item.chat-list-context-source{position:relative;z-index:2;transform:scale(1.012);opacity:.20;transition:transform .18s ease,opacity .18s ease}.row-item.chat-list-context-source-return{transform:scale(1);opacity:1}.chat-list-context-open body{overscroll-behavior:none}
html[data-theme="light"] .chat-list-preview-overlay{background:rgba(225,230,238,.24)}html[data-theme="light"] .chat-list-preview-menu{background:rgba(250,250,252,.90)}
@media(max-width:899px) and (orientation:landscape){.chat-list-preview-stage{width:min(560px,calc(100vw - 44px));height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 14px);gap:7px}.chat-list-preview-card{min-height:150px;max-height:calc(100% - 150px)}.chat-list-preview-header{height:44px;min-height:44px}.chat-list-preview-composer{height:36px;min-height:36px}.chat-list-preview-composer span{height:26px}.chat-list-preview-composer i{width:26px;height:26px}.chat-list-preview-menu{max-height:46vh}.chat-list-preview-action{min-height:44px;font-size:15px}.chat-list-preview-messages{padding:6px 8px;gap:2px}.chat-list-preview-bubble{font-size:12px}}
@media(max-width:380px){.chat-list-preview-stage{width:calc(100vw - 24px)}.chat-list-preview-card{min-height:190px}.chat-list-preview-action{padding:0 14px}}
@media(prefers-reduced-motion:reduce){.chat-list-preview-overlay,.row-item.chat-list-context-source{transition:none!important}}
@media(min-width:900px){.chat-list-preview-overlay{display:none!important}}
