.overlive-chat-trigger { display: none; position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(91px + env(safe-area-inset-bottom)); z-index: 15; min-height: 48px; padding: 12px 17px; border: 1px solid #ffc483; border-radius: 30px; color: #3b1b0c; background: #fff2e5; box-shadow: 0 8px 30px #0006; align-items: center; gap: 8px; font-weight: 700; }
.overlive-chat-drawer [hidden], .overlive-chat-embedded [hidden] { display: none !important; }
body[data-page='studio'] .overlive-chat-trigger, body[data-page='liveRoom'] .overlive-chat-trigger { display: inline-flex; }
.chat-unread { display: grid; place-items: center; min-width: 22px; min-height: 22px; border-radius: 15px; background: #bc471f; color: #fff3df; font-size: 10px; padding: 2px 5px; }
.overlive-chat-drawer { position: fixed; inset: auto 12px 8px auto; margin: 0; width: min(430px, calc(100vw - 24px)); height: min(65dvh, 640px); max-width: none; max-height: calc(100dvh - 16px); padding: 18px; border: 1px solid #e9803c80; border-radius: 24px; background: radial-gradient(ellipse at top right, #74341450, transparent 60%), #24140e; color: #ffceaa; box-shadow: 0 20px 70px #0009; overflow: hidden; box-sizing: border-box; }
.overlive-chat-drawer[open] { display: flex; flex-direction: column; gap: 12px; }
.overlive-chat-drawer::backdrop { background: #0b0604a6; backdrop-filter: blur(4px); }
.overlive-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.chat-kicker { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: #e5965c; }
.overlive-chat-header h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.7px; }
.chat-close { width: 44px; min-width: 44px; height: 44px; border-radius: 50%; border: 1px solid #c36a333d; background: #4d2919; color: #ffd0a7; font-size: 25px; }
.overlive-chat-notice { flex: 0 0 auto; margin: 0; padding: 9px 12px; border: 1px solid #b8663333; background: #46250f; border-radius: 10px; color: #efb181; font-size: 11px; line-height: 1.6; }
.overlive-chat-messages { flex: 1 1 auto; min-height: 50px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 8px 2px; scrollbar-width: thin; scrollbar-color: #a95728 #27150e; }
.overlive-chat-message { flex: 0 0 auto; align-self: flex-start; max-width: 92%; padding: 10px 12px; border: 1px solid #8b4d293b; border-radius: 13px; background: #3d2417; color: #ffccaa; overflow-wrap: anywhere; }
.overlive-chat-message.mine { align-self: flex-end; background: #6b3319; border-color: #e4823944; }
.chat-message-meta { display: flex; align-items: baseline; gap: 14px; }
.chat-message-meta strong { color: #ffac63; font-size: 11px; }
.chat-message-meta time { color: #c38e67; font-size: 9px; }
.overlive-chat-message p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.chat-reaction-image { display: block; width: 96px; height: 96px; border-radius: 18px; margin-top: 6px; object-fit: contain; }
.overlive-chat-empty { color: #b68460; font-size: 12px; line-height: 1.7; padding: 18px 10px; text-align: center; }
.overlive-chat-form { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.overlive-chat-form textarea { display: block; flex: 1 1 auto; min-width: 0; min-height: 46px; max-height: 92px; resize: none; border: 1px solid #bd642f66; border-radius: 13px; background: #3b2317; color: #ffccaa; padding: 12px; font: 16px/1.4 'DM Sans', system-ui, sans-serif; }
.overlive-chat-form textarea::placeholder { color: #b27c59; }
.chat-gif-toggle, .chat-send { flex: 0 0 auto; min-width: 44px; min-height: 46px; border: 0; border-radius: 12px; background: #fff0e1; color: #52240e; font-weight: 700; padding: 10px; }
.chat-send { font-size: 22px; }
.chat-gif-toggle[aria-expanded='true'] { background: #f98b38; }
.chat-connection-hint { flex: 0 0 auto; margin: 0; color: #ac7857; font-size: 9px; line-height: 1.5; text-align: center; }
.overlive-gif-tray { flex: 0 1 280px; min-height: 110px; display: flex; flex-direction: column; gap: 10px; border: 1px solid #d7793633; border-radius: 14px; background: #351d12; padding: 12px; overflow: hidden; }
.overlive-gif-search { display: block; flex: 0 0 auto; color: #dda579; font-size: 10px; }
.overlive-gif-search input { display: block; width: 100%; min-height: 44px; margin-top: 5px; background: #21130d; color: #ffcfaa; border: 1px solid #9e572e66; border-radius: 10px; padding: 10px; font-size: 16px; }
.overlive-gif-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; gap: 8px; scrollbar-width: thin; }
.overlive-chat-drawer:has(.overlive-gif-tray:not([hidden])) .overlive-chat-messages { display: none; }
.overlive-chat-drawer .overlive-gif-tray:not([hidden]) { flex: 1 1 auto; min-height: 0; }
.overlive-chat-notice { max-height: 64px; overflow-y: auto; overscroll-behavior: contain; }
.overlive-gif-choice { padding: 4px; min-width: 0; min-height: 82px; border: 1px solid #c46b3338; border-radius: 12px; background: #64351e; color: #ffcea9; text-align: center; }
.overlive-gif-choice picture { display: block; width: 100%; }
.overlive-gif-choice img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 9px; object-fit: contain; }
.overlive-gif-choice span { display: block; margin-top: 4px; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlive-chat-drawer button:focus-visible, .overlive-chat-drawer textarea:focus-visible, .overlive-chat-drawer input:focus-visible { outline: 2px solid #ffb67c; outline-offset: 3px; }
.overlive-chat-drawer[data-keyboard-compact='true'] .chat-kicker, .overlive-chat-drawer[data-keyboard-compact='true'] .chat-connection-hint, .overlive-chat-drawer[data-keyboard-compact='true'] .overlive-chat-notice { display: none; }
.overlive-chat-drawer[data-keyboard-compact='true'] .overlive-chat-header h2 { font-size: 18px; margin: 0; }
.overlive-chat-drawer[data-keyboard-compact='true'][open] { gap: 6px; padding-block: 10px; }
@media(max-width: 500px) { .overlive-chat-drawer { left: 8px; right: 8px; width: calc(100vw - 16px); padding: 15px 13px max(12px, env(safe-area-inset-bottom)); border-radius: 20px; gap: 9px; } .overlive-chat-header h2 { font-size: 21px; } .overlive-chat-form { gap: 6px; } .overlive-chat-form textarea { padding-inline: 10px; } .overlive-chat-trigger { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media(max-height: 470px) { .overlive-chat-drawer[open] { gap: 6px; } .chat-kicker, .chat-connection-hint { display: none; } .overlive-chat-header h2 { font-size: 18px; } .overlive-chat-notice { padding-block: 5px; font-size: 10px; } .overlive-gif-tray { flex-basis: 130px; } }

/* The live page supplies the dock's position; this chat remains in the page,
   above the camera, with no modal backdrop or floating open/close button. */
.overlive-chat-embedded { position: relative; display: flex; flex-direction: column; gap: 7px; width: 100%; min-width: 0; max-width: 440px; color: #ffe1c5; background: transparent; box-sizing: border-box; }
.overlive-chat-embedded *, .overlive-chat-embedded *::before, .overlive-chat-embedded *::after { box-sizing: border-box; }
.overlive-chat-embedded .overlive-chat-messages { flex: 0 1 auto; min-height: 0; max-height: 220px; max-height: min(30dvh, 220px); gap: 5px; margin: 0; padding: 2px 4px 2px 0; overflow-anchor: none; scrollbar-color: #ef924c88 transparent; }
.overlive-chat-embedded .overlive-chat-messages:empty { display: none; }
.overlive-chat-embedded .overlive-chat-message, .overlive-chat-embedded .overlive-chat-message.mine { align-self: flex-start; max-width: 96%; padding: 6px 9px; border: 0; border-radius: 10px; background: #120b07b3; color: #ffe9d5; text-shadow: 0 1px 3px #000c; box-shadow: none; }
.overlive-chat-embedded .overlive-chat-message.mine { background: #40200db8; }
.overlive-chat-embedded .chat-message-meta { gap: 8px; }
.overlive-chat-embedded .chat-message-meta strong { color: #ffb876; font-size: 11px; }
.overlive-chat-embedded .chat-message-meta time { color: #dbb89b; font-size: 9px; }
.overlive-chat-embedded .overlive-chat-message p { margin: 2px 0 0; font-size: 12px; line-height: 1.45; }
.overlive-chat-embedded .chat-reaction-image { width: 64px; height: 64px; margin-top: 3px; border-radius: 9px; }
.overlive-chat-embedded .overlive-chat-form { gap: 5px; padding: 3px; border: 1px solid #ffd6b333; border-radius: 17px; background: #170d08b3; backdrop-filter: blur(5px); }
.overlive-chat-embedded .overlive-chat-form textarea { min-height: 44px; max-height: 80px; padding: 10px 8px; border: 0; border-radius: 12px; background: transparent; color: #ffe9d5; }
.overlive-chat-embedded .overlive-chat-form textarea::placeholder { color: #dfb899; }
.overlive-chat-embedded :is(.chat-gif-toggle, .chat-send) { min-width: 44px; min-height: 44px; padding: 8px; border-radius: 12px; background: #fff0df; color: #5d2b10; }
.overlive-chat-embedded .chat-gif-toggle { font-size: 11px; }
.overlive-chat-embedded .chat-gif-toggle[aria-expanded='true'] { background: #ff973f; }
.overlive-chat-embedded :is(button, textarea, input):disabled { opacity: .5; }
.overlive-chat-embedded :is(button, textarea, input):focus-visible, .overlive-chat-embedded .overlive-chat-messages:focus-visible { outline: 2px solid #ffbd83; outline-offset: 2px; }
.overlive-chat-embedded .overlive-chat-notice:not([data-error='true']), .overlive-chat-embedded .overlive-gif-search > span { position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.overlive-chat-embedded .overlive-chat-notice[data-error='true'] { margin: 0; max-height: 52px; padding: 7px 10px; border: 1px solid #e7894a66; background: #31170cdb; color: #ffd4af; font-size: 10px; }
.overlive-chat-embedded .overlive-gif-tray { flex: 0 1 auto; height: 220px; height: min(30dvh, 220px); min-height: 110px; max-height: 220px; gap: 6px; padding: 8px; border-color: #ffb47744; border-radius: 14px; background: #1e100ce6; }
.overlive-chat-embedded .overlive-gif-search input { min-height: 40px; margin: 0; padding: 8px 10px; border-color: #ffac7144; }
.overlive-chat-embedded .overlive-gif-grid { gap: 5px; }
.overlive-chat-embedded .overlive-gif-choice { min-height: 68px; padding: 3px; border-radius: 9px; background: #4a2918cc; }
.overlive-chat-embedded .overlive-gif-choice span { font-size: 9px; }
body.chat-keyboard-open .overlive-chat-embedded .overlive-chat-messages { max-height: 120px; max-height: min(22dvh, 120px); }
body.chat-keyboard-open .overlive-chat-embedded .overlive-gif-tray { height: 160px; height: min(25dvh, 160px); }

/* User-provided Fraise/Piment moods share the existing live composer and GIF
   tray. Original GIF/Reddit controls and keyboard positioning stay intact. */
.chat-emoji-toggle{display:grid;place-items:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:10px;border:0;border-radius:12px;background:#fff0df;color:#5d2b10;}
.chat-emoji-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.chat-emoji-toggle[aria-expanded='true']{background:#ff973f;}
.overlive-chat-embedded .chat-emoji-toggle{min-width:44px;min-height:44px;}
.overlive-mood-picker{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-width:0;min-height:0;overflow:hidden;}
.overlive-mood-families{display:flex;flex:0 0 auto;gap:6px;}
.overlive-mood-families button{flex:1 1 0;min-width:0;min-height:44px;padding:7px 8px;border:1px solid rgb(255 235 220 / .25);border-radius:12px;background:rgb(8 10 16 / .75);color:#fff4e9;font:600 12px/1.3 system-ui;}
.overlive-mood-families button[aria-selected='true']{border-color:rgb(255 191 134 / .75);box-shadow:inset 0 0 0 1px rgb(255 191 134 / .22);}
.overlive-mood-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:7px;flex:1 1 auto;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
.overlive-mood-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:94px;padding:5px;border:1px solid rgb(255 230 205 / .18);border-radius:12px;background:rgb(8 10 16 / .75);color:#fff4e9;}
.overlive-mood-choice img{display:block;width:72px;height:72px;max-width:100%;object-fit:contain;}
.overlive-mood-choice span{font:11px/1.3 system-ui;max-width:100%;overflow-wrap:anywhere;text-align:center;}
body .overlive-chat-embedded .chat-mood-image{width:96px;height:96px;max-width:100%;object-fit:contain;}
.overlive-chat-drawer .chat-mood-image{width:112px;height:112px;max-width:100%;object-fit:contain;}
.overlive-mood-picker :is(button):focus-visible,.chat-emoji-toggle:focus-visible{outline:2px solid #fff;outline-offset:2px;}
@media(max-width:350px){.overlive-mood-grid{gap:5px;}.overlive-mood-choice{padding:4px;}.overlive-mood-choice img{width:64px;height:64px;}.overlive-chat-embedded .overlive-chat-form{gap:3px;}}

/* A single scroll surface keeps every mood reachable in short landscape and
   keyboard viewports. Sticky source/family tabs leave the composer untouched. */
body .overlive-gif-tray[data-picker='moods']{display:block!important;overflow-y:auto!important;overscroll-behavior:contain;scroll-padding-top:94px;scroll-padding-bottom:8px;}
body .overlive-gif-tray[data-picker='moods'] .overlive-gif-tabs{position:sticky;top:0;z-index:3;margin:0 0 6px;background:var(--readable-panel,#080b14);}
body .overlive-gif-tray[data-picker='moods'] .overlive-mood-picker{display:block;min-height:0;overflow:visible;}
body .overlive-gif-tray[data-picker='moods'] .overlive-mood-families{position:sticky;top:42px;z-index:2;margin:0 0 6px;padding-bottom:2px;background:var(--readable-panel,#080b14);}
body .overlive-gif-tray[data-picker='moods'] .overlive-mood-grid{display:grid;overflow:visible;min-height:0;}
body.immersive-live #sharedChatDock .overlive-chat-embedded .chat-mood-image{width:96px;height:96px;}
body.rgb-theme .chat-emoji-toggle{background:var(--readable-control,#0c101c);color:var(--readable-ink,#f8f9fc);border:1px solid var(--readable-border,#ebf0ff70);}
@media(max-height:430px){body .overlive-gif-tray[data-picker='moods']{padding:6px;}body .overlive-gif-tray[data-picker='moods'] .overlive-gif-tabs{margin-bottom:4px;}body .overlive-gif-tray[data-picker='moods'] .overlive-mood-families{margin-bottom:4px;}body .overlive-mood-choice{min-height:88px;}body .overlive-mood-choice img{width:64px;height:64px;}}

/* One GIFs surface serves both composer entry points. Search stays local to the
   supplied28 moods; optional existing Reddit sharing lives in a disclosure. */
.overlive-mood-toolbar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:5px;margin:0 0 6px;padding-bottom:2px;background:var(--readable-panel,#080b14);}
.overlive-mood-search{display:block;flex:1 1 auto;min-width:0;}
.overlive-mood-search>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.overlive-mood-search input{display:block;width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid var(--readable-border,#ebf0ff70);border-radius:12px;font-size:16px;}
.chat-gifs-close{display:grid;place-items:center;flex:0 0 44px;min-width:44px;height:44px;padding:0;border-radius:12px;background:var(--readable-button,#0c101c);color:var(--readable-ink,#f8f9fc);font:24px/1 system-ui;}
body .overlive-gif-tray[data-picker='moods'] .overlive-mood-families{top:52px;}
.overlive-mood-families button{padding-inline:5px;font-size:11px;}
.overlive-link-add{margin-top:10px;border-top:1px solid rgb(235 240 255 / .2);padding-top:4px;}
.overlive-link-add>summary{min-height:44px;display:flex;align-items:center;padding:7px 9px;border-radius:10px;color:var(--readable-muted,#d6dbe6);font:12px/1.3 system-ui;cursor:pointer;}
.overlive-link-add .overlive-reddit-picker{padding-top:7px;}
body .chat-gifs-close:focus-visible,.overlive-link-add>summary:focus-visible{outline:2px solid #fff;outline-offset:2px;}

/* The open picker is above the music launcher. Its transparent control-row
   gap remains click-through, so the live mic/camera/menu keep their targets. */
body.immersive-live #sharedChatDock:has(.overlive-gif-tray:not([hidden])){z-index:36;pointer-events:none;}
body.immersive-live #sharedChatDock:has(.overlive-gif-tray:not([hidden])) .overlive-chat-embedded{background:transparent;pointer-events:none;}
body.immersive-live #sharedChatDock:has(.overlive-gif-tray:not([hidden])) :is(.overlive-gif-tray,.overlive-chat-form){pointer-events:auto;}
body.immersive-live #roomsPanel:has(#sharedChatDock .overlive-gif-tray:not([hidden])) .room-primary-actions{z-index:37;}
