/* Chat-only visual layer. No global tokens or other tabs are changed. */
#chatView{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans Myanmar",sans-serif}
#chatView button.chat-partner-avatar{padding:0;font-family:inherit;cursor:pointer}
#chatView button.chat-partner-avatar:focus-visible{outline:3px solid #6847d7;outline-offset:3px}
#chatView .chat-emoji-picker{
  position:relative;z-index:20;flex:0 0 auto;
  display:flex;flex-direction:column;gap:6px;margin:8px 0 0;padding:10px;
  height:min(300px,40dvh);max-height:none;overflow:hidden;background:#f8f4fc;
  box-shadow:0 8px 28px #30254440;border:1px solid #ffffffd9;
}
#chatView .chat-emoji-categories{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));flex:none;gap:3px}
#chatView .chat-picker-handle{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;touch-action:none;cursor:ns-resize;user-select:none}
#chatView .chat-picker-handle span{font-size:13px;color:#51416e;text-align:center}
#chatView .chat-picker-handle button{width:44px;height:36px;flex:none;font-size:24px;color:#51416e;background:#e9e0f4}
#chatView .chat-emoji-picker.expanded{
  position:fixed;inset:0;z-index:250;width:min(100%,720px);height:100dvh;
  margin:0 auto;border-radius:0;padding:calc(10px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom));
  box-sizing:border-box;
}
#chatView .chat-emoji-picker.expanded .chat-sticker-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
#chatView .chat-emoji-picker.expanded .chat-sticker-grid button{height:120px}
#chatView .chat-emoji-categories button{height:40px}
#chatView .chat-emoji-categories button[aria-pressed="true"]{background:#e3d7f8;box-shadow:inset 0 -2px #7855e1}
#chatView .chat-emoji-heading{color:#51416e;font-size:14px;padding:0 4px;flex:none}
#chatView .chat-emoji-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;overflow-y:auto;min-height:0;flex:1;align-content:start;overscroll-behavior:contain}
#chatView .chat-emoji-grid button{height:40px;font-size:25px}
#chatView .chat-emoji-picker button:focus-visible{outline:2px solid #7855e1;outline-offset:-2px}
#chatView .chat-emoji-picker button,#chatView .chat-emoji-btn{touch-action:manipulation}
#chatView .chat-composer .chat-input-count{display:none}
#chatView .chat-picker-modes{display:flex;justify-content:center;gap:8px;flex:none}
#chatView .chat-picker-modes button{font:inherit;font-size:15px;height:38px;padding:0 18px;color:#51416e}
#chatView .chat-picker-modes button[aria-pressed="true"]{background:#e3d7f8}
#chatView .chat-sticker-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#chatView .chat-sticker-section{grid-column:1/-1;padding:6px 3px;color:#51416e;font-size:13px;font-weight:600}
#chatView .chat-sticker-packs{display:grid;grid-template-columns:repeat(4,48px);justify-content:center;gap:8px;flex:none;padding:5px 8px;border-bottom:1px solid #ded4ec}
#chatView .chat-sticker-packs button{width:48px;height:42px;padding:0;border:0;border-radius:13px;background:transparent;color:#51416e;font-size:21px;touch-action:manipulation}
#chatView .chat-sticker-packs button[aria-pressed="true"]{background:#e3d7f8;box-shadow:inset 0 -3px #7855e1}
#chatView .chat-sticker-grid button{height:90px;padding:4px}
#chatView .chat-sticker-grid img{width:100%;height:100%;object-fit:contain;pointer-events:none}
#chatView .animated-sticker{position:relative;overflow:hidden;min-width:0}
#chatView .animated-sticker video,#chatView .sticker-lottie{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
#chatView .sticker-lottie canvas{width:100%!important;height:100%!important;object-fit:contain}
#chatView .animated-sticker.animation-ready>img,#chatView .animation-ready>.animation-placeholder{visibility:hidden}
#chatView .animation-placeholder{font-size:12px;color:#51416e}
#chatView .animation-error .animation-placeholder::after{content:' · Cannot play';display:block}
#chatView .chat-message.sticker .chat-bubble{background:transparent;border:0;box-shadow:none;max-width:210px}
#chatView .chat-message.sticker .chat-photo-message{background:transparent;box-shadow:none}
#chatView .chat-message.sticker .chat-photo-message img{height:180px;min-height:0;object-fit:contain;background:transparent}
#chatView .chat-message.sticker footer{background:#f4f0f9e6;border-radius:12px;padding:3px 8px;width:max-content;margin-left:auto}
#chatView {
  --brand:#6847d7; --brand-dark:#403563; --brand-soft:#e9e3f6;
  --pink:#a186ee; --pink-soft:#eee8f5; --text:#292d3c; --muted:#595f73;
  --glass-bg:radial-gradient(ellipse at 6% 4%,#f6e4d8 0%,transparent 57%),radial-gradient(ellipse at 98% 82%,#8d9da8 0%,transparent 60%),linear-gradient(135deg,#e7d6d0 15%,#c1b7c3 56%,#697989 100%);
  background:var(--glass-bg);border:1px solid #ffffffa3;border-radius:32px;
  padding:14px;box-shadow:inset 0 2px 2px #ffffffb3,0 18px 45px #32395024;
}
#chatView .chat-topbar,#chatView .chat-composer {
  background:linear-gradient(130deg,#ffffff52,#ffffff14);
  border:1px solid #ffffffbd;
  box-shadow:inset 0 1px 2px #fff, inset 0 -1px 2px #ffffff70,0 9px 22px #3d3e5724;
  -webkit-backdrop-filter:blur(6px) saturate(1.12);backdrop-filter:blur(6px) saturate(1.12);
}
#chatView .chat-topbar{border-radius:26px;padding:10px;gap:9px}
/* A second inset rim gives the glass thickness without covering controls. */
#chatView .chat-topbar::after,#chatView .chat-composer::after{
  content:"";position:absolute;inset:3px;border-radius:inherit;pointer-events:none;
  border:1px solid #ffffff40;
  border-top-color:#fffaf0b3;border-left-color:#fffaf080;
  box-shadow:inset 0 2px 3px #ffffff26,0 1px 2px #5e52641a;
}
#chatView .chat-partner-copy strong{color:#292d3c}
#chatView .chat-partner-copy small.offline{color:#50566a}
#chatView .chat-partner-avatar{background:linear-gradient(145deg,#fff5ef,#d8daf5);box-shadow:inset 0 1px 3px #fff,0 4px 9px #44415b21}
#chatView .chat-more-btn,#chatView .chat-back-btn{background:#ffffff65;color:#514575;border:1px solid #ffffffb5;box-shadow:inset 0 1px 2px #fff}
#chatView #chatMessages{border:0;box-shadow:none;border-radius:0;margin:0;width:100%}
#chatView .chat-messages[data-background="glass"]{background:linear-gradient(135deg,#ffffff30,#ffffff0a);background-size:cover}
#chatView .chat-bubble{background:linear-gradient(135deg,#ffffffeb,#f1f5f3df);color:#292d3c;border:1px solid #ffffffd9;box-shadow:inset 0 1px 1px #fff,0 5px 12px #393c5320}
#chatView .chat-message.mine .chat-bubble{background:linear-gradient(135deg,#e4d4fbf5,#c8c4f0f0 65%,#bcdfe8f0);color:#302544;border-color:#ffffffa8}
#chatView .chat-bubble p{color:inherit}
#chatView .chat-bubble footer{opacity:1;color:#5d536d}
#chatView .chat-replied{background:#76669b16;color:#51416e;border-left-color:#8464d8}
#chatView .chat-replied.photo small{color:#714087}
#chatView .chat-message.mine .chat-voice-toggle{background:#7552cb;color:white}
#chatView .chat-message.mine .chat-voice-range::-webkit-slider-runnable-track{color:#6847ad}
#chatView .chat-message.mine .chat-voice-range::-webkit-slider-thumb{background:#6847ad;border-color:white}
#chatView .chat-date-separator{background:#ffffffbd;color:#4f4860;box-shadow:inset 0 1px 1px #fff}
#chatView .chat-composer{border-radius:28px;padding:6px}
#chatView .chat-compose-row textarea{color:#302d40}
#chatView .chat-compose-row textarea::placeholder{color:#676474}
#chatView .chat-send-btn{background:linear-gradient(145deg,#b08aef,#7855e1 60%,#6247d4);color:#fff;border:1px solid #d9c2ff;box-shadow:inset 0 2px 3px #ffffff80,0 4px 10px #7853c95c}
#chatView .chat-media-btn,#chatView .chat-mic-btn,#chatView .chat-emoji-btn{color:#514575}
#chatView .chat-mic-btn.recording{background:#ffdfeb;color:#a52558}
#chatView .chat-send-btn:active{transform:scale(.94)}
#chatView .chat-more-menu{background:#f4f0f9f7;border-color:#fff;box-shadow:inset 0 1px 2px #fff,0 15px 35px #32304433}
#chatView .chat-search-bar,#chatView .chat-reply-preview{background:#ffffffb3;border-color:#ffffffd9;color:#51416e}
#chatView .chat-empty{color:#3f3b51}
#chatView .chat-empty p{color:#555168}
#chatBackgroundPicker .background-sample.glass{background:radial-gradient(circle at 5% 0%,#f5dfd3,transparent 70%),linear-gradient(135deg,#d8c5d2,#778b9c)}
/* These dialogs belong exclusively to Chat, including when mounted outside it. */
body.chat-active :is(#chatBackgroundPicker,#profileEditor,#chatPhotoPreview,.chat-extras-panel){background:linear-gradient(145deg,#faf4f0f7,#edeaf6f7);border:1px solid #fff;box-shadow:inset 0 2px 2px #fff,0 22px 55px #32364b40}
body.chat-active :is(#chatBackgroundPicker,#profileEditor,#chatPhotoPreview,.chat-extras-panel) .primary-btn{background:linear-gradient(145deg,#a283e5,#7050d3);color:#fff;box-shadow:inset 0 1px 2px #ffffffb3,0 5px 15px #7152c33d}
body.chat-active #chatActionSheet{background:#f8f4fbf5;border:1px solid white;box-shadow:inset 0 1px 2px #fff,0 15px 40px #3530443d}
@media(max-width:520px){
  body.chat-active #chatView{display:flex;flex-direction:column;background:var(--glass-bg);border:0;border-radius:0;box-shadow:none}
  #chatView .chat-topbar{padding:8px;border-radius:24px}
  #chatView .chat-messages{flex:1;min-height:0;padding:12px 8px 18px}
  #chatView .chat-topbar,#chatView .chat-composer{flex:none}
  body.chat-active #chatView{padding-left:0;padding-right:0}
  body.chat-active #chatView #chatMessages{flex:1;min-height:0;border:0;border-radius:0;box-shadow:none}
  body.chat-active #chatView .chat-topbar{margin:0 8px 0}
  body.chat-active #chatView .chat-composer{margin:0 8px}
}
@supports not (backdrop-filter:blur(1px)){
  #chatView .chat-topbar,#chatView .chat-composer{background:#efebf2}
}
@media(prefers-reduced-transparency:reduce){
  #chatView .chat-topbar,#chatView .chat-composer{background:#efebf2;backdrop-filter:none}
  #chatView .chat-bubble{background:#f9f8fc}
  #chatView .chat-message.mine .chat-bubble{background:#e0d5f5}
}

/* Compact Telegram-like text bubbles; media, voice and stickers keep their own sizing. */
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker){margin:3px 0}
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble{width:auto;max-width:min(72%,420px);padding:5px 8px 4px;border-radius:14px}
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker).mine .chat-bubble{border-bottom-right-radius:5px}
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker).theirs .chat-bubble{border-bottom-left-radius:5px}
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble p{font-size:14px;line-height:1.34}
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble footer{gap:4px;min-height:9px;margin-top:1px;font-size:7.5px;line-height:1}
body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble.long-text{width:auto;max-width:min(78%,460px)}
body.chat-large-text #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble{width:auto;max-width:84%;padding:7px 9px 5px;border-radius:15px}
body.chat-large-text #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble.long-text{width:auto;max-width:88%}
@media(max-width:520px){body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble{max-width:74%}body:not(.chat-large-text) #chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble.long-text{width:auto;max-width:80%}}

/* v143 — compact Telegram-like header and composer. */
#chatView .chat-topbar{padding:6px 7px;gap:7px;border-radius:20px}
#chatView .chat-partner-avatar{width:38px;height:38px;font-size:21px}
#chatView .chat-partner-copy strong{font-size:15px;line-height:1.15}
#chatView .chat-partner-copy small{font-size:10px;line-height:1.2}
#chatView .chat-more-btn,#chatView .chat-back-btn{width:36px;height:36px;border-radius:50%}
#chatView .chat-composer{padding:3px 4px;border-radius:20px}
#chatView .chat-compose-row{gap:1px;align-items:center}
#chatView .chat-compose-row textarea{min-height:38px;padding:8px 5px 6px;font-size:16px;line-height:1.35}
#chatView .chat-emoji-btn,#chatView .chat-media-btn,#chatView .chat-mic-btn{width:32px;height:38px}
#chatView .chat-send-btn{width:38px;height:38px}
@media(max-width:520px){body.chat-active .chat-topbar{margin-bottom:4px;padding:4px 5px;border-radius:18px}body.chat-active .chat-partner-avatar{width:36px;height:36px}body.chat-active .chat-partner-copy strong{font-size:15px}body.chat-active .chat-more-btn,body.chat-active .chat-back-btn{width:34px;height:34px}body.chat-active .chat-composer{margin-top:4px;padding:3px;border-radius:20px}body.chat-active #chatForm{min-height:46px}body.chat-active .chat-compose-row{grid-template-columns:32px minmax(70px,1fr) 32px 32px 38px}body.chat-active .chat-compose-row textarea{min-height:38px;max-height:104px}}

/* v144 — Telegram message shapes and single-tap action palette. */
#chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble{position:relative;background:linear-gradient(135deg,#ffffffeb,#f1f5f3df);color:#292d3c;border:1px solid #ffffffd9;box-shadow:inset 0 1px 1px #fff,0 5px 12px #393c5320}
#chatView .chat-message:not(.voice):not(.photo):not(.sticker).mine .chat-bubble{background:linear-gradient(135deg,#e4d4fbf5,#c8c4f0f0 65%,#bcdfe8f0);color:#302544;border-color:#ffffffa8}
#chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble p{display:inline;margin:0}
#chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-bubble footer{display:inline-flex;align-items:flex-end;float:none;margin:0 0 0 8px;vertical-align:-1px;color:#5d536d;white-space:nowrap}
#chatView .chat-message:not(.voice):not(.photo):not(.sticker) .chat-delivery-state{color:#7159a7;font-size:10px;font-weight:850}
#chatView .chat-message:not(.voice):not(.photo):not(.sticker).mine .chat-bubble::after,#chatView .chat-message:not(.voice):not(.photo):not(.sticker).theirs .chat-bubble::after{content:none}
body.chat-active #chatActionSheet{background:rgba(39,52,68,.98);border-color:rgba(255,255,255,.12);box-shadow:0 18px 48px rgba(0,0,0,.38)}
body.chat-active #chatActionSheet>button{color:#fff}
body.chat-active #chatActionSheet>button span{color:#fff}
body.chat-active #chatActionSheet>button:active{background:rgba(255,255,255,.1)}
body.chat-active #chatActionSheet>button.danger,body.chat-active #chatActionSheet>button.danger span{color:#ff668d}
body.chat-active #chatReactionPicker,body.chat-active #chatReactionMore{background:rgba(45,58,74,.99);border-color:rgba(255,255,255,.1);box-shadow:0 12px 30px rgba(0,0,0,.34)}
body.chat-active #chatReactionPicker button.selected{background:rgba(114,151,255,.35)}
body.chat-active #chatReactionMoreBtn{background:rgba(255,255,255,.14)!important;color:#dce6f3!important}
body.chat-active #chatReactionMore{bottom:calc(100% + 4px);max-height:152px;border-radius:18px}
body.chat-active #chatReactionPicker.expanded{border-radius:18px 18px 12px 12px}
body.chat-active #chatReactionPicker.expanded::after{display:none}
#chatView .chat-bubble p.myanmar-message-text{font-weight:700}

/* v126 — Telegram-style stickers: media floats freely, never inside a message bubble. */
#chatView .chat-message.sticker{width:100%;max-width:none;margin-top:3px;margin-bottom:3px;overflow:visible}
#chatView .chat-message.sticker .chat-bubble,
#chatView[data-light="day"] .chat-message.sticker .chat-bubble,
#chatView[data-light="night"] .chat-message.sticker .chat-bubble{position:relative;width:auto;max-width:100%;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;overflow:visible}
#chatView .chat-message.sticker .chat-photo-message{display:block;width:min(220px,58vw);height:min(220px,58vw);padding:0;border:0;border-radius:0;background:transparent!important;box-shadow:none!important;overflow:visible}
#chatView .chat-message.sticker .chat-photo-message img{display:block;width:100%;height:100%;min-height:0;max-height:none;object-fit:contain;background:transparent!important;filter:drop-shadow(0 5px 7px rgba(38,28,48,.16))}
#chatView .chat-message.sticker .chat-photo-message.animated-sticker{overflow:visible}
#chatView .chat-message.sticker footer{position:absolute;right:2px;bottom:1px;z-index:2;width:max-content;min-height:0;margin:0;padding:3px 7px;border:0;border-radius:999px;background:rgba(43,35,56,.58);color:#fff;box-shadow:none;font-size:8px;line-height:1;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
#chatView .chat-message.sticker.theirs footer{right:auto;left:2px}
#chatView .chat-message.sticker .chat-message-reactions{position:absolute;right:-3px;bottom:-4px;z-index:3}
@media(max-width:380px){#chatView .chat-message.sticker .chat-photo-message{width:min(210px,62vw);height:min(210px,62vw)}}

/* Local-time lighting: gradients paint the background, never intercept taps.
   Saved wallpapers and preset backgrounds remain untouched inside messages. */
#chatView[data-light="day"] {
  /* Broad, diffused sunlight; depth comes from objects, not painted stripes. */
  --glass-bg:radial-gradient(ellipse at 0% 0%,#fff4e8d9 0%,#f5dfd08c 30%,transparent 72%),radial-gradient(ellipse at 100% 10%,#68778970 0%,transparent 65%),linear-gradient(135deg,#e9d8d0 0%,#c7bac3 55%,#82909f 100%);
}
#chatView[data-light="day"] .chat-topbar,
#chatView[data-light="day"] .chat-composer {
  background:radial-gradient(ellipse at 5% 0%,#ffffff66,transparent 55%),linear-gradient(165deg,#ffffff24 0%,#ffffff08 48%,#c9ecf51f 100%);
  border-color:#fff7eee0 #ffffff80 #ffffffa6 #fff7eed9;
  box-shadow:inset 1px 2px 2px #fffaf0,inset -1px -2px 2px #ffffff85,2px 4px 3px #ffffff30,7px 10px 9px #51495924,16px 24px 24px -8px #51495950;
}
#chatView[data-light="day"] .chat-bubble {
  box-shadow:inset 1px 2px 1px #fffaf0,inset -1px -1px 1px #ffffff70,5px 7px 6px #56506420,12px 18px 17px -5px #56506440;
}
#chatView[data-light="day"] :is(.chat-send-btn,.chat-back-btn,.chat-more-btn){
  box-shadow:inset 1px 2px 2px #ffffffa6,inset -1px -2px 2px #ffffff50,5px 8px 9px -2px #51495945;
}
#chatView[data-light="night"] {
  --glass-bg:radial-gradient(ellipse at 95% 2%,#d4e4f8 0%,#9baed0 20%,transparent 58%),linear-gradient(235deg,transparent 20%,#d6e8ff24 21%,#d6e8ff10 35%,transparent 36%),linear-gradient(140deg,#686880 0%,#505d79 54%,#292e4d 100%);
}
#chatView[data-light="night"] .chat-topbar,
#chatView[data-light="night"] .chat-composer {
  background:linear-gradient(235deg,#f4f7ff80,#e0def050);
  border-color:#dae9ffb3;
  box-shadow:inset -1px 2px 1px #f2f6ff,inset 1px -1px 1px #dae9ff85,0 0 12px #bfdcff18,-12px 18px 22px #171b3d55;
}
/* The composer sits over the darkest sky; use light controls there only. */
#chatView[data-light="night"] .chat-composer{background:linear-gradient(235deg,#18223b38,#18223b60)}
#chatView[data-light="night"] .chat-topbar::after,
#chatView[data-light="night"] .chat-composer::after{
  border-top-color:#e5f1ffbd;border-right-color:#d6eaff99;border-left-color:#ffffff30;
  box-shadow:inset -1px 2px 3px #dceaff24,0 1px 2px #10152c26;
}
#chatView[data-light="night"] .chat-compose-row textarea,
#chatView[data-light="night"] .chat-composer :is(.chat-media-btn,.chat-mic-btn,.chat-emoji-btn){color:#f4f5ff}
#chatView[data-light="night"] .chat-compose-row textarea::placeholder{color:#e0e4f3}
#chatView[data-light="night"] .chat-composer .chat-mic-btn.recording{color:#a52558}
#chatView[data-light="night"] .chat-bubble {
  box-shadow:inset -1px 1px 2px #ecf4ff,-5px 8px 14px #10152c38;
}
#chatView[data-light="night"] .chat-messages[data-background="glass"]:not(.custom-wallpaper) {
  background:linear-gradient(225deg,#dceaff20,#ffffff08);
  border-color:#d8eaff66;box-shadow:inset -1px 1px 2px #daeaff55,0 0 18px #b3ceff12;
}
#chatView[data-light="night"] .chat-messages[data-background="glass"]:not(.custom-wallpaper) .chat-empty,
#chatView[data-light="night"] .chat-messages[data-background="glass"]:not(.custom-wallpaper) .chat-empty p{color:#f1f3ff}
#chatView[data-light="night"] .chat-send-btn{box-shadow:inset 0 2px 3px #ffffff80,0 0 12px #b1a1ff80}
@media(prefers-reduced-transparency:reduce){
  #chatView[data-light] .chat-topbar,#chatView[data-light] .chat-composer{background:#efebf2;backdrop-filter:none;-webkit-backdrop-filter:none}
  #chatView[data-light="night"] .chat-compose-row textarea,
  #chatView[data-light="night"] .chat-composer :is(.chat-media-btn,.chat-mic-btn,.chat-emoji-btn){color:#302d40}
  #chatView[data-light="night"] .chat-compose-row textarea::placeholder{color:#595569}
}
.profile-editor.partner-profile-view :is(.profile-photo-button,.profile-name-field,#useDefaultProfileBtn,#saveProfileBtn,#profileEditorError){display:none}
.profile-editor.partner-profile-view{width:min(calc(100% - 24px),460px);max-height:90dvh;padding:0;overflow:auto;border-radius:29px;background:linear-gradient(155deg,#f8f2fa,#e8e9f3)}
.profile-editor.partner-profile-view .profile-editor-head{position:absolute;z-index:3;inset:max(12px,env(safe-area-inset-top)) auto auto 12px;width:auto;padding:0;background:transparent;color:#fff;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
.profile-editor.partner-profile-view .profile-editor-head>div{display:none}.profile-editor.partner-profile-view .profile-editor-head>button{display:grid;place-items:center;flex:0 0 auto;width:42px;height:42px;border:1px solid rgba(255,255,255,.5);border-radius:50%;background:rgba(31,25,43,.58);color:#fff;box-shadow:0 5px 16px rgba(24,17,38,.2);font-size:23px}
.profile-editor.partner-profile-view .profile-preview{width:100%;height:min(45dvh,390px);margin:0;border:0;border-radius:0;background:linear-gradient(145deg,#dfd4ef,#a8a9c8);box-shadow:none}
.profile-editor.partner-profile-view .profile-preview span{font-size:120px;filter:drop-shadow(0 16px 20px rgba(48,34,61,.2))}.profile-editor.partner-profile-view .profile-preview img{width:100%;height:100%;object-fit:cover}
.partner-profile-details{display:grid;gap:14px;padding:17px}.partner-profile-copy h3{margin:0;color:#332741;font-size:25px}.partner-profile-copy p{margin:3px 0 0;color:#746c7e;font-size:12px}.partner-profile-copy p.online{color:#23986a}
.partner-profile-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.partner-profile-actions button{display:grid;place-items:center;gap:4px;min-height:68px;border:1px solid rgba(255,255,255,.8);border-radius:19px;background:rgba(255,255,255,.54);color:#6d45a2;box-shadow:inset 0 1px 1px #fff,0 8px 18px rgba(55,41,72,.08);font:inherit}.partner-profile-actions span{font-size:22px}.partner-profile-actions b{font-size:11px}
.partner-profile-media-head{display:flex;align-items:center;justify-content:space-between;color:#40354b}.partner-profile-media-head button{border:0;background:transparent;color:#8051b5;font:inherit;font-size:11px;font-weight:800}
.partner-profile-media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;min-height:80px}.partner-profile-media-grid button{padding:0;aspect-ratio:1;border:0;border-radius:11px;background:#ddd3e7;overflow:hidden}.partner-profile-media-grid img{width:100%;height:100%;object-fit:cover}.partner-profile-media-grid>p{grid-column:1/-1;margin:20px;text-align:center;color:#81778b;font-size:12px}
@media(max-width:520px){.profile-editor.partner-profile-view{inset:0;left:0;top:0;width:100%;height:100dvh;max-height:none;border:0;border-radius:0;transform:none;animation:partnerProfileIn .24s ease-out both}.profile-editor.partner-profile-view .profile-preview{height:47dvh;min-height:290px}.partner-profile-details{padding-bottom:calc(24px + env(safe-area-inset-bottom))}}@keyframes partnerProfileIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

.chat-new-below-anchor{position:relative;height:0;min-height:0;flex:0 0 0;z-index:8;overflow:visible}
#chatNewBelowBtn{position:absolute;right:16px;bottom:10px;max-width:calc(100% - 32px);min-height:44px;padding:9px 16px;border:1px solid rgba(255,255,255,.65);border-radius:24px;background:#7956aa;color:white;box-shadow:0 3px 14px #30204030;font-family:inherit;font-size:13px;font-weight:600;line-height:1.4;cursor:pointer}
#chatNewBelowBtn:focus-visible{outline:3px solid #bcb0f5;outline-offset:3px}
/* Reactions sit just outside the message edge; emoji stays unboxed. */
#chatView .chat-message:has(.chat-message-reactions){margin-bottom:14px;overflow:visible}
#chatView .chat-message .chat-bubble{position:relative;overflow:visible}
#chatView .chat-message:not(.sticker) .chat-message-reactions{position:absolute;z-index:4;bottom:-13px;display:flex;gap:4px;margin:0;pointer-events:none}
#chatView .chat-message.mine:not(.sticker) .chat-message-reactions{right:7px}
#chatView .chat-message.theirs:not(.sticker) .chat-message-reactions{left:7px}
#chatView .chat-message .chat-message-reactions span,#chatView .chat-message.mine .chat-message-reactions span,#chatView .chat-message .chat-message-reactions span.mine{padding:0;border:0;background:transparent;color:inherit;box-shadow:none;font-size:15px;line-height:1.15;text-shadow:0 1px 2px rgba(255,255,255,.9),0 1px 3px rgba(35,24,43,.18)}
#chatView .chat-message.sticker .chat-message-reactions{right:4px;bottom:-10px;gap:4px;margin:0;pointer-events:none}
#chatView .chat-message.sticker.theirs .chat-message-reactions{right:auto;left:4px}

/* Reliable sticker sending: immediate local preview with clear recovery controls. */
#chatView .chat-history-state{align-self:center;margin:5px auto 9px;padding:4px 10px;border:1px solid rgba(255,255,255,.42);border-radius:999px;background:rgba(255,255,255,.22);color:rgba(42,35,54,.72);font-size:10px;line-height:1.25;backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px)}
#chatView .chat-message.sticker-sending .chat-photo-message{opacity:.7;animation:stickerSendingPulse 1.25s ease-in-out infinite}
#chatView .chat-message.sticker-failed .chat-photo-message{opacity:.62;filter:saturate(.7)}
#chatView .chat-sticker-send-state{position:absolute;left:50%;bottom:25px;z-index:5;display:flex;align-items:center;gap:5px;transform:translateX(-50%);padding:5px 7px;border-radius:999px;background:rgba(45,34,56,.82);color:#fff;font-size:9px;white-space:nowrap;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
#chatView .chat-sticker-send-state button{min-height:25px;padding:3px 8px;border:0;border-radius:999px;background:#fff;color:#6b3ba1;font:inherit;font-weight:800}
#chatView .chat-sticker-send-state button:last-child{background:rgba(255,255,255,.16);color:#fff}
@keyframes stickerSendingPulse{50%{opacity:.45;transform:scale(.975)}}
@media(prefers-reduced-motion:reduce){#chatView .chat-message.sticker-sending .chat-photo-message{animation:none}}

/* Telegram-like photo messages: use the mobile canvas and show the whole image. */
#chatView .chat-message.photo:not(.sticker) .chat-bubble{
  width:min(390px,92%);max-width:92%;padding:4px 4px 7px;border-radius:18px;overflow:visible
}
#chatView .chat-message.photo:not(.sticker) .chat-photo-message{
  display:block;width:100%;max-width:none;border-radius:14px;background:rgba(25,20,34,.08);overflow:hidden
}
#chatView .chat-message.photo:not(.sticker) .chat-photo-message img{
  display:block;width:100%;height:auto;max-height:min(62dvh,560px);object-fit:contain;background:rgba(25,20,34,.06)
}
#chatView .chat-message.photo:not(.sticker).mine .chat-bubble{border-bottom-right-radius:6px}
#chatView .chat-message.photo:not(.sticker).theirs .chat-bubble{border-bottom-left-radius:6px}
#chatView .chat-message.photo:not(.sticker) .chat-bubble>p{display:block;padding:6px 8px 1px}
@media(max-width:380px){#chatView .chat-message.photo:not(.sticker) .chat-bubble{width:94%;max-width:94%}}

/* Telegram-inspired reaction burst and a soft confirmation pulse. */
#chatView .chat-bubble.reaction-confirmed{position:relative;isolation:isolate;overflow:visible}
#chatView .chat-reaction-burst{position:absolute;z-index:12;right:8px;bottom:-2px;width:58px;height:58px;pointer-events:none;animation:chatReactionBurst .72s cubic-bezier(.18,.82,.24,1) both}
#chatView .chat-message.theirs .chat-reaction-burst{right:auto;left:8px}
#chatView .chat-reaction-burst b{position:absolute;inset:8px;display:grid;place-items:center;font-size:31px;line-height:1;filter:drop-shadow(0 5px 7px rgba(46,25,55,.22));animation:chatReactionEmoji .72s cubic-bezier(.2,.9,.25,1) both}
#chatView .chat-reaction-burst i{position:absolute;color:#fff3a8;font-size:13px;font-style:normal;text-shadow:0 1px 5px rgba(116,69,24,.3);animation:chatReactionSpark .62s ease-out both}
#chatView .chat-reaction-burst i:nth-of-type(1){left:2px;top:7px;--spark-x:-12px;--spark-y:-16px}
#chatView .chat-reaction-burst i:nth-of-type(2){right:1px;top:1px;--spark-x:14px;--spark-y:-13px;animation-delay:.04s}
#chatView .chat-reaction-burst i:nth-of-type(3){right:5px;bottom:4px;--spark-x:16px;--spark-y:8px;animation-delay:.08s}
#chatView .chat-bubble.reaction-confirmed .chat-message-reactions span.mine{animation:chatReactionChip .5s cubic-bezier(.2,.9,.25,1) both}
@keyframes chatReactionBurst{0%{opacity:0;transform:translateY(12px) scale(.55)}25%{opacity:1}72%{opacity:1}100%{opacity:0;transform:translateY(-24px) scale(1.08)}}
@keyframes chatReactionEmoji{0%{transform:scale(.35) rotate(-16deg)}42%{transform:scale(1.28) rotate(8deg)}68%{transform:scale(.94) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}
@keyframes chatReactionSpark{0%{opacity:0;transform:translate(0,0) scale(.3)}28%{opacity:1}100%{opacity:0;transform:translate(var(--spark-x),var(--spark-y)) scale(1.15)}}
@keyframes chatReactionChip{0%{transform:scale(.7)}55%{transform:scale(1.3)}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){#chatView .chat-reaction-burst{display:none}#chatView .chat-bubble.reaction-confirmed .chat-message-reactions span.mine{animation:none}}

/* Multiple-photo composer: compact album preview with removable selections. */
.chat-photo-preview-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:52dvh;overflow:auto;overscroll-behavior:contain;border-radius:17px}
.chat-photo-preview-item{position:relative;aspect-ratio:1;border-radius:14px;background:#eee7f2;overflow:hidden}
.chat-photo-preview-item img{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover!important;border-radius:inherit!important}
.chat-photo-preview-item button{position:absolute;right:5px;top:5px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid rgba(255,255,255,.5);border-radius:50%;background:rgba(27,20,34,.7);color:#fff;font-size:18px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.chat-photo-preview-item span{position:absolute;left:6px;bottom:6px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#7e55ba;color:#fff;font:800 10px/1 system-ui,sans-serif;box-shadow:0 2px 8px rgba(39,24,48,.25)}
.chat-photo-preparing{grid-column:1/-1;display:grid;place-items:center;min-height:150px;margin:0;color:#6f6278;font-size:13px}
@media(max-width:360px){.chat-photo-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
