.direct-dialog{position:fixed;left:0;right:0;bottom:auto;top:var(--direct-dialog-top,16px);margin:0 auto;box-sizing:border-box;width:min(560px,calc(100vw - 24px));height:min(700px,calc(var(--direct-viewport-height,100dvh) - 32px));max-width:calc(100vw - 24px);max-height:calc(var(--direct-viewport-height,100dvh) - 32px);padding:0;border:1px solid #bbd3ad33;border-radius:18px;background:#1a3028;color:#f1f0df;box-shadow:0 20px 80px #0008;overflow:hidden}
.direct-dialog[open]{display:flex;flex-direction:column}
.direct-dialog::backdrop{background:#08171099;backdrop-filter:blur(3px)}
.direct-dialog [hidden]{display:none!important}
.direct-dialog *{box-sizing:border-box;min-width:0}
.direct-dialog button{font:inherit;cursor:pointer;touch-action:manipulation}
.direct-dialog button:disabled{opacity:.55;cursor:default}
.direct-header{display:flex;align-items:center;gap:8px;flex:none;min-height:64px;margin:0;padding:10px 12px;border-bottom:1px solid #ffffff12}
.direct-header h2{flex:1;margin:0;font-size:19px;line-height:1.3;overflow-wrap:anywhere}
.direct-header button{flex:0 0 44px;width:44px;height:44px;padding:11px;display:grid;place-items:center;border:0;border-radius:50%;background:#ffffff08;color:inherit}
.direct-dialog svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.direct-body{position:relative;display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.direct-status{margin:0;padding:0 16px;flex:none;font-size:12px;color:#c3ceb8;line-height:1.45;overflow-wrap:anywhere}
.direct-status:not(:empty){padding:9px 16px;background:#ffffff05}
.direct-status.is-error{color:#f0bdad}
.direct-inbox{flex:1;overflow:auto;overscroll-behavior:contain;padding:8px 12px}
.direct-thread{display:flex;align-items:center;gap:11px;width:100%;padding:12px 0;border:0;border-bottom:1px solid #ffffff0b;background:transparent;color:inherit;text-align:left}
.direct-thread:hover{background:#ffffff04}
.direct-peer-initial{flex:0 0 40px;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#bdd3a620;color:#cfdfbd;font-size:22px}
.direct-thread-copy{flex:1;display:grid;gap:4px;overflow:hidden}
.direct-thread-copy strong{font-weight:600;font-size:15px;overflow-wrap:anywhere}
.direct-thread-preview{display:block;font-size:13px;color:#c0cbb6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.direct-thread-meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:100px;flex:none}
.direct-thread-meta time{font-size:10px;color:#a2b39e;white-space:nowrap}
.direct-unread{border-radius:12px;min-width:22px;padding:3px 6px;background:#e0c575;color:#243223;text-align:center;font-size:11px;font-weight:700}
.direct-empty{margin:20px 8px;color:#bccbb2;font-size:14px;line-height:1.65;text-align:center}
.direct-more-threads,.direct-earlier{align-self:center;flex:none;min-height:44px;padding:10px 14px;border:0;border-radius:10px;background:transparent;color:#c9dfb6;font-size:13px}
.direct-messages{display:flex;flex:1;min-height:0;flex-direction:column;align-items:flex-start;gap:9px;overflow:auto;overscroll-behavior:contain;padding:12px 14px;scrollbar-width:thin}
.direct-messages .direct-empty{align-self:stretch}
.direct-message{flex:none;max-width:92%;padding:8px 11px;border-radius:12px;background:#ffffff07;overflow-wrap:anywhere}
.direct-message.mine{align-self:flex-end;background:#c5d9a915}
.direct-message-meta{display:flex;align-items:baseline;flex-wrap:wrap;justify-content:space-between;gap:3px 12px;margin-bottom:4px}
.direct-message-meta strong{font-size:12px;color:#d1dfba;overflow-wrap:anywhere}
.direct-message-meta time{font-size:10px;color:#afbea7;white-space:nowrap}
.direct-message p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.45}
.direct-message .message-photo{display:block;padding:0;border:0;margin:4px 0;background:transparent;border-radius:8px;overflow:hidden;max-width:100%}
.direct-message .message-photo img{display:block;max-width:100%;max-height:210px;height:auto;object-fit:contain}
.direct-photo-gallery{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;margin:4px 0}
.direct-photo-gallery[data-count="2"],.direct-photo-gallery[data-count="3"]{grid-template-columns:repeat(2,minmax(0,1fr))}
.direct-photo-gallery[data-count="3"] .message-photo:first-child{grid-column:1/-1}
.direct-photo-gallery .message-photo{margin:0;width:100%}
.direct-photo-gallery[data-count="2"] img,.direct-photo-gallery[data-count="3"] img{width:100%;height:100%;max-height:150px;aspect-ratio:4/3;object-fit:cover}
.direct-message .message-video{display:block;width:100%;max-width:320px;max-height:240px;margin:4px 0}
.direct-message .message-audio{display:block;width:100%;min-width:0;max-width:320px;height:44px;margin:4px 0}
#direct-message-form{position:relative;flex:none;gap:0;margin:0;padding:8px 10px max(8px,env(safe-area-inset-bottom,0px));border-top:1px solid #ffffff10;background:#182d26}
#direct-message-form .composer-row{display:flex;align-items:center;gap:4px}
#direct-message-form input[name="text"]{flex:1;width:0;min-height:44px;margin:0;padding:10px 12px;border:1px solid #ffffff12;border-radius:22px;background:#10251e;color:inherit;font:inherit;font-size:16px}
#direct-message-form .send,#direct-message-form .attach-button,#direct-message-form .emoji-toggle{display:grid;place-items:center;flex:0 0 36px;width:36px;min-height:44px;margin:0;padding:6px;border:0;border-radius:18px;background:transparent;color:#cfdfb3}
#direct-message-form .send{background:#c6deab;color:#223d29}
#direct-message-form .composer-feedback{display:flex;align-items:flex-start;gap:8px;justify-content:space-between;font-size:11px}
#direct-message-form .attachment-status{flex:1;margin:4px 0 0;line-height:1.4;overflow-wrap:anywhere}
#direct-message-form .composer-limit{flex:none;margin-top:4px;color:#adbfa5;font-variant-numeric:tabular-nums;font-size:10px}
#direct-message-form .attachment-preview{display:flex;align-items:center;gap:8px;padding:6px 0 10px;font-size:12px}
#direct-message-form .attachment-item{position:relative;display:flex;align-items:center;flex:1;gap:5px;min-height:58px;max-width:33.333%;padding:4px;border:1px solid #ffffff16;border-radius:9px;overflow:hidden}
#direct-message-form .attachment-item>span{display:none}
#direct-message-form .attachment-item>img{width:100%;height:54px;object-fit:cover}
#direct-message-form .attachment-item .remove-attachment{position:absolute;top:0;right:0;min-width:44px;width:44px;min-height:44px;height:44px;border-radius:0 6px 0 8px;background:#172a23bb;font-size:23px;line-height:1}
#direct-message-form .attachment-item.is-video,#direct-message-form .attachment-item.is-audio{max-width:100%;min-height:44px;padding-right:48px}
#direct-message-form .attachment-item.is-video>span,#direct-message-form .attachment-item.is-audio>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#direct-message-form .attachment-preview>span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#direct-message-form .attachment-preview img{width:45px;height:45px;object-fit:cover;border-radius:8px}
#direct-message-form .remove-attachment{min-width:44px;min-height:44px;padding:4px;border:0;background:transparent;color:inherit;font-size:25px}
.direct-photo-view{position:absolute;inset:64px 0 0;display:flex;flex-direction:column;align-items:center;gap:8px;padding:8px 14px 16px;background:#12231d;overflow:auto}
.direct-photo-view>.message-photo-canvas{min-height:0;flex:1;height:auto}
.direct-photo-close{align-self:flex-start;display:flex;align-items:center;gap:8px;min-height:44px;padding:6px 0;border:0;background:transparent;color:#d0dfbc;font-size:13px}
@media(max-width:400px){.direct-dialog{width:calc(100vw - 12px);max-width:calc(100vw - 12px);height:calc(var(--direct-viewport-height,100dvh) - 16px);max-height:calc(var(--direct-viewport-height,100dvh) - 16px);border-radius:14px}.direct-header{padding:8px}.direct-header h2{font-size:17px}.direct-messages{padding:10px;gap:8px}.direct-thread{gap:8px}.direct-thread-meta{max-width:76px}.direct-thread-meta time{font-size:9px}#direct-message-form{padding-left:6px;padding-right:6px}#direct-message-form .composer-row{gap:2px}#direct-message-form input[name="text"]{padding-left:9px;padding-right:9px}}
@media(prefers-reduced-motion:reduce){.direct-dialog .chat-emoji{animation:none!important}}
#direct-message-form .attachment-item:has(.voice-draft-player){width:100%;flex-wrap:wrap;padding:6px 42px 6px 6px}
#direct-message-form .voice-draft-player{width:100%}
#direct-message-form .attachment-item:has(.camera-draft-player){width:100%;flex-wrap:wrap;padding:6px 42px 6px 6px}
#direct-message-form .camera-draft-player{width:100%}
#direct-message-form .attachment-preview[hidden]{display:none}
.direct-safety-actions{display:flex;justify-content:flex-end;margin-bottom:6px}.direct-safety-actions button{font-size:11px;padding:6px 10px;min-height:32px}.direct-rules{margin:8px 0}.direct-rules[hidden]{display:none!important}.direct-safety-menu{width:min(360px,calc(100vw - 28px))}.direct-safety-menu h2{margin-bottom:16px}.direct-safety-menu button{display:block;width:100%;margin-top:10px}
