/* Black River v46 corrective layer: loaded last on purpose. */

/* Every range control gets an actual visible track. Older themes made the track transparent. */
body.river-chat input[type="range"],
body.river-chat .call-overlay input[type="range"],
body.river-chat .group-call-panel input[type="range"],
body.river-chat dialog input[type="range"]{
  --range-fill:var(--accent,#5865f2);
  --range-rest:#4e5058;
  appearance:none!important;
  -webkit-appearance:none!important;
  height:18px!important;
  min-height:18px!important;
  background:transparent!important;
  cursor:pointer!important;
}
body.river-chat input[type="range"]::-webkit-slider-runnable-track,
body.river-chat .call-overlay input[type="range"]::-webkit-slider-runnable-track,
body.river-chat .group-call-panel input[type="range"]::-webkit-slider-runnable-track,
body.river-chat dialog input[type="range"]::-webkit-slider-runnable-track{
  height:5px!important;border:0!important;border-radius:999px!important;
  background:linear-gradient(90deg,var(--range-fill) 0 var(--range-progress,50%),var(--range-rest) var(--range-progress,50%) 100%)!important;
  box-shadow:inset 0 0 0 1px #ffffff10!important;
}
body.river-chat input[type="range"]::-webkit-slider-thumb,
body.river-chat .call-overlay input[type="range"]::-webkit-slider-thumb,
body.river-chat .group-call-panel input[type="range"]::-webkit-slider-thumb,
body.river-chat dialog input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none!important;appearance:none!important;width:14px!important;height:14px!important;margin-top:-4.5px!important;border:2px solid #fff!important;border-radius:50%!important;background:#fff!important;box-shadow:0 1px 5px #0008!important;
}
body.river-chat input[type="range"]::-moz-range-track,
body.river-chat .call-overlay input[type="range"]::-moz-range-track,
body.river-chat .group-call-panel input[type="range"]::-moz-range-track,
body.river-chat dialog input[type="range"]::-moz-range-track{height:5px!important;border-radius:999px!important;background:var(--range-rest)!important}
body.river-chat input[type="range"]::-moz-range-progress,
body.river-chat .call-overlay input[type="range"]::-moz-range-progress,
body.river-chat .group-call-panel input[type="range"]::-moz-range-progress,
body.river-chat dialog input[type="range"]::-moz-range-progress{height:5px!important;border-radius:999px!important;background:var(--range-fill)!important}
body.river-chat input[type="range"]::-moz-range-thumb,
body.river-chat .call-overlay input[type="range"]::-moz-range-thumb,
body.river-chat .group-call-panel input[type="range"]::-moz-range-thumb,
body.river-chat dialog input[type="range"]::-moz-range-thumb{width:12px!important;height:12px!important;border:2px solid #fff!important;border-radius:50%!important;background:#fff!important}

/* Calls belong to the workspace, not a floating modal. */
body.river-chat #callPanel.call-overlay:not(.incoming-call):not(.minimized){
  inset:0!important;width:100vw!important;height:var(--visible-height,100dvh)!important;max-width:none!important;max-height:none!important;
  padding:10px 14px!important;border:0!important;border-radius:0!important;background:#111214!important;box-shadow:none!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(290px,360px)!important;grid-template-rows:46px minmax(0,1fr) 60px!important;gap:8px!important;
}
body.river-chat #callPanel:not(.incoming-call):not(.minimized) .call-top{grid-column:1/-1!important;grid-row:1!important}
body.river-chat #callPanel:not(.incoming-call):not(.minimized) .call-stage{grid-column:1/-1!important;grid-row:2!important;min-width:0!important;min-height:0!important;border-radius:8px!important}
body.river-chat #callPanel:not(.incoming-call):not(.minimized):has(#callChatPanel:not([hidden])) .call-stage{grid-column:1!important}
body.river-chat #callPanel:not(.incoming-call):not(.minimized) #callChatPanel:not([hidden]){position:relative!important;inset:auto!important;grid-column:2!important;grid-row:2!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:290px!important;resize:horizontal!important;overflow:hidden!important;border-radius:8px!important;transform:none!important}
body.river-chat #callPanel:not(.incoming-call):not(.minimized) .call-controls{grid-column:1/-1!important;grid-row:3!important;align-self:center!important}
body.river-chat #callPanel:not(.incoming-call):not(.minimized) .call-note{display:none!important}
body.river-chat #callPanel:not(.incoming-call) .call-workspace-return{display:none!important}
body.river-chat #callPanel:not(.incoming-call) #expandCall{display:none!important}

/* Group calls are also a full Discord-like workspace on desktop. */
body.river-chat .group-call-panel.discord-call:not(.minimized){inset:0!important;width:100vw!important;height:var(--visible-height,100dvh)!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:8px 12px!important;gap:8px!important}
body.river-chat .group-call-panel.discord-call .group-call-workspace{grid-template-columns:minmax(0,1fr) minmax(280px,350px)!important}
body.river-chat .group-call-panel.discord-call.chat-collapsed .group-call-workspace{grid-template-columns:minmax(0,1fr)!important}
body.river-chat .group-call-panel.discord-call.chat-collapsed .group-call-chat{display:none!important}
body.river-chat .group-call-panel.discord-call .group-call-grid[data-count="3"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important}
body.river-chat .group-call-panel.discord-call .group-call-grid[data-count="3"]>.group-call-card:nth-child(3):last-child{grid-column:1/-1!important;width:50%!important;justify-self:center!important}

/* Compact Discord message rhythm. A normal left click no longer opens the action sheet. */
body.river-chat .river-workspace .message{margin:1px 0!important}
body.river-chat .river-workspace .message:not(.message-grouped){margin-top:11px!important}
body.river-chat .river-workspace .message-grouped{margin-top:1px!important}
body.river-chat .river-workspace .message-content{padding:8px 12px!important;border-radius:8px!important}
body.river-chat .river-workspace .message.own .message-content{border-radius:8px!important}
body.river-chat .river-workspace .message-author{margin-bottom:2px!important}
body.river-chat .message-receipt{color:#b5bac1!important;margin:2px 4vw 2px auto!important}
body.river-chat .message-receipt.delivered strong{color:#b5bac1!important}
body.river-chat .message-receipt.delivered>svg{color:#949ba4!important}
body.river-chat .message-actions{top:-15px!important;right:8px!important;border-radius:7px!important;background:#2b2d31!important}

/* iMessage-like Send Later sheet with photo attachments. */
body.river-chat .ios-schedule{grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr)!important;gap:28px!important;max-width:1040px!important;margin:0 auto!important}
body.river-chat .ios-schedule-compose{display:grid;gap:14px}
body.river-chat .ios-schedule-header{display:flex;align-items:flex-start;gap:12px;padding:4px 0 8px}
body.river-chat .ios-schedule-header>span{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:#3478f61c;color:#5b9cff}
body.river-chat .ios-schedule-header>span svg{width:22px;height:22px}
body.river-chat .ios-schedule-header small{font-size:10px;color:#8e8e93;letter-spacing:.08em;font-weight:700}
body.river-chat .ios-schedule-header h3{margin:2px 0 4px!important;font-size:22px!important;letter-spacing:-.03em!important}
body.river-chat .ios-schedule-header p{margin:0;color:var(--muted);font-size:12px}
body.river-chat .ios-schedule-message{margin:0!important;padding:12px 14px;border-radius:14px;background:var(--panel2);border:1px solid var(--line)}
body.river-chat .ios-schedule-message textarea{margin-top:7px!important;border:0!important;background:transparent!important;padding:4px 0!important;box-shadow:none!important;resize:none}
body.river-chat .scheduled-photo-row{display:flex;align-items:center;gap:10px}
body.river-chat .scheduled-photo-preview{display:flex;gap:8px;overflow-x:auto;min-height:0;padding-bottom:2px}
body.river-chat .scheduled-photo-preview:empty{display:none}
body.river-chat .scheduled-photo-preview figure{position:relative;flex:0 0 86px;width:86px;height:86px;margin:0;border-radius:12px;overflow:hidden;background:#222;border:1px solid var(--line)}
body.river-chat .scheduled-photo-preview img{width:100%;height:100%;object-fit:cover}
body.river-chat .scheduled-photo-preview button{position:absolute;top:5px;right:5px;display:grid;place-items:center;width:24px;height:24px;min-height:24px;padding:0;border:0;border-radius:50%;background:#000b;color:#fff}
body.river-chat .scheduled-photo-preview button svg{width:13px;height:13px}
body.river-chat .ios-time-card{display:grid;gap:8px;padding:12px 14px;border:1px solid var(--line);border-radius:15px;background:var(--panel2)}
body.river-chat .ios-time-card-head{display:flex;align-items:center;gap:10px}
body.river-chat .ios-time-card-head>span{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#3478f61c;color:#5b9cff}
body.river-chat .ios-time-card-head>div{display:grid;gap:1px}
body.river-chat .ios-time-card-head strong{font-size:12px}
body.river-chat .ios-time-card-head small{font-size:11px;color:var(--muted)}
body.river-chat #scheduledAt{height:48px!important;margin:0!important;padding:0 12px!important;border-radius:12px!important;background:#111214!important;font-size:16px!important;font-weight:650!important;color:#fff!important;color-scheme:dark}
body.river-chat .scheduled-card{display:grid!important;grid-template-columns:auto minmax(0,1fr) 36px 36px!important;gap:9px!important;padding:10px!important;border-bottom:0!important;margin-bottom:6px;background:var(--panel2);border:1px solid var(--line);border-radius:12px!important}
body.river-chat .scheduled-card-preview{display:flex;align-items:center;min-width:0}
body.river-chat .scheduled-card-preview:empty{display:none}
body.river-chat .scheduled-card-preview img{width:38px;height:38px;object-fit:cover;border-radius:8px;border:2px solid var(--panel2);margin-left:-8px}
body.river-chat .scheduled-card-preview img:first-child{margin-left:0}
body.river-chat .scheduled-card-preview b{font-size:9px;margin-left:4px;color:var(--muted)}

/* Arnie/theater mode: keep a clear way back and hide the cursor only while actually watching. */
body.river-chat .arnie-call-tile.arnie-theater{position:absolute!important;inset:0!important;z-index:40!important;border-radius:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important}
body.river-chat .arnie-call-tile.arnie-theater .arnie-art{height:100%!important}
body.river-chat .arnie-call-tile.arnie-theater .arnie-player-controls{position:absolute!important;left:14px!important;right:14px!important;bottom:14px!important;z-index:45!important;opacity:0;transition:opacity .18s ease}
body.river-chat .arnie-call-tile.arnie-theater:hover .arnie-player-controls,body.river-chat .arnie-call-tile.arnie-theater:focus-within .arnie-player-controls{opacity:1}
body.river-chat .arnie-call-tile.arnie-theater.cursor-hidden{cursor:none!important}
body.river-chat .arnie-call-tile.arnie-theater.cursor-hidden *{cursor:none!important}

@media(max-width:760px){
 body.river-chat #callPanel.call-overlay:not(.incoming-call):not(.minimized){grid-template-columns:1fr!important;grid-template-rows:44px minmax(0,1fr) auto 58px!important;padding:max(6px,env(safe-area-inset-top)) 6px max(6px,env(safe-area-inset-bottom))!important}
 body.river-chat #callPanel:not(.incoming-call):not(.minimized) .call-stage{grid-column:1!important;grid-row:2!important}
 body.river-chat #callPanel:not(.incoming-call):not(.minimized) #callChatPanel:not([hidden]){grid-column:1!important;grid-row:3!important;min-width:0!important;max-height:34dvh!important;resize:none!important}
 body.river-chat #callPanel:not(.incoming-call):not(.minimized) .call-controls{grid-column:1!important;grid-row:4!important}
 body.river-chat .group-call-panel.discord-call .group-call-workspace{grid-template-columns:1fr!important;grid-template-rows:minmax(0,1fr) minmax(150px,30dvh)!important}
 body.river-chat .ios-schedule{grid-template-columns:1fr!important;gap:18px!important}
}

/* Whiteboard board naming + keep the top-left identity compact. */
body.river-chat .sketch-board-title{display:block;width:min(260px,34vw);margin:0;padding:0;border:0!important;background:transparent!important;box-shadow:none!important;color:var(--text);font:700 14px/1.2 inherit;outline:none}
body.river-chat .sketch-board-title:focus{box-shadow:0 1px 0 var(--accent)!important}
