:root{color-scheme:dark;--bg:#080809;--surface:#151417;--s2:#211f24;--s3:#302c34;--text:#f3eef6;--muted:#b4acba;--sub:#918997;--accent:#d9baf1;--strong:#c28bec;--container:#594567;--soft:#302438;--green:#b5d9c1;--red:#ffb5bd;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--text)}body{-webkit-font-smoothing:antialiased}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.42;cursor:default}button,input,textarea,a{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}a{color:var(--accent);text-decoration:none}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;vertical-align:middle}.defs{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.flower{color:var(--strong);width:48px;height:48px;stroke:none}.purple{color:var(--accent)}.brand{display:flex;gap:12px;align-items:center;min-width:0}.brand span:not(.purple){display:block;font-size:.7rem;color:var(--muted);margin-bottom:3px}.brand h1{font-size:1.7rem;line-height:1.08;font-weight:650;letter-spacing:-.045em;margin:0}.gate{min-height:100dvh;padding:22px 18px;display:grid;place-content:center;overflow-y:auto}.gate-card{width:min(100%,428px);padding:28px;border:1px solid #28232b;border-radius:30px;background:var(--surface);animation:arrive .3s ease-out}.gate-card .brand{margin-bottom:30px}.gate-card h2{font-size:1.5rem;letter-spacing:-.04em;font-weight:600;margin:0 0 7px}.gate-card p{color:var(--muted);font-size:.88rem;line-height:1.6;margin:0 0 24px}.gate-card form{display:grid;gap:14px}.gate-card label{font-size:.78rem;color:var(--muted);display:grid;gap:7px}.gate-card input{height:52px;padding:0 14px;background:var(--s2);border:1px solid transparent;border-radius:15px;width:100%}.gate-card input:focus{border-color:var(--strong);outline:none}.primary,.secondary{min-height:45px;border:0;border-radius:999px;padding:10px 19px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:.86rem;font-weight:650;transition:background .2s,transform .16s}.primary{background:var(--accent);color:#2b173b}.primary:hover{background:#ead4fa}.secondary{background:var(--s2);color:var(--accent)}.primary:active,.secondary:active{transform:scale(.98)}.gate-card .error{color:var(--red);font-size:.8rem;margin:0}.error:empty{display:none}.gate-note{display:flex;gap:9px;align-items:center;color:var(--muted);font-size:.75rem;line-height:1.45;border-top:1px solid var(--s3);padding-top:17px;margin-top:22px}.gate-note svg{width:18px;color:var(--accent)}.gate>small{color:var(--sub);text-align:center;font-size:.65rem;letter-spacing:.18em;margin-top:23px}.quiet{border:0;background:none;color:var(--accent);font-size:.78rem;padding:10px 6px;display:block;text-align:center;margin:auto}.app{height:100dvh;display:grid;grid-template-columns:minmax(300px,390px) minmax(0,1fr);max-width:1440px;margin:auto;border-inline:1px solid #1b191e}.sidebar{height:100%;display:flex;flex-direction:column;min-height:0;position:relative;background:var(--bg);border-right:1px solid #242128;padding:env(safe-area-inset-top) 0 0}.sidebar-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px 22px;gap:12px}.sidebar-head .flower{width:40px;height:40px}.sidebar-head .brand h1{font-size:1.45rem}.avatar{display:grid;place-items:center;border:0;border-radius:50%;background:var(--soft);color:var(--accent);width:46px;height:46px;font-size:.95rem;font-weight:650;flex-shrink:0}.sidebar-title{display:flex;justify-content:space-between;align-items:center;padding:0 21px}.sidebar-title h2{font-size:1.8rem;letter-spacing:-.05em;font-weight:570;margin:0 0 13px}.connection{display:flex;gap:5px;align-items:center;font-size:.67rem;color:var(--muted)}.connection i{width:6px;height:6px;border-radius:50%;background:var(--green)}.connection.offline i{background:var(--red)}.search{margin:0 18px 13px;background:var(--surface);border:1px solid #252128;border-radius:999px;display:flex;gap:9px;align-items:center;padding:0 14px;height:46px;color:var(--sub)}.search svg{width:19px;height:19px}.search input{border:0;outline:0;background:none;width:100%;min-width:0;font-size:.87rem}.filter-row{display:flex;gap:7px;align-items:center;padding:0 18px 12px}.filter{font-size:.76rem;border:1px solid var(--s3);border-radius:999px;padding:7px 13px;background:transparent;color:var(--muted)}.filter.selected{background:var(--container);color:#f6ebff;border-color:transparent}.contact-count{margin-left:auto;color:var(--sub);font-size:.67rem}.contacts{flex:1;overflow-y:auto;min-height:0;padding:0 9px 12px;scrollbar-width:thin;scrollbar-color:var(--s3) transparent}.contact{display:flex;align-items:center;gap:13px;width:100%;border:0;background:none;color:var(--text);text-align:left;padding:13px 10px;border-radius:20px;margin-bottom:3px;transition:background .15s}.contact:hover,.contact.chosen{background:var(--surface)}.contact .avatar{width:49px;height:49px;background:var(--soft);border:1px solid #48334d}.contact-text{min-width:0;flex:1}.contact-line{display:flex;align-items:center;justify-content:space-between;gap:8px}.contact-line strong{font-size:.91rem;font-weight:620;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contact-line time{font-size:.63rem;white-space:nowrap;color:var(--sub)}.contact-preview{color:var(--muted);font-size:.75rem;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;margin-top:4px}.pending{color:var(--accent);background:var(--soft);border-radius:999px;padding:3px 7px;font-size:.58rem;white-space:nowrap}.list-empty{padding:35px 20px;text-align:center;color:var(--muted);font-size:.83rem}.side-footer{padding:10px 15px;text-align:center;font-size:.66rem;color:var(--sub);display:flex;align-items:center;justify-content:center;gap:5px}.side-footer svg{width:13px;height:13px}.island{margin:2px auto max(12px,env(safe-area-inset-bottom));width:min(calc(100% - 28px),320px);height:61px;flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:6px;border-radius:999px;border:1px solid #28232b;background:#171519;box-shadow:0 5px 18px #0005}.nav{border:0;border-radius:999px;background:none;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:6px;font-weight:600;font-size:.78rem}.nav span{display:none}.nav.active{background:var(--container);color:#f6ebff}.nav.active span{display:inline}.conversation{min-width:0;min-height:0;height:100%;position:relative;background:#100f12}.empty-chat{height:100%;display:grid;justify-items:center;align-content:center;text-align:center;padding:30px;gap:12px}.empty-icon{width:103px;height:103px;display:grid;place-items:center;border-radius:32px;background:var(--soft);color:var(--strong);margin-bottom:9px}.empty-icon svg{width:68px;height:68px}.empty-chat h2{margin:0;font-size:clamp(1.7rem,3vw,2.5rem);letter-spacing:-.055em;font-weight:570}.empty-chat p{margin:0;max-width:330px;font-size:.86rem;color:var(--muted);line-height:1.6}.secure-note{display:flex;gap:6px;align-items:center;justify-content:center;text-align:center;color:var(--sub);font-size:.71rem;line-height:1.55;margin:8px auto 16px;max-width:95%;padding:8px 13px}.secure-note svg{width:15px;height:15px;color:var(--accent)}.active-chat{height:100%;display:flex;flex-direction:column;min-height:0}.chat-header{display:flex;align-items:center;gap:12px;min-height:73px;flex-shrink:0;background:var(--bg);padding:max(12px,env(safe-area-inset-top)) 19px 12px;border-bottom:1px solid #262329}.icon-button{border:0;background:var(--s2);color:var(--accent);height:40px;width:40px;border-radius:50%;display:grid;place-items:center;flex-shrink:0}.icon-button:hover{background:var(--soft)}.icon-button svg{width:20px;height:20px}.back{display:none}.peer-title{flex:1;min-width:0}.peer-title strong{display:block;font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:650}.peer-title span{display:block;font-size:.7rem;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.peer-avatar{width:43px;height:43px}.messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px clamp(16px,4vw,60px);display:flex;flex-direction:column;gap:6px;scrollbar-width:thin;scrollbar-color:var(--s3) transparent;background-image:radial-gradient(#ffffff06 1px,transparent 1px);background-size:23px 23px}.date-label{align-self:center;padding:6px 12px;background:var(--surface);border:1px solid #2a262d;border-radius:999px;color:var(--muted);font-size:.66rem;margin:12px 0 6px}.bubble{max-width:min(78%,540px);align-self:flex-start;border-radius:4px 19px 19px 19px;background:var(--s2);padding:10px 13px 8px;box-shadow:0 2px 4px #0002;animation:arrive .16s ease-out}.bubble.mine{align-self:flex-end;background:#4c395b;border-radius:19px 4px 19px 19px;color:#f8efff}.bubble p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.91rem;line-height:1.47}.bubble-meta{display:flex;justify-content:flex-end;align-items:center;gap:5px;color:#c6b5cf;font-size:.63rem;margin:4px 0 0}.bubble-meta svg{width:12px;height:12px}.bubble.bad p{font-style:italic;color:var(--red)}.negotiation{flex-shrink:0;margin:10px auto 16px;padding:21px;width:min(94%,440px);background:var(--surface);border:1px solid var(--s3);border-radius:24px;text-align:center;animation:arrive .2s ease-out}.negotiate-icon{width:42px;height:42px;border-radius:15px;background:var(--soft);color:var(--accent);display:grid;place-items:center;margin:auto}.negotiation h3{font-size:1.12rem;font-weight:600;letter-spacing:-.025em;margin:10px 0 6px}.negotiation p{font-size:.78rem;color:var(--muted);line-height:1.6;margin:0 0 12px}.days{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:12px}.day{border:1px solid var(--s3);background:var(--s2);border-radius:13px;padding:10px 7px;color:var(--muted);font-size:.8rem}.day.selected{background:var(--container);color:#f6ebff;border-color:var(--strong)}.negotiation .primary{width:100%;min-height:42px}.composer{padding:10px 18px max(10px,env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid #262329;flex-shrink:0}.composer form{display:flex;gap:8px;align-items:flex-end}.composer textarea{resize:none;border:1px solid #2d2931;background:var(--surface);border-radius:25px;outline:0;flex:1;min-width:0;min-height:47px;max-height:130px;line-height:1.45;padding:12px 16px;font-size:.91rem}.composer textarea:focus{border-color:var(--container)}.send-button{width:47px;height:47px;display:grid;place-items:center;flex-shrink:0;border:0;border-radius:50%;color:#2b173b;background:var(--accent)}.send-button svg{width:23px;height:23px}.composer>small{display:block;text-align:center;color:var(--sub);font-size:.62rem;margin-top:7px}dialog{background:var(--surface);color:var(--text);border:1px solid var(--s3);border-radius:27px;width:min(430px,calc(100% - 32px));padding:23px;max-height:90dvh;overflow:auto}dialog::backdrop{background:#0009;backdrop-filter:blur(4px)}.dialog-head{display:flex;justify-content:space-between;gap:10px;align-items:center}.eyebrow{font-size:.62rem;color:var(--sub);letter-spacing:.17em}.dialog-head h2{font-size:1.3rem;font-weight:600;letter-spacing:-.04em;margin:4px 0 0}dialog p{color:var(--muted);font-size:.83rem;line-height:1.55}.safety{display:block;white-space:pre-wrap;overflow-wrap:anywhere;padding:16px;border-radius:15px;background:var(--soft);color:var(--accent);font-size:1rem;line-height:1.65;letter-spacing:.04em;text-align:center}.fine{font-size:.7rem!important}.wide,dialog .primary{width:100%;margin:8px 0}#toast{position:fixed;bottom:80px;left:50%;transform:translate(-50%,10px);z-index:20;pointer-events:none;opacity:0;background:var(--s3);border:1px solid #51495a;border-radius:17px;padding:12px 18px;max-width:calc(100% - 32px);width:max-content;font-size:.8rem;transition:opacity .2s,transform .2s}#toast.show{opacity:1;transform:translate(-50%,0)}@keyframes arrive{from{opacity:.35;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@media(max-width:680px){.app{display:block;border:0}.sidebar{border:0;height:100%}.conversation{display:none}.app.open .sidebar{display:none}.app.open .conversation{display:block}.back{display:grid;background:transparent;width:28px}.chat-header{gap:9px;padding-left:10px;padding-right:12px;min-height:67px}.chat-header .icon-button:not(.back){height:36px;width:36px}.peer-avatar{width:40px;height:40px}.messages{padding:12px 13px}.bubble{max-width:85%}.composer{padding-left:10px;padding-right:10px}.negotiation{padding:16px;margin-bottom:10px}.day{padding:8px}.sidebar-head{padding-top:15px}.sidebar-title h2{font-size:1.65rem}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
button.connection{border:0;background:none;padding:5px 0;cursor:pointer}.connection.connecting i,.connection.warning i{background:#e6ca92;animation:connectionpulse 1.3s infinite}.connection.offline i{background:var(--red)}@keyframes connectionpulse{50%{opacity:.35}}

.reset-form{display:grid;gap:12px}.reset-form label{display:grid;gap:6px;font-size:.8rem;color:var(--muted)}.reset-form input:not([type=checkbox]){width:100%;height:46px;padding:0 12px;background:var(--s2);border:1px solid var(--s3);border-radius:13px}.reset-form .reset-confirm{display:flex;align-items:flex-start;gap:8px}.reset-confirm input{accent-color:var(--strong);margin-top:3px}.reset-form .error{color:var(--red);margin:0}.gate-card .wide{margin-top:12px}

/* Chat wallpaper: separate fixed surface, no overlays over conversation content. */
html,body{overscroll-behavior:none;touch-action:pan-x pan-y}
.active-chat{position:relative;isolation:isolate;background:#000}
.active-chat>.chat-header,.active-chat>.messages,.active-chat>.composer,.active-chat>.negotiation{position:relative;z-index:1}
.messages{background:none}
.wallpaper{position:absolute;inset:0;overflow:hidden;pointer-events:none;background:var(--wall-base,#000);z-index:0}
.wallpaper::before,.wallpaper::after{content:"";position:absolute;pointer-events:none;inset:0}
.wallpaper[data-wallpaper="flower"]::before{background:url(/flower.svg) center/ min(46%,220px) auto no-repeat;opacity:.38}
.wallpaper[data-wallpaper="oled"]::before,.wallpaper[data-wallpaper="oled"]::after{display:none}
.wallpaper.motion::before,.wallpaper.motion::after{display:none}
.wall-motion-canvas{display:block;position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.wallpaper[data-wallpaper="flower"]::before{animation:flower-breathe 6.2s cubic-bezier(.37,0,.63,1) infinite alternate;transform-origin:center;will-change:transform,opacity}
@keyframes flower-breathe{0%{transform:translateY(5px) scale(.96);opacity:.34}100%{transform:translateY(-5px) scale(1.04);opacity:.47}}
.wall-sample .wallpaper[data-wallpaper="flower"]::before{animation-name:flower-preview}
@keyframes flower-preview{from{transform:translateY(2px) scale(.96);opacity:.64}to{transform:translateY(-2px) scale(1.04);opacity:.88}}
@media(prefers-reduced-motion:reduce){.wallpaper[data-wallpaper="flower"]::before{animation:none!important;will-change:auto}}
.secure-note{color:#d0c6d6;text-shadow:0 1px 6px #000}.bubble-meta .receipt-read{color:#9ee0ed}.bubble-meta .receipt-read svg{width:16px}
#settings-dialog{width:min(560px,calc(100% - 24px));padding:22px;max-height:min(90dvh,820px)}
.settings-subtitle{font-size:.78rem;color:var(--muted);margin:7px 0 18px}
.settings-group{margin:19px 0 0}.settings-group h3{font-size:.75rem;letter-spacing:.13em;text-transform:uppercase;color:var(--accent);margin:0 0 8px;font-weight:650}
.setting-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 12px;background:var(--s2);border-radius:15px;margin:5px 0;cursor:pointer}
.setting-row strong{font-size:.86rem;font-weight:620;display:block}.setting-row small{font-size:.72rem;color:var(--muted);display:block;line-height:1.4;margin-top:4px}
.setting-row input{appearance:none;width:42px;height:25px;border-radius:999px;background:#45404a;border:1px solid #61586b;flex-shrink:0;position:relative;cursor:pointer;margin:0;transition:background .16s}.setting-row input::before{content:"";position:absolute;left:3px;top:3px;width:17px;height:17px;border-radius:50%;background:#c7becb;transition:transform .16s}.setting-row input:checked{background:#bd94dd;border-color:#bd94dd}.setting-row input:checked::before{transform:translateX(17px);background:#281a32}
.wall-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.wall-option{display:flex;flex-direction:column;align-items:stretch;gap:6px;text-align:left;background:var(--s2);border:1px solid transparent;border-radius:14px;padding:5px;color:var(--text);min-width:0;position:relative}
.wall-option[aria-pressed="true"]{border-color:var(--accent);background:var(--soft)}.wall-option[aria-pressed="true"]::after{content:"✓";position:absolute;right:10px;top:9px;border-radius:50%;background:var(--accent);color:#281a32;width:20px;height:20px;text-align:center;line-height:20px;font-size:.78rem;font-weight:700;z-index:2}
.wall-sample{aspect-ratio:1.12;position:relative;overflow:hidden;border-radius:10px;isolation:isolate}.wall-sample .wallpaper[data-wallpaper="flower"]::before{background-size:36% auto;opacity:.8}
.wall-option .wall-label{font-size:.66rem;font-weight:600;line-height:1.3;overflow-wrap:anywhere;padding:2px 2px 5px}
.settings-actions{position:sticky;bottom:-22px;background:var(--surface);padding:10px 0 6px;margin-top:14px;box-shadow:0 -8px 18px var(--surface)}
.install-note{font-size:.73rem;color:var(--muted);margin:8px 0 0}.avatar.peer-online,.contact .avatar.peer-online{position:relative}.avatar.peer-online::after{content:"";position:absolute;bottom:0;right:0;width:12px;height:12px;border:2px solid var(--bg);border-radius:50%;background:#8fdbac}
@media(max-width:380px){.wall-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.wallpaper.motion::before,.wallpaper.motion::after{animation:none!important;will-change:auto}}

.wallpaper[data-wallpaper="aurora"]{--wall-base:#080b17;--wall-a:#7453c7;--wall-b:#187f73;--wall-time:7200ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="bloom"]{--wall-base:#110a15;--wall-a:#9c416f;--wall-b:#54308b;--wall-time:8400ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="eclipse"]{--wall-base:#080b14;--wall-a:#3152a0;--wall-b:#6042ab;--wall-time:10000ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="crimson"]{--wall-base:#100608;--wall-a:#b82742;--wall-b:#641018;--wall-time:6600ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="rose"]{--wall-base:#130b13;--wall-a:#b74783;--wall-b:#7e385d;--wall-time:8200ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="purple"]{--wall-base:#0c0718;--wall-a:#753fc6;--wall-b:#492294;--wall-time:7600ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="ruby"]{--wall-base:#080306;--wall-a:#a80c35;--wall-b:#620b3a;--wall-time:9400ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="sapphire"]{--wall-base:#060b16;--wall-a:#245dcb;--wall-b:#126477;--wall-time:9000ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="emerald"]{--wall-base:#060e0c;--wall-a:#137d5b;--wall-b:#17685f;--wall-time:8700ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="solar"]{--wall-base:#110d07;--wall-a:#a56a18;--wall-b:#804324;--wall-time:9600ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="obsidian"]{--wall-base:#000000;--wall-a:#4d5261;--wall-b:#343842;--wall-time:11000ms;--wall-opacity:0.75}
.wallpaper[data-wallpaper="sunset"]{--wall-base:#100911;--wall-a:#bb4a40;--wall-b:#7c2965;--wall-time:7900ms;--wall-opacity:0.62}
.wallpaper[data-wallpaper="ruby-violet"]{--wall-base:#0a0610;--wall-a:#b3123f;--wall-b:#6c2bd9;--wall-time:9000ms;--wall-opacity:0.66}
/* Real four-state delivery indicators. */
.bubble-meta .receipt{display:inline-flex;align-items:center;justify-content:center;min-width:14px;color:#d3c8d9}
.bubble-meta .receipt svg{height:15px;width:15px}
.bubble-meta .receipt-delivered svg,.bubble-meta .receipt-read svg{width:19px}
.bubble-meta .receipt-read{color:#d7a6ff}
.bubble-meta .receipt-pending{opacity:.75}
.bubble-meta .receipt-failed{color:#ffc1cd;cursor:pointer}
button.receipt{border:0;background:transparent;padding:0;font:inherit;gap:4px}
.notification-row{cursor:default}.notification-row .secondary{flex-shrink:0;min-height:36px;padding:8px 12px;font-size:.73rem}
.bubble.outbox{animation:arrive .16s ease-out}
.bubble.outbox .bubble-meta{min-height:16px}

/* Personal contacts and invitation-only registration */
.contact-add{width:34px;height:34px;font-size:1.35rem;font-weight:400;margin-left:auto;flex-shrink:0}
.filter-row{flex-wrap:wrap;gap:5px}.filter-row .filter{white-space:nowrap;padding:7px 10px}.filter-row .contact-count{margin-left:0;font-size:.65rem}
#contacts-dialog{width:min(440px,calc(100vw - 28px))}
#contacts-dialog .reset-form{display:grid;gap:12px}
#contacts-dialog input,#reg-key{background:var(--s2);border:1px solid #414049;border-radius:12px;padding:12px;color:var(--fg);width:100%;font:inherit}
#reg-key{opacity:.55;font-size:.75rem;overflow:hidden;text-overflow:ellipsis}
.account-key-value{overflow-wrap:anywhere;word-break:break-all;font-size:.76rem}
#invite-link{font-size:.75rem}#contacts-error,#reg-error{color:#ff9bab;white-space:pre-wrap}
.invite-registration{max-width:450px}
@media(max-width:390px){.filter-row .contact-count{display:none}.filter-row .filter{font-size:.73rem;padding:7px 8px}}

/* Encrypted image / voice composer, inline replies and attachments */
.composer form{align-items:flex-end;gap:5px}
.composer-tool,.mini-button{display:grid;place-items:center;flex-shrink:0;background:transparent;border:0;color:var(--accent);padding:0;width:33px;height:46px;border-radius:14px}
.composer-tool svg,.mini-button svg{width:21px;height:21px}
.composer-tool:hover,.mini-button:hover{background:var(--s2)}
.composer textarea{min-width:0}
.reply-draft,.media-draft,.record-bar{display:flex;align-items:center;gap:10px;padding:9px 10px;margin-bottom:8px;background:var(--s2);border-radius:14px}
.reply-draft{border-left:3px solid var(--accent)}.reply-draft>div,.media-draft-text{flex:1;min-width:0}
.reply-draft strong,.media-draft strong{display:block;color:var(--accent);font-size:.78rem}
.reply-draft span,.media-draft small{display:block;color:var(--muted);font-size:.73rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:3px}
.reply-draft .mini-button,.media-draft .mini-button{height:34px}
#media-draft-preview img{width:56px;height:56px;object-fit:cover;border-radius:9px;display:block}
#media-draft-preview audio{width:100%;height:34px}
.media-draft.voice-draft{flex-wrap:wrap}.voice-draft #media-draft-preview{flex:1 0 100%;order:3}
.record-bar{color:var(--text);font-variant-numeric:tabular-nums}
.record-bar .quiet{margin-left:auto}
.record-dot{background:#ff737e;width:10px;height:10px;border-radius:50%;animation:record-pulse 1s ease infinite alternate}
@keyframes record-pulse{to{opacity:.3}}
.bubble{position:relative}
.bubble-meta .reply-action{display:inline-grid;place-items:center;border:0;background:transparent;color:inherit;padding:0 2px;cursor:pointer;margin-right:3px}
.bubble-meta .reply-action svg{width:15px;height:15px}
.reply-quote{display:block;width:100%;text-align:left;background:#0002;border:0;border-left:3px solid var(--accent);color:inherit;border-radius:6px;padding:7px 9px;margin:0 0 7px;overflow:hidden}
.reply-quote strong,.reply-quote span{display:block;font-size:.74rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reply-quote strong{color:var(--accent);font-size:.7rem;margin-bottom:3px}
.message-image{display:block;max-width:100%;width:240px;max-height:320px;border-radius:12px;object-fit:contain;cursor:zoom-in}
.media-card{min-width:min(180px,50vw);max-width:100%;margin:0 0 5px}
.media-card button{max-width:100%;display:flex;align-items:center;gap:7px;text-align:left;background:#0002;color:inherit;border:0;border-radius:10px;padding:10px;font-size:.78rem}
.media-card audio{width:min(240px,58vw);max-width:100%;height:38px;display:block}
.media-card .media-meta{display:block;font-size:.65rem;color:var(--muted);margin:4px 2px}
.bubble-highlight{outline:2px solid var(--accent);outline-offset:2px}
#image-dialog{width:min(760px,calc(100vw - 20px));max-height:95vh}
#full-image{max-width:100%;max-height:74vh;display:block;margin:12px auto;object-fit:contain}
@media(max-width:450px){.composer{padding-left:8px;padding-right:8px}.composer-tool{width:30px}.composer form{gap:4px}.composer textarea{padding-left:11px;padding-right:10px}.send-button{width:43px;height:43px;flex-shrink:0}}

/* Veyra voice cards, swipe reply and synchronized profile photography */
.avatar{position:relative;isolation:isolate}
.avatar-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%;display:block;z-index:1}
.avatar.peer-online::after,.avatar.online::after{z-index:2}
.profile-avatar-row{display:flex;align-items:center;gap:15px;margin:13px 0 16px}
.profile-avatar-button{position:relative;background:none;padding:0;border:0;border-radius:50%;flex-shrink:0}
.profile-avatar-button .avatar{width:74px;height:74px;font-size:1.4rem}
.avatar-camera{position:absolute;bottom:0;right:0;z-index:3;border:2px solid var(--surface);width:27px;height:27px;border-radius:50%;background:var(--accent);color:#281b30;display:grid;place-items:center}
.avatar-camera svg{width:14px;height:14px}
.profile-avatar-row strong,.avatar-settings-row strong{display:block;font-size:.88rem;color:var(--text)}
.profile-avatar-row small,.avatar-settings-row small{display:block;font-size:.72rem;color:var(--muted);margin:4px 0}
.profile-avatar-row .quiet{padding:3px 0;margin:0;text-align:left}
.avatar-settings-row{display:flex;width:100%;align-items:center;gap:12px;text-align:left;border:0;border-radius:16px;padding:10px 12px;background:var(--s2);color:var(--accent)}
.avatar-settings-row>span:nth-child(2){flex:1}
.avatar-settings-row .avatar{width:42px;height:42px}
.avatar-editor{text-align:center;padding:19px 0 6px}.avatar-editor .avatar{width:110px;height:110px;margin:auto;font-size:2rem}
.avatar-editor p{font-size:.78rem;margin:10px 0;color:var(--muted)}
#avatar-error{color:#ffb0c0}
.messages{overflow-x:hidden}
.bubble.swipeable{touch-action:pan-y;transition:transform .2s cubic-bezier(.2,.8,.2,1);will-change:auto}
.bubble.swipeable.swiping{transition:none;user-select:none;-webkit-user-select:none;will-change:transform}
.bubble.swipeable:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.swipe-indicator{position:absolute;left:-32px;top:50%;transform:translateY(-50%) scale(.75);opacity:0;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#27202e;color:var(--accent);pointer-events:none;transition:opacity .12s,transform .12s}
.swipe-indicator svg{width:14px;height:14px}
.swiping .swipe-indicator{opacity:.65;transform:translateY(-50%) scale(.9)}
.swipe-ready .swipe-indicator{opacity:1;background:var(--accent);color:#2b1d36;transform:translateY(-50%) scale(1)}
.bubble.mine .swipe-indicator{left:-34px}
.voice-card{width:min(270px,69vw);max-width:100%;display:flex;align-items:center;gap:9px;padding:3px 1px 2px;min-width:0}
.voice-card .voice-play{display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:#ffffff13;color:#efe2fb;width:38px;height:38px;flex:0 0 38px}
.voice-card .voice-play svg{width:18px;height:18px}
.voice-card .voice-play:hover{background:#ffffff25}
.voice-card .voice-play[aria-busy="true"]{opacity:.55}
.voice-center{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.voice-wave-wrap{height:35px;position:relative;display:flex;align-items:center;overflow:hidden}
.voice-wave{display:block;width:100%;height:34px;overflow:visible;pointer-events:none}
.voice-wave rect{fill:currentColor;opacity:.28;transition:opacity .12s}
.voice-wave rect.played{opacity:1;fill:#e6c7ff}
.voice-card .voice-wave{color:#e6d8eb}
.voice-seek{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;touch-action:pan-x;z-index:2}
.voice-seek:focus-visible{opacity:.65}
.voice-bottom{display:flex;align-items:center;justify-content:space-between;gap:6px;color:var(--muted);font-size:.67rem;font-variant-numeric:tabular-nums}
.voice-card .voice-avatar-wrap{position:relative;flex:0 0 42px}
.voice-card .voice-avatar{width:42px;height:42px;font-size:.8rem}
.voice-mic-badge{display:grid;place-items:center;position:absolute;bottom:-2px;left:-3px;z-index:3;width:17px;height:17px;border-radius:50%;background:#b68bdd;color:#26192f;border:1px solid #55465f}
.voice-mic-badge svg{width:10px;height:10px}
.voice-status{color:var(--muted);font-size:.66rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.voice-card audio{display:none!important}
.bubble.has-voice{padding:9px 10px 7px;min-width:0}
.voice-card .voice-rate{background:none;border:0;color:var(--accent);padding:0;font-size:.67rem;min-height:16px;white-space:nowrap}
.voice-card .voice-rate:hover{background:none;text-decoration:underline}
@media(max-width:380px){.voice-card{width:min(248px,68vw);gap:7px}.voice-card .voice-avatar-wrap{flex-basis:36px}.voice-card .voice-avatar{width:36px;height:36px}.voice-card .voice-play{width:34px;height:34px;flex-basis:34px}}
@media(prefers-reduced-motion:reduce){.bubble.swipeable{transition:none}.voice-wave rect{transition:none}}

.voice-wave rect{stroke:none}
.media-draft #media-draft-preview .voice-card{width:100%}
.media-draft #media-draft-preview .voice-card audio{display:none}

/* Audio-only calls */
.call-button{color:var(--accent)}
.call-dialog{width:min(420px,calc(100% - 30px));border-radius:30px;background:#16131b;padding:24px;overflow-y:auto;max-height:92dvh}
.call-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.call-lock{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:.7rem}
.call-lock svg,.call-footer svg{width:13px;height:13px;flex-shrink:0}
.call-person{text-align:center;padding:30px 0 22px}
.call-avatar-orbit{position:relative;isolation:isolate;display:grid;place-items:center;width:132px;height:132px;margin:0 auto 20px}
.call-avatar-orbit:before,.call-avatar-orbit:after{content:"";position:absolute;inset:3px;border-radius:50%;background:#7655a529;z-index:-1}
.call-avatar-orbit:after{inset:13px;background:#a977d629}
.call-dialog[data-phase="ringing"] .call-avatar-orbit:before,.call-dialog[data-phase="connecting"] .call-avatar-orbit:before{animation:call-orbit 1.8s ease-out infinite}
@keyframes call-orbit{from{transform:scale(.85);opacity:.9}to{transform:scale(1.22);opacity:0}}
#call-avatar{width:104px;height:104px;font-size:2rem;background:#392944}
.call-person h2{font-size:1.5rem;margin:0 0 8px;overflow-wrap:anywhere}
.call-person p{font-size:.85rem;color:var(--muted);margin:0;min-height:1.2em}
.call-duration{display:block;margin-top:10px;font-size:1.45rem;font-weight:600;font-variant-numeric:tabular-nums}
.call-actions{display:flex;justify-content:center;align-items:flex-start;gap:38px;margin:6px 0 22px}
.call-action{display:flex;flex-direction:column;align-items:center;gap:8px;border:0;padding:0;color:var(--text);font:inherit;font-size:.73rem;background:transparent;min-width:64px}
.call-action-icon{width:64px;height:64px;display:grid;place-items:center;border-radius:50%;background:#302a38}
.call-action-icon svg{width:25px;height:25px}
.call-action.end .call-action-icon{background:#cd3d50;color:#fff}
.call-action.accept .call-action-icon{background:#4d9c78;color:#fff}
.call-action.mute[aria-pressed="true"] .call-action-icon{background:#d6b8ed;color:#291d32}
.call-footer{display:flex;align-items:center;justify-content:center;gap:7px;font-size:.7rem;color:var(--muted);margin:0;text-align:center}
.call-verify{padding:12px;border-radius:15px;background:var(--s2);margin-bottom:18px}
.call-verify p{font-size:.76rem;margin:0 0 8px}
.call-verify .safety{overflow-wrap:anywhere;font-size:.75rem}
@media(max-width:450px){.chat-header{gap:6px}.chat-header .icon-button:not(.back){width:36px;height:36px;flex:0 0 36px}.chat-header .icon-button svg{width:18px;height:18px}.chat-header .peer-title{min-width:0}.chat-header .peer-title strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}}
@media(prefers-reduced-motion:reduce){.call-avatar-orbit:before{animation:none!important}}

/* Call summaries use ordinary encrypted message envelopes and ordinary expiration. */
.call-entry{align-self:center;display:flex;align-items:center;gap:10px;max-width:min(94%,350px);min-width:218px;padding:10px 12px;border-radius:17px;background:#1b1920e8;color:var(--text);border:1px solid #ffffff0d;margin:6px 0}
.call-entry-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#41324e;color:#dfc4f7;flex-shrink:0}
.call-entry-icon svg{width:18px;height:18px}
.call-missed .call-entry-icon{color:#f1a9b5;background:#472a35}
.call-entry-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.call-entry-text strong{font-size:.79rem;font-weight:600}
.call-entry-text small,.call-entry-time{font-size:.67rem;color:var(--muted);font-variant-numeric:tabular-nums}
.call-entry-time{align-self:flex-end;white-space:nowrap}

/* Daily mobile setup reminder; non-modal and dismissible. */
.setup-reminder{position:fixed;z-index:45;top:calc(env(safe-area-inset-top,0px) + 12px);right:12px;left:12px;margin:0 auto;max-width:470px;padding:14px;border:1px solid #ba9adb35;border-radius:20px;background:#211b29f7;color:var(--text);box-shadow:0 12px 40px #0009;backdrop-filter:blur(20px);}
.setup-reminder[hidden]{display:none!important}
.setup-head{display:flex;align-items:flex-start;gap:12px}
.setup-head img{border-radius:12px;flex-shrink:0}
.setup-head>div{flex:1;min-width:0}
.setup-head strong{font-size:15px;display:block}
.setup-head p{font-size:12px;line-height:1.5;color:var(--muted);margin:4px 0 0}
.setup-dismiss{background:transparent;border:0;display:grid;place-items:center;width:28px;height:28px;color:var(--muted);padding:5px}
.setup-dismiss svg{width:16px;height:16px}
.setup-actions{display:grid;gap:7px;margin-top:12px}
.setup-actions button{font-size:12px;min-height:38px;padding:8px 12px;margin:0}
.setup-actions button[hidden]{display:none!important}
.setup-reminder .fine{font-size:11px;margin:9px 0 0;line-height:1.5}
.push-test-result{padding:10px 12px;border-radius:12px;background:#ba9adb10;line-height:1.5}
@media(min-width:901px){.setup-reminder{display:none!important}}
