﻿﻿/* Mobile browsers add a blue tap flash unless the interaction color is defined. */
html,
body,
button,
a,
input,
textarea,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"] {
  -webkit-touch-callout: none;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
  outline: none;
}

 .chat-filters{display:flex;gap:6px;margin:0 3px 10px}.chat-filters button{padding:7px 12px;border-radius:9px;background:transparent;color:var(--muted);font-size:10px}.chat-filters button.active{background:#e0eee5;color:var(--green-dark);font-weight:700}.chat-search{height:38px;display:flex;align-items:center;gap:7px;padding:0 11px;margin:0 3px 12px;background:#fff;border:1px solid var(--line);border-radius:12px;color:var(--muted)}.chat-search span{font-size:17px}.chat-search input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font-size:11px}.user-details strong{display:flex;align-items:center;gap:5px}.user-details em{font-size:8px;color:var(--green);font-style:normal;font-weight:500}.user-meta{display:grid;justify-items:end;gap:5px;color:var(--muted)}.user-meta time{font-size:9px}.presence-dot{width:6px;height:6px;border-radius:50%;background:#78ae8f;display:block}.memory-composer{display:grid;gap:8px;margin-top:13px}.memory-composer textarea{width:100%;min-height:72px;resize:none;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff;color:var(--ink);font-size:11px;outline:0}.memory-composer .primary-button{width:100%;margin-top:0}.memory-list{margin-top:14px}.memory-entry{background:#f0f5f0;border:1px solid #dfeae1;border-radius:14px;padding:11px 13px;margin-bottom:8px}.memory-entry time{color:var(--green);font-size:9px}.memory-entry p{font-size:11px;line-height:1.6;margin:6px 0 0}.compact-empty{padding:18px 12px}.photo-toolbar{display:flex;justify-content:space-between;align-items:center;padding:4px 2px 15px}.photo-toolbar small{font-size:9px;color:var(--muted)}.photo-add{display:inline-flex;align-items:center;gap:4px;background:var(--green);color:#fff;padding:9px 12px;border-radius:10px;font-size:11px;font-weight:700;cursor:pointer}.photo-empty{padding-top:70px}.photo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.photo-tile{aspect-ratio:1;border-radius:13px;overflow:hidden;position:relative;background:#dfe8e0}.photo-tile img{width:100%;height:100%;object-fit:cover;display:block}.photo-tile button{position:absolute;top:5px;right:5px;width:22px;height:22px;border-radius:50%;background:#263433b8;color:#fff;line-height:1;font-size:16px}.empty-state{text-align:center;color:var(--muted);padding:60px 15px;font-size:11px}.empty-state span{font-size:25px;color:var(--green);display:block;margin-bottom:10px}.night-mode .chat-search,.night-mode .memory-composer textarea,.night-mode .memory-entry{background:var(--card);color:var(--ink)}.night-mode .chat-filters button.active{background:#365145;color:#d8eee0}

/* Reference-inspired glass phone skin: soft wallpaper, translucent surfaces and a grouped app launcher. */
:root{--wallpaper:url('inc/257d2d67df0a510c4a1cbc93ff704011.jpg');--glass:rgba(248,251,255,.76);--glass-strong:rgba(255,255,255,.88);--glass-line:rgba(255,255,255,.82);--blue-ink:#30445a;--blue-muted:#718297}
body{background:#d6e3ed}
.device-stage,.auth-device{background:linear-gradient(135deg,#e9f1f5 0%,#dce9f0 48%,#f1e7ee 100%)}
.phone-frame{border-color:#243447;background:#243447;box-shadow:0 30px 90px rgba(36,52,71,.28)}
.phone-screen{background:linear-gradient(150deg,#dce9f1 0%,#edf2f4 46%,#f0e7ef 100%)}
.phone-screen:after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.2),rgba(238,246,251,.42));z-index:0}
.phone-screen.has-custom-wallpaper{background-size:cover;background-position:center;background-repeat:no-repeat}
.phone-screen.has-custom-wallpaper:before{content:'';position:absolute;inset:0;background-image:var(--custom-wallpaper);background-size:cover;background-position:center;background-repeat:no-repeat;z-index:0}
.phone-screen.has-custom-wallpaper:after{background:linear-gradient(180deg,rgba(255,255,255,.28),rgba(238,246,251,.52));}
.phone-screen.has-custom-wallpaper .phone-view{background:transparent}
.status-bar,.phone-view{z-index:1}.conversation-modal{z-index:10}.home-indicator{z-index:20}.toast{z-index:30}.status-bar{color:#233649;text-shadow:0 1px rgba(255,255,255,.65)}
.phone-view{position:relative;color:var(--blue-ink)}.tiny-label,.section-title span,.view-intro,.user-details small,.user-meta,.photo-toolbar small,.setting-profile small{color:var(--blue-muted)}
.auth-content{position:relative;z-index:1}
.home-header{padding-top:25px}.home-header h1,.app-header h2{color:#263b50;letter-spacing:-.7px}
.profile-orb{background:linear-gradient(145deg,#e79eb4,#ba7e9d);box-shadow:0 8px 18px rgba(126,94,126,.22);border:2px solid rgba(255,255,255,.78)}
.companion-card,.weather-widget,.quick-actions button,.home-note,.user-item,.contact-row,.diary-entry,.memory-card,.memory-composer textarea,.setting-row,.chat-search,.mood-picker button,.message-composer,.auth-card{background:var(--glass);border-color:var(--glass-line);box-shadow:0 12px 28px rgba(79,104,128,.12);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.companion-card{background:linear-gradient(120deg,rgba(239,246,250,.86),rgba(217,232,238,.72));border-radius:24px;padding:15px 14px 13px}.companion-avatar{background:linear-gradient(145deg,#88b9be,#7188b6);border-radius:17px;box-shadow:inset 0 1px rgba(255,255,255,.65)}.companion-copy strong{color:#31485e}.companion-copy small{color:#6b8192}.check-in-button{background:rgba(255,255,255,.76);color:#587493;border:1px solid rgba(255,255,255,.9)}.check-in-button.done{background:#719db0;color:#fff}.companion-progress{background:rgba(155,182,201,.35)}.companion-progress span{background:linear-gradient(90deg,#7ea9c1,#9c8fc2)}
.weather-widget{background:linear-gradient(120deg,rgba(210,225,235,.8),rgba(235,226,236,.74));border-radius:24px}.weather-widget strong{color:#2f4960}.weather-widget small{color:#6f8191}.weather-icon{color:#f0b4c0;text-shadow:0 2px 6px rgba(150,101,124,.18)}
.section-title{margin-top:24px;color:#3a5065}.app-grid{gap:18px 12px}.app-icon{color:#354c61}.app-icon span{border-radius:20px;color:#fff;border:1px solid rgba(255,255,255,.78);box-shadow:0 10px 20px rgba(71,93,113,.16);background:linear-gradient(145deg,#8bb6c4,#758fae)}.app-icon:nth-child(2) span{background:linear-gradient(145deg,#d4a9b5,#a89bc9)}.app-icon:nth-child(3) span{background:linear-gradient(145deg,#e5c4a5,#cb9c9f)}.app-icon:nth-child(4) span{background:linear-gradient(145deg,#a4b6d7,#8e8fc3)}.app-icon:nth-child(5) span{background:linear-gradient(145deg,#9bc6b8,#83a4b4)}.app-icon:nth-child(6) span{background:linear-gradient(145deg,#a6b4c3,#7c8d9e)}
.quick-actions{gap:10px;margin-top:22px}.quick-actions button{border-radius:20px;padding:13px 12px}.quick-actions span{color:#bd809f}.home-note{border-radius:20px}
 .dock{left:16px;right:16px;bottom:24px;height:68px;border-radius:26px;background:rgba(238,246,250,.72);border-color:rgba(255,255,255,.9);box-shadow:0 12px 30px rgba(67,91,110,.18);pointer-events:none}.dock-icon{width:44px;height:44px;border-radius:16px;background:rgba(255,255,255,.78);color:#6f8797;border:1px solid rgba(255,255,255,.86);pointer-events:auto}
.app-header{padding-top:22px}.back-button,.header-action{color:#6c8192}.chat-filters button.active{background:rgba(213,231,238,.86);color:#486a83}.chat-search{border-radius:18px}.user-item,.contact-row{border-radius:20px}.user-item:hover,.user-item.selected,.contact-row:hover{background:rgba(224,239,243,.84);border-color:rgba(255,255,255,.9)}.avatar{border-radius:16px;background:linear-gradient(145deg,#86b6c1,#8292ba)!important;border:1px solid rgba(255,255,255,.75)}.presence-dot{background:#62c2a3;box-shadow:0 0 0 3px rgba(98,194,163,.15)}
.unread-badge{min-width:17px;height:17px;padding:0 5px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;background:#e98fa7;color:#fff;font-size:8px;font-weight:700;line-height:1}.date-divider{display:flex;align-items:center;gap:8px;margin:15px 0 9px;color:#91a1ad;font-size:9px}.date-divider:before,.date-divider:after{content:'';height:1px;flex:1;background:rgba(170,191,205,.42)}.date-divider span{padding:3px 8px;border-radius:9px;background:rgba(255,255,255,.55)}
.conversation-modal{background:linear-gradient(180deg,#eaf4f8 0%,#f5f8fa 100%);grid-template-rows:70px 34px minmax(0,1fr) auto}.conversation-header{border-bottom-color:rgba(170,191,205,.45);background:rgba(245,250,253,.94);backdrop-filter:blur(16px);padding:10px 13px 10px 9px}.conversation-identity{display:flex;align-items:center;gap:9px;min-width:0}.conversation-identity>div:last-child{min-width:0}.conversation-header h2{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-header p{display:flex;align-items:center;gap:5px}.conversation-header p:before{content:'';width:6px;height:6px;border-radius:50%;background:#52c49b;box-shadow:0 0 0 3px rgba(82,196,155,.13)}.conversation-tools{display:flex;align-items:center;gap:3px;margin-left:auto}.conversation-tool{width:34px;height:34px;border-radius:12px;background:rgba(255,255,255,.72);color:#688196;font-size:18px;line-height:1}.conversation-tool:hover{background:#fff;transform:translateY(-1px)}.conversation-tool.danger-button{color:#b47482}.conversation-banner{display:flex;align-items:center;justify-content:center;gap:7px;color:#788c9d;font-size:9px;letter-spacing:.1px}.conversation-banner .presence-dot{width:6px;height:6px}.message-list{padding:12px 15px 18px;overflow-y:auto;scrollbar-width:none}.message-list::-webkit-scrollbar{display:none}.message-row{display:flex;align-items:flex-end;gap:8px;margin:12px 0}.message-row.mine{flex-direction:row-reverse;justify-content:flex-start}.message-avatar{width:30px;height:30px;flex:none;border-radius:11px;display:grid;place-items:center;background:linear-gradient(145deg,#9ab8c6,#8e9bc3);border:1px solid rgba(255,255,255,.86);color:#fff;font-weight:700;font-size:11px;box-shadow:0 5px 12px rgba(82,108,127,.13)}.message-avatar.mine-avatar{background:linear-gradient(145deg,#dca3b5,#aa8fb8)}.message-content{display:grid;gap:4px;max-width:78%;min-width:0}.mine .message-content{justify-items:end}.message-author{font-size:9px;color:#8295a4;padding:0 3px}.mine .message-author{color:#8c8ba9}.bubble{max-width:100%;padding:10px 12px;background:rgba(255,255,255,.84);border:1px solid rgba(255,255,255,.86);border-radius:7px 17px 17px 17px;box-shadow:0 7px 18px rgba(93,119,138,.09);font-size:12px;line-height:1.65;white-space:pre-wrap;word-break:break-word}.mine .bubble{background:linear-gradient(145deg,#7ca8b9,#788db5);border-color:transparent;color:#fff;border-radius:17px 7px 17px 17px}.bubble time{display:block;font-size:8px;opacity:.62;margin-top:4px}.message-composer{display:flex;align-items:flex-end;gap:6px;min-height:72px;padding:10px 11px calc(12px + env(safe-area-inset-bottom));border-top-color:rgba(170,191,205,.5);background:rgba(244,249,252,.96)}.compose-tool{width:34px;height:34px;flex:none;border-radius:12px;background:rgba(255,255,255,.82);color:#71899a;font-size:20px;line-height:1}.compose-tool:hover{background:#fff;transform:translateY(-1px)}.spark-tool{color:#9a83b3}.message-input-shell{flex:1;min-width:0;border:1px solid rgba(185,203,214,.7);border-radius:17px;background:rgba(255,255,255,.9);padding:7px 10px}.message-composer textarea{display:block;width:100%;min-height:19px;max-height:84px;resize:none;border:0;outline:0;background:transparent;color:var(--ink);font-size:12px;line-height:1.55;padding:0}.message-composer textarea::placeholder{color:#91a1ae}.send-button{width:34px;height:34px;flex:none;background:#607c9a;color:#fff;border-radius:13px;font-size:18px;line-height:1;padding:0}.send-button:disabled{opacity:.35}
.mood-picker button{border-radius:16px}.mood-picker button.selected{background:rgba(213,231,238,.9);outline-color:#789cb6}.diary-entry,.memory-card{border-radius:20px}.memory-entry{background:rgba(229,240,241,.76);border-color:rgba(255,255,255,.8);border-radius:17px}.timeline-line{border-left-color:#a9c3cb}.photo-add{background:#718fa8;border-radius:15px}.photo-tile{border-radius:18px;box-shadow:0 8px 18px rgba(71,93,113,.13)}.setting-row{border-radius:18px}.danger-row{color:#b66f7d}.toast{background:#30485d;border:1px solid rgba(255,255,255,.25);box-shadow:0 12px 24px rgba(37,55,72,.22)}
.auth-screen{background:linear-gradient(150deg,#dce9f1 0%,#f1edf3 100%)}.auth-content h1{color:#293f54}.auth-card{border-radius:25px}.app-logo{background:linear-gradient(145deg,#7daabd,#aa8eb7);border-radius:21px}.primary-button{background:linear-gradient(145deg,#6f9bb0,#7f86b2);border-radius:16px;box-shadow:0 10px 18px rgba(86,112,139,.18)}.primary-button:hover{background:linear-gradient(145deg,#628da5,#716fa5)}
.night-mode .phone-screen{background:linear-gradient(150deg,#202f3e 0%,#1b2938 52%,#332d3c 100%)}.night-mode .phone-screen:after{background:linear-gradient(180deg,rgba(20,30,42,.2),rgba(13,21,31,.4))}.night-mode .phone-view,.night-mode .conversation-modal{color:#e7eef4}.night-mode .home-header h1,.night-mode .app-header h2,.night-mode .section-title,.night-mode .app-icon,.night-mode .companion-copy strong,.night-mode .weather-widget strong{color:#eef5f8}.night-mode .companion-card,.night-mode .weather-widget,.night-mode .quick-actions button,.night-mode .home-note,.night-mode .user-item,.night-mode .contact-row,.night-mode .diary-entry,.night-mode .memory-card,.night-mode .setting-row,.night-mode .chat-search,.night-mode .mood-picker button,.night-mode .message-composer,.night-mode .auth-card{background:rgba(38,52,67,.76);border-color:rgba(168,193,209,.2)}.night-mode .dock{background:rgba(32,47,62,.8);border-color:rgba(200,219,231,.2)}.night-mode .dock-icon{background:rgba(71,91,111,.72);color:#d7e7ef}.night-mode .message-composer input,.night-mode .message-input-shell{background:rgba(33,46,61,.8);color:var(--ink);border-color:rgba(168,193,209,.28)}.night-mode .message-composer textarea{color:#edf4f8}.night-mode .conversation-tool,.night-mode .compose-tool{background:rgba(71,91,111,.72);color:#d7e7ef}
.conversation-modal.has-contact-wallpaper{background-image:linear-gradient(180deg,rgba(236,246,250,.78),rgba(246,249,250,.9)),var(--contact-wallpaper);background-position:center;background-size:cover;background-repeat:no-repeat}
.conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper){background-image:linear-gradient(180deg,rgba(236,246,250,.78),rgba(246,249,250,.9)),var(--qixi-chat-wallpaper);background-position:center;background-size:cover;background-repeat:no-repeat}
.conversation-modal.has-contact-wallpaper .message-list{background:rgba(245,249,251,.22)}
.conversation-modal.has-contact-wallpaper .conversation-header,.conversation-modal.has-contact-wallpaper .message-composer{backdrop-filter:blur(18px)}
.night-mode .conversation-modal.has-contact-wallpaper{background-image:linear-gradient(180deg,rgba(25,37,49,.78),rgba(25,35,47,.9)),var(--contact-wallpaper)}
.night-mode .conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper){background-image:linear-gradient(180deg,rgba(25,37,49,.78),rgba(25,35,47,.9)),var(--qixi-chat-wallpaper)}
.night-mode .conversation-modal.has-contact-wallpaper .message-list{background:rgba(22,31,42,.3)}
@media(max-width:380px){.phone-view{padding-left:15px;padding-right:15px}.app-grid{gap:15px 7px}.app-icon span{width:52px;height:52px}.app-icon small{font-size:9px}.quick-actions button{padding-left:9px;padding-right:9px}.dock{left:12px;right:12px}}
.message-composer{position:relative;display:grid;grid-template-rows:auto auto;gap:8px;min-height:104px;padding:10px 12px calc(12px + env(safe-area-inset-bottom));align-items:stretch}
.composer-main-row{display:flex;align-items:center;gap:8px;min-width:0}
.message-input-shell{min-height:38px;display:flex;align-items:center;border-radius:18px;padding:8px 12px;background:rgba(255,255,255,.94);border:1px solid rgba(173,196,209,.7);box-shadow:inset 0 1px 0 rgba(255,255,255,.85);transition:border-color .2s,box-shadow .2s}
.message-input-shell:focus-within{border-color:#82a9bd;box-shadow:0 0 0 3px rgba(126,168,191,.14),inset 0 1px 0 rgba(255,255,255,.85)}
.message-composer textarea{min-height:20px;max-height:86px;line-height:1.5}
.composer-tools{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:0 2px}
.compose-tool{width:32px;height:32px;border-radius:11px;display:grid;place-items:center;background:transparent;color:#71899a;font-size:18px;line-height:1;transition:background .2s,color .2s,transform .2s}
.compose-tool:hover,.compose-tool:focus-visible{background:rgba(219,233,240,.76);color:#4f738e;transform:translateY(-1px)}
.compose-tool svg{width:18px;height:18px;stroke-width:1.85}
.spark-tool{color:#9a83b3}
.send-button{width:36px;height:36px;display:grid;place-items:center;padding:0;border-radius:13px;background:linear-gradient(145deg,#6689a7,#617795);box-shadow:0 6px 12px rgba(73,103,130,.2);transition:transform .2s,filter .2s}
.send-button:hover:not(:disabled){filter:brightness(1.06);transform:translateY(-1px)}
.send-button svg{width:18px;height:18px;stroke-width:2}
.emoji-panel{position:absolute;right:52px;bottom:101px;z-index:35;display:grid;grid-template-columns:repeat(4,34px);gap:5px;padding:8px;border:1px solid rgba(255,255,255,.88);border-radius:15px;background:rgba(248,252,254,.96);box-shadow:0 12px 28px rgba(52,77,96,.2);backdrop-filter:blur(14px)}
.emoji-panel[hidden]{display:none}
.emoji-panel button{width:34px;height:30px;border-radius:9px;background:transparent;font-size:17px;line-height:1}
.emoji-panel button:hover,.emoji-panel button:focus-visible{background:#e4eef3}
.night-mode .message-input-shell{background:rgba(33,46,61,.82);border-color:rgba(168,193,209,.3)}
.night-mode .compose-tool{color:#d7e7ef}.night-mode .compose-tool:hover{background:rgba(71,91,111,.72)}
.night-mode .emoji-panel{background:rgba(35,50,65,.97);border-color:rgba(168,193,209,.28)}
@media(max-width:380px){.message-composer{min-height:108px;padding-left:10px;padding-right:10px}.composer-tools{gap:2px}.compose-tool{width:30px;height:30px}.compose-tool svg{width:17px;height:17px}.message-input-shell{padding-left:11px;padding-right:11px}.send-button{width:34px;height:34px}}
.entry-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.entry-delete{width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.48);color:#879aaa;font-size:16px;line-height:1}.entry-delete:hover{background:rgba(189,111,125,.14);color:#b66f7d}
.background-setting{width:100%;margin-top:2px}.background-upload{display:inline-flex;align-items:center;justify-content:center;min-width:48px;padding:6px 10px;border-radius:12px;background:rgba(112,150,171,.16);color:#587493;font-size:10px;cursor:pointer}.background-upload:hover{background:rgba(112,150,171,.28)}.background-preview{min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 11px;border:1px solid rgba(255,255,255,.72);border-radius:16px;background:rgba(226,237,242,.68);background-size:cover;background-position:center;color:#567086;overflow:hidden}.background-preview span{font-size:10px;font-weight:600;text-shadow:0 1px rgba(255,255,255,.55)}.background-preview button{padding:6px 8px;border-radius:10px;background:rgba(255,255,255,.72);color:#607b91;font-size:9px;white-space:nowrap}.background-preview.has-image{color:#fff}.background-preview.has-image span{text-shadow:0 1px 4px rgba(0,0,0,.4)}.background-preview.has-image button{background:rgba(255,255,255,.82)}.night-mode .background-preview{background-color:rgba(38,52,67,.78);border-color:rgba(168,193,209,.2);color:#d9e8ef}.night-mode .background-upload{background:rgba(126,165,189,.2);color:#c5dce7}
.message-composer{position:relative;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-areas:'input input input input input send' 'voice attach emoji quick . .';gap:8px;min-height:108px;padding:10px 12px calc(12px + env(safe-area-inset-bottom));align-items:center}
.message-input-shell{grid-area:input;min-height:38px;display:flex;align-items:center;border-radius:18px;padding:8px 12px;background:rgba(255,255,255,.94);border:1px solid rgba(173,196,209,.7);box-shadow:inset 0 1px 0 rgba(255,255,255,.85);transition:border-color .2s,box-shadow .2s}
.message-input-shell:focus-within{border-color:#82a9bd;box-shadow:0 0 0 3px rgba(126,168,191,.14),inset 0 1px 0 rgba(255,255,255,.85)}
.message-composer textarea{display:block;width:100%;min-height:20px;max-height:86px;resize:none;border:0;outline:0;background:transparent;color:var(--ink);font-size:12px;line-height:1.5;padding:0}
.message-composer textarea::placeholder{color:#91a1ae}
#voice-message{grid-area:voice}#attach-message{grid-area:attach}#emoji-message{grid-area:emoji}#quick-message{grid-area:quick}
.compose-tool{width:32px;height:32px;justify-self:center;border-radius:11px;display:grid;place-items:center;background:transparent;color:#71899a;font-size:18px;line-height:1;transition:background .2s,color .2s,transform .2s}
.compose-tool:hover,.compose-tool:focus-visible{background:rgba(219,233,240,.76);color:#4f738e;transform:translateY(-1px)}
.send-button{grid-area:send;width:36px;height:36px;justify-self:end;display:grid;place-items:center;padding:0;border-radius:13px;background:linear-gradient(145deg,#6689a7,#617795);box-shadow:0 6px 12px rgba(73,103,130,.2);font-size:18px;line-height:1}
.send-button:hover:not(:disabled){filter:brightness(1.06);transform:translateY(-1px)}
.night-mode .message-input-shell{background:rgba(33,46,61,.82);border-color:rgba(168,193,209,.3)}.night-mode .compose-tool{color:#d7e7ef}.night-mode .compose-tool:hover{background:rgba(71,91,111,.72)}
@media(max-width:380px){.message-composer{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding-left:10px;padding-right:10px}.compose-tool{width:30px;height:30px}.message-input-shell{padding-left:11px;padding-right:11px}.send-button{width:34px;height:34px}}

/* QQ/WeChat-inspired message grouping and touch actions. */
.message-time{display:none;justify-self:center;margin:1px 0 1px;color:#8b9ba8;font-size:8px;line-height:1.2;font-variant-numeric:tabular-nums;letter-spacing:.1px}
.message-time.is-visible{display:block}
.mine .message-time{color:#8b8ca8}
.message-context-menu{position:absolute;top:50px;left:50%;z-index:40;display:none;grid-template-columns:repeat(3,minmax(0,1fr));width:min(252px,calc(100% - 24px));padding:8px;border:1px solid rgba(255,255,255,.62);border-radius:16px;background:rgba(36,52,70,.96);box-shadow:0 18px 40px rgba(31,47,61,.3);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);transform:translateX(-50%);animation:message-menu-in .16s ease-out}
.message-context-menu.open{display:grid}
.message-context-menu button{display:grid;place-items:center;gap:4px;min-height:54px;padding:7px 3px;border-radius:11px;background:transparent;color:#edf5f8;font-size:9px;line-height:1.2;transition:background .16s,color .16s,transform .16s}
.message-context-menu button:hover,.message-context-menu button:focus-visible{background:rgba(255,255,255,.13);color:#fff;transform:translateY(-1px)}
.message-context-menu button[data-message-action="delete"]{color:#f0a4ae}
.message-context-menu button span{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:rgba(255,255,255,.12);font-size:14px;line-height:1}
.message-context-menu button[data-message-action="delete"] span{background:rgba(240,164,174,.16)}
.message-popover{position:absolute;z-index:35;display:none;border:1px solid rgba(255,255,255,.76);border-radius:17px;background:rgba(248,252,254,.94);box-shadow:0 15px 32px rgba(68,93,111,.2);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);animation:message-menu-in .16s ease-out}
.message-popover.open{display:grid}
.attach-popover{left:12px;bottom:112px;grid-template-columns:repeat(4,minmax(48px,1fr));gap:4px;padding:7px}
.message-popover button{border:0;cursor:pointer}
.attach-popover button{display:grid;place-items:center;gap:4px;min-height:54px;padding:6px 4px;border-radius:11px;background:transparent;color:#60798b;font-size:9px;line-height:1.2}
.attach-popover button:hover,.attach-popover button:focus-visible{background:rgba(211,230,238,.72);color:#45687f}
.attach-popover button span{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:rgba(116,158,179,.14);color:#638ba1;font-size:15px}
.emoji-popover{right:12px;bottom:112px;grid-template-columns:repeat(4,38px);gap:4px;padding:7px}
.emoji-popover button{width:38px;height:36px;border-radius:10px;background:transparent;font-size:19px;line-height:1}
.emoji-popover button:hover,.emoji-popover button:focus-visible{background:rgba(211,230,238,.72);transform:scale(1.06)}
.message-row{position:relative;transition:opacity .18s,transform .18s}
.message-row.multi-selected{transform:translateX(3px);opacity:1}
.message-row.multi-selected:after{content:'✓';position:absolute;left:-3px;top:50%;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#668da6;color:#fff;font-size:11px;font-weight:700;box-shadow:0 3px 8px rgba(72,105,127,.24);transform:translate(-100%,-50%)}
.message-row.mine.multi-selected:after{left:auto;right:-3px;transform:translate(100%,-50%)}
.multi-select-mode .message-row{cursor:pointer}
#voice-message.recording{background:rgba(228,147,163,.2);color:#c46d82;animation:recording-pulse 1.1s ease-in-out infinite}
.night-mode .message-context-menu{background:rgba(26,38,52,.97);border-color:rgba(168,193,209,.2);box-shadow:0 18px 40px rgba(0,0,0,.42)}
.night-mode .message-popover{background:rgba(35,49,64,.96);border-color:rgba(168,193,209,.22)}
.night-mode .attach-popover button,.night-mode .emoji-popover button{color:#d7e7ef}
.night-mode .attach-popover button:hover,.night-mode .attach-popover button:focus-visible,.night-mode .emoji-popover button:hover,.night-mode .emoji-popover button:focus-visible{background:rgba(112,145,164,.28);color:#fff}
.night-mode .message-time{color:#9eb1bc}
@keyframes message-menu-in{from{opacity:0;transform:translateX(-50%) translateY(5px) scale(.98)}to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}
@keyframes recording-pulse{0%,100%{box-shadow:0 0 0 0 rgba(205,108,131,.12)}50%{box-shadow:0 0 0 6px rgba(205,108,131,.08)}}
@media(max-width:380px){.message-context-menu{width:calc(100% - 18px);padding:6px}.message-context-menu button{min-height:50px;font-size:8px}.message-context-menu button span{width:24px;height:24px;font-size:13px}.attach-popover{left:9px;right:9px;grid-template-columns:repeat(4,minmax(0,1fr));bottom:108px}.emoji-popover{right:9px;bottom:108px;grid-template-columns:repeat(4,34px)}.emoji-popover button{width:34px;height:33px;font-size:17px}}
.message-popover,.message-context-menu{position:absolute;z-index:31;display:none;border:1px solid rgba(255,255,255,.9);border-radius:15px;background:rgba(248,252,254,.97);box-shadow:0 12px 28px rgba(52,77,96,.2);backdrop-filter:blur(14px)}
.message-popover.open,.message-context-menu.open{display:grid}
.message-popover{padding:8px;gap:5px}.message-popover button,.message-context-menu button{border-radius:9px;background:transparent;color:#536e83;font-size:11px;padding:7px 8px;white-space:nowrap}.message-popover button:hover,.message-context-menu button:hover{background:#e4eef3}
.attach-popover{left:13px;bottom:104px;grid-template-columns:repeat(4,auto)}.emoji-popover{right:46px;bottom:104px;grid-template-columns:repeat(4,32px)}.emoji-popover button{width:32px;height:29px;padding:0;font-size:17px}
.message-context-menu{right:12px;bottom:105px;grid-template-columns:repeat(3,auto);padding:7px}.message-context-menu button{display:grid;gap:3px;justify-items:center;min-width:46px;font-size:9px}.message-context-menu button span{font-size:15px}
.night-mode .message-popover,.night-mode .message-context-menu{background:rgba(35,50,65,.97);border-color:rgba(168,193,209,.28)}.night-mode .message-popover button,.night-mode .message-context-menu button{color:#d7e7ef}.night-mode .message-popover button:hover,.night-mode .message-context-menu button:hover{background:rgba(71,91,111,.72)}

/* Keep the action surfaces centered and anchored to the phone screen. */
.message-context-menu{left:50%;right:auto;top:50px;bottom:auto;width:min(252px,calc(100% - 24px));padding:8px;grid-template-columns:repeat(3,minmax(0,1fr));z-index:40;background:rgba(36,52,70,.96);border-color:rgba(255,255,255,.62);border-radius:16px;box-shadow:0 18px 40px rgba(31,47,61,.3);transform:translateX(-50%);animation:message-menu-in .16s ease-out}
.message-context-menu button{min-width:0;min-height:54px;padding:7px 3px;color:#edf5f8;font-size:9px;line-height:1.2}
.message-context-menu button span{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:rgba(255,255,255,.12);font-size:14px;line-height:1}
.message-popover{z-index:35;background:rgba(248,252,254,.94);border-color:rgba(255,255,255,.76);border-radius:17px;box-shadow:0 15px 32px rgba(68,93,111,.2);animation:message-menu-in .16s ease-out}
.attach-popover{left:12px;right:auto;bottom:112px;grid-template-columns:repeat(4,minmax(48px,1fr));gap:4px;padding:7px}
.attach-popover button{min-height:54px;padding:6px 4px;font-size:9px}
.emoji-popover{left:auto;right:12px;bottom:112px;grid-template-columns:repeat(4,38px);gap:4px;padding:7px}
.emoji-popover button{width:38px;height:36px;padding:0;font-size:19px}
@media(max-width:380px){.message-context-menu{width:calc(100% - 18px);padding:6px}.attach-popover{left:9px;right:9px;bottom:108px}.emoji-popover{right:9px;bottom:108px;grid-template-columns:repeat(4,34px)}.emoji-popover button{width:34px;height:33px;font-size:17px}}

/* The menu is a sibling of the conversation modal, so anchor it to the phone screen itself. */
#phone-screen #message-context-menu.message-context-menu{
  left:50%;
  right:auto;
  top:50px;
  bottom:auto;
  width:min(252px,calc(100% - 24px));
  transform:translateX(-50%);
}
@media(max-width:380px){#phone-screen #message-context-menu.message-context-menu{width:calc(100% - 18px)}}
.message-author{display:none}.message-content{gap:0}.message-row{margin:10px 0;gap:9px}.message-avatar{width:36px;height:36px;border-radius:11px;font-size:11px}.conversation-identity .avatar{width:34px;height:34px;border-radius:11px;font-size:12px}.bubble{min-height:36px;padding:7px 11px;line-height:1.45}.bubble time{margin-top:2px;font-size:7px}.bubble.image-bubble{min-height:0}
.contact-settings-panel{position:absolute;top:56px;right:10px;z-index:32;width:176px;display:none;padding:7px;border:1px solid rgba(255,255,255,.9);border-radius:15px;background:rgba(248,252,254,.97);box-shadow:0 14px 30px rgba(52,77,96,.2);backdrop-filter:blur(16px)}
.contact-settings-panel.open{display:grid;gap:2px}.contact-settings-title{padding:7px 9px 6px;color:#8295a4;font-size:9px}.contact-settings-panel button{display:grid;grid-template-columns:17px 1fr auto;align-items:center;gap:7px;padding:8px 9px;border-radius:10px;background:transparent;color:#536e83;text-align:left;font-size:10px}.contact-settings-panel button:hover,.contact-settings-panel button.active{background:#e4eef3}.contact-settings-panel button svg{width:15px;height:15px}.contact-settings-panel button b{font-size:8px;color:#6ca68f;font-weight:600}.night-mode .contact-settings-panel{background:rgba(35,50,65,.97);border-color:rgba(168,193,209,.28)}.night-mode .contact-settings-panel button{color:#d7e7ef}.night-mode .contact-settings-panel button:hover,.night-mode .contact-settings-panel button.active{background:rgba(71,91,111,.72)}
.entry-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.entry-delete{width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.48);color:#879aaa;font-size:16px;line-height:1}.entry-delete:hover{background:rgba(189,111,125,.14);color:#b66f7d}
.contact-settings-view{position:absolute;inset:0;z-index:40;display:none;overflow-y:auto;background:#f2f6f8;color:#30445a;scrollbar-width:none}.contact-settings-view::-webkit-scrollbar{display:none}.contact-settings-view.open{display:block}
.contact-settings-header{height:62px;display:grid;grid-template-columns:38px 1fr 38px;align-items:center;padding:10px 13px 8px;background:rgba(248,251,253,.96);border-bottom:1px solid rgba(174,195,207,.38);position:sticky;top:0;z-index:2;backdrop-filter:blur(16px)}.contact-settings-header h2{margin:0;text-align:center;font-size:15px;font-weight:700}.contact-settings-header-spacer{width:38px}.contact-settings-back{width:34px;height:34px;display:grid;place-items:center;border-radius:12px;background:transparent;color:#617c91}.contact-settings-back:hover{background:#e5eef3}.contact-settings-back svg{width:20px;height:20px}
.contact-settings-body{padding:12px 12px 36px}.contact-settings-profile,.contact-settings-group{width:100%;border:1px solid rgba(206,220,228,.72);background:rgba(255,255,255,.88);box-shadow:0 8px 18px rgba(74,100,118,.08);border-radius:14px;overflow:hidden}.contact-settings-profile{display:flex;align-items:center;gap:11px;padding:14px 13px;text-align:left}.contact-settings-avatar{width:42px;height:42px;display:grid;place-items:center;flex:none;border-radius:13px;background:linear-gradient(145deg,#86b6c1,#8292ba);color:#fff;font-weight:700;font-size:16px;border:1px solid rgba(255,255,255,.9)}.contact-settings-profile-copy{display:grid;gap:4px;min-width:0;flex:1}.contact-settings-profile-copy strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.contact-settings-profile-copy small{font-size:10px;color:#8295a4}.contact-settings-profile>svg{width:17px;color:#9aabb6}
.contact-settings-group{margin-top:11px}.contact-settings-row{min-height:45px;width:100%;display:flex;align-items:center;gap:9px;padding:0 13px;background:transparent;color:#40586b;text-align:left;font-size:11px;position:relative}.contact-settings-row+.contact-settings-row{border-top:1px solid rgba(218,228,234,.72)}.contact-settings-row:hover{background:#f1f6f8}.contact-settings-row>span:first-child{flex:1}.contact-settings-row .row-icon{width:23px;height:23px;display:grid;place-items:center;border-radius:8px;background:#e8f0f3;color:#68879a;flex:0 0 23px}.contact-settings-row .row-icon svg{width:14px;height:14px}.row-arrow{width:16px;height:16px;color:#a0b0ba;flex:none}.row-detail{margin-left:auto;color:#93a4ae;font-size:10px}.contact-settings-toggle{width:34px;height:20px;flex:none;border-radius:11px;background:#d7e1e6;padding:2px;transition:background .2s}.contact-settings-toggle i{display:block;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(50,72,86,.2);transition:transform .2s}.contact-settings-row.is-on .contact-settings-toggle{background:#6f9db5}.contact-settings-row.is-on .contact-settings-toggle i{transform:translateX(14px)}.contact-settings-danger .contact-settings-row{color:#b77984}.contact-settings-report{display:block;width:100%;margin-top:19px;background:transparent;color:#6d91a7;font-size:10px;text-align:center;padding:8px}.contact-settings-report:hover{text-decoration:underline}
.night-mode .contact-settings-view{background:#202f3e;color:#e7eef4}.night-mode .contact-settings-header{background:rgba(31,46,60,.96);border-color:rgba(168,193,209,.2)}.night-mode .contact-settings-header h2,.night-mode .contact-settings-row{color:#e7eef4}.night-mode .contact-settings-profile,.night-mode .contact-settings-group{background:rgba(38,52,67,.9);border-color:rgba(168,193,209,.2)}.night-mode .contact-settings-row+.contact-settings-row{border-color:rgba(168,193,209,.14)}.night-mode .contact-settings-row:hover{background:rgba(71,91,111,.55)}.night-mode .contact-settings-profile-copy small,.night-mode .row-detail{color:#a5b8c5}.night-mode .contact-settings-row .row-icon{background:rgba(126,165,189,.18);color:#c5dce7}

/* Lucide icon system: one visual language for every action and navigation control. */
[data-lucide],svg.lucide{width:1em;height:1em;display:block;flex:none;stroke-width:1.8;stroke:currentColor}
.app-icon span,.dock-icon,.companion-avatar,.weather-icon,.quick-actions button>span,.quick-actions button>i,.photo-empty>span{display:grid;place-items:center}
.app-icon span svg{width:27px;height:27px}.dock-icon svg{width:19px;height:19px}.companion-avatar svg{width:22px;height:22px}.weather-icon svg{width:39px;height:39px;stroke-width:1.5}
.quick-actions button>span svg{width:19px;height:19px}.quick-actions button>i svg{width:14px;height:14px}.photo-empty>span svg{width:42px;height:42px;stroke-width:1.5}
.app-header .back-button svg{width:19px;height:19px}.header-action svg{width:18px;height:18px}.chat-search>span svg{width:15px;height:15px}.conversation-tool svg{width:17px;height:17px}
.primary-button>span,.photo-add,.background-upload{display:inline-flex;align-items:center;gap:5px}.primary-button>span svg{width:15px;height:15px}.photo-add svg,.background-upload svg{width:14px;height:14px}
.setting-row>span,.setting-row>span>i,.setting-row>span svg{display:inline-flex;align-items:center}.setting-row>span>svg,.setting-row>span>i svg{width:16px;height:16px}.setting-row>span>i{font-style:normal}
.message-composer .compose-tool svg{width:18px;height:18px}.send-button svg{width:18px;height:18px}.message-popover button span svg,.message-context-menu button span svg{width:15px;height:15px}.message-popover button span,.message-context-menu button span{display:grid;place-items:center}
.message-context-menu button span svg{stroke-width:1.9}.empty-state>span svg{width:25px;height:25px}
.entry-delete svg,.photo-tile button svg{width:14px;height:14px}
.contact-settings-row>span.row-icon:first-child{flex:0 0 23px!important;width:23px!important}
.contact-search-view{position:absolute;inset:0;z-index:45;display:none;overflow-y:auto;background:#f9fbfd;color:#30445a;scrollbar-width:none}.contact-search-view::-webkit-scrollbar{display:none}.contact-search-view.open{display:block}
.contact-search-header{height:62px;display:grid;grid-template-columns:38px 1fr 38px;align-items:center;padding:10px 13px 8px;background:rgba(255,255,255,.97);border-bottom:1px solid rgba(174,195,207,.32);position:sticky;top:0;z-index:2;backdrop-filter:blur(16px)}.contact-search-header h2{margin:0;text-align:center;font-size:15px;font-weight:700}.contact-search-back,.contact-search-filter{width:34px;height:34px;display:grid;place-items:center;border-radius:12px;background:transparent;color:#617c91}.contact-search-back:hover,.contact-search-filter:hover{background:#eaf2f6}.contact-search-back svg,.contact-search-filter svg{width:19px;height:19px}.contact-search-body{padding:18px 16px 38px}.contact-search-input{height:46px;display:flex;align-items:center;gap:10px;padding:0 13px;border-radius:15px;background:#f1f4fa;color:#94a2b0;box-shadow:inset 0 1px 2px rgba(80,104,121,.04)}.contact-search-input>svg{width:21px;height:21px;stroke-width:1.7}.contact-search-input input{width:100%;height:100%;border:0;outline:0;background:transparent;color:#40586b;font-size:14px}.contact-search-input input::placeholder{color:#a1aab6}.contact-search-clear{width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:rgba(122,145,161,.12);color:#78909e}.contact-search-clear[hidden]{display:none}.contact-search-clear svg{width:14px;height:14px}.contact-search-hint{margin:42px 0 25px;text-align:center;color:#9ba4af;font-size:15px}.contact-search-category-grid{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid rgba(182,194,204,.32);border-left:1px solid rgba(182,194,204,.32);border-radius:2px;overflow:hidden}.contact-search-category-grid button{min-height:72px;display:grid;place-items:center;align-content:center;gap:7px;border:0;border-right:1px solid rgba(182,194,204,.32);border-bottom:1px solid rgba(182,194,204,.32);background:rgba(255,255,255,.64);color:#5d82b0;font-size:12px;transition:background .2s,color .2s}.contact-search-category-grid button:hover,.contact-search-category-grid button:focus-visible,.contact-search-category-grid button.active{background:#edf4fb;color:#4f80b5}.contact-search-category-grid button svg{width:22px;height:22px;stroke-width:1.6}.contact-search-results{margin-top:22px}.contact-search-result-count{margin:0 3px 8px;color:#9aa8b4;font-size:10px}.contact-search-result{width:100%;display:flex;align-items:center;gap:10px;padding:11px 4px;border-bottom:1px solid rgba(188,202,211,.35);background:transparent;color:#40586b;text-align:left}.contact-search-result:hover{background:rgba(237,244,249,.75)}.contact-search-result-icon{width:31px;height:31px;display:grid;place-items:center;flex:none;border-radius:10px;background:#edf3f6;color:#7893a6}.contact-search-result-icon svg{width:16px;height:16px}.contact-search-result-copy{display:grid;gap:5px;min-width:0;flex:1}.contact-search-result-copy strong{display:flex;align-items:center;gap:8px;font-size:11px}.contact-search-result-copy strong time{font-size:9px;color:#9aa9b4;font-weight:400}.contact-search-result-copy>span{overflow:hidden;color:#738694;font-size:10px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.contact-search-result-copy mark{padding:1px 2px;border-radius:3px;background:#ffe8a8;color:#556b7b}.contact-search-result-arrow{width:15px;height:15px;flex:none;color:#a2b0b9}.contact-search-empty,.contact-search-loading{display:grid;justify-items:center;gap:9px;padding:38px 12px;color:#9aa8b4;text-align:center}.contact-search-empty svg,.contact-search-loading svg{width:27px;height:27px;color:#91adbe;stroke-width:1.5}.contact-search-empty strong{font-size:12px;color:#718797}.contact-search-empty span,.contact-search-loading span{font-size:10px}.contact-search-loading svg{animation:contact-search-spin .9s linear infinite}@keyframes contact-search-spin{to{transform:rotate(360deg)}}
.night-mode .contact-search-view{background:#202f3e;color:#e7eef4}.night-mode .contact-search-header{background:rgba(31,46,60,.97);border-color:rgba(168,193,209,.2)}.night-mode .contact-search-header h2,.night-mode .contact-search-result{color:#e7eef4}.night-mode .contact-search-back,.night-mode .contact-search-filter{color:#d7e7ef}.night-mode .contact-search-input{background:rgba(38,52,67,.9);color:#b6c8d2}.night-mode .contact-search-input input{color:#edf4f8}.night-mode .contact-search-category-grid{border-color:rgba(168,193,209,.22)}.night-mode .contact-search-category-grid button{background:rgba(38,52,67,.76);border-color:rgba(168,193,209,.18);color:#9dc1d9}.night-mode .contact-search-category-grid button:hover,.night-mode .contact-search-category-grid button.active{background:rgba(71,91,111,.72)}.night-mode .contact-search-result{border-color:rgba(168,193,209,.16)}.night-mode .contact-search-result:hover{background:rgba(71,91,111,.55)}.night-mode .contact-search-result-icon{background:rgba(126,165,189,.18);color:#c5dce7}.night-mode .contact-search-result-copy>span{color:#b2c1ca}.night-mode .contact-search-empty strong{color:#d5e5ed}
.demo-seed-tools{display:grid;gap:9px;margin-top:15px;padding:10px 11px;border:1px solid rgba(179,202,213,.62);border-radius:14px;background:rgba(235,244,247,.7);box-shadow:inset 0 1px 0 rgba(255,255,255,.85)}.demo-seed-tools[hidden]{display:none}.demo-seed-tools>div:first-child{display:grid;gap:3px}.demo-seed-tools strong{color:#587488;font-size:10px}.demo-seed-tools span{color:#8b9eaa;font-size:9px}.demo-seed-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.demo-seed-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:30px;padding:0 7px;border:0;border-radius:9px;background:#6d92a8;color:#fff;font-size:9px;font-weight:700}.demo-seed-button svg{width:13px;height:13px}.demo-seed-button.secondary{background:rgba(112,145,161,.14);color:#6b8798}.demo-seed-button:hover,.demo-seed-button:focus-visible{filter:brightness(.97);transform:translateY(-1px)}.night-mode .demo-seed-tools{border-color:rgba(168,193,209,.2);background:rgba(38,52,67,.78)}.night-mode .demo-seed-tools strong{color:#d7e7ef}.night-mode .demo-seed-tools span{color:#a5b8c5}.night-mode .demo-seed-button.secondary{background:rgba(126,165,189,.18);color:#c8dfe8}
.contact-search-category-grid{display:flex;gap:3px;overflow-x:auto;padding:0 0 2px;border:0;border-bottom:1px solid rgba(182,194,204,.35);border-radius:0;scrollbar-width:none}.contact-search-category-grid::-webkit-scrollbar{display:none}.contact-search-category-grid button{position:relative;flex:0 0 auto;min-height:44px;padding:0 11px;border:0;background:transparent;color:#26333f;font-size:12px;white-space:nowrap}.contact-search-category-grid button:hover,.contact-search-category-grid button:focus-visible,.contact-search-category-grid button.active{background:transparent;color:#4e91c4}.contact-search-category-grid button.active{font-weight:700}.contact-search-category-grid button.active::after{content:"";position:absolute;right:10px;bottom:-2px;left:10px;height:3px;border-radius:3px;background:#4c96cb}.date-mode .contact-search-input,.date-mode .contact-search-hint{display:none}.date-mode .contact-search-body{padding-top:4px}.contact-calendar{display:grid;gap:21px;margin-top:14px}.contact-calendar-month{padding-bottom:17px;border-bottom:1px dotted rgba(89,105,118,.55)}.contact-calendar-month>header{display:flex;align-items:baseline;gap:5px;margin-bottom:9px}.contact-calendar-month>header strong{font-size:35px;line-height:1;font-weight:800;color:#1f2730}.contact-calendar-month>header span{color:#647382;font-size:13px}.contact-calendar-weekdays,.contact-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.contact-calendar-weekdays{margin-bottom:3px}.contact-calendar-weekdays span{text-align:center;color:#798692;font-size:10px}.contact-calendar-day{position:relative;display:grid;place-items:center;min-height:38px;border:0;border-radius:50%;background:transparent;color:#252f38;font-size:13px}.contact-calendar-day.is-empty{pointer-events:none}.contact-calendar-day:disabled{cursor:default;color:#a5adb4;opacity:.68}.contact-calendar-day.has-records{cursor:pointer;color:#4d91c2;font-weight:700}.contact-calendar-day.has-records span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e7f2fa}.contact-calendar-day.has-records i{position:absolute;right:calc(50% - 17px);bottom:1px;width:6px;height:6px;border-radius:50%;background:#4c96cb;color:transparent;font-size:0}.contact-calendar-day.selected span{background:#4c96cb;color:#fff;box-shadow:0 4px 10px rgba(76,150,203,.28)}.contact-calendar-day.selected i{background:#fff}.contact-calendar-results{margin-top:17px;padding-top:13px;border-top:1px solid rgba(182,194,204,.35)}.contact-calendar-results>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.contact-calendar-results>header strong{color:#526c7e;font-size:12px}.contact-calendar-results>header button{width:26px;height:26px;display:grid;place-items:center;border:0;border-radius:8px;background:#edf4f8;color:#7291a4}.contact-calendar-results>header svg{width:14px;height:14px}.night-mode .contact-search-category-grid{border-color:rgba(168,193,209,.22)}.night-mode .contact-search-category-grid button{background:transparent;color:#d7e7ef}.night-mode .contact-search-category-grid button:hover,.night-mode .contact-search-category-grid button:focus-visible,.night-mode .contact-search-category-grid button.active{background:transparent;color:#9fc9e4}.night-mode .contact-calendar-month{border-color:rgba(168,193,209,.32)}.night-mode .contact-calendar-month>header strong,.night-mode .contact-calendar-day{color:#edf4f8}.night-mode .contact-calendar-month>header span,.night-mode .contact-calendar-weekdays span{color:#a5b8c5}.night-mode .contact-calendar-day:disabled{color:#71818e}.night-mode .contact-calendar-day.has-records span{background:rgba(76,150,203,.24)}.night-mode .contact-calendar-day.selected span{background:#4c96cb;color:#fff}.night-mode .contact-calendar-results{border-color:rgba(168,193,209,.22)}.night-mode .contact-calendar-results>header strong{color:#d7e7ef}.night-mode .contact-calendar-results>header button{background:rgba(126,165,189,.18);color:#c8dfe8}
@media(max-width:380px){.contact-search-body{padding-left:13px;padding-right:13px}.contact-search-hint{margin-top:35px;margin-bottom:20px}.contact-search-category-grid button{min-height:66px;font-size:11px}}
@media(max-width:380px){.contact-search-category-grid button{min-height:44px;padding-inline:9px}.contact-calendar-day{min-height:35px}.contact-calendar-month>header strong{font-size:32px}}
/* UID and friend center: compact enough for the phone viewport, with clear QQ-like states. */
.friend-center{display:grid;gap:9px;padding-bottom:26px}.uid-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 13px;border:1px solid rgba(255,255,255,.72);border-radius:16px;background:linear-gradient(135deg,rgba(225,239,235,.92),rgba(235,229,242,.9));box-shadow:0 8px 18px rgba(74,100,114,.08)}.uid-card .tiny-label{margin-bottom:3px}.uid-card strong{font-size:18px;letter-spacing:1px;color:#4b6d82;font-variant-numeric:tabular-nums}.uid-card button{padding:7px 10px;border-radius:10px;background:rgba(255,255,255,.78);color:#5d7890;font-size:10px;font-weight:700}.friend-search{display:flex;align-items:center;gap:7px;padding:7px 8px 7px 11px;border:1px solid rgba(185,203,214,.7);border-radius:15px;background:rgba(255,255,255,.78);box-shadow:inset 0 1px 0 rgba(255,255,255,.86)}.friend-search>span{color:#8b9eaa;font-size:17px;line-height:1}.friend-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font-size:11px}.friend-search input::placeholder{color:#93a2ad}.friend-search button{padding:7px 10px;border-radius:10px;background:#6c8da1;color:#fff;font-size:10px;font-weight:700}.friend-search-result,.friend-request-list{display:grid;gap:7px}.friend-result,.friend-request{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid rgba(218,229,233,.88);border-radius:14px;background:rgba(255,255,255,.72)}.friend-result .avatar,.friend-request .avatar{width:34px;height:34px;border-radius:11px;font-size:11px}.friend-user-details{display:grid;gap:3px;min-width:0;flex:1}.friend-user-details strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.friend-user-details small{font-size:9px;color:#8a9aa4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.friend-action,.friend-request-actions button{padding:6px 9px;border-radius:9px;background:#6e92a6;color:#fff;font-size:9px;font-weight:700;white-space:nowrap}.friend-status{padding:5px 7px;border-radius:8px;font-size:9px;white-space:nowrap}.friend-status.accepted{background:rgba(105,166,143,.13);color:#559279}.friend-status.pending{background:rgba(207,161,91,.14);color:#ae8042}.friend-section-head{display:flex;align-items:center;gap:7px;padding:6px 3px 1px;color:#526b7d;font-size:11px}.friend-section-head span{display:grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:rgba(113,147,164,.15);color:#64849a;font-size:9px}.contacts-heading{margin-top:3px}.friend-request-actions{display:flex;gap:5px}.friend-request-actions button:last-child{background:rgba(126,146,157,.14);color:#718391}.friend-empty,.friend-loading{text-align:center;padding:12px 8px;color:#92a0aa;font-size:10px;line-height:1.6}.contact-row{position:relative}.contact-arrow{margin-left:auto;color:#91a0aa;font-size:18px;font-style:normal}.night-mode .uid-card{background:linear-gradient(135deg,rgba(47,71,77,.92),rgba(58,54,75,.9));border-color:rgba(168,193,209,.2)}.night-mode .uid-card strong{color:#d4e7ec}.night-mode .uid-card button,.night-mode .friend-search,.night-mode .friend-result,.night-mode .friend-request{background:rgba(38,52,67,.78);border-color:rgba(168,193,209,.2);color:#d7e7ef}.night-mode .friend-search input{color:#edf4f8}.night-mode .friend-section-head{color:#d7e7ef}.night-mode .friend-empty,.night-mode .friend-loading,.night-mode .friend-user-details small{color:#9eb1bc}
@media(max-width:380px){.uid-card{padding:10px 11px}.uid-card strong{font-size:16px}.friend-result,.friend-request{padding:8px}.friend-request-actions button,.friend-action{padding:5px 7px;font-size:8px}}

/* Conversation avatars and QQ-style quoted message cards. */
.message-avatar{width:42px;height:42px;border-radius:15px;font-size:12px;box-shadow:0 7px 15px rgba(82,108,127,.18)}
.conversation-identity{cursor:pointer;transition:opacity .2s}
.conversation-identity:hover{opacity:.85}
.conversation-identity .avatar{width:38px;height:38px;border-radius:14px;font-size:13px}
.message-row{gap:10px}
.message-content{max-width:80%}
.bubble{padding:9px 12px}
.bubble-text{display:block;white-space:pre-wrap;word-break:break-word}
.quoted-message{width:100%;display:flex;align-items:center;gap:8px;margin:0 0 7px;padding:7px 8px;border:0;border-left:3px solid rgba(92,139,165,.72);border-radius:8px;background:rgba(223,235,241,.8);color:#60798a;text-align:left;cursor:pointer;transition:background .18s,transform .18s}
.quoted-message:hover,.quoted-message:focus-visible{background:rgba(205,224,233,.96);transform:translateY(-1px)}
.mine .quoted-message{border-left-color:rgba(255,255,255,.72);background:rgba(255,255,255,.16);color:rgba(255,255,255,.92)}
.quoted-message-copy{display:grid;gap:2px;min-width:0;flex:1}.quoted-message-copy strong{font-size:9px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quoted-message-copy span{font-size:9px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quoted-message>svg{width:13px;height:13px;flex:none;opacity:.7}
.message-quote-target{animation:quote-target-pulse 1.6s ease both}.message-quote-target .bubble{box-shadow:0 0 0 3px rgba(107,164,188,.24),0 9px 22px rgba(76,110,130,.18)}
.message-composer{grid-template-rows:auto auto;grid-template-areas:'input input input input input send' 'voice attach emoji quick . .'}
.message-composer.has-quote{grid-template-rows:auto auto auto;grid-template-areas:'quote quote quote quote quote quote' 'input input input input input send' 'voice attach emoji quick . .'}
.message-quote-preview{grid-area:quote;display:none;align-items:center;gap:8px;min-width:0;min-height:42px;padding:6px 8px;border:1px solid rgba(183,205,216,.78);border-radius:12px;background:rgba(225,237,242,.78);box-shadow:inset 0 1px 0 rgba(255,255,255,.88)}
.message-quote-preview.open{display:flex}.message-quote-preview[hidden]{display:none}.quote-preview-accent{width:3px;height:27px;flex:none;border-radius:3px;background:#6f9db5}.quote-preview-copy{display:grid;gap:2px;min-width:0;flex:1}.quote-preview-copy strong{font-size:9px;color:#557488}.quote-preview-copy span{font-size:10px;color:#728995;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quote-preview-close{width:24px;height:24px;display:grid;place-items:center;flex:none;border-radius:8px;background:transparent;color:#8299a6}.quote-preview-close:hover{background:rgba(255,255,255,.7);color:#5c7788}.quote-preview-close svg{width:14px;height:14px}
.night-mode .quoted-message{background:rgba(94,124,143,.28);border-left-color:#a4c6d5;color:#dbeaf0}.night-mode .message-quote-preview{background:rgba(55,78,94,.8);border-color:rgba(168,193,209,.28)}.night-mode .quote-preview-copy strong,.night-mode .quote-preview-copy span{color:#d2e4eb}
@keyframes quote-target-pulse{0%,100%{transform:translateX(0)}25%{transform:translateX(3px)}60%{transform:translateX(0)}}
@media(max-width:380px){.message-avatar{width:38px;height:38px;border-radius:13px;font-size:11px}.conversation-identity .avatar{width:36px;height:36px}.message-row{gap:8px}.message-content{max-width:82%}.quoted-message{margin-bottom:5px;padding:6px 7px}.quoted-message-copy strong,.quoted-message-copy span{font-size:8px}.message-quote-preview{min-height:38px;padding:5px 7px}}

/* Photo library: date sections, selection mode, contact sending and full-screen preview. */
.photo-view{padding-bottom:32px;overflow-y:auto;scrollbar-width:none}.photo-view::-webkit-scrollbar{display:none}
.photo-toolbar{position:sticky;top:0;z-index:4;padding:5px 2px 12px;background:linear-gradient(180deg,rgba(235,244,248,.96) 78%,rgba(235,244,248,0));backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.photo-toolbar small{flex:1;margin-left:9px}.photo-select-toggle{display:inline-flex;align-items:center;gap:4px;min-height:34px;padding:0 10px;border:1px solid rgba(255,255,255,.86);border-radius:11px;background:rgba(255,255,255,.58);color:#668196;font-size:10px;font-weight:700;box-shadow:0 5px 13px rgba(71,93,113,.08)}.photo-select-toggle svg{width:14px;height:14px}.photo-select-toggle.active{background:#6d92a8;color:#fff;border-color:transparent}
.photo-date-group{margin:2px 0 18px}.photo-date-heading{display:flex;align-items:baseline;gap:7px;padding:0 2px 8px;color:#48637a}.photo-date-heading strong{font-size:12px}.photo-date-heading span{font-size:9px;color:#8da0ae}.photo-date-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.photo-tile{cursor:pointer;box-shadow:0 8px 18px rgba(71,93,113,.13);outline:0;transition:transform .18s,box-shadow .18s}.photo-tile:hover,.photo-tile:focus-visible{transform:translateY(-2px);box-shadow:0 12px 22px rgba(71,93,113,.2)}.photo-tile.is-pressing{transform:scale(.96)}.photo-tile.is-selected{box-shadow:0 0 0 3px #6f9db5,0 10px 20px rgba(71,93,113,.2)}.photo-tile.is-selected img{filter:saturate(.82) brightness(.88)}.photo-select-check{position:absolute;left:7px;top:7px;width:22px;height:22px;display:grid;place-items:center;border:1.5px solid rgba(255,255,255,.92);border-radius:50%;background:rgba(42,61,75,.32);color:transparent;opacity:0;transition:opacity .16s,background .16s,color .16s}.photo-select-check svg{width:13px;height:13px}.photo-selection-bar:not([hidden])~*{}.photo-tile:has(.photo-select-check){ }.photo-selection-bar:not([hidden]) ~ .photo-date-group .photo-select-check,.photo-tile.is-selected .photo-select-check{opacity:1}.photo-tile.is-selected .photo-select-check{background:#6f9db5;color:#fff;border-color:#fff}.photo-delete-button{position:absolute;right:6px;top:6px;width:23px;height:23px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.5);border-radius:50%;background:rgba(36,52,67,.58);color:#fff;opacity:0;transition:opacity .16s}.photo-tile:hover .photo-delete-button,.photo-tile:focus-within .photo-delete-button{opacity:1}.photo-delete-button svg{width:13px;height:13px}
.photo-selection-bar{position:sticky;bottom:8px;z-index:7;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:5px 0 10px;padding:8px 9px;border:1px solid rgba(255,255,255,.9);border-radius:15px;background:rgba(42,62,77,.94);color:#f0f7fa;box-shadow:0 12px 24px rgba(39,57,71,.22);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}.photo-selection-bar[hidden]{display:none}.photo-selection-bar strong{font-size:10px;white-space:nowrap}.photo-selection-bar>div{display:flex;gap:4px}.photo-action-button{display:inline-flex;align-items:center;gap:3px;min-height:28px;padding:0 7px;border:0;border-radius:9px;background:rgba(255,255,255,.13);color:#f0f7fa;font-size:9px}.photo-action-button svg{width:13px;height:13px}.photo-action-button:hover{background:rgba(255,255,255,.24)}.photo-action-button.danger{color:#ffdce1}.photo-action-button.subtle{color:#c4d5dc}
.photo-send-sheet,.photo-lightbox{position:absolute;inset:0;z-index:25;display:grid;align-items:end}.photo-send-sheet[hidden],.photo-lightbox[hidden]{display:none}.photo-send-sheet-backdrop,.photo-lightbox-backdrop{position:absolute;inset:0;background:rgba(29,45,57,.38);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}.photo-send-panel{position:relative;z-index:1;max-height:78%;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:9px;padding:17px 14px 22px;border-radius:22px 22px 0 0;background:rgba(244,250,252,.98);box-shadow:0 -12px 36px rgba(37,56,70,.2);animation:photo-sheet-up .2s ease-out}.photo-send-panel header{display:flex;align-items:center;justify-content:space-between;gap:10px}.photo-send-panel h3{margin:2px 0 0;color:#30485c;font-size:15px}.photo-sheet-close{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:10px;background:#e6f0f3;color:#698296}.photo-sheet-close svg{width:16px;height:16px}.photo-send-progress{margin:0;color:#7d919e;font-size:10px}.photo-send-contact-list{display:grid;gap:7px;overflow-y:auto;padding:2px;scrollbar-width:none}.photo-send-contact-list::-webkit-scrollbar{display:none}.photo-send-contact{display:flex;align-items:center;gap:9px;width:100%;padding:9px;border:1px solid rgba(208,223,230,.82);border-radius:14px;background:rgba(255,255,255,.82);color:#3d586d;text-align:left}.photo-send-contact:hover{background:#edf5f7}.photo-send-contact .avatar{width:35px;height:35px;flex:none;border-radius:11px}.photo-send-contact>span:nth-child(2){display:grid;gap:3px;min-width:0;flex:1}.photo-send-contact strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.photo-send-contact small{font-size:9px;color:#8b9ca7}.photo-send-contact>svg{width:15px;color:#9aadb8}.photo-send-loading{padding:24px 8px;text-align:center;color:#8a9aa5;font-size:10px;line-height:1.6}
.photo-lightbox{align-items:stretch;background:rgba(26,40,52,.96)}.photo-lightbox-backdrop{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.photo-lightbox-panel{position:relative;z-index:1;display:grid;grid-template-rows:58px minmax(0,1fr) 66px;min-height:100%;color:#ecf4f7}.photo-lightbox-panel header{display:flex;align-items:center;gap:10px;padding:12px 12px 7px}.photo-lightbox-close{width:34px;height:34px;display:grid;place-items:center;border:0;border-radius:12px;background:rgba(255,255,255,.1);color:#eaf4f7}.photo-lightbox-close svg{width:18px;height:18px}.photo-lightbox-title{display:grid;gap:3px;min-width:0;flex:1}.photo-lightbox-title strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.photo-lightbox-title small{font-size:9px;color:#a9c0cb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.photo-lightbox-index{font-size:10px;color:#b8cbd4}.photo-lightbox-stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:0;padding:10px 38px}.photo-lightbox-stage img{max-width:100%;max-height:100%;object-fit:contain;border-radius:12px;box-shadow:0 16px 32px rgba(0,0,0,.28)}.photo-lightbox-nav{position:absolute;top:50%;width:30px;height:30px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.22);border-radius:50%;background:rgba(255,255,255,.11);color:#ecf4f7;transform:translateY(-50%)}.photo-lightbox-nav.prev{left:9px}.photo-lightbox-nav.next{right:9px}.photo-lightbox-nav svg{width:17px;height:17px}.photo-lightbox-actions{display:flex;align-items:center;justify-content:center;gap:9px;padding:8px 14px 18px}.photo-lightbox-actions button{display:inline-flex;align-items:center;gap:5px;min-height:34px;padding:0 12px;border:1px solid rgba(255,255,255,.18);border-radius:11px;background:rgba(255,255,255,.1);color:#ecf4f7;font-size:10px}.photo-lightbox-actions button:hover{background:rgba(255,255,255,.2)}.photo-lightbox-actions button.danger{color:#ffd7dd}.photo-lightbox-actions svg{width:15px;height:15px}
.night-mode .photo-toolbar{background:linear-gradient(180deg,rgba(31,46,60,.96) 78%,rgba(31,46,60,0))}.night-mode .photo-date-heading{color:#dcecf2}.night-mode .photo-date-heading span{color:#9eb3bf}.night-mode .photo-select-toggle{background:rgba(38,52,67,.78);border-color:rgba(168,193,209,.24);color:#d7e7ef}.night-mode .photo-select-toggle.active{background:#6f9db5;color:#fff}.night-mode .photo-send-panel{background:rgba(31,46,60,.98)}.night-mode .photo-send-panel h3,.night-mode .photo-send-contact{color:#e6f1f5}.night-mode .photo-send-contact{background:rgba(38,52,67,.88);border-color:rgba(168,193,209,.22)}.night-mode .photo-send-contact:hover{background:rgba(71,91,111,.7)}.night-mode .photo-send-contact small,.night-mode .photo-send-progress,.night-mode .photo-send-loading{color:#a8bdc8}.night-mode .photo-sheet-close{background:rgba(126,165,189,.18);color:#d9edf3}
@keyframes photo-sheet-up{from{transform:translateY(24px);opacity:.6}to{transform:translateY(0);opacity:1}}
@media(max-width:380px){.photo-toolbar{padding-bottom:10px}.photo-add{padding:8px 9px;font-size:10px}.photo-select-toggle{padding:0 8px}.photo-date-grid{gap:5px}.photo-selection-bar{padding:7px}.photo-action-button{padding:0 6px;font-size:8px}.photo-action-button span{display:none}.photo-send-panel{padding:14px 11px 18px}.photo-lightbox-stage{padding:8px 31px}.photo-lightbox-actions{gap:5px;padding-inline:8px}.photo-lightbox-actions button{padding:0 9px;font-size:9px}}
.photo-view.selection-mode .photo-select-check{opacity:1}

/* iOS Photos style grid: the photo itself fills each cell instead of looking like a badge. */
#phone-screen #photo-view .photo-grid{display:block;width:100%;min-width:0}
#phone-screen #photo-view .photo-date-group{width:100%;min-width:0;margin:0 0 20px}
#phone-screen #photo-view .photo-date-heading{padding:0 2px 9px;color:#36566d}
#phone-screen #photo-view .photo-date-heading strong{font-size:13px;font-weight:750}
#phone-screen #photo-view .photo-date-heading span{font-size:10px;color:#7f95a3}
#phone-screen #photo-view .photo-date-grid{display:grid;width:100%;min-width:0;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:auto;gap:3px}
#phone-screen #photo-view .photo-tile{display:block;width:100%;min-width:0;aspect-ratio:1/1;margin:0;padding:0;border:0;border-radius:4px;overflow:hidden;position:relative;background:#dbe6eb;box-shadow:none;transform:none;transition:filter .16s,box-shadow .16s}
#phone-screen #photo-view .photo-tile:hover,#phone-screen #photo-view .photo-tile:focus-visible{transform:none;box-shadow:0 0 0 2px rgba(99,145,169,.72);z-index:1}
#phone-screen #photo-view .photo-tile.is-pressing{transform:scale(.97)}
#phone-screen #photo-view .photo-tile img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;object-position:center;background:#dbe6eb}
.photo-send-sheet{z-index:50}
.photo-lightbox{z-index:40}
.photo-send-contact.is-sending{opacity:.58;pointer-events:none}
#phone-screen #photo-view .photo-tile.is-selected{box-shadow:0 0 0 3px #6f9db5;z-index:1}
#phone-screen #photo-view .photo-tile.is-selected img{filter:saturate(.82) brightness(.88)}
#phone-screen #photo-view .photo-select-check{left:6px;top:6px;width:21px;height:21px}
#phone-screen #photo-view .photo-view-empty{grid-column:1/-1}
.night-mode #phone-screen #photo-view .photo-date-heading{color:#e2f0f5}
.night-mode #phone-screen #photo-view .photo-date-heading span{color:#a9bdc8}
@media(max-width:380px){#phone-screen #photo-view .photo-date-grid{gap:2px}#phone-screen #photo-view .photo-tile{border-radius:3px}}

/* Keep the long-press menu readable when shared popover hover styles run later. */
#phone-screen #message-context-menu.message-context-menu button:hover,
#phone-screen #message-context-menu.message-context-menu button:focus-visible {
  background: rgba(255,255,255,.14);
  color: #fff;
  opacity: 1;
}

/* Composer bottom sheets: keep the action surface above the input bar and
   make it feel like the QQ/WeChat mobile action tray. */
.message-bottom-sheet{left:0!important;right:0!important;bottom:0!important;top:auto!important;width:100%!important;z-index:60!important;padding:10px 14px calc(18px + env(safe-area-inset-bottom))!important;border:0!important;border-radius:24px 24px 0 0!important;background:rgba(247,251,253,.98)!important;box-shadow:0 -16px 40px rgba(50,76,96,.2)!important;transform:none!important;animation:message-sheet-in .2s ease-out!important}
.message-bottom-sheet:not(.open){display:none!important}
.message-bottom-sheet.open{display:block!important}
.conversation-modal > #message-attach-panel.message-bottom-sheet {
  bottom: var(--composer-height, 108px) !important;
  z-index: 80 !important;
  max-height: calc(100% - var(--composer-height, 108px) - 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bottom-sheet-grabber{width:34px;height:4px;margin:0 auto 12px;border-radius:99px;background:rgba(109,137,153,.35)}
.bottom-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 2px 13px;color:#4b6579}.bottom-sheet-heading>div{display:grid;gap:3px}.bottom-sheet-heading .widget-eyebrow{margin:0;color:#90a4b2;font-size:8px;letter-spacing:1.2px}.bottom-sheet-heading strong{font-size:16px;line-height:1.2}.bottom-sheet-close{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:rgba(224,235,241,.74);color:#7790a0}.bottom-sheet-close svg{width:16px;height:16px}
.message-more-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.message-more-grid button{min-width:0;display:grid;justify-items:center;gap:4px;padding:9px 3px 8px;border-radius:15px;background:rgba(238,246,249,.88);color:#60798b;transition:transform .18s,background .18s}.message-more-grid button:hover,.message-more-grid button:focus-visible{background:#e1eef3;transform:translateY(-1px)}.message-more-grid button>span{width:38px;height:38px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(145deg,#d5eaf2,#eaf3f5);color:#5c8fa9}.message-more-grid button:nth-child(2)>span{color:#7188b0;background:linear-gradient(145deg,#e2e4f5,#edf1fa)}.message-more-grid button:nth-child(3)>span{color:#ad8f72;background:linear-gradient(145deg,#f5e9d8,#fbf3e9)}.message-more-grid button:nth-child(4)>span{color:#bb7187;background:linear-gradient(145deg,#f4e0e7,#fff0f3)}.message-more-grid button:nth-child(5)>span{color:#6f9d8d;background:linear-gradient(145deg,#dcefe7,#eff8f3)}.message-more-grid button:nth-child(6)>span{color:#7d8fac;background:linear-gradient(145deg,#e2e9f3,#f0f4fa)}.message-more-grid button:nth-child(7)>span{color:#b69a62;background:linear-gradient(145deg,#f6ecd2,#fff7e7)}.message-more-grid button:nth-child(8)>span{color:#9b82b0;background:linear-gradient(145deg,#eee4f5,#f8f1fb)}.message-more-grid button svg{width:20px;height:20px;stroke-width:1.8}.message-more-grid b{font-size:10px;font-weight:600;color:#4e687b}.message-more-grid small{font-size:8px;color:#9aaab5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.voice-sheet{padding-bottom:calc(20px + env(safe-area-inset-bottom))!important}.voice-sheet-body{display:grid;justify-items:center;gap:15px;padding:2px 0 4px}.voice-sheet-body p{margin:0;color:#708797;font-size:11px}.voice-record-button{width:118px;height:118px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#6da9c5,#7595c5);color:#fff;box-shadow:0 14px 28px rgba(88,135,170,.28),inset 0 2px 0 rgba(255,255,255,.35);transition:transform .18s,box-shadow .18s}.voice-record-button svg{width:42px;height:42px;stroke-width:1.5}.voice-record-button:active,.voice-record-button.recording{transform:scale(.94);box-shadow:0 0 0 10px rgba(110,164,196,.16),0 10px 24px rgba(88,135,170,.24)}.voice-record-button.recording{background:linear-gradient(145deg,#d58ca3,#bd809f)}.voice-sheet-modes{display:flex;align-items:center;gap:26px}.voice-sheet-modes button{padding:5px 0;background:transparent;color:#8a9ca8;font-size:11px}.voice-sheet-modes button.active{color:#4d7086;font-weight:700}
.night-mode .message-bottom-sheet{background:rgba(29,43,57,.98)!important;box-shadow:0 -16px 40px rgba(0,0,0,.4)!important}.night-mode .bottom-sheet-heading,.night-mode .message-more-grid b{color:#dbe9ef}.night-mode .message-more-grid button{background:rgba(56,76,92,.82)}.night-mode .bottom-sheet-close{background:rgba(71,94,111,.72);color:#d4e4eb}.night-mode .message-more-grid small,.night-mode .voice-sheet-body p{color:#a9bbc5}
@keyframes message-sheet-in{from{opacity:0;transform:translateY(18px)!important}to{opacity:1;transform:translateY(0)!important}}
@media(max-width:380px){.message-more-grid{gap:5px}.message-more-grid button{padding-left:1px;padding-right:1px}.message-more-grid button>span{width:34px;height:34px}.message-more-grid small{font-size:7px}.message-bottom-sheet{padding-left:10px!important;padding-right:10px!important}}
#phone-screen #message-context-menu.message-context-menu button:hover span,
#phone-screen #message-context-menu.message-context-menu button:focus-visible span {
  color: inherit;
  background: rgba(255,255,255,.18);
}
#phone-screen #message-context-menu.message-context-menu button span svg {
  color: currentColor;
  stroke: currentColor;
}
#phone-screen #message-context-menu.message-context-menu button[data-message-action="delete"]:hover,
#phone-screen #message-context-menu.message-context-menu button[data-message-action="delete"]:focus-visible {
  color: #ffc0c8;
}

/* Four equal columns keep the bottom message tools centered and balanced. */
.message-composer {
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-template-areas:
    'input input input send'
    'voice attach emoji quick';
}
.message-composer.has-quote {
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-template-areas:
    'quote quote quote quote'
    'input input input send'
    'voice attach emoji quick';
}
.message-composer .compose-tool,
.message-composer .send-button {
  justify-self: center;
}

@media(max-width:380px) {
  .message-composer {
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 6px;
  }
  .message-composer.has-quote {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }
}

/* Message actions: clear selection state and soft-delete/recalled feedback. */
 .conversation-modal{position:absolute}
.message-selection-bar{position:absolute;left:10px;right:10px;bottom:106px;z-index:18;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:42px;padding:6px 7px 6px 10px;border:1px solid rgba(255,255,255,.86);border-radius:14px;background:rgba(42,62,77,.95);color:#f5fafc;box-shadow:0 10px 24px rgba(36,54,69,.25);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.message-selection-bar[hidden]{display:none}
.message-selection-summary{display:flex;align-items:center;gap:6px;min-width:0}.message-selection-summary svg{width:15px;height:15px;color:#b9d9e4}.message-selection-summary strong{font-size:10px;white-space:nowrap}
.message-selection-actions{display:flex;align-items:center;gap:4px}.message-selection-actions button{display:inline-flex;align-items:center;gap:3px;min-height:29px;padding:0 7px;border:0;border-radius:9px;background:rgba(255,255,255,.12);color:#eff7fa;font-size:9px}.message-selection-actions button svg{width:13px;height:13px}.message-selection-actions button:hover,.message-selection-actions button.active{background:rgba(255,255,255,.25)}.message-selection-actions button.danger{color:#ffd8dd}.message-selection-actions button.danger:hover{background:rgba(220,94,111,.25)}
.message-list.multi-select-mode .message-row{cursor:pointer;transition:filter .16s,transform .16s}.message-list.multi-select-mode .message-row:hover{filter:brightness(.98)}.message-list .message-row.multi-selected .message-content{position:relative}.message-list .message-row.multi-selected .message-content:before{content:'✓';position:absolute;right:-8px;top:-8px;z-index:2;width:20px;height:20px;display:grid;place-items:center;border:2px solid #fff;border-radius:50%;background:#5c9ab5;color:#fff;font-size:11px;font-weight:800;box-shadow:0 3px 8px rgba(52,91,108,.24)}.message-list .message-row.multi-selected .bubble{box-shadow:0 0 0 2px rgba(75,150,184,.55),0 7px 18px rgba(93,119,138,.12)}
.recalled-message{display:inline-flex;align-items:center;gap:5px;color:#91a0aa!important;background:rgba(227,235,239,.58)!important;border:1px dashed rgba(157,174,184,.62)!important;box-shadow:none!important;font-size:10px!important;font-style:italic}.recalled-message svg{width:13px;height:13px;flex:none}.mine .recalled-message{color:#7c8c99!important;background:rgba(232,239,242,.7)!important}.recalled-message time{font-style:normal}
#message-context-menu [data-message-action="recall"]{color:#6f96a9}#message-context-menu [data-message-action="recall"]:hover{color:#4d819c}
@media(max-width:380px){.message-selection-bar{left:7px;right:7px;bottom:104px;padding-left:8px}.message-selection-actions button{padding:0 6px;font-size:8px}.message-selection-actions button span{display:none}.message-selection-summary strong{font-size:9px}}

/* Personal profile: soft glass surfaces and fully circular avatars. */
.avatar,
.message-avatar,
.profile-orb,
.avatar-image {
  border-radius: 50% !important;
}
.avatar,
.message-avatar,
.profile-orb {
  background: linear-gradient(145deg,#c4e0dc 0%,#d7dff1 100%) !important;
  color: #587689;
  border: 1px solid rgba(255,255,255,.86);
  box-shadow: 0 7px 16px rgba(104,139,153,.16);
}
.message-avatar.mine-avatar,
.profile-orb.has-image {
  background: linear-gradient(145deg,#f1d5d8 0%,#ddd5ef 100%) !important;
}
.message-avatar img,
.profile-orb img,
.avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.profile-orb {
  overflow: hidden;
  position: relative;
  padding: 0;
}
.profile-form {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 16px;
  background: rgba(255,255,255,.56);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 20px rgba(98,127,143,.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.profile-field {
  display: grid;
  gap: 5px;
}
.profile-field span {
  color: #78909e;
  font-size: 9px;
}
.profile-field input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(180,204,214,.72);
  border-radius: 11px;
  outline: 0;
  background: rgba(255,255,255,.74);
  color: #40586a;
  font-size: 11px;
}
.profile-field input:focus {
  border-color: #8fb8c3;
  box-shadow: 0 0 0 3px rgba(143,184,195,.14);
}
.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.avatar-upload,
.profile-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 9px;
  cursor: pointer;
}
.avatar-upload {
  border: 1px solid rgba(143,184,195,.34);
  background: rgba(220,237,239,.7);
  color: #5d8391;
}
.profile-save {
  background: linear-gradient(135deg,#8eb8bb,#8e9fc4);
  color: #fff;
  box-shadow: 0 6px 12px rgba(111,145,163,.15);
}
.avatar-upload:hover,
.profile-save:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}
.night-mode .profile-form {
  background: rgba(38,52,67,.72);
  border-color: rgba(168,193,209,.2);
}
.night-mode .profile-field span,
.night-mode .profile-field input {
  color: #d8e7ed;
}
.night-mode .profile-field input {
  background: rgba(33,46,61,.78);
  border-color: rgba(168,193,209,.28);
}
.night-mode .avatar-upload {
  background: rgba(126,165,189,.2);
  color: #c5dce7;
}
@media(max-width:380px) {
  .profile-form { padding: 10px; }
  .profile-form-actions { gap: 5px; }
  .avatar-upload, .profile-save { padding-inline: 8px; }
}

/* Presence and QQ-style incoming message notification. */
.user-presence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7f9a9e;
  font-size: 8px;
  line-height: 1;
}
.presence-dot.is-online { background: #55c29a; box-shadow: 0 0 0 3px rgba(85,194,154,.14); }
.presence-dot.is-offline { background: #aab8c0; box-shadow: 0 0 0 3px rgba(170,184,192,.12); }
.presence-label { white-space: nowrap; }
.contact-details { display: grid; gap: 2px; min-width: 0; flex: 1; }
.contact-details .user-presence { margin-top: 2px; }
.conversation-header p.is-online { color: #4fa987; }
.conversation-header p.is-offline { color: #8b9ba5; }
.conversation-header p.is-offline:before { background: #aab8c0; box-shadow: 0 0 0 3px rgba(170,184,192,.12); }
.incoming-message-card {
  position: absolute;
  top: 43px;
  left: 12px;
  right: 12px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 17px;
  background: rgba(247,252,253,.9);
  color: #3c596c;
  text-align: left;
  box-shadow: 0 14px 30px rgba(55,78,94,.2), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(-12px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.incoming-message-card.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.incoming-message-card > svg { width: 16px; height: 16px; margin-left: auto; color: #91a5af; flex: none; }
.incoming-message-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 12px rgba(90,119,132,.16);
}
.incoming-message-copy { min-width: 0; display: grid; gap: 4px; }
.incoming-message-copy strong { font-size: 11px; color: #3d596b; }
.incoming-message-copy span { overflow: hidden; color: #7a919d; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.night-mode .incoming-message-card { background: rgba(38,52,67,.92); border-color: rgba(168,193,209,.22); color: #e5f0f4; }
.night-mode .incoming-message-copy strong { color: #e5f0f4; }
.night-mode .incoming-message-copy span { color: #adc1cb; }
.night-mode .incoming-message-card > svg { color: #b8ccd5; }
@media(max-width:380px) {
  .incoming-message-card { left: 9px; right: 9px; min-height: 54px; padding: 7px 9px; }
  .incoming-message-avatar { width: 35px; height: 35px; }
}

/* The server can disable an account or device after the user has already logged in. */
.device-lock-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 248, 250, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.device-lock-screen.hidden { display: none !important; }
.device-lock-card {
  width: min(300px, 100%);
  padding: 26px 22px;
  border: 1px solid #dfe8ec;
  border-radius: 22px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 40px rgba(42, 63, 78, .14);
  text-align: center;
}
.device-lock-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: #6d8798;
}
.device-lock-icon svg { width: 22px; height: 22px; }
.device-lock-card h2 { margin: 8px 0; font-size: 18px; }
.device-lock-card p:not(.tiny-label) { margin: 0; color: #7b8992; font-size: 11px; line-height: 1.7; }
.device-lock-card .primary-button { width: 100%; margin-top: 20px; justify-content: center; gap: 8px; }
.admin-disabled-feature { display: none !important; pointer-events: none !important; }
.device-locked > .phone-view,
.device-locked > .conversation-modal,
.device-locked > .toast,
.device-locked > .home-indicator { pointer-events: none; }
.night-mode .device-lock-screen { background: rgba(32, 42, 41, .96); }
.night-mode .device-lock-card { border-color: #40514c; background: rgba(43, 56, 53, .97); }
.night-mode .device-lock-card p:not(.tiny-label) { color: #b5c3bc; }

/* QQ-inspired personalisation app */
.app-appearance span { background: linear-gradient(145deg,#b39ad1,#758fb8) !important; }
.appearance-view { padding: 0 0 30px; color: #31485e; overflow-x: hidden; }
.appearance-header { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; min-height: 68px; padding: 18px 16px 10px; background: rgba(239,246,249,.84); border-bottom: 1px solid rgba(173,194,207,.22); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.appearance-header .back-button { width: 32px; height: 32px; display: grid; place-items: center; color: #5d778c; }
.appearance-header h2 { margin: 2px 0 0; color: #273f54; font-size: 18px; letter-spacing: -.4px; }
.appearance-header .tiny-label { color: #8397a5; font-size: 8px; }
.appearance-reset { padding: 7px 9px; border-radius: 10px; color: #6d8292; background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.8); font-size: 9px; }
.appearance-tabs { display: flex; gap: 18px; padding: 4px 16px 0; overflow-x: auto; scrollbar-width: none; background: rgba(239,246,249,.84); }
.appearance-tabs::-webkit-scrollbar { display: none; }
.appearance-tabs button { flex: 0 0 auto; position: relative; padding: 9px 0 11px; color: #8093a0; background: transparent; font-size: 11px; white-space: nowrap; }
.appearance-tabs button.is-active { color: #2f536d; font-weight: 700; }
.appearance-tabs button.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: #6e95ad; }
.appearance-body { padding: 13px 16px 18px; }
.appearance-panel { display: none; animation: appearance-fade-in .22s ease; }
.appearance-panel.is-active { display: block; }
@keyframes appearance-fade-in { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.appearance-hero { display: flex; align-items: center; justify-content: space-between; min-height: 142px; padding: 18px 18px 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.86); border-radius: 22px; background: linear-gradient(125deg,rgba(227,238,247,.96),rgba(236,224,241,.9)); box-shadow: 0 14px 28px rgba(73,98,119,.12); }
.appearance-hero::after { content: ''; width: 145px; height: 145px; position: absolute; margin-left: 154px; border-radius: 50%; background: radial-gradient(circle at 35% 35%,rgba(255,255,255,.72),rgba(166,183,215,.08) 65%,transparent 70%); pointer-events: none; }
.appearance-hero > div { position: relative; z-index: 1; display: grid; gap: 6px; }
.appearance-hero > div > span { color: #70889b; font-size: 9px; font-weight: 700; letter-spacing: .7px; }
.appearance-hero strong { color: #29445b; font-size: 21px; line-height: 1.22; letter-spacing: -.6px; }
.appearance-hero small { color: #7d91a0; font-size: 10px; }
.appearance-hero-orb { position: relative; z-index: 1; width: 66px; height: 66px; display: grid; place-items: center; flex: none; border: 1px solid rgba(255,255,255,.88); border-radius: 23px; color: #fff; background: linear-gradient(145deg,#8db6c8,#ab91c6); box-shadow: 0 14px 24px rgba(89,111,145,.22); }
.appearance-hero-orb svg { width: 28px; height: 28px; }
.appearance-quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin: 12px 0 14px; }
.appearance-quick-grid button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 9px; border: 1px solid rgba(255,255,255,.82); border-radius: 15px; color: #5c7485; background: rgba(255,255,255,.66); box-shadow: 0 8px 18px rgba(75,98,115,.07); }
.appearance-quick-grid button:hover { transform: translateY(-1px); background: rgba(255,255,255,.9); }
.appearance-quick-grid svg { width: 17px; height: 17px; color: #748fab; }
.appearance-quick-grid span { font-size: 10px; font-weight: 700; }
.appearance-quick-grid small { color: #93a2ac; font-size: 8px; }
.appearance-current { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin-bottom: 18px; border: 1px solid rgba(255,255,255,.82); border-radius: 14px; background: rgba(232,241,245,.72); color: #5b778a; }
.appearance-current span { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.appearance-current svg { width: 14px; height: 14px; color: #9c83b6; }
.appearance-current strong { color: #3e5c70; font-size: 10px; }
.appearance-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin: 8px 2px 10px; }
.appearance-section-heading div { display: grid; gap: 3px; }
.appearance-section-heading span { color: #8295a3; font-size: 9px; }
.appearance-section-heading strong { color: #2d475b; font-size: 16px; }
.appearance-section-heading button { display: inline-flex; align-items: center; gap: 2px; padding: 5px 0; color: #7892a2; background: transparent; font-size: 9px; }
.appearance-section-heading svg { width: 13px; height: 13px; }
.appearance-panel-heading { display: grid; gap: 5px; margin: 2px 2px 14px; }
.appearance-panel-heading span { color: #8295a3; font-size: 9px; }
.appearance-panel-heading strong { color: #2d475b; font-size: 21px; letter-spacing: -.4px; }
.appearance-panel-heading small { color: #8798a4; font-size: 10px; }
.appearance-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.appearance-card-grid.compact-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.appearance-card { position: relative; display: grid; gap: 5px; min-width: 0; padding: 9px; text-align: left; border: 1px solid rgba(255,255,255,.86); border-radius: 17px; color: #405b6d; background: rgba(255,255,255,.7); box-shadow: 0 9px 20px rgba(73,98,118,.08); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.appearance-card:hover { transform: translateY(-2px); box-shadow: 0 13px 24px rgba(73,98,118,.13); }
.appearance-card.is-selected { border-color: #7099b2; box-shadow: 0 0 0 2px rgba(112,153,178,.18), 0 12px 22px rgba(73,98,118,.13); }
.appearance-card strong { overflow: hidden; color: #38556a; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.appearance-card small { overflow: hidden; color: #94a1aa; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.appearance-check { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; display: grid; place-items: center; opacity: 0; border-radius: 50%; color: #fff; background: #6f96ad; transform: scale(.7); transition: opacity .18s ease, transform .18s ease; }
.appearance-check svg { width: 12px; height: 12px; }
.appearance-card.is-selected .appearance-check { opacity: 1; transform: scale(1); }
.appearance-theme-preview { display: flex; align-items: end; gap: 4px; height: 76px; padding: 8px; overflow: hidden; border-radius: 12px; background: linear-gradient(145deg,var(--theme-a),var(--theme-b)); }
.appearance-theme-preview i { display: block; flex: 1; height: 55%; border-radius: 7px; background: rgba(255,255,255,.6); box-shadow: 0 5px 9px rgba(54,79,95,.1); }
.appearance-theme-preview i:nth-child(2) { height: 76%; background: rgba(255,255,255,.82); }
.appearance-theme-preview i:nth-child(3) { height: 42%; background: var(--theme-c); }
.appearance-bubble-preview { display: grid; align-content: center; gap: 6px; min-height: 82px; padding: 8px; overflow: hidden; border-radius: 12px; background: linear-gradient(145deg,#edf4f7,#e9e5ef); }
.appearance-bubble-preview i { justify-self: start; max-width: 90%; padding: 6px 8px; overflow: hidden; border-radius: 7px 13px 13px 13px; color: #476174; background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.9); font-size: 9px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.appearance-bubble-preview i:last-child { justify-self: end; color: #fff; border: 0; border-radius: 13px 7px 13px 13px; background: linear-gradient(145deg,#7ca8b9,#788db5); }
.appearance-background-preview { display: grid; place-items: center; height: 88px; overflow: hidden; border-radius: 12px; color: rgba(255,255,255,.82); background-position: center; background-size: cover; }
.appearance-background-preview svg { width: 23px; height: 23px; filter: drop-shadow(0 3px 6px rgba(40,57,71,.2)); }
.appearance-upload-card { display: grid; justify-items: center; gap: 5px; margin-top: 10px; padding: 16px 12px; border: 1px dashed rgba(111,145,162,.42); border-radius: 16px; color: #678297; background: rgba(255,255,255,.42); cursor: pointer; }
.appearance-upload-card > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg,#83aabd,#9f8eb8); }
.appearance-upload-card svg { width: 16px; height: 16px; }
.appearance-upload-card strong { font-size: 11px; }
.appearance-upload-card small { color: #94a1aa; font-size: 9px; }
.qixi-theme-cream .appearance-header,.qixi-theme-cream .appearance-tabs { background: rgba(255,248,240,.88); }
.qixi-theme-cream .appearance-hero { background: linear-gradient(125deg,#fff3e4,#f9e7e7); }
.qixi-theme-cream .appearance-tabs button.is-active::after { background: #bc8c6b; }
.qixi-theme-rose .appearance-header,.qixi-theme-rose .appearance-tabs { background: rgba(255,245,246,.88); }
.qixi-theme-rose .appearance-hero { background: linear-gradient(125deg,#f9e2e9,#eee0f1); }
.qixi-theme-rose .appearance-tabs button.is-active::after { background: #c887a0; }
.qixi-theme-forest .appearance-header,.qixi-theme-forest .appearance-tabs { background: rgba(240,248,242,.88); }
.qixi-theme-forest .appearance-hero { background: linear-gradient(125deg,#e0f0e5,#e5efef); }
.qixi-theme-forest .appearance-tabs button.is-active::after { background: #6d9a86; }
body.qixi-theme-midnight .appearance-header, body.qixi-theme-midnight .appearance-tabs { color: #e7eef5; background: rgba(30,43,57,.9); border-color: rgba(192,210,224,.14); }
body.qixi-theme-midnight .appearance-header h2, body.qixi-theme-midnight .appearance-panel-heading strong, body.qixi-theme-midnight .appearance-section-heading strong { color: #edf5fb; }
body.qixi-theme-midnight .appearance-hero { background: linear-gradient(125deg,#253a50,#463d59); }
body.qixi-theme-midnight .appearance-hero strong, body.qixi-theme-midnight .appearance-hero > div > span, body.qixi-theme-midnight .appearance-hero small { color: #e5eff6; }
body.qixi-theme-midnight .appearance-card, body.qixi-theme-midnight .appearance-quick-grid button, body.qixi-theme-midnight .appearance-current, body.qixi-theme-midnight .appearance-upload-card { color: #e3eef5; background: rgba(42,59,75,.78); border-color: rgba(190,210,224,.18); }
body.qixi-theme-midnight .appearance-card strong, body.qixi-theme-midnight .appearance-current strong { color: #e2eef6; }
body.qixi-theme-midnight .appearance-card small, body.qixi-theme-midnight .appearance-panel-heading small, body.qixi-theme-midnight .appearance-current { color: #a9bdca; }
body.qixi-theme-midnight:not(.qixi-home-bg-custom) .phone-screen { background: linear-gradient(145deg,#202d3b,#39435b 52%,#5d4b68) !important; }
body.qixi-theme-cream:not(.qixi-home-bg-custom) .phone-screen { background: linear-gradient(145deg,#f8efe4,#fff8ef 52%,#f0dfe1) !important; }
body.qixi-theme-rose:not(.qixi-home-bg-custom) .phone-screen { background: linear-gradient(145deg,#f3dde4,#fff5f3 52%,#e7dff0) !important; }
body.qixi-theme-forest:not(.qixi-home-bg-custom) .phone-screen { background: linear-gradient(145deg,#dcebe3,#eff7f0 52%,#dce9e9) !important; }
body.qixi-chat-bg-sky .conversation-modal { background: linear-gradient(180deg,#e6f5fb,#f5fafc) !important; }
body.qixi-chat-bg-lavender .conversation-modal { background: linear-gradient(180deg,#f0eafb,#fbf6fb) !important; }
body.qixi-chat-bg-peach .conversation-modal { background: linear-gradient(180deg,#fff0eb,#fff8f2) !important; }
body.qixi-chat-bg-forest .conversation-modal { background: linear-gradient(180deg,#e5f1e9,#f4faf5) !important; }
body.qixi-chat-bg-midnight .conversation-modal { background: linear-gradient(180deg,#202e3e,#283a4c) !important; }
.conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper) { background-image: linear-gradient(180deg,rgba(236,246,250,.76),rgba(246,249,250,.86)),var(--qixi-chat-wallpaper) !important; background-position: center; background-size: cover; background-repeat: no-repeat; }
.qixi-bubble-jelly .bubble, .appearance-bubble-preview.qixi-bubble-jelly i { background: linear-gradient(145deg,rgba(255,255,255,.8),rgba(226,239,255,.7)); border-color: rgba(255,255,255,.94); box-shadow: 0 9px 20px rgba(115,147,182,.18); backdrop-filter: blur(12px); }
.qixi-bubble-jelly .mine .bubble, .appearance-bubble-preview.qixi-bubble-jelly i:last-child { background: linear-gradient(145deg,#73b8d0,#8c84c8); }
.qixi-bubble-outline .bubble, .appearance-bubble-preview.qixi-bubble-outline i { color: #506b7c; background: rgba(255,255,255,.2); border: 1px solid rgba(112,151,174,.52); box-shadow: none; }
.qixi-bubble-outline .mine .bubble, .appearance-bubble-preview.qixi-bubble-outline i:last-child { color: #567186; background: rgba(191,219,231,.32); border-color: rgba(112,151,174,.58); }
.qixi-bubble-soft .bubble, .appearance-bubble-preview.qixi-bubble-soft i { color: #6f5e5e; background: #fff5e9; border-color: #fffaf4; border-radius: 15px 17px 17px 17px; box-shadow: 0 7px 18px rgba(177,133,113,.12); }
.qixi-bubble-soft .mine .bubble, .appearance-bubble-preview.qixi-bubble-soft i:last-child { color: #fff; background: linear-gradient(145deg,#e9ae9e,#c68cae); }
.qixi-bubble-peach .bubble, .appearance-bubble-preview.qixi-bubble-peach i { color: #725962; background: linear-gradient(145deg,#fff0e7,#ffe5ec); border-color: rgba(255,255,255,.92); }
.qixi-bubble-peach .mine .bubble, .appearance-bubble-preview.qixi-bubble-peach i:last-child { color: #fff; background: linear-gradient(145deg,#eb9c99,#d383ad); }
.qixi-bubble-ink .bubble, .appearance-bubble-preview.qixi-bubble-ink i { color: #d9e8f0; background: rgba(38,57,73,.82); border-color: rgba(168,199,216,.22); }
.qixi-bubble-ink .mine .bubble, .appearance-bubble-preview.qixi-bubble-ink i:last-child { color: #fff; background: linear-gradient(145deg,#476f8c,#5f5d91); }
body.qixi-theme-midnight .conversation-header, body.qixi-theme-midnight .message-composer { background: rgba(31,46,61,.9); border-color: rgba(186,208,223,.14); }
body.qixi-theme-midnight .message-list { color: #e5eef5; }
body.qixi-theme-midnight .conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper) { background-image: linear-gradient(180deg,rgba(26,39,52,.74),rgba(25,35,47,.86)),var(--qixi-chat-wallpaper) !important; }
@media (max-width: 380px) { .appearance-body { padding-left: 12px; padding-right: 12px; }.appearance-header { padding-left: 12px; padding-right: 12px; }.appearance-tabs { padding-left: 12px; padding-right: 12px; gap: 15px; }.appearance-hero strong { font-size: 19px; }.appearance-quick-grid { gap: 5px; }.appearance-quick-grid button { padding-left: 2px; padding-right: 2px; }.appearance-card-grid { gap: 8px; } }
.phone-screen.has-custom-wallpaper::after { background: linear-gradient(180deg, rgb(255 255 255 / var(--qixi-wallpaper-overlay, .38)), rgb(238 246 251 / var(--qixi-wallpaper-overlay, .38))); }
.conversation-modal.has-contact-wallpaper { background-image: linear-gradient(180deg, rgb(236 246 250 / var(--contact-wallpaper-overlay, .38)), rgb(246 249 250 / var(--contact-wallpaper-overlay, .38))), var(--contact-wallpaper); }
.conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper) { background-image: linear-gradient(180deg, rgb(236 246 250 / var(--contact-wallpaper-overlay, .38)), rgb(246 249 250 / var(--contact-wallpaper-overlay, .38))), var(--qixi-chat-wallpaper) !important; }
.night-mode .conversation-modal.has-contact-wallpaper { background-image: linear-gradient(180deg, rgb(25 37 49 / var(--contact-wallpaper-overlay, .38)), rgb(25 35 47 / var(--contact-wallpaper-overlay, .38))), var(--contact-wallpaper); }
.night-mode .conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper) { background-image: linear-gradient(180deg, rgb(25 37 49 / var(--contact-wallpaper-overlay, .38)), rgb(25 35 47 / var(--contact-wallpaper-overlay, .38))), var(--qixi-chat-wallpaper) !important; }
.appearance-opacity-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; margin-top: 14px; padding: 13px 14px; border: 1px solid rgba(180,204,216,.52); border-radius: 15px; background: rgba(255,255,255,.58); }
.appearance-opacity-control div { display: grid; gap: 4px; min-width: 0; }
.appearance-opacity-control span { color: #47677b; font-size: 11px; font-weight: 700; }
.appearance-opacity-control small { color: #8a9da8; font-size: 9px; }
.appearance-opacity-control output { color: #64889b; font-size: 11px; font-variant-numeric: tabular-nums; }
.appearance-opacity-control input { grid-column: 1 / -1; width: 100%; accent-color: #729caf; }
.night-mode .appearance-opacity-control { border-color: rgba(168,193,209,.24); background: rgba(38,52,67,.76); }
.night-mode .appearance-opacity-control span { color: #d8e8ee; }
.night-mode .appearance-opacity-control small,.night-mode .appearance-opacity-control output { color: #9eb6c1; }

/* QQ-inspired browsing layout refinements */
.appearance-view {
  --appearance-surface: rgba(255,255,255,.94);
  --appearance-muted: #8b929a;
  background: #f7f8fa;
  color: #20242a;
}
.appearance-header {
  grid-template-columns: 38px minmax(0,1fr) auto;
  min-height: 62px;
  padding: 14px 16px 8px;
  background: rgba(255,255,255,.96);
  border-bottom-color: rgba(24,31,39,.08);
}
.appearance-header > div { min-width: 0; text-align: center; }
.appearance-header .tiny-label { display: none; }
.appearance-header h2 {
  margin: 0;
  color: #171a1f;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}
.appearance-header .back-button {
  color: #171a1f;
  border-radius: 50%;
}
.appearance-header .back-button:hover { background: #f1f2f4; }
.appearance-reset {
  min-width: 42px;
  padding: 7px 0;
  color: #171a1f;
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 600;
}
.appearance-tabs {
  position: sticky;
  top: 62px;
  z-index: 3;
  gap: 24px;
  min-height: 42px;
  padding: 0 16px;
  align-items: end;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid rgba(24,31,39,.08);
}
.appearance-tabs button {
  padding: 10px 0 11px;
  color: #626870;
  font-size: 12px;
  font-weight: 500;
}
.appearance-tabs button.is-active { color: #15181c; font-weight: 700; }
.appearance-tabs button.is-active::after {
  right: 2px;
  left: 2px;
  height: 3px;
  border-radius: 999px;
  background: #15181c;
}
.appearance-body { padding: 14px 16px 34px; }
.appearance-hero {
  position: relative;
  min-height: 144px;
  padding: 18px 18px 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(116deg,#dceafa 0%,#e9e2f7 54%,#f4dfe7 100%);
  box-shadow: none;
}
.appearance-hero::after { display: none; }
.appearance-hero > div { gap: 5px; }
.appearance-hero > div > span { color: #5e6b7b; font-size: 9px; letter-spacing: .2px; }
.appearance-hero strong { color: #171b22; font-size: 20px; letter-spacing: -.2px; }
.appearance-hero small { color: #667080; font-size: 10px; }
.appearance-hero-orb {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 20px;
  color: #313744;
  background: rgba(255,255,255,.55);
  box-shadow: none;
}
.appearance-hero-orb svg { width: 25px; height: 25px; }
.appearance-quick-grid {
  gap: 7px;
  margin: 10px 0 16px;
}
.appearance-quick-grid button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 3px;
  border: 0;
  border-radius: 11px;
  color: #20242a;
  background: var(--appearance-surface);
  box-shadow: 0 2px 8px rgba(32,37,44,.04);
}
.appearance-quick-grid button:hover { transform: none; background: #fff; }
.appearance-quick-grid svg { width: 16px; height: 16px; color: #343a43; }
.appearance-quick-grid span { font-size: 10px; font-weight: 600; }
.appearance-quick-grid small { display: none; }
.appearance-current {
  padding: 8px 2px;
  margin: 0 0 16px;
  border: 0;
  border-bottom: 1px solid rgba(24,31,39,.08);
  border-radius: 0;
  background: transparent;
  color: var(--appearance-muted);
}
.appearance-current span { font-size: 10px; }
.appearance-current svg { color: #747b83; }
.appearance-current strong { color: #5d636c; font-size: 10px; font-weight: 500; }
.appearance-section-heading { margin: 0 2px 10px; }
.appearance-section-heading div { gap: 2px; }
.appearance-section-heading span { color: #8b929a; font-size: 9px; }
.appearance-section-heading strong { color: #171a1f; font-size: 16px; }
.appearance-section-heading button { color: #727982; }
.appearance-card-grid.compact-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(31%,1fr);
  grid-template-columns: none;
  gap: 9px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.appearance-card-grid.compact-grid::-webkit-scrollbar { display: none; }
.appearance-card {
  gap: 5px;
  padding: 8px;
  border: 0;
  border-radius: 14px;
  color: #30363d;
  background: var(--appearance-surface);
  box-shadow: 0 2px 9px rgba(32,37,44,.05);
}
.appearance-card:hover { transform: none; box-shadow: 0 3px 12px rgba(32,37,44,.08); }
.appearance-card.is-selected { border: 2px solid #272c33; padding: 6px; box-shadow: none; }
.appearance-card strong { color: #252a30; font-size: 11px; }
.appearance-card small { color: #9298a0; font-size: 9px; }
.appearance-check { top: 7px; right: 7px; width: 19px; height: 19px; color: #fff; background: #20252b; }
.appearance-theme-preview { height: 76px; border-radius: 10px; }
.appearance-panel-heading { margin: 2px 2px 14px; }
.appearance-panel-heading span { color: #8b929a; }
.appearance-panel-heading strong { color: #171a1f; font-size: 20px; }
.appearance-panel-heading small { color: #8b929a; }
.appearance-upload-card { border-color: rgba(45,51,59,.2); border-radius: 13px; background: rgba(255,255,255,.72); }
.qixi-theme-cream .appearance-header,.qixi-theme-cream .appearance-tabs,
.qixi-theme-rose .appearance-header,.qixi-theme-rose .appearance-tabs,
.qixi-theme-forest .appearance-header,.qixi-theme-forest .appearance-tabs { background: rgba(255,255,255,.96); }
body.qixi-theme-midnight .appearance-view { background: #1d232b; }
body.qixi-theme-midnight .appearance-header, body.qixi-theme-midnight .appearance-tabs { background: rgba(28,34,42,.97); }
body.qixi-theme-midnight .appearance-header h2, body.qixi-theme-midnight .appearance-tabs button.is-active,
body.qixi-theme-midnight .appearance-section-heading strong, body.qixi-theme-midnight .appearance-panel-heading strong { color: #f4f6f8; }
body.qixi-theme-midnight .appearance-tabs button, body.qixi-theme-midnight .appearance-section-heading span,
body.qixi-theme-midnight .appearance-panel-heading small { color: #aab3bd; }
body.qixi-theme-midnight .appearance-tabs button.is-active::after { background: #f4f6f8; }
@media (max-width: 380px) {
  .appearance-tabs { gap: 18px; }
  .appearance-tabs button { font-size: 11px; }
  .appearance-hero strong { font-size: 18px; }
  .appearance-quick-grid { gap: 4px; }
  .appearance-quick-grid span { font-size: 9px; }
}

/* Theme palettes: one token set drives the whole phone, not only the picker cards. */
body.qixi-theme-mist {
  --paper: #e9f1f6;
  --screen: #f4f8fb;
  --card: #ffffff;
  --ink: #273844;
  --muted: #7f909d;
  --line: #d8e4eb;
  --green: #5d9bbd;
  --green-dark: #397796;
  --coral: #d78da1;
  --qixi-frame: #243b4a;
  --qixi-bg: #f4f8fb;
  --qixi-surface: rgba(255,255,255,.9);
  --qixi-surface-strong: #ffffff;
  --qixi-border: rgba(181,205,218,.72);
  --qixi-accent: #5d9bbd;
  --qixi-accent-strong: #397796;
  --qixi-accent-soft: #d8edf6;
  --qixi-gradient: linear-gradient(145deg,#dbeef7 0%,#f4f8fb 54%,#ece5f3 100%);
  --qixi-surface-gradient: linear-gradient(135deg,rgba(255,255,255,.94),rgba(226,240,247,.84));
  --qixi-accent-gradient: linear-gradient(145deg,#66afd0,#788bc1);
  --qixi-mine-gradient: linear-gradient(145deg,#64a9cc,#7f8ac2);
  --qixi-overlay: linear-gradient(180deg,rgba(255,255,255,.2),rgba(223,239,247,.42));
  --qixi-shadow: 0 12px 26px rgba(54,91,111,.13);
}
body.qixi-theme-cream {
  --paper: #f5eee7;
  --screen: #fffaf5;
  --card: #fffdf9;
  --ink: #493b35;
  --muted: #9b8980;
  --line: #eadcd1;
  --green: #c68d69;
  --green-dark: #a9694b;
  --coral: #d38b89;
  --qixi-frame: #5a4b45;
  --qixi-bg: #fffaf5;
  --qixi-surface: rgba(255,253,249,.92);
  --qixi-surface-strong: #fffdf9;
  --qixi-border: rgba(224,199,183,.78);
  --qixi-accent: #c68d69;
  --qixi-accent-strong: #a9694b;
  --qixi-accent-soft: #f6e3d4;
  --qixi-gradient: linear-gradient(145deg,#fae8d7 0%,#fffaf5 54%,#f3e1e5 100%);
  --qixi-surface-gradient: linear-gradient(135deg,rgba(255,253,249,.95),rgba(251,235,220,.86));
  --qixi-accent-gradient: linear-gradient(145deg,#d9a17f,#c88996);
  --qixi-mine-gradient: linear-gradient(145deg,#d99b7c,#c789a1);
  --qixi-overlay: linear-gradient(180deg,rgba(255,253,249,.18),rgba(250,231,216,.42));
  --qixi-shadow: 0 12px 26px rgba(125,84,65,.12);
}
body.qixi-theme-rose {
  --paper: #f7e9ee;
  --screen: #fff5f7;
  --card: #fffafb;
  --ink: #4b303b;
  --muted: #9c7f8c;
  --line: #efcbd7;
  --green: #d7769c;
  --green-dark: #b55279;
  --coral: #d7769c;
  --qixi-frame: #543645;
  --qixi-bg: #fff5f7;
  --qixi-surface: rgba(255,250,251,.92);
  --qixi-surface-strong: #fffafb;
  --qixi-border: rgba(232,187,204,.8);
  --qixi-accent: #d7769c;
  --qixi-accent-strong: #b55279;
  --qixi-accent-soft: #f8dce6;
  --qixi-gradient: linear-gradient(145deg,#f6dce5 0%,#fff5f7 54%,#e9e0f4 100%);
  --qixi-surface-gradient: linear-gradient(135deg,rgba(255,250,251,.95),rgba(250,226,235,.84));
  --qixi-accent-gradient: linear-gradient(145deg,#e88eae,#bc84b5);
  --qixi-mine-gradient: linear-gradient(145deg,#e98eac,#c988b5);
  --qixi-overlay: linear-gradient(180deg,rgba(255,250,251,.18),rgba(246,218,229,.42));
  --qixi-shadow: 0 12px 26px rgba(137,75,103,.13);
}
body.qixi-theme-forest {
  --paper: #eaf3ec;
  --screen: #f3faf5;
  --card: #fbfffc;
  --ink: #30443a;
  --muted: #7e9788;
  --line: #cde3d4;
  --green: #70a98a;
  --green-dark: #4c8568;
  --coral: #c9937d;
  --qixi-frame: #294a3b;
  --qixi-bg: #f3faf5;
  --qixi-surface: rgba(251,255,252,.92);
  --qixi-surface-strong: #fbfffc;
  --qixi-border: rgba(187,214,195,.82);
  --qixi-accent: #70a98a;
  --qixi-accent-strong: #4c8568;
  --qixi-accent-soft: #dff0e4;
  --qixi-gradient: linear-gradient(145deg,#d9eee0 0%,#f3faf5 54%,#dfecef 100%);
  --qixi-surface-gradient: linear-gradient(135deg,rgba(251,255,252,.95),rgba(226,242,230,.86));
  --qixi-accent-gradient: linear-gradient(145deg,#75b08f,#6d9eb2);
  --qixi-mine-gradient: linear-gradient(145deg,#70ad8c,#649db3);
  --qixi-overlay: linear-gradient(180deg,rgba(251,255,252,.18),rgba(217,238,224,.42));
  --qixi-shadow: 0 12px 26px rgba(60,111,83,.12);
}
body.qixi-theme-midnight {
  --paper: #17222d;
  --screen: #1d2936;
  --card: #273746;
  --ink: #edf3f6;
  --muted: #9cafbb;
  --line: #425766;
  --green: #91a9d6;
  --green-dark: #b7a3e4;
  --coral: #dc9eb0;
  --qixi-frame: #0e1822;
  --qixi-bg: #1d2936;
  --qixi-surface: rgba(39,55,70,.92);
  --qixi-surface-strong: #2b3d4e;
  --qixi-border: rgba(152,181,198,.3);
  --qixi-accent: #a58ed2;
  --qixi-accent-strong: #c2b0ed;
  --qixi-accent-soft: #3c405b;
  --qixi-gradient: linear-gradient(145deg,#1b2b3b 0%,#26384b 54%,#4a3b59 100%);
  --qixi-surface-gradient: linear-gradient(135deg,rgba(42,60,76,.96),rgba(54,49,72,.9));
  --qixi-accent-gradient: linear-gradient(145deg,#718eb9,#9a7fc1);
  --qixi-mine-gradient: linear-gradient(145deg,#6688b1,#9075b7);
  --qixi-overlay: linear-gradient(180deg,rgba(18,29,40,.24),rgba(12,20,30,.48));
  --qixi-shadow: 0 16px 32px rgba(5,12,20,.34);
}

/* Shared surfaces and controls consume the active palette. */
body[class*="qixi-theme-"] .phone-frame { background: var(--qixi-frame); border-color: var(--qixi-frame); }
body[class*="qixi-theme-"] .phone-screen:not(.has-custom-wallpaper) { background: var(--qixi-gradient) !important; }
body[class*="qixi-theme-"] .phone-screen:not(.has-custom-wallpaper):after { background: var(--qixi-overlay) !important; }
body[class*="qixi-theme-"] .phone-view { color: var(--ink); }
body[class*="qixi-theme-"] .companion-card,
body[class*="qixi-theme-"] .weather-widget,
body[class*="qixi-theme-"] .quick-actions button,
body[class*="qixi-theme-"] .home-note,
body[class*="qixi-theme-"] .user-item,
body[class*="qixi-theme-"] .contact-row,
body[class*="qixi-theme-"] .diary-entry,
body[class*="qixi-theme-"] .memory-card,
body[class*="qixi-theme-"] .setting-row,
body[class*="qixi-theme-"] .auth-card,
body[class*="qixi-theme-"] .mood-picker button,
body[class*="qixi-theme-"] #diary-input,
body[class*="qixi-theme-"] .chat-search,
body[class*="qixi-theme-"] .friend-result,
body[class*="qixi-theme-"] .friend-request,
body[class*="qixi-theme-"] .contact-settings-profile,
body[class*="qixi-theme-"] .contact-settings-group {
  color: var(--ink);
  background: var(--qixi-surface) !important;
  border-color: var(--qixi-border) !important;
  box-shadow: var(--qixi-shadow);
}
body[class*="qixi-theme-"] .companion-card,
body[class*="qixi-theme-"] .weather-widget { background: var(--qixi-surface-gradient) !important; }
body[class*="qixi-theme-"] .companion-copy strong,
body[class*="qixi-theme-"] .weather-widget strong,
body[class*="qixi-theme-"] .home-header h1,
body[class*="qixi-theme-"] .app-header h2,
body[class*="qixi-theme-"] .section-title,
body[class*="qixi-theme-"] .app-icon,
body[class*="qixi-theme-"] .user-details strong,
body[class*="qixi-theme-"] .contact-row strong,
body[class*="qixi-theme-"] .setting-row b { color: var(--ink) !important; }
body[class*="qixi-theme-"] .tiny-label,
body[class*="qixi-theme-"] .companion-copy small,
body[class*="qixi-theme-"] .weather-widget small,
body[class*="qixi-theme-"] .user-details small,
body[class*="qixi-theme-"] .user-item time,
body[class*="qixi-theme-"] .setting-row i,
body[class*="qixi-theme-"] .view-intro { color: var(--muted) !important; }
body[class*="qixi-theme-"] .profile-orb,
body[class*="qixi-theme-"] .companion-avatar,
body[class*="qixi-theme-"] .app-logo,
body[class*="qixi-theme-"] .primary-button,
body[class*="qixi-theme-"] .photo-add,
body[class*="qixi-theme-"] .send-button { background: var(--qixi-accent-gradient) !important; }
body[class*="qixi-theme-"] .companion-progress { background: var(--qixi-accent-soft) !important; }
body[class*="qixi-theme-"] .companion-progress span { background: var(--qixi-accent-gradient) !important; }
body[class*="qixi-theme-"] .chat-filters button.active,
body[class*="qixi-theme-"] .user-item:hover,
body[class*="qixi-theme-"] .user-item.selected,
body[class*="qixi-theme-"] .contact-row:hover { background: var(--qixi-accent-soft) !important; color: var(--qixi-accent-strong) !important; }
body[class*="qixi-theme-"] .conversation-modal { background: var(--qixi-gradient) !important; color: var(--ink); }
body[class*="qixi-theme-"] .conversation-header,
body[class*="qixi-theme-"] .message-composer,
body[class*="qixi-theme-"] .message-input-shell,
body[class*="qixi-theme-"] .conversation-tool,
body[class*="qixi-theme-"] .compose-tool { background: var(--qixi-surface) !important; border-color: var(--qixi-border) !important; color: var(--ink); }
body[class*="qixi-theme-"] .bubble { background: var(--qixi-surface-strong) !important; border-color: var(--qixi-border) !important; color: var(--ink); }
body[class*="qixi-theme-"] .mine .bubble { background: var(--qixi-mine-gradient) !important; border-color: transparent !important; color: #fff; }
body[class*="qixi-theme-"] .message-composer textarea { color: var(--ink); }
body[class*="qixi-theme-"] .message-composer textarea::placeholder { color: var(--muted); }
body[class*="qixi-theme-"] .contact-settings-view { background: var(--qixi-bg); color: var(--ink); }
body[class*="qixi-theme-"] .contact-settings-header { background: var(--qixi-surface) !important; border-color: var(--qixi-border); }
body[class*="qixi-theme-"] .contact-settings-row { color: var(--ink); }
body[class*="qixi-theme-"] .contact-settings-row + .contact-settings-row { border-color: var(--qixi-border); }
body[class*="qixi-theme-"] .contact-settings-row .row-icon { background: var(--qixi-accent-soft); color: var(--qixi-accent-strong); }
body[class*="qixi-theme-"] .appearance-view { background: var(--qixi-bg); }
body[class*="qixi-theme-"] .appearance-header,
body[class*="qixi-theme-"] .appearance-tabs { background: var(--qixi-surface-strong); border-color: var(--qixi-border); }
body[class*="qixi-theme-"] .appearance-tabs button.is-active::after { background: var(--qixi-accent-strong); }
body[class*="qixi-theme-"] .appearance-hero { background: var(--qixi-gradient); }
body[class*="qixi-theme-"] .appearance-quick-grid button,
body[class*="qixi-theme-"] .appearance-card,
body[class*="qixi-theme-"] .appearance-upload-card { background: var(--qixi-surface) !important; border-color: var(--qixi-border); color: var(--ink); }
body[class*="qixi-theme-"] .appearance-card strong,
body[class*="qixi-theme-"] .appearance-section-heading strong,
body[class*="qixi-theme-"] .appearance-panel-heading strong { color: var(--ink); }
body[class*="qixi-theme-"] .appearance-card.is-selected { border-color: var(--qixi-accent-strong); box-shadow: 0 0 0 2px var(--qixi-accent-soft); }
body[class*="qixi-theme-"] .appearance-check,
body[class*="qixi-theme-"] .appearance-upload-card > span { background: var(--qixi-accent-gradient); }
body[class*="qixi-theme-"] .appearance-current { border-color: var(--qixi-border); color: var(--muted); }
body[class*="qixi-theme-"] .appearance-current strong { color: var(--ink); }
body[class*="qixi-theme-"] .appearance-opacity-control { background: var(--qixi-surface); border-color: var(--qixi-border); }
body[class*="qixi-theme-"] .appearance-opacity-control input { accent-color: var(--qixi-accent); }
/* Keep a selected chat wallpaper visible while applying the active theme's tint. */
body[class*="qixi-theme-"] .conversation-modal.has-contact-wallpaper {
  background-color: var(--qixi-bg) !important;
  background-image: var(--qixi-overlay), var(--contact-wallpaper) !important;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
body[class*="qixi-theme-"] .conversation-modal.has-appearance-chat-wallpaper:not(.has-contact-wallpaper) {
  background-color: var(--qixi-bg) !important;
  background-image: var(--qixi-overlay), var(--qixi-chat-wallpaper) !important;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Appearance controls are independent: the selected bubble/background wins
   over the theme's shared defaults without changing the other selections. */
body.qixi-home-bg-default .phone-screen:not(.has-custom-wallpaper),
body.qixi-home-bg-mist .phone-screen:not(.has-custom-wallpaper) {
  background: linear-gradient(145deg,#d8e9f2 0%,#edf1f4 48%,#f0e2ea 100%) !important;
}
body.qixi-home-bg-sky .phone-screen:not(.has-custom-wallpaper) {
  background: linear-gradient(145deg,#c4e4f2 0%,#eef7fa 55%,#d8e8f4 100%) !important;
}
body.qixi-home-bg-lavender .phone-screen:not(.has-custom-wallpaper) {
  background: linear-gradient(145deg,#ddd3ef 0%,#f7eff7 52%,#d7e4ef 100%) !important;
}
body.qixi-home-bg-peach .phone-screen:not(.has-custom-wallpaper) {
  background: linear-gradient(145deg,#f6d5c7 0%,#fff3e7 50%,#ead9ef 100%) !important;
}
body.qixi-home-bg-forest .phone-screen:not(.has-custom-wallpaper) {
  background: linear-gradient(145deg,#cfe7da 0%,#eff6ed 52%,#dce9e9 100%) !important;
}
body.qixi-home-bg-midnight .phone-screen:not(.has-custom-wallpaper) {
  background: linear-gradient(145deg,#17283a 0%,#35415d 52%,#6d577d 100%) !important;
}
body[class*="qixi-home-bg-"] .phone-screen:not(.has-custom-wallpaper)::after {
  background: linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.24)) !important;
}

body.qixi-chat-bg-default .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper),
body.qixi-chat-bg-mist .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper) {
  background: linear-gradient(180deg,#d8e9f2,#edf1f4 52%,#f0e2ea) !important;
}
body.qixi-chat-bg-sky .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper) {
  background: linear-gradient(180deg,#e6f5fb,#f5fafc) !important;
}
body.qixi-chat-bg-lavender .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper) {
  background: linear-gradient(180deg,#f0eafb,#fbf6fb) !important;
}
body.qixi-chat-bg-peach .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper) {
  background: linear-gradient(180deg,#fff0eb,#fff8f2) !important;
}
body.qixi-chat-bg-forest .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper) {
  background: linear-gradient(180deg,#e5f1e9,#f4faf5) !important;
}
body.qixi-chat-bg-midnight .conversation-modal:not(.has-contact-wallpaper):not(.has-appearance-chat-wallpaper) {
  background: linear-gradient(180deg,#202e3e,#283a4c) !important;
}

body.qixi-bubble-glass .bubble {
  color: #3f5364 !important;
  background: rgba(255,255,255,.84) !important;
  border: 1px solid rgba(255,255,255,.86) !important;
  box-shadow: 0 7px 18px rgba(93,119,138,.09) !important;
}
body.qixi-bubble-glass .mine .bubble {
  color: #fff !important;
  background: linear-gradient(145deg,#7ca8b9,#788db5) !important;
  border-color: transparent !important;
}
body.qixi-bubble-jelly .bubble {
  color: #476174 !important;
  background: linear-gradient(145deg,rgba(255,255,255,.8),rgba(226,239,255,.7)) !important;
  border-color: rgba(255,255,255,.94) !important;
  box-shadow: 0 9px 20px rgba(115,147,182,.18) !important;
  backdrop-filter: blur(12px) !important;
}
body.qixi-bubble-jelly .mine .bubble {
  color: #fff !important;
  background: linear-gradient(145deg,#73b8d0,#8c84c8) !important;
  border-color: transparent !important;
}
body.qixi-bubble-outline .bubble {
  color: #506b7c !important;
  background: rgba(255,255,255,.2) !important;
  border: 1px solid rgba(112,151,174,.52) !important;
  box-shadow: none !important;
}
body.qixi-bubble-outline .mine .bubble {
  color: #567186 !important;
  background: rgba(191,219,231,.32) !important;
  border-color: rgba(112,151,174,.58) !important;
}
body.qixi-bubble-soft .bubble {
  color: #6f5e5e !important;
  background: #fff5e9 !important;
  border-color: #fffaf4 !important;
  border-radius: 15px 17px 17px 17px !important;
  box-shadow: 0 7px 18px rgba(177,133,113,.12) !important;
}
body.qixi-bubble-soft .mine .bubble {
  color: #fff !important;
  background: linear-gradient(145deg,#e9ae9e,#c68cae) !important;
  border-color: transparent !important;
}
body.qixi-bubble-peach .bubble {
  color: #725962 !important;
  background: linear-gradient(145deg,#fff0e7,#ffe5ec) !important;
  border-color: rgba(255,255,255,.92) !important;
}
body.qixi-bubble-peach .mine .bubble {
  color: #fff !important;
  background: linear-gradient(145deg,#eb9c99,#d383ad) !important;
  border-color: transparent !important;
}
body.qixi-bubble-ink .bubble {
  color: #d9e8f0 !important;
  background: rgba(38,57,73,.82) !important;
  border-color: rgba(168,199,216,.22) !important;
}
body.qixi-bubble-ink .mine .bubble {
  color: #fff !important;
  background: linear-gradient(145deg,#476f8c,#5f5d91) !important;
  border-color: transparent !important;
}


/* Keep the conversation focused on messages: no extra status strip below the header. */
.conversation-modal {
  grid-template-rows: 70px minmax(0, 1fr) auto;
}
.conversation-banner {
  display: none !important;
}

/* Match the conversation header to the light glass surface used by the phone page. */
.conversation-header {
  color: #4f687b;
  background: rgba(244, 249, 252, .96);
  border-bottom-color: rgba(170, 191, 205, .5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.conversation-header h2 { color: #405d72; }
.conversation-tool {
  background: rgba(255, 255, 255, .8);
  color: #688196;
  box-shadow: 0 4px 12px rgba(88, 116, 134, .08);
}

/* Voice sheet is intentionally flush with the phone edges. */
.message-bottom-sheet.voice-sheet {
  border-radius: 0 !important;
}

/* QQ-style voice message bubbles. The fixed row keeps the message list stable
 * while the audio element changes between paused and playing states. */
.audio-bubble {
  min-width: 148px;
  padding: 5px !important;
  overflow: hidden;
}
.audio-message-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(54px, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 4px 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.audio-message-button time {
  grid-column: 1 / -1;
  margin: 0 2px 0 auto;
  text-align: right;
}
.audio-message-button strong {
  min-width: 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  text-align: right;
  opacity: .84;
}
.audio-play-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: #5d8095;
  box-shadow: 0 4px 10px rgba(77,108,130,.14);
}
.audio-play-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}
.mine .audio-play-icon {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.audio-wave {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: .7;
}
.audio-wave i {
  width: 2px;
  height: 8px;
  display: block;
  border-radius: 2px;
  background: currentColor;
  opacity: .7;
  transform-origin: center;
}
.audio-wave i:nth-child(2n) { height: 14px; }
.audio-wave i:nth-child(3n) { height: 20px; }
.audio-wave i:nth-child(5n) { height: 11px; }
.audio-message-button.is-playing .audio-wave i {
  animation: qixi-audio-wave .75s ease-in-out infinite alternate;
}
.audio-message-button.is-playing .audio-wave i:nth-child(2n) { animation-delay: -.28s; }
.audio-message-button.is-playing .audio-wave i:nth-child(3n) { animation-delay: -.52s; }
.audio-message-button:hover .audio-play-icon { transform: scale(1.05); }
.audio-message-button:focus-visible { outline: 2px solid rgba(105,160,183,.55); outline-offset: 2px; }
.audio-message-element { display: none; }
.voice-record-button.uploading { cursor: wait; opacity: .72; }
@keyframes qixi-audio-wave {
  from { transform: scaleY(.62); }
  to { transform: scaleY(1.18); }
}

.video-bubble { max-width: min(250px, 72vw); padding: 6px !important; overflow: hidden; }
.video-message-wrap { position: relative; overflow: hidden; border-radius: 12px; background: rgba(32, 54, 68, .08); }
.video-message-element { display: block; width: min(238px, 68vw); max-height: 220px; aspect-ratio: 16 / 10; object-fit: contain; background: #1d2d39; }
.video-message-duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 999px; color: #fff; background: rgba(16, 31, 42, .62); font-size: 10px; line-height: 1.2; }
.video-bubble > time { display: block; margin: 4px 2px 0 auto; text-align: right; }
.message-more-grid [data-attach-action="video"] > span { background: rgba(127, 167, 196, .18); color: #5b86a2; }
.night-mode .video-message-wrap { background: rgba(220, 237, 244, .08); }
.message-time-row{display:flex;justify-content:center;align-items:center;width:100%;margin:7px 0 3px;pointer-events:none}
.message-time-row .message-time{display:block;margin:0;padding:3px 9px;border:1px solid rgba(255,255,255,.62);border-radius:999px;background:rgba(123,145,157,.14);color:#778b98;font-size:8px;line-height:1.2;font-variant-numeric:tabular-nums;letter-spacing:.15px;white-space:nowrap}
.night-mode .message-time-row .message-time{border-color:rgba(168,193,209,.2);background:rgba(71,91,111,.48);color:#b8c9d2}
.recalled-divider{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;margin:8px 0;color:#8b9ba8;font-size:9px;line-height:1.2}
.recalled-divider:before,.recalled-divider:after{content:'';height:1px;flex:1 1 24px;background:rgba(170,191,205,.35)}
.recalled-divider>span{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border:1px solid rgba(255,255,255,.62);border-radius:999px;background:rgba(255,255,255,.52);white-space:nowrap}
.recalled-divider>span svg{width:12px;height:12px;opacity:.75}
.recalled-edit-button{padding:4px 8px;border:1px solid rgba(113,150,169,.3);border-radius:999px;background:rgba(225,238,243,.72);color:#5f879b;font-size:8px;line-height:1.2}
.recalled-edit-button:hover,.recalled-edit-button:focus-visible{background:#d6e9ef;color:#426f86}
.night-mode .recalled-divider{color:#aabac4}.night-mode .recalled-divider:before,.night-mode .recalled-divider:after{background:rgba(168,193,209,.28)}.night-mode .recalled-divider>span{border-color:rgba(168,193,209,.2);background:rgba(71,91,111,.48)}.night-mode .recalled-edit-button{border-color:rgba(168,193,209,.28);background:rgba(71,91,111,.62);color:#b8d5df}

.setting-row.is-policy-disabled { opacity: .58; cursor: not-allowed; }

/* Unified night palette. Keep every app surface on the same blue-charcoal
   scale so the older green defaults cannot leak through in dark mode. */
body.night-mode {
  --screen: #111c29;
  --ink: #e8f1f5;
  --muted: #91a5b2;
  --line: rgba(168, 197, 211, .18);
  --card: rgba(27, 42, 57, .9);
  --glass: rgba(27, 42, 57, .82);
  --glass-strong: rgba(31, 48, 64, .96);
  --glass-line: rgba(168, 197, 211, .2);
  --blue-ink: #e8f1f5;
  --blue-muted: #9aafbc;
  --qixi-bg: #111c29;
  --qixi-surface: rgba(27, 42, 57, .9);
  --qixi-surface-strong: #1d3041;
  --qixi-border: rgba(168, 197, 211, .2);
  --qixi-accent: #6eabc0;
  --qixi-accent-strong: #9bc9d8;
  --qixi-accent-soft: rgba(74, 119, 137, .34);
  --qixi-surface-gradient: linear-gradient(135deg, rgba(32, 55, 70, .96), rgba(43, 42, 65, .9));
  --qixi-accent-gradient: linear-gradient(145deg, #4e8da3, #596b9c);
  --qixi-shadow: 0 14px 30px rgba(0, 0, 0, .24);
  color-scheme: dark;
  background: #0b1420;
  color: var(--ink);
}

body.night-mode .device-stage,
body.night-mode .auth-device {
  background: radial-gradient(circle at 16% 12%, rgba(77, 111, 137, .2), transparent 34%),
    radial-gradient(circle at 85% 85%, rgba(96, 73, 112, .16), transparent 38%), #0b1420;
}

body.night-mode .phone-frame {
  border-color: #08111c;
  background: #08111c;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}

body.night-mode .phone-screen,
body.night-mode .auth-screen {
  background: linear-gradient(155deg, #142536 0%, #101c2a 54%, #1c1b2d 100%) !important;
}

body.night-mode .phone-screen:after {
  background: linear-gradient(180deg, rgba(12, 23, 35, .18), rgba(7, 14, 24, .62)) !important;
}

body.night-mode .phone-screen.has-custom-wallpaper:after {
  background: linear-gradient(180deg, rgba(10, 20, 31, .38), rgba(8, 15, 25, .72)) !important;
}

body.night-mode .status-bar,
body.night-mode .phone-view,
body.night-mode .conversation-modal {
  color: var(--ink);
}

body.night-mode .status-bar {
  color: #dceaf0;
  text-shadow: 0 1px rgba(0, 0, 0, .38);
}

body.night-mode .tiny-label,
body.night-mode .section-title span,
body.night-mode .view-intro,
body.night-mode .user-details small,
body.night-mode .user-meta,
body.night-mode .photo-toolbar small,
body.night-mode .setting-profile small,
body.night-mode .message-author,
body.night-mode .message-time {
  color: #91a5b2;
}

body.night-mode .home-header h1,
body.night-mode .app-header h2,
body.night-mode .section-title,
body.night-mode .app-icon,
body.night-mode .companion-copy strong,
body.night-mode .weather-widget strong,
body.night-mode .home-note strong,
body.night-mode .setting-profile strong {
  color: #eaf3f6;
}

body.night-mode .companion-card,
body.night-mode .weather-widget,
body.night-mode .quick-actions button,
body.night-mode .home-note,
body.night-mode .user-item,
body.night-mode .contact-row,
body.night-mode .diary-entry,
body.night-mode .memory-card,
body.night-mode .memory-entry,
body.night-mode .memory-composer textarea,
body.night-mode .setting-row,
body.night-mode .chat-search,
body.night-mode .mood-picker button,
body.night-mode .message-composer,
body.night-mode .auth-card,
body.night-mode .friend-search,
body.night-mode .friend-result,
body.night-mode .friend-request,
body.night-mode .uid-card {
  color: var(--ink);
  background: rgba(27, 42, 57, .84);
  border-color: rgba(168, 197, 211, .2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

body.night-mode .companion-card {
  background: linear-gradient(120deg, rgba(39, 68, 77, .9), rgba(42, 48, 73, .86));
}

body.night-mode .weather-widget {
  background: linear-gradient(120deg, rgba(49, 70, 80, .92), rgba(58, 52, 75, .9));
}

body.night-mode .quick-actions button:hover,
body.night-mode .user-item:hover,
body.night-mode .user-item.selected,
body.night-mode .contact-row:hover,
body.night-mode .friend-result:hover,
body.night-mode .friend-request:hover,
body.night-mode .setting-row:hover {
  background: rgba(61, 83, 101, .78);
  border-color: rgba(168, 197, 211, .3);
}

body.night-mode .chat-filters button.active {
  color: #e4f3f5;
  background: rgba(61, 101, 101, .72);
}

body.night-mode .chat-search input,
body.night-mode .friend-search input,
body.night-mode .auth-form input,
body.night-mode #diary-input,
body.night-mode .message-composer textarea,
body.night-mode .message-input-shell input {
  color: var(--ink);
  background: transparent;
}

body.night-mode input::placeholder,
body.night-mode textarea::placeholder {
  color: #718895;
}

body.night-mode .message-input-shell {
  background: rgba(15, 28, 42, .92);
  border-color: rgba(168, 197, 211, .26);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

body.night-mode .message-list {
  background: rgba(11, 22, 34, .2);
}

body.night-mode .bubble {
  color: #e3eef2;
  background: rgba(47, 68, 84, .94);
  border-color: rgba(168, 197, 211, .16);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
}

body.night-mode .mine .bubble {
  color: #fff;
  background: linear-gradient(145deg, #4d91a6, #596aa0);
  border-color: transparent;
}

body.night-mode .conversation-header,
body.night-mode .message-composer {
  background: rgba(18, 32, 47, .94);
  border-color: rgba(168, 197, 211, .18);
}

body.night-mode .conversation-tool,
body.night-mode .compose-tool,
body.night-mode .dock-icon,
body.night-mode .soft-icon,
body.night-mode .add-widget-button {
  color: #d4e6ed;
  background: rgba(65, 88, 106, .68);
  border-color: rgba(168, 197, 211, .2);
}

body.night-mode .dock {
  background: rgba(20, 35, 49, .86);
  border-color: rgba(168, 197, 211, .2);
  box-shadow: 0 15px 30px rgba(0, 0, 0, .24);
}

body.night-mode .photo-toolbar {
  background: linear-gradient(180deg, rgba(17, 30, 44, .98) 78%, rgba(17, 30, 44, 0));
}

body.night-mode .photo-date-heading,
body.night-mode .photo-empty strong,
body.night-mode .photo-empty p {
  color: #dcecf2;
}

body.night-mode .photo-tile {
  background: #243746;
}

body.night-mode .background-preview,
body.night-mode .background-upload,
body.night-mode .photo-select-toggle,
body.night-mode .photo-send-panel,
body.night-mode .contact-settings-panel,
body.night-mode .message-popover,
body.night-mode .message-context-menu,
body.night-mode .widget-sheet-panel,
body.night-mode .lock-setup-card {
  color: var(--ink);
  background: rgba(22, 37, 52, .96);
  border-color: rgba(168, 197, 211, .22);
}

body.night-mode .background-upload,
body.night-mode .photo-select-toggle {
  color: #c5dce6;
}

body.night-mode .toast {
  color: #f3f8fa;
  background: #1c3042;
  border-color: rgba(168, 197, 211, .25);
}

body.night-mode .primary-button,
body.night-mode .photo-add,
body.night-mode .friend-search button,
body.night-mode .send-button {
  background: linear-gradient(145deg, #4e8da3, #596b9c);
  color: #fff;
}

body.night-mode .danger-row,
body.night-mode .contact-settings-danger .contact-settings-row {
  color: #f0a5b1;
}

body.night-mode .date-divider span,
body.night-mode .message-time-row .message-time {
  color: #a9bdc7;
  background: rgba(61, 83, 101, .64);
  border-color: rgba(168, 197, 211, .18);
}

/* Settings are also themed by the selectable qixi theme rules above. Use a
   more specific night selector so those light surfaces cannot win the cascade. */
body.night-mode[class*="qixi-theme-"] {
  --qixi-bg: #111c29 !important;
  --qixi-surface: rgba(27, 42, 57, .92) !important;
  --qixi-surface-strong: #1d3041 !important;
  --qixi-border: rgba(168, 197, 211, .22) !important;
  --qixi-accent-soft: rgba(74, 119, 137, .34) !important;
  --qixi-surface-gradient: linear-gradient(135deg, rgba(32, 55, 70, .96), rgba(43, 42, 65, .9)) !important;
  --qixi-accent-gradient: linear-gradient(145deg, #4e8da3, #596b9c) !important;
  --qixi-mine-gradient: linear-gradient(145deg, #4d91a6, #596aa0) !important;
  --qixi-overlay: linear-gradient(180deg, rgba(10, 20, 31, .38), rgba(8, 15, 25, .72)) !important;
}

body.night-mode .settings-list .setting-row,
body.night-mode .settings-list .setting-row-feature,
body.night-mode .settings-list .background-preview,
body.night-mode .settings-list .setting-profile {
  color: #e8f1f5 !important;
  background: rgba(27, 42, 57, .92) !important;
  border-color: rgba(168, 197, 211, .22) !important;
}

body.night-mode .settings-list .setting-row b,
body.night-mode .settings-list .setting-row i,
body.night-mode .settings-list .setting-row small,
body.night-mode .settings-list .setting-profile strong,
body.night-mode .settings-list .setting-profile small {
  color: #e8f1f5 !important;
}

body.night-mode .settings-list .setting-row i,
body.night-mode .settings-list .setting-profile small {
  color: #9ab0bd !important;
}

body.night-mode .settings-list .background-upload,
body.night-mode .settings-list .background-preview button,
body.night-mode .settings-list .setting-mini-button,
body.night-mode .settings-list .setting-link-button {
  color: #d7e8ee !important;
  background: rgba(65, 88, 106, .72) !important;
  border-color: rgba(168, 197, 211, .2) !important;
}

body.night-mode .settings-list .danger-row,
body.night-mode .settings-list .danger-row b,
body.night-mode .settings-list .danger-row i {
  color: #f0a5b1 !important;
}

/* QQ/WeChat-inspired sticker tray. The tray stays compact on the phone while
   giving management mode a clear selection state and batch action bar. */
.sticker-popover {
  right: 10px;
  bottom: 110px;
  width: min(330px, calc(100% - 20px));
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}
.sticker-popover.open { display: grid; }
.sticker-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px 8px; border-bottom: 1px solid rgba(178, 199, 211, .35); }
.sticker-panel-heading > div:first-child { display: grid; gap: 2px; min-width: 0; }
.sticker-eyebrow { color: #8ca0ae; font-size: 9px; letter-spacing: .4px; }
.sticker-panel-heading strong { color: #4f6879; font-size: 12px; }
.sticker-heading-actions { display: flex; align-items: center; gap: 5px; }
.sticker-heading-actions button { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 9px; background: rgba(111, 147, 165, .12); color: #64849a; font-size: 10px; }
.sticker-heading-actions .sticker-add-button { width: 28px; padding: 0; font-size: 18px; line-height: 1; }
.sticker-pack-tabs { display: flex; gap: 2px; padding: 7px 8px 6px; overflow-x: auto; border-bottom: 1px solid rgba(178, 199, 211, .28); scrollbar-width: none; }
.sticker-pack-tabs::-webkit-scrollbar { display: none; }
.sticker-pack-tab { flex: 0 0 47px; display: grid; justify-items: center; gap: 2px; padding: 3px 2px 5px; border: 0; border-radius: 9px; background: transparent; color: #8194a1; }
.sticker-pack-tab span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(218, 232, 238, .7); font-size: 16px; overflow: hidden; }
.sticker-pack-tab small { max-width: 45px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.sticker-pack-tab.active { color: #4d85a0; background: rgba(198, 222, 232, .35); }
.sticker-pack-tab.active span { background: rgba(255, 255, 255, .88); box-shadow: 0 2px 7px rgba(72, 109, 126, .12); }
.sticker-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; min-height: 148px; max-height: 214px; padding: 10px; overflow-y: auto; scrollbar-width: thin; }
.sticker-tile { position: relative; display: grid; place-items: center; min-width: 0; aspect-ratio: 1; padding: 5px; border: 0; border-radius: 11px; background: transparent; color: #425d70; cursor: pointer; }
.sticker-tile:hover, .sticker-tile:focus-visible { background: rgba(211, 230, 238, .62); outline: 0; }
.sticker-tile img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.sticker-emoji { font-size: 25px; line-height: 1; }
.sticker-check { position: absolute; top: 3px; right: 3px; display: none; place-items: center; width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: #89a9ba; color: #fff; font-size: 10px; font-style: normal; box-shadow: 0 2px 5px rgba(50, 79, 96, .2); }
.sticker-managing .sticker-check { display: grid; background: #d4e2e8; color: transparent; }
.sticker-managing .sticker-tile.selected .sticker-check { background: #5d9fba; color: #fff; }
.sticker-managing .sticker-tile.selected { background: rgba(172, 211, 225, .4); }
.sticker-empty { padding: 36px 15px; color: #899ba7; text-align: center; font-size: 10px; line-height: 1.8; }
.sticker-empty button { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(111, 147, 165, .14); color: #5e849a; font-size: 10px; }
.sticker-panel-hint { padding: 7px 11px 9px; color: #9aabb5; text-align: center; font-size: 8px; border-top: 1px solid rgba(178, 199, 211, .24); }
.sticker-manage-bar { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 6px; padding: 8px 10px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(178, 199, 211, .3); background: rgba(238, 246, 249, .78); }
.sticker-manage-bar button { min-height: 29px; border-radius: 9px; background: #6b96ab; color: #fff; font-size: 10px; font-weight: 700; }
.sticker-manage-bar button.danger { background: rgba(198, 113, 129, .15); color: #b66d7d; }
.sticker-manage-bar button.subtle { background: rgba(111, 147, 165, .12); color: #688597; }
body.night-mode .sticker-popover { background: rgba(29, 43, 57, .98); border-color: rgba(168, 193, 209, .25); }
body.night-mode .sticker-panel-heading { border-color: rgba(168, 193, 209, .2); }
body.night-mode .sticker-panel-heading strong { color: #e1edf2; }
body.night-mode .sticker-eyebrow, body.night-mode .sticker-panel-hint, body.night-mode .sticker-empty { color: #9eb4bf; }
body.night-mode .sticker-heading-actions button { background: rgba(91, 119, 136, .42); color: #d1e3ea; }
body.night-mode .sticker-pack-tabs { border-color: rgba(168, 193, 209, .2); }
body.night-mode .sticker-pack-tab { color: #9eb4bf; }
body.night-mode .sticker-pack-tab span { background: rgba(75, 99, 115, .72); }
body.night-mode .sticker-pack-tab.active { color: #c4e3ee; background: rgba(93, 139, 159, .26); }
body.night-mode .sticker-pack-tab.active span { background: rgba(106, 145, 163, .55); }
body.night-mode .sticker-tile:hover, body.night-mode .sticker-tile:focus-visible, body.night-mode .sticker-managing .sticker-tile.selected { background: rgba(91, 130, 149, .34); }
body.night-mode .sticker-manage-bar { background: rgba(25, 38, 51, .98); border-color: rgba(168, 193, 209, .2); }
body.night-mode .sticker-manage-bar button.subtle { background: rgba(91, 119, 136, .35); color: #d1e3ea; }

/* The sticker tray follows the same full-width bottom-sheet model as voice
   and attachment actions. Keeping it in the phone viewport prevents the
   narrow floating column that used to appear beside the composer. */
.sticker-popover.message-bottom-sheet {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  max-height: min(70%, 430px);
  display: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom)) !important;
  overflow: hidden;
  border-radius: 24px 24px 0 0 !important;
}
.sticker-popover.message-bottom-sheet.open { display: grid !important; }
.sticker-popover.message-bottom-sheet .bottom-sheet-grabber { margin-bottom: 8px; }
.sticker-popover.message-bottom-sheet .sticker-panel-heading { margin: 0 2px 6px; padding: 0 0 8px; }
.sticker-popover.message-bottom-sheet .sticker-pack-tabs { padding: 5px 2px 6px; }
.sticker-popover.message-bottom-sheet .sticker-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 0;
  max-height: none;
  padding: 10px 2px;
  gap: 4px;
}
.sticker-popover.message-bottom-sheet .sticker-panel-hint { padding-bottom: 2px; }
.sticker-popover.message-bottom-sheet .sticker-manage-bar { margin: 0 -14px -14px; }
@media (max-width: 380px) {
  .sticker-popover.message-bottom-sheet { max-height: min(72%, 400px); padding-left: 10px !important; padding-right: 10px !important; }
  .sticker-popover.message-bottom-sheet .sticker-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px 1px; }
  .sticker-popover.message-bottom-sheet .sticker-manage-bar { margin-left: -10px; margin-right: -10px; margin-bottom: -10px; }
  .sticker-emoji { font-size: 22px; }
}

/* Match the voice sheet: the sticker tray is a normal grid row after the
   composer, so the input bar stays above it instead of being covered. */
.sticker-popover.message-bottom-sheet {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  max-height: none;
  padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
  box-shadow: 0 -18px 42px rgba(48, 76, 96, .24) !important;
}
.conversation-modal > .message-composer { position: relative; z-index: 75; }
/* Contact settings is a full-screen chat subpage; keep the composer behind it. */
.conversation-modal.settings-open > .message-composer {
  visibility: hidden;
  pointer-events: none;
}
.conversation-modal > .contact-settings-view {
  z-index: 90;
}
.sticker-pack-cover {
  display: grid !important;
  place-items: center;
}
.sticker-pack-cover svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}
.sticker-pack-tab.active .sticker-pack-cover svg { color: #5c91aa; }
.sticker-heading-actions button,
.sticker-manage-bar button,
.sticker-empty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sticker-heading-actions button svg,
.sticker-manage-bar button svg,
.sticker-empty button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.sticker-heading-actions .sticker-add-button svg { width: 17px; height: 17px; }
.sticker-manage-bar button { white-space: nowrap; }
.sticker-manage-bar button span { line-height: 1; }
.sticker-heading-actions .sticker-manage-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 68px;
  padding: 0 9px;
  border: 1px solid rgba(108, 151, 171, .2);
  background: linear-gradient(145deg, rgba(226, 241, 247, .96), rgba(242, 247, 249, .9));
  box-shadow: 0 4px 10px rgba(73, 112, 132, .08);
}
.sticker-heading-actions .sticker-manage-button svg {
  width: 15px;
  height: 15px;
  padding: 3px;
  box-sizing: content-box;
  border-radius: 7px;
  background: rgba(104, 157, 178, .16);
  color: #5d91a7;
}
.sticker-heading-actions .sticker-manage-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, #6099b0, #718bb1);
  box-shadow: 0 5px 12px rgba(83, 130, 157, .25);
}
.sticker-heading-actions .sticker-manage-button.active svg { background: rgba(255,255,255,.2); color: #fff; }
.sticker-action-icon {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.32);
}
.sticker-action-icon svg { width: 13px; height: 13px; }
.sticker-manage-bar button { display: inline-flex; align-items: center; gap: 5px; justify-content: center; }
.sticker-manage-bar button.danger .sticker-action-icon { background: rgba(198, 113, 129, .14); }
.sticker-manage-bar button.subtle .sticker-action-icon { background: rgba(111, 147, 165, .16); }
.sticker-empty-add { display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 5px 12px rgba(80, 120, 140, .1); }
.sticker-move-picker { padding: 8px 2px 4px; border-top: 1px solid rgba(178, 199, 211, .24); }
.sticker-move-title { display: flex; align-items: center; gap: 6px; padding: 0 3px 7px; color: #59768a; font-size: 10px; font-weight: 700; }
.sticker-move-title > svg { width: 14px; height: 14px; color: #689bb0; }
.sticker-move-close { width: 24px; height: 24px; display: grid; place-items: center; margin-left: auto; border-radius: 8px; background: rgba(111,147,165,.1); color: #718c9c; }
.sticker-move-close svg { width: 13px; height: 13px; }
.sticker-move-options { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.sticker-move-options::-webkit-scrollbar { display: none; }
.sticker-move-options button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 8px 4px 5px; border-radius: 10px; background: rgba(230,241,246,.8); color: #607d8f; font-size: 9px; }
.sticker-move-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.8); color: #6a9eb4; }
.sticker-move-icon svg { width: 14px; height: 14px; }
.sticker-move-empty { margin: 0; padding: 3px 0 5px; color: #93a4ae; font-size: 9px; }
body.night-mode .sticker-heading-actions .sticker-manage-button { background: rgba(76, 103, 120, .75); border-color: rgba(168,193,209,.2); color: #d8e8ef; }
body.night-mode .sticker-heading-actions .sticker-manage-button.active { background: linear-gradient(145deg, #4f849b, #687eaa); color: #fff; }
body.night-mode .sticker-move-picker { border-color: rgba(168,193,209,.2); }
body.night-mode .sticker-move-title { color: #d3e4eb; }
body.night-mode .sticker-move-options button { background: rgba(71, 96, 113, .72); color: #d2e2e8; }
body.night-mode .sticker-move-icon { background: rgba(96,126,143,.65); color: #d8eaf1; }

/* Keep the sticker sheet visually consistent with the flat voice sheet. */
.sticker-popover.message-bottom-sheet {
  border-radius: 0 !important;
  box-shadow: 0 -10px 28px rgba(48, 76, 96, .14) !important;
  padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
}
.sticker-popover.message-bottom-sheet .sticker-manage-bar {
  margin: 0 -14px;
  padding: 10px 14px calc(20px + env(safe-area-inset-bottom));
  border-radius: 0;
  background: rgba(238, 246, 249, .86);
}
.sticker-manage-bar button {
  min-height: 38px;
  flex-direction: column;
  gap: 3px;
  border-radius: 10px;
  font-size: 9px;
}
.sticker-action-icon {
  width: 28px;
  height: 26px;
  border-radius: 8px;
}
.sticker-action-icon svg { width: 14px; height: 14px; stroke-width: 2.1; }
.sticker-check {
  width: 19px !important;
  height: 19px !important;
  display: none;
  place-items: center;
  padding: 4px;
  border: 2px solid rgba(255,255,255,.94);
  border-radius: 50%;
  background: #d5e2e8;
  color: #7894a2;
  stroke-width: 2.8;
  box-shadow: 0 2px 5px rgba(50, 79, 96, .16);
}
.sticker-popover.message-bottom-sheet .sticker-check { display: none !important; }
.sticker-popover.message-bottom-sheet.sticker-managing .sticker-check { display: grid !important; }
.sticker-managing .sticker-tile.selected .sticker-check {
  background: #5d9fba;
  color: #fff;
}
.sticker-empty-add {
  min-height: 34px;
  padding: 5px 12px !important;
  border: 1px solid rgba(111,147,165,.18);
  border-radius: 10px !important;
  background: rgba(230,241,246,.78) !important;
}
@media (max-width: 380px) {
  .sticker-popover.message-bottom-sheet .sticker-manage-bar { margin-left: -10px; margin-right: -10px; }
}
body.night-mode .sticker-popover.message-bottom-sheet .sticker-manage-bar { background: rgba(25,38,51,.94); }

/* Keep view controls compact and give sticker artwork most of the tray area. */
.sticker-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 22px);
  gap: 2px;
  padding: 1px;
  border: 1px solid rgba(108, 151, 171, .18);
  border-radius: 9px;
  background: rgba(111, 147, 165, .08);
}
.sticker-heading-actions .sticker-view-button {
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 0;
  height: 22px;
  padding: 0;
  border-radius: 7px;
  color: #7893a2;
  background: transparent;
}
.sticker-heading-actions .sticker-view-button.active {
  color: #527f95;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 6px rgba(73, 112, 132, .12);
}
.sticker-view-button svg { width: 12px; height: 12px; }
.sticker-list-mode .sticker-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: start;
  gap: 5px;
  padding: 8px 2px;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-tile {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 18px;
  justify-items: start;
  gap: 12px;
  width: 100%;
  min-height: 84px;
  aspect-ratio: auto !important;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(178, 199, 211, .23);
  border-radius: 8px;
  text-align: left;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-tile > img,
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-emoji {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: 72px !important;
  height: 72px !important;
  object-fit: cover;
  border-radius: 7px;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-emoji {
  display: grid;
  place-items: center;
  font-size: 27px;
  line-height: 1;
}
.sticker-list-mode .sticker-item-label { display: none !important; }
.sticker-list-mode .sticker-tile:hover,
.sticker-list-mode .sticker-tile:focus-visible,
.sticker-list-mode .sticker-tile.selected {
  background: rgba(209, 231, 239, .48);
}
.sticker-popover.message-bottom-sheet {
  height: min(46dvh, 390px);
  min-height: min(300px, 42dvh);
  max-height: min(52dvh, 430px);
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab {
  min-height: 37px;
  padding: 2px 2px 4px;
  gap: 1px;
}
.sticker-popover.message-bottom-sheet .sticker-pack-cover {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}
.sticker-popover.message-bottom-sheet .sticker-pack-cover svg {
  width: 13px;
  height: 13px;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab small { font-size: 7px; }
.sticker-popover.message-bottom-sheet .sticker-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 7px;
  padding: 10px 3px;
}
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile {
  aspect-ratio: 1;
}
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile > img {
  width: 100%;
  height: 100%;
}
@media (max-width: 340px) {
  .sticker-popover.message-bottom-sheet .sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-tile { grid-template-columns: 64px minmax(0, 1fr) 16px; }
  .sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-tile > img,
  .sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-emoji { width: 64px !important; height: 64px !important; }
}
body.night-mode .sticker-heading-actions .sticker-view-button { color: #b6cad4; }
body.night-mode .sticker-heading-actions .sticker-view-button.active { color: #e0eff5; background: rgba(91, 119, 136, .72); }
body.night-mode .sticker-list-mode .sticker-tile { border-color: rgba(168, 193, 209, .16); }


/* Final sticker tray alignment pass. The pack tabs and management actions
   use stable tracks so labels do not drift when a pack name changes. */
.sticker-popover.message-bottom-sheet .sticker-pack-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(64px, 1fr);
  align-items: stretch;
  gap: 6px;
  padding: 6px 2px 8px;
  overflow-x: auto;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 4px 3px 6px;
  border-radius: 11px;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab::after {
  content: '';
  width: 22px;
  height: 2px;
  margin-top: 1px;
  border-radius: 2px;
  background: transparent;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab.active::after {
  background: #6a9eb5;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab small {
  max-width: 100%;
  line-height: 1.2;
}

.sticker-popover.message-bottom-sheet .sticker-manage-bar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}
.sticker-popover.message-bottom-sheet .sticker-manage-bar button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 5px 4px;
  line-height: 1.15;
  white-space: nowrap;
}
.sticker-popover.message-bottom-sheet .sticker-manage-bar button .sticker-action-icon {
  flex: 0 0 auto;
}
.sticker-popover.message-bottom-sheet .sticker-manage-bar button > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* QQ-style sticker gallery: uploaded image packs use the same five-column
   square list as the reference picker, while management checks stay on top. */
.sticker-popover.message-bottom-sheet .sticker-grid,
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 6px;
  padding: 12px 4px;
  align-content: start;
}
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile {
  aspect-ratio: 1;
  padding: 3px;
  border: 0;
  border-radius: 11px;
  background: transparent;
}
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile:hover,
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile:focus-visible,
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile.selected {
  background: rgba(209, 231, 239, .68);
}
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}
.sticker-item-label { display: none; }
body.night-mode .sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile:hover,
body.night-mode .sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile:focus-visible,
body.night-mode .sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile.selected {
  background: rgba(91, 130, 149, .34);
}

@media (max-width: 380px) {
  .sticker-popover.message-bottom-sheet .sticker-pack-tabs { gap: 4px; }
  .sticker-popover.message-bottom-sheet .sticker-manage-bar { gap: 5px; }
  .sticker-popover.message-bottom-sheet .sticker-manage-bar button { padding-left: 2px; padding-right: 2px; font-size: 8px; }
}

/* Give sticker artwork the full gallery cell; legacy emoji-popover button
   sizing otherwise constrains both images and emoji to small fixed buttons. */
.sticker-popover.message-bottom-sheet .sticker-grid,
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 8px;
  padding: 12px 6px;
}
.sticker-popover.message-bottom-sheet .sticker-tile {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 2px;
  border-radius: 12px;
}
.sticker-popover.message-bottom-sheet .sticker-emoji {
  font-size: 38px;
  line-height: 1;
}
.sticker-popover.message-bottom-sheet.sticker-image-list .sticker-tile > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px;
  padding: 10px 2px;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-tile {
  grid-template-columns: 88px minmax(0, 1fr) 18px;
  width: 100%;
  height: auto;
  min-height: 104px;
  padding: 8px 10px;
  gap: 12px;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-tile > img,
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-emoji {
  width: 88px !important;
  height: 88px !important;
  object-fit: contain;
}
.sticker-popover.message-bottom-sheet.sticker-list-mode .sticker-emoji {
  font-size: 44px;
}
.sticker-popover.message-bottom-sheet .sticker-item-label {
  display: none !important;
}
.sticker-heading-actions .sticker-view-button svg {
  width: 12px;
  height: 12px;
}
@media (max-width: 380px) {
  .sticker-popover.message-bottom-sheet .sticker-grid,
  .sticker-popover.message-bottom-sheet.sticker-image-list .sticker-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* A restrained icon-and-label rail keeps sticker packs easy to scan without
   oversized cover icons or a heavy selected tab. */
.sticker-popover.message-bottom-sheet .sticker-pack-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 5px 4px 8px;
  border-bottom: 1px solid rgba(178, 199, 211, .24);
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab {
  flex: 1 0 68px;
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 3px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #8496a2;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.sticker-popover.message-bottom-sheet .sticker-pack-cover {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(111, 147, 165, .09);
}
.sticker-popover.message-bottom-sheet .sticker-pack-cover svg {
  width: 12px;
  height: 12px;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab small {
  max-width: 100%;
  color: inherit;
  font-size: 8px;
  line-height: 1.15;
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab.active {
  border-color: rgba(105, 149, 169, .16);
  background: rgba(255, 255, 255, .84);
  color: #567f93;
  box-shadow: 0 2px 7px rgba(73, 112, 132, .08);
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab.active .sticker-pack-cover {
  background: rgba(105, 151, 174, .14);
}
.sticker-popover.message-bottom-sheet .sticker-pack-tab.active::after {
  content: none;
  display: none;
}
body.night-mode .sticker-popover.message-bottom-sheet .sticker-pack-tab {
  color: #a9bdc7;
}
body.night-mode .sticker-popover.message-bottom-sheet .sticker-pack-cover {
  background: rgba(151, 181, 197, .12);
}
body.night-mode .sticker-popover.message-bottom-sheet .sticker-pack-tab.active {
  border-color: rgba(168, 193, 209, .2);
  background: rgba(76, 103, 120, .48);
  color: #e0eff5;
}
body.night-mode .sticker-popover.message-bottom-sheet .sticker-pack-tab.active .sticker-pack-cover {
  background: rgba(151, 181, 197, .18);
}
.sticker-popover.message-bottom-sheet .sticker-manage-bar.sticker-manage-bar-two-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
