/* River × Sylvie / v51S · Messages is a lightweight native-messenger-inspired room.
   Another Room intentionally keeps the original retro typewriter styling. */
.view[data-view="chat"][data-chat-channel="messages"]{
  --chat-river: rgba(232,246,252,.79);
  --chat-me: rgba(249,225,239,.81);
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-head{
  border-bottom:1px solid var(--card-line);
  padding-bottom:10px;margin-bottom:8px;
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-head::after{content:none!important}
.view[data-view="chat"][data-chat-channel="messages"] .avatar,
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-avatar{
  border-radius:50%;box-shadow:0 2px 8px rgba(85,73,96,.10);border:1px solid var(--card-line);
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-name{
  font-family:'Songti SC','STSong',Georgia,serif;font-size:22px;font-style:normal;font-weight:550;
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-line-label{
  font-size:7px;letter-spacing:.13em;
}
.view[data-view="chat"][data-chat-channel="messages"] .messages{
  gap:10px;padding:10px 3px 18px;
}
.view[data-view="chat"][data-chat-channel="messages"] .msg{
  border:1px solid rgba(157,159,182,.17);border-radius:18px;
  min-width:0;max-width:min(77%,310px);padding:10px 12px;
  box-shadow:0 3px 11px rgba(65,59,86,.065);
  font-size:13px;line-height:1.65;letter-spacing:.012em;
}
.view[data-view="chat"][data-chat-channel="messages"] .msg.river{
  background:linear-gradient(135deg,rgba(255,255,255,.27),transparent 75%),var(--chat-river);
  border-left:1px solid rgba(157,159,182,.17);border-bottom-left-radius:6px;
}
.view[data-view="chat"][data-chat-channel="messages"] .msg.me{
  background:linear-gradient(135deg,rgba(255,255,255,.20),transparent 75%),var(--chat-me);
  border-right:1px solid rgba(157,159,182,.17);border-bottom-right-radius:6px;
}
.view[data-view="chat"][data-chat-channel="messages"] .msg::before,
.view[data-view="chat"][data-chat-channel="messages"] .msg::after{content:none!important;display:none!important}
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-quote{
  padding:7px 9px;border-left:2px solid rgba(145,126,179,.38);border-radius:7px;background:rgba(255,255,255,.18);
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-quote::before{content:none!important}
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-time{font-size:9px;letter-spacing:0}
.view[data-view="chat"][data-chat-channel="messages"] .composer-box{
  border-radius:21px;border:1px solid var(--card-line);box-shadow:0 5px 18px rgba(70,66,97,.08);
  background:var(--chat-paper);padding:5px 6px 5px 12px;
}
.view[data-view="chat"][data-chat-channel="messages"] .composer-box::before{content:none!important}
.view[data-view="chat"][data-chat-channel="messages"] .composer-box>.send{
  border-radius:15px;box-shadow:none;
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-collection-bar>button,
.view[data-view="chat"][data-chat-channel="messages"] .chat-new-messages{
  border-radius:13px;box-shadow:none;
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-new-options{display:none!important}
:root[data-phase="night"] .view[data-view="chat"][data-chat-channel="messages"]{
  --chat-river:rgba(71,75,110,.66);--chat-me:rgba(105,71,105,.66);
}


/* v51T: smaller, quieter daily messages. Does NOT alter Another Room or Cycle. */
body.messages-active{--nav-h:60px}
.view[data-view="chat"][data-chat-channel="messages"]{
  padding-top:max(9px,env(safe-area-inset-top));
  padding-right:max(10px,env(safe-area-inset-right));
  padding-left:max(10px,env(safe-area-inset-left));
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-head{
  min-height:53px;margin:0 0 5px;padding:0 61px 8px 0;gap:5px;
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-sidebar-toggle{
  flex:0 0 36px;width:36px;height:42px;border-radius:13px;
  transition:background-color .18s ease,transform .18s cubic-bezier(.2,.8,.2,1);
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-sidebar-toggle svg{width:18px;height:18px}
.view[data-view="chat"][data-chat-channel="messages"] .river-head{gap:7px}
.view[data-view="chat"][data-chat-channel="messages"] .chat-head .avatar{width:30px;height:30px;font-size:15px;box-shadow:none}
.view[data-view="chat"][data-chat-channel="messages"] .chat-head-copy{padding-top:9px}
.view[data-view="chat"][data-chat-channel="messages"] .chat-name{font-size:20px;line-height:1.13}
.view[data-view="chat"][data-chat-channel="messages"] .presence{font-size:7px;line-height:1.4;margin-top:2px}
.view[data-view="chat"][data-chat-channel="messages"] .chat-line-label{font-size:6px;letter-spacing:.11em}
.view[data-view="chat"][data-chat-channel="messages"] .messages{
  gap:6px;padding:5px 2px 12px;
  -webkit-overflow-scrolling:touch;scroll-behavior:auto;
  touch-action:pan-y;overscroll-behavior-y:contain;
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-row{gap:5px}
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-avatar{
  flex:0 0 29px;width:29px;height:29px;margin-top:1px;font-size:13px;box-shadow:none;
}
.view[data-view="chat"][data-chat-channel="messages"] .msg{
  min-width:0;max-width:min(74%,285px);
  border-radius:16px;padding:8px 10px;
  font-size:12.5px;line-height:1.57;letter-spacing:0;
  box-shadow:0 2px 8px rgba(54,51,74,.055);
  transform:translate3d(var(--swipe-x,0px),0,0);
  transition:transform .20s cubic-bezier(.2,.85,.22,1),background-color .17s ease,box-shadow .17s ease;
  touch-action:pan-y;-webkit-tap-highlight-color:transparent;
}
.view[data-view="chat"][data-chat-channel="messages"] .msg:active{
  background-color:rgba(255,255,255,.13);box-shadow:0 1px 5px rgba(54,51,74,.04);
}
.view[data-view="chat"][data-chat-channel="messages"] .chat-message-time{font-size:8px;letter-spacing:0;opacity:.68}
.view[data-view="chat"][data-chat-channel="messages"] .chat-stage-line{font-size:6px;padding:3px 0;gap:7px}
.view[data-view="chat"][data-chat-channel="messages"] .chat-stage-line::before,
.view[data-view="chat"][data-chat-channel="messages"] .chat-stage-line::after{border-top-width:1px;height:1px}
.view[data-view="chat"][data-chat-channel="messages"] .composer{gap:3px;padding-top:4px;padding-bottom:calc(var(--nav-h) + 9px + env(safe-area-inset-bottom))}
.view[data-view="chat"][data-chat-channel="messages"] .composer-box{
  min-height:45px;padding:3px 5px 3px 11px;border-radius:20px;
  box-shadow:0 3px 12px rgba(70,66,97,.06);
  -webkit-backdrop-filter:none;backdrop-filter:none;
}
.view[data-view="chat"][data-chat-channel="messages"] .composer textarea{
  font-size:16px!important;line-height:22px;padding:4px 0 2px;
}
.view[data-view="chat"][data-chat-channel="messages"] .send{
  flex:0 0 40px;width:40px;height:40px;border-radius:15px;
  transition:transform .17s cubic-bezier(.2,.8,.22,1),filter .18s ease;
}
.view[data-view="chat"][data-chat-channel="messages"] .send:active{transform:scale(.95)}
.view[data-view="chat"][data-chat-channel="messages"] .chat-collection-bar{font-size:9px}
.view[data-view="chat"][data-chat-channel="messages"] .chat-collection-bar>button{min-height:36px;border-radius:12px}
body.messages-active .nav-wrap{padding-left:14px;padding-right:14px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
body.messages-active .nav-wrap .nav{height:58px;border-radius:21px;padding:4px;box-shadow:none}
body.messages-active .nav-wrap .nav button{
  height:48px;min-width:0;border-radius:15px;gap:3px;
  transition:background-color .19s ease,color .19s ease,transform .16s cubic-bezier(.2,.8,.22,1);
  -webkit-tap-highlight-color:transparent;
}
body.messages-active .nav-wrap .nav button:active{transform:scale(.94)}
body.messages-active .nav-wrap .nav svg{width:18px;height:18px}
body.messages-active .nav-wrap .nav-label{font-size:9px}
body.messages-active .nav-wrap .nav button[data-tab="messages"] .nav-label{font-size:9px}
body.messages-active .settings-quick{transform:scale(.92);transform-origin:top right}
body.messages-active .view[data-view="chat"].active{animation:messages-in .20s cubic-bezier(.2,.7,.25,1) both}
@keyframes messages-in{from{opacity:.82;transform:translate3d(7px,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@media(prefers-reduced-motion:reduce){
 body.messages-active .view[data-view="chat"].active{animation:none}
 .view[data-view="chat"][data-chat-channel="messages"] .msg,
 body.messages-active .nav-wrap .nav button{transition:none}
}

/* Touch drawer and channel switch motion without changing legacy room visuals. */
.view[data-view="chat"] .chat-rooms-dialog[open]{
 transform:translate3d(var(--drawer-drag-x,0px),0,0);
 transition:transform .16s cubic-bezier(.2,.82,.25,1);
}
.view[data-view="chat"] .chat-rooms-dialog.closing[open]{
 animation:messages-drawer-out .16s cubic-bezier(.35,0,.8,.8) forwards!important;
}
@keyframes messages-drawer-out{to{transform:translate3d(-105%,0,0);opacity:.78}}
.view[data-view="chat"].active[data-chat-channel="room"]{animation:messages-room-in .18s cubic-bezier(.22,.75,.25,1) both}
@keyframes messages-room-in{from{opacity:.86;transform:translate3d(-6px,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@media(prefers-reduced-motion:reduce){
 .view[data-view="chat"].active[data-chat-channel="room"]{animation:none}
 .view[data-view="chat"] .chat-rooms-dialog[open]{transition:none}
 .view[data-view="chat"] .chat-rooms-dialog.closing[open]{animation:none!important}
}

/* v51X: optional mobile soft-keyboard newline (Shift+Enter on hardware). */
.river-chat-newline{display:none!important}
@media (hover:none) and (pointer:coarse){
 body.messages-active.chat-input-focus .view[data-view="chat"][data-chat-channel="messages"] .river-chat-newline{
   display:grid!important;place-items:center;flex:0 0 30px;width:30px;height:34px;
   padding:0;border:0;border-radius:12px;background:rgba(170,146,183,.09);
   color:var(--muted);font-size:21px;line-height:1;
 }
 body.messages-active.chat-input-focus .view[data-view="chat"][data-chat-channel="messages"] .river-chat-newline:active{transform:scale(.91);background:rgba(170,146,183,.16)}
}

/* v51AE media attachments and tactile input affordance. */
.river-chat-attach{flex:0 0 32px;align-self:center;height:34px;width:34px;border:1px solid var(--card-line,rgba(120,94,146,.25));background:rgba(255,255,255,.18);color:var(--text);border-radius:50%;font-size:24px;line-height:1;cursor:pointer;touch-action:manipulation;transition:transform .16s ease,background .16s ease}
.river-chat-attach:active{transform:scale(.87);background:rgba(178,154,217,.25)}
.river-chat-attach:disabled{opacity:.45;cursor:progress}
.river-chat-media-progress{font-size:11px;color:var(--muted);padding:4px 10px 7px}
.river-chat-media{margin-top:6px;border-radius:13px;max-width:min(64vw,270px);overflow:hidden;min-height:38px;font-size:11px;color:var(--muted);background:rgba(113,100,142,.08)}
.river-chat-media img,.river-chat-media video{width:100%;max-height:320px;object-fit:contain;display:block;background:#17121e}
.river-chat-media video{min-height:100px}
.river-chat-media span{display:block;padding:10px}

.composer-box .river-chat-attach{margin-right:1px;box-sizing:border-box;padding:0;user-select:none;-webkit-tap-highlight-color:transparent}
@media(max-width:480px){.composer-box .river-chat-attach{width:29px;height:29px;flex-basis:29px;font-size:22px}}

/* Diagnostics are intentionally separate from the chat bubble layout. */
.chat-context-inspector pre{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;max-height:58vh;overflow-y:auto;font-size:12px;padding:12px 4px;color:var(--chat-ink)}
