/* Nexa Chat 4.3 — consistent themes, media viewer, gifts, and micro-interactions */
:root{--v43-ease:cubic-bezier(.2,.85,.22,1)}
.v43-photo-avatar{overflow:hidden;border-radius:50%;position:relative;background:linear-gradient(130deg,var(--profile-accent),#395c96)}
.v43-photo-avatar img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;border-radius:inherit}
.v43-open-avatar{display:flex;align-items:center;justify-content:center;border:0;background:transparent;padding:0;border-radius:50%;overflow:visible;cursor:zoom-in}
.v43-open-community-avatar{cursor:zoom-in;transition:transform .27s var(--v43-ease)}.v43-open-community-avatar:active{transform:scale(.95)}
.v43-gift-from-profile{border:1px solid #dfc6ff;background:linear-gradient(135deg,#f6eaff,#efe6ff);color:#7351ab;border-radius:17px;padding:12px;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.v43-gift-from-profile .icon{height:19px;width:19px}.v41-profile-actions{flex-wrap:wrap}.v41-profile-actions>button{min-width:0}.v41-profile-actions .v43-gift-from-profile{flex-basis:100%;}
.v43-gift-header{display:flex;align-items:center;gap:14px;margin:8px 0 14px}.v43-gift-header h2{font-size:23px;line-height:1.15;margin:0;color:var(--ink)}.v43-gift-header p{color:#778ea3;font-size:12px;margin:6px 0}
.v43-gift-orb{width:58px;height:58px;flex:0 0 auto;border-radius:20px;display:grid;place-items:center;background:radial-gradient(circle at 25% 25%,#ead9ff,#aa89e1);box-shadow:0 9px 22px #ad82e656;color:#fff}.v43-gift-orb .icon{width:28px;height:28px}
.v43-gift-hint{font-size:12px;line-height:1.6;color:#71879e;padding:12px 14px;background:#f1f7fd;border-radius:15px;margin:13px 0}
.v43-gift-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
.v43-gift-choice{border:1px solid #dbe7f6;background:linear-gradient(150deg,#f8fbff,#eaf4ff);border-radius:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:13px 8px 16px;gap:4px;color:#2c4b72;min-width:0;overflow:hidden;animation:v43-pop .4s var(--v43-ease) both}
.v43-gift-choice:nth-child(2n){animation-delay:.055s}.v43-gift-choice:nth-child(3n){animation-delay:.105s}
.v43-gift-choice .v43-gift-img{width:92px;height:92px;object-fit:contain;animation:v43-gift-float 3.7s ease-in-out infinite;filter:drop-shadow(0 8px 8px #5185bc44)}
.v43-gift-choice strong{font-size:13px}.v43-gift-choice small{color:#6593b3;font-weight:850}.v43-gift-choice:active{transform:scale(.93) rotate(-1deg)}.v43-gift-choice:disabled{opacity:.45;filter:grayscale(.65)}
.v43-gift-spark{position:absolute;top:7px;right:13px;font-size:23px;color:#77b5f1;animation:v43-twinkle 2.8s infinite}
.v43-return-btn{width:100%;padding:14px;border:1px solid #dbe7f1;background:#f2f7fc;border-radius:16px;display:flex;align-items:center;justify-content:center;gap:8px;color:#4f7292;font-weight:800}
@keyframes v43-pop{from{transform:scale(.92) translateY(12px);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes v43-gift-float{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-8px) rotate(4deg)}}
@keyframes v43-twinkle{0%,100%{opacity:.4;transform:scale(.6)}50%{opacity:1;transform:scale(1.2)}}
.v43-image-open{overflow:hidden!important}.v43-lightbox{position:fixed;inset:0;z-index:99999;background:#070b14;color:#fff;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);animation:v43-pop .24s var(--v43-ease)}
.v43-lightbox-top{height:66px;flex-shrink:0;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;gap:7px;background:#0b1120;border-bottom:1px solid #ffffff1d}
.v43-lightbox-top>span{font-size:13px;color:#b9c9df;text-align:center;min-width:0;flex:1}
.v43-lightbox-top button{display:inline-flex;align-items:center;gap:5px;justify-content:center;border:1px solid #ffffff22;background:#1b3048;color:#fff;border-radius:14px;padding:11px 10px;font-size:12px;font-weight:750;white-space:nowrap}.v43-lightbox-top .icon{width:17px;height:17px}
.v43-lightbox-stage{flex:1;min-height:0;display:grid;place-items:center;padding:12px;overflow:auto}.v43-lightbox-stage img{display:block;max-width:100%;max-height:100%;object-fit:contain;border-radius:4px;box-shadow:0 16px 60px #0009;transition:transform .25s;user-select:none}.v43-lightbox-stage img.zoom{transform:scale(1.75)}
.v43-lightbox-tip{flex-shrink:0;text-align:center;padding:12px 8px;font-size:11px;color:#a1aec0}
.messages .bubble a:has(img){display:block;overflow:hidden;border-radius:12px;cursor:zoom-in}
.messages .bubble a img{max-width:min(100%,300px);max-height:390px;object-fit:contain;border-radius:13px}
.v43-emoji-trigger{flex:0 0 auto;border:0;border-radius:13px;background:#e8f5ff;color:#348ac4;width:33px;height:38px;font-size:24px;line-height:1}
.v43-emoji-pop{position:relative;z-index:10;background:#fff;border:1px solid #dae8f5;border-radius:20px 20px 0 0;padding:10px 12px;box-shadow:0 -9px 30px #19395026;animation:v43-pop .25s both}
.v43-emoji-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-size:14px;color:#51718f;font-weight:850}.v43-emoji-title button{border:0;background:#e9f1fa;color:#67859f;border-radius:50%;width:28px;height:28px}
.v43-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;max-height:190px;overflow:auto}.v43-emoji-grid button{border:0;background:transparent;border-radius:11px;font-size:23px;padding:6px 1px;line-height:1.5}.v43-emoji-grid button:active{background:#e3f2ff}
@media(max-width:390px){.v43-emoji-grid{grid-template-columns:repeat(7,minmax(0,1fr))}.v41-composer{gap:2px}.v43-emoji-trigger{width:29px;padding:0}.v43-gift-choice .v43-gift-img{width:77px;height:77px}}
/* Consistent dark palette, including overlays and forms that were white in v4.2. */
html[data-nexa-theme="dark"]{color-scheme:dark;--ink:#e6f1ff;--muted:#aabed4;--line:#35506b;--soft:#22364b;--glass:#1c2e43;--v43-bg:#132235;--v43-card:#20344a;--v43-card2:#2a415b;--v43-text:#e8f2ff;--v43-dim:#aac2d9;--v43-border:#3b5874}
html[data-nexa-theme="dark"] body,html[data-nexa-theme="dark"] .app-shell,html[data-nexa-theme="dark"] .main-layout,html[data-nexa-theme="dark"] .sidebar,html[data-nexa-theme="dark"] .content,html[data-nexa-theme="dark"] .pane-scroll,html[data-nexa-theme="dark"] .settings-screen{background:#132235!important;color:var(--v43-text)!important}
html[data-nexa-theme="dark"] :is(.sidebar,.v41-ready .sidebar,.v41-ready .pane-scroll){background:#15263a!important}
html[data-nexa-theme="dark"] :is(.modal,.v4-modal,.v41-sheet,.v42-sheet,.pane-head,.side-top,.side-header,.settings-tiles,.settings-section,.settings-section-title,.chat-row,.settings-tile,.settings-card,.settings-hero,.v41-group,.v41-security-list,.v41-tile,.v42-settings-row,.v42-session,.v4-card,.v4-modal,.v42-actions button,.quick-menu,.bottomnav,.composer,.v43-emoji-pop,.v43-gift-hint,.v43-return-btn,.v43-emoji-trigger){background:var(--v43-card)!important;color:var(--v43-text)!important;border-color:var(--v43-border)!important}
html[data-nexa-theme="dark"] :is(.v42-screen-heading h2,.v42-sheet h2,.v41-sheet h2,.section-title,.pane-head .title,.v41-chat-header strong,.chat-row strong,.settings-tile strong,.v41-tile strong,.v42-row-text strong,.v43-gift-header h2,.v43-gift-choice strong,.v4-nft-name,.v42-nft-name,.v4-card h2,.v4-card h3,.v42-settings-row strong,.v4-collection-title){color:var(--v43-text)!important}
html[data-nexa-theme="dark"] :is(.v41-tile small,.v42-row-text small,.v42-session small,.v4-hint,.v42-note,.v41-note,.v42-session small,.v43-gift-header p,.v43-gift-hint,.v41-chat-header small,.v4-profile-subtitle,.preview,.settings-section-title,.v43-gift-choice small,.v43-emoji-title){color:var(--v43-dim)!important}
html[data-nexa-theme="dark"] :is(.field input,.field textarea,.search-wrap,.search-wrap input,.search-input,.composer textarea,.v4-field input,.v42-label input,.v42-sheet textarea,.v41-outline,.v41-shortcuts button,.v42-theme-options button,.v42-chooser button,.v42-theme-preview,.v42-preview-bubble,.v42-checkbox,.v42-message-quote,.v41-profile-about,.v41-preview-banner,.v4-member,.v42-photo-upload,.v42-upload-btn,.v42-theme-options,.v43-emoji-title button){background:var(--v43-card2)!important;border-color:var(--v43-border)!important;color:var(--v43-text)!important}
html[data-nexa-theme="dark"] :is(input,textarea,select){color:var(--v43-text);caret-color:#85cdff}html[data-nexa-theme="dark"] :is(input,textarea)::placeholder{color:#8ea9c2;opacity:1}
html[data-nexa-theme="dark"] :is(.v42-theme-options .picked,.v42-chooser .picked){background:#284f73!important;border-color:#4b9fdd!important;color:#addefb!important}
html[data-nexa-theme="dark"] .messages{background:#14263a!important;color:#e8f2ff}
html[data-nexa-theme="dark"][data-nexa-wall="clear"] .messages{background:linear-gradient(#182b41,#122238)!important}
html[data-nexa-theme="dark"][data-nexa-wall="cloud"] .messages{background:radial-gradient(circle at 15% 20%,#274f7166,transparent 45%),linear-gradient(#182e44,#132438)!important}
html[data-nexa-theme="dark"][data-nexa-wall="stars"] .messages{background-color:#0f1b33!important;background-image:radial-gradient(#e0edff55 1px,transparent 1px),radial-gradient(#5da8ea88 1px,transparent 1px)!important;background-size:35px 41px,91px 73px!important}
html[data-nexa-theme="dark"][data-nexa-wall="waves"] .messages{background:repeating-radial-gradient(ellipse at 85% 15%,#15283a 0px,#15283a 25px,#1d3852 40px,#1a2d46 60px)!important}
html[data-nexa-theme="dark"] .bubble{background:#28415c!important;color:#f0f8ff!important;border-color:#3b5a75!important}html[data-nexa-theme="dark"] .bubble.own{background:#246497!important;color:#fff!important}
html[data-nexa-theme="dark"] :is(.bubble-time,.sender,.v42-message-foot,.v41-profile-about p,.v41-profile-about h3){color:#d4e4f5!important}
html[data-nexa-theme="dark"] .v43-gift-choice{background:linear-gradient(145deg,#294564,#203850)!important;border-color:#3b5978!important;color:#e4f1ff!important}
html[data-nexa-theme="dark"] .v43-gift-from-profile{background:linear-gradient(140deg,#483b70,#322e57)!important;border-color:#675e97!important;color:#f3dcff!important}
html[data-nexa-theme="dark"] .v43-emoji-grid button:active{background:#2b5679}
html[data-nexa-theme="dark"] .v42-nft-card{background:#223954!important;border-color:#3c5a75!important}
html[data-nexa-theme="dark"] .v42-nft-art{background:radial-gradient(circle at 40% 20%,#5471a1,#203959 80%)!important}
/* Soft theme: every surface remains coherent, not a white/dark mismatch. */
html[data-nexa-theme="soft"]{--ink:#38304e;--soft:#f4f0ff;--line:#e7def4;--glass:#fcf9ff}
html[data-nexa-theme="soft"] :is(.sidebar,.pane-scroll,.content,.settings-screen){background:#faf6ff!important}
html[data-nexa-theme="soft"] :is(.modal,.chat-row,.settings-tile,.v41-tile,.v42-settings-row,.v41-profile-about,.settings-card){background:#fffaff;border-color:#eadff8}
html[data-nexa-theme="soft"] .messages{background:linear-gradient(#f3efff,#faf6ff)}
html[data-nexa-theme="soft"] .bubble.own{background:#d9cafd}
/* high contrast focus / accessibility / motion preferences */
.v43-ready :is(.v43-gift-choice,.v43-emoji-trigger,.v43-open-avatar,.v43-open-community-avatar):focus-visible{outline:3px solid var(--blue);outline-offset:3px}
@media(prefers-reduced-motion:reduce){.v43-gift-choice,.v43-gift-choice .v43-gift-img,.v43-gift-spark,.v43-lightbox,.v43-emoji-pop{animation:none!important;transition:none!important}}
html.v4-reduce-motion .v43-gift-choice,html.v4-reduce-motion .v43-gift-img{animation:none!important}
