/* The chat picker (app.js chatPickerButton / emojiPickerModal) and voice messages (voiceHTML / voiceRecordingRow). */

/* The input row: [input] [smiley] [+]. Enter sends on a keyboard; Send shows only on touch screens and while a
   message is being edited (Save). */
:root .chat-picker-wrap{position:relative;display:flex;align-items:stretch}
:root .chat-picker-button{min-width:40px;display:grid;place-items:center;padding:0 8px}
:root .chat-picker-wrap>.setting-new{position:absolute;top:-8px;right:-10px;pointer-events:auto;z-index:2}
@media (hover:hover) and (pointer:fine){:root .composer-send:not(.editing){display:none}}

/* The picker window: the same width whichever tab shows, the bottom tabs always in the same place. */
:root .modal.chat-picker-modal .window-body{display:flex;flex-direction:column;min-height:min(560px,78vh)}
:root .emoji-picker{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0}
:root .emoji-sections{display:flex;min-width:0;justify-content:space-between;gap:2px;border-bottom:1px solid var(--line,#2c3a45)}
:root .emoji-section-tab{flex:1 1 0;min-width:0;overflow:hidden;background:none;border:0;border-bottom:3px solid transparent;border-radius:0;padding:6px 0 7px;font-size:20px;line-height:1;opacity:.7}
:root .emoji-section-tab:hover:not(:disabled){background:#ffffff0d}
:root .emoji-section-tab.active{opacity:1;border-bottom-color:#5ec27a}
:root .emoji-search-row{position:relative;display:flex;align-items:center}
:root .emoji-search-row input{border-radius:20px;padding-left:14px}
:root .emoji-search-row input:focus{border-color:#5ec27a;box-shadow:0 0 0 2px #5ec27a22}
:root .emoji-search-row .setting-new{position:absolute;right:10px;top:-8px}
:root .emoji-list{overflow:auto;flex:1;min-height:220px;max-height:min(420px,52vh);padding-right:4px;scrollbar-color:#455365 transparent}
:root .emoji-list h4{margin:10px 2px 6px;font-size:12px;font-weight:600;color:var(--muted)}
:root .emoji-list section:first-child h4{margin-top:0}
:root .emoji-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(38px,1fr));gap:2px}
:root .emoji-cell{background:none;border:0;border-radius:8px;padding:4px 0;font-size:24px;line-height:1.3;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
:root .emoji-cell:hover:not(:disabled){background:#ffffff14}
:root .emoji-results{padding-top:4px}
:root .picker-tabs{position:relative;display:flex;justify-content:center;align-self:center;margin:14px auto 0;border:1px solid #ffffff26;border-radius:20px;overflow:visible}
:root .picker-tabs>button{background:none;border:0;border-radius:0;min-width:64px;height:34px;display:grid;place-items:center;font-size:12px;font-weight:600;color:var(--muted)}
:root .picker-tabs>button:first-child{border-radius:20px 0 0 20px}
:root .picker-tabs>button:last-of-type{border-radius:0 20px 20px 0}
:root .picker-tabs>button+button,:root .picker-tabs>.setting-new+button{border-left:1px solid #ffffff1a}
:root .picker-tabs>button.active{background:#ffffff1f;color:var(--text)}
:root .picker-tabs>.setting-new{position:absolute;top:-10px;left:calc(50% + 8px)}
:root .picker-tabs>.setting-new~.setting-new{left:auto;right:-14px}

/* Recording a voice message: in place of the input row. */
:root .composer-row[hidden]{display:none}
:root .voice-recording{align-items:center}
:root .voice-recording .voice-cancel{font-size:18px;height:42px}
:root .voice-rec{flex:1;min-width:0;display:flex;align-items:center;gap:10px;height:42px;padding:0 14px;border-radius:21px;background:#ffffff0f;overflow:hidden}
:root .voice-rec-dot{width:10px;height:10px;border-radius:50%;background:#ff3c3c;flex-shrink:0;animation:voice-blink 1s step-end infinite}
:root .voice-rec-time{font-variant-numeric:tabular-nums;font-size:13px;min-width:34px}
:root .voice-rec-bars{flex:1;display:flex;align-items:center;justify-content:flex-end;gap:2px;height:26px;overflow:hidden}
:root .voice-rec-bars>span{width:3px;border-radius:2px;background:#ffffffc0;flex-shrink:0}
:root .voice-send{min-width:46px;font-size:16px}
@keyframes voice-blink{50%{opacity:0}}
@media (prefers-reduced-motion:reduce){:root .voice-rec-dot{animation:none}}

/* A voice message. */
:root .voice-msg{display:inline-flex;align-items:center;gap:10px;padding:6px 10px 6px 6px;border-radius:24px;background:#ffffff0f;max-width:100%}
:root .voice-play{width:34px;height:34px;border-radius:50%;padding:0;display:grid;place-items:center;background:#5ec27a;border:0;color:#fff;flex-shrink:0}
:root .voice-play:hover:not(:disabled){background:#6ed68a}
:root .voice-msg.loading .voice-play{animation:voice-blink 1s step-end infinite}
:root .voice-wave{display:flex;align-items:center;gap:2px;height:28px;width:min(200px,40vw);cursor:pointer}
:root .voice-wave>span{flex:1;min-width:2px;max-width:3px;border-radius:2px;background:#ffffff90}
:root .voice-wave>span.lit{background:#5ec27a}
:root .voice-time{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;min-width:32px}
:root .voice-msg.playing .voice-time{color:var(--text)}
:root .voice-timer{position:static;width:22px;height:22px;font-size:12px}

@media (max-width:480px){:root .emoji-section-tab{font-size:17px}:root .emoji-cell{font-size:22px}}
