/* The early synchronous theme script sets desktop mode before any content is painted. */
:root[data-echo-desktop] [data-windows-download],:root[data-echo-desktop] #desktopAppLink{display:none!important}
.desktop-cursor-setting{margin:16px 0;display:grid;gap:7px}
.desktop-cursor-setting[hidden]{display:none}
.cursor-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:400px}
:root .preferences-dialog .preferences-content .cursor-choice{position:relative;display:grid;grid-template-rows:58px auto;gap:7px;place-items:center;min-width:0;width:100%;margin:0;min-height:0;padding:10px 12px 12px;border:1px solid var(--border);border-radius:13px;background:var(--panel-soft);color:var(--tone-edf4f1);box-shadow:none;clip-path:none;transition:border-color .15s,background-color .15s}
:root .preferences-dialog .preferences-content .cursor-choice:hover{border-color:var(--green);background:var(--panel-soft)}
:root .preferences-dialog .preferences-content .cursor-choice[aria-checked="true"]{border-color:var(--green);background:color-mix(in srgb,var(--panel) 91%,var(--green));box-shadow:inset 0 0 0 1px var(--green)}
.cursor-choice:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.cursor-choice-preview{display:flex;align-items:center;justify-content:center;gap:16px;width:100%;height:100%;pointer-events:none}
.cursor-choice-preview>img,.cursor-choice-preview>svg{width:37px;height:37px;object-fit:contain;filter:drop-shadow(0 2px 3px #0003)}
.cursor-choice-preview>img:nth-child(2),.cursor-choice-preview>svg:nth-child(2){width:29px;height:29px}
.cursor-choice-name{font-size:12px;font-weight:650;line-height:1.2;white-space:nowrap}
.cursor-choice-check{position:absolute;right:8px;top:8px;display:grid;place-items:center;width:17px;height:17px;border-radius:50%;border:1px solid var(--border);color:transparent}
.cursor-choice-check svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cursor-choice[aria-checked="true"] .cursor-choice-check{background:var(--green);color:var(--bg);border-color:var(--green)}
:root[data-theme="arc"] .preferences-dialog .preferences-content .cursor-choice{border-radius:4px;background:#1d202c}
:root[data-theme="gta"] .preferences-dialog .preferences-content .cursor-choice{background:#292036;border-color:#715269}
:root[data-theme="gta"] .preferences-dialog .preferences-content .cursor-choice[aria-checked="true"]{background:#38263e;border-color:#f5a2c6;box-shadow:inset 0 0 0 1px #f5a2c6}
:root[data-theme="gta"] .preferences-dialog .preferences-content .cursor-choice:hover{border-color:#f5a2c6}
@media(max-width:420px){:root .preferences-dialog .preferences-content .cursor-choice{padding:9px 7px;grid-template-rows:49px auto}.cursor-choice-preview{gap:8px}.cursor-choice-preview>img,.cursor-choice-preview>svg{width:31px;height:31px}.cursor-choice-preview>img:nth-child(2),.cursor-choice-preview>svg:nth-child(2){width:24px;height:24px}}
@media(forced-colors:active){:root .preferences-dialog .preferences-content .cursor-choice[aria-checked="true"]{border:2px solid Highlight}.cursor-choice-check{color:ButtonText}.cursor-choice[aria-checked="true"] .cursor-choice-check{background:Highlight;color:HighlightText}}
.echo-context-menu{position:fixed;z-index:2147483647;min-width:190px;max-width:min(280px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;padding:5px;border:1px solid var(--border);border-radius:11px;background:var(--panel);color:var(--tone-edf4f1);box-shadow:0 12px 30px rgba(0,0,0,.32);font:500 13px/1.35 Inter,"Segoe UI",sans-serif;text-align:left;overscroll-behavior:contain}
.echo-context-menu[hidden]{display:none}
.echo-context-menu button{display:flex;align-items:center;gap:9px;width:100%;border:0;border-radius:6px;padding:8px 10px;text-align:left;color:inherit;background:transparent;font:inherit;white-space:normal}
.echo-context-menu button:hover,.echo-context-menu button:focus-visible{background:var(--panel-soft);outline:1px solid var(--green)}
.echo-context-menu button:disabled{opacity:.42;cursor:default}
.echo-context-menu button svg{flex:0 0 16px;width:16px;height:16px;fill:none;stroke:var(--green);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.echo-context-menu .echo-menu-caption{flex:1;min-width:0}
.echo-context-menu small{margin-left:auto;color:var(--muted);font:inherit;font-size:11px}
.echo-context-menu .echo-menu-label{display:block;color:var(--muted);padding:7px 10px 3px;overflow-wrap:anywhere}
.echo-context-menu .echo-menu-volume{display:flex;gap:8px;align-items:center;padding:6px 10px}
.echo-context-menu .echo-menu-volume input{min-width:0;flex:1;accent-color:var(--green)}
.echo-context-menu .echo-menu-volume output{min-width:38px;text-align:right}
:root[data-theme="arc"] .echo-context-menu{border-radius:3px}
:root[data-theme="gta"] .echo-context-menu{border-color:#b576a0;box-shadow:0 12px 30px #110c24aa}
@media (pointer:fine) and (forced-colors:none){
:root[data-echo-desktop][data-cursor="echo"][data-theme="echo"]{--echo-cursor-arrow:url("/assets/cursors/echo-arrow.svg") 3 3,auto;--echo-cursor-hand:url("/assets/cursors/echo-hand.svg") 8 3,pointer;--echo-cursor-move:url("/assets/cursors/echo-move.svg") 10 10,move;--echo-cursor-resize:url("/assets/cursors/echo-resize.svg") 10 10,nwse-resize;--echo-cursor-grab:url("/assets/cursors/echo-grab.svg") 10 10,grab;--echo-cursor-grabbing:url("/assets/cursors/echo-grabbing.svg") 10 10,grabbing}
:root[data-echo-desktop][data-cursor="echo"][data-theme="day"]{--echo-cursor-arrow:url("/assets/cursors/day-arrow.svg") 3 3,auto;--echo-cursor-hand:url("/assets/cursors/day-hand.svg") 8 3,pointer;--echo-cursor-move:url("/assets/cursors/day-move.svg") 10 10,move;--echo-cursor-resize:url("/assets/cursors/day-resize.svg") 10 10,nwse-resize;--echo-cursor-grab:url("/assets/cursors/day-grab.svg") 10 10,grab;--echo-cursor-grabbing:url("/assets/cursors/day-grabbing.svg") 10 10,grabbing}
:root[data-echo-desktop][data-cursor="echo"][data-theme="night"]{--echo-cursor-arrow:url("/assets/cursors/night-arrow.svg") 3 3,auto;--echo-cursor-hand:url("/assets/cursors/night-hand.svg") 8 3,pointer;--echo-cursor-move:url("/assets/cursors/night-move.svg") 10 10,move;--echo-cursor-resize:url("/assets/cursors/night-resize.svg") 10 10,nwse-resize;--echo-cursor-grab:url("/assets/cursors/night-grab.svg") 10 10,grab;--echo-cursor-grabbing:url("/assets/cursors/night-grabbing.svg") 10 10,grabbing}
:root[data-echo-desktop][data-cursor="echo"][data-theme="arc"]{--echo-cursor-arrow:url("/assets/cursors/arc-arrow.svg") 3 3,auto;--echo-cursor-hand:url("/assets/cursors/arc-hand.svg") 8 3,pointer;--echo-cursor-move:url("/assets/cursors/arc-move.svg") 10 10,move;--echo-cursor-resize:url("/assets/cursors/arc-resize.svg") 10 10,nwse-resize;--echo-cursor-grab:url("/assets/cursors/arc-grab.svg") 10 10,grab;--echo-cursor-grabbing:url("/assets/cursors/arc-grabbing.svg") 10 10,grabbing}
:root[data-echo-desktop][data-cursor="echo"][data-theme="gta"]{--echo-cursor-arrow:url("/assets/cursors/gta-arrow.svg") 3 3,auto;--echo-cursor-hand:url("/assets/cursors/gta-hand.svg") 8 3,pointer;--echo-cursor-move:url("/assets/cursors/gta-move.svg") 10 10,move;--echo-cursor-resize:url("/assets/cursors/gta-resize.svg") 10 10,nwse-resize;--echo-cursor-grab:url("/assets/cursors/gta-grab.svg") 10 10,grab;--echo-cursor-grabbing:url("/assets/cursors/gta-grabbing.svg") 10 10,grabbing}
:root[data-echo-desktop][data-cursor="echo"] body{cursor:var(--echo-cursor-arrow,auto)}
:root[data-echo-desktop][data-cursor="echo"] :is(button:not(:disabled),a[href],label:has(input:is([type=checkbox],[type=radio])),summary,[role=button],input[type=range],select){cursor:var(--echo-cursor-hand,pointer)}
:root[data-echo-desktop][data-cursor="echo"] :is(input:not([type]),input[type=text],input[type=search],input[type=url],input[type=email],input[type=tel],input[type=password],textarea,[contenteditable=true]){cursor:text}
/* All floating-chat drag affordances use the same themed cursor family.
   Keep the hand on real header buttons; touch layouts have no drag handle. */
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel .chat-head{cursor:var(--echo-cursor-arrow,auto)}
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel .chat-head button:not(:disabled){cursor:var(--echo-cursor-hand,pointer)}
@media(min-width:781px){
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel .chat-head{cursor:var(--echo-cursor-move,move)}
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel .chat-resize-grip{cursor:var(--echo-cursor-resize,nwse-resize)}
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel[data-chat-drag="move"] .chat-head{cursor:var(--echo-cursor-move,move)}
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel[data-chat-drag="resize"] .chat-resize-grip{cursor:var(--echo-cursor-resize,nwse-resize)}
}
:root[data-echo-desktop][data-cursor="echo"] .preferences-content .overlay-preview-widget{cursor:var(--echo-cursor-grab,grab)}
:root[data-echo-desktop][data-cursor="echo"] .preferences-content .overlay-preview-widget:active{cursor:var(--echo-cursor-grabbing,grabbing)}
:root[data-echo-desktop][data-cursor="echo"] :is(button:disabled,input:disabled,select:disabled){cursor:not-allowed}
}

/* Native shell is not a selectable web document. Keep real text editing,
   messages, room codes and diagnostic output accessible. */
:root[data-echo-desktop] body{user-select:none;-webkit-user-select:none}
/* Top-layer dialogs can escape the body's selection inheritance. Explicitly
   lock app chrome, including nested SVGs, labels and context menu items. */
:root[data-echo-desktop] :is(dialog,dialog *,button,button *,label,label *,nav,nav *,.echo-context-menu,.echo-context-menu *){user-select:none;-webkit-user-select:none}
:root[data-echo-desktop] :is(input:not([type]),input[type=text],input[type=search],input[type=url],input[type=email],input[type=tel],input[type=password],input[type=number],textarea,[contenteditable=true],.chat-message-text,.chat-message-text *,#roomCode,.feedback-preview,.feedback-preview *,#audioDiagnosticsText){user-select:text;-webkit-user-select:text}
:root[data-echo-desktop] .echo-context-menu *{user-select:none!important;-webkit-user-select:none!important}
:root[data-echo-desktop] img{ -webkit-user-drag:none }
.echo-context-menu .echo-menu-danger{color:#e68b91}
.echo-context-menu .echo-menu-danger svg{stroke:currentColor}
.chat-action-bar{display:flex;align-items:center;gap:10px;padding:8px 12px;border-top:1px solid var(--border);background:var(--panel);color:var(--green);min-width:0}
.chat-action-bar[hidden]{display:none}
.chat-action-bar>svg,.chat-action-bar button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.chat-action-content{display:grid;min-width:0;gap:3px;flex:1}
.chat-action-content strong{font-size:12px}
.chat-action-content span,.chat-reply-quote span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}
.chat-action-bar button{display:grid;place-items:center;width:30px;height:30px;flex:none;border:0;background:transparent;color:var(--muted);border-radius:7px}
.chat-reply-quote{display:grid;gap:2px;text-align:left;min-width:0;max-width:100%;margin:3px 0 5px;padding:5px 8px;border:0;border-left:2px solid var(--green);border-radius:4px;background:var(--panel-soft);color:var(--green);overflow:hidden}
body.in-room #chatPanel .chat-reply-quote{margin-left:32px;width:calc(100% - 32px);max-width:calc(100% - 32px)}
.chat-reply-quote strong{font-size:11px}
.chat-edited{color:var(--muted);font-size:10px;white-space:nowrap}
.chat-delete-dialog{max-width:min(360px,calc(100vw - 32px));padding:20px;border:1px solid var(--border);border-radius:14px;background:var(--panel);color:var(--tone-edf4f1);box-shadow:0 12px 40px #0005}
.chat-delete-dialog::backdrop{background:#0007}
.chat-delete-dialog h3{margin:0 0 10px;font-size:17px}
.chat-delete-dialog p{color:var(--muted);font-size:13px;margin:0 0 18px}
.chat-delete-actions{display:flex;justify-content:flex-end;gap:8px}
.chat-delete-actions button{border:1px solid var(--border);background:var(--panel-soft);color:inherit;padding:8px 13px;border-radius:8px}
.chat-delete-actions .chat-delete-confirm{color:#ffb0b3;border-color:#ab5961}

.echo-context-menu .echo-reaction-palette{display:grid;grid-template-columns:repeat(6,1fr);gap:3px;padding:4px 2px 6px;margin-bottom:4px;border-bottom:1px solid var(--border)}
.echo-context-menu .echo-reaction-palette button{display:grid;place-items:center;min-width:0;width:30px;height:32px;padding:0;border-radius:7px;font:18px/1 "Segoe UI Emoji",sans-serif}
.echo-context-menu .echo-reaction-palette button[aria-pressed="true"]{background:var(--panel-soft);outline:1px solid var(--green)}
/* Keep timestamps and delivery marks anchored to the same right edge,
   irrespective of reaction state. Animate only the normal-flow reaction area. */
body.in-room #chatPanel .chat-message[data-text-message-id]{position:relative}
body.in-room #chatPanel .chat-message[data-text-message-id] .chat-message-meta,
body.in-room #chatPanel .chat-message.chat-own[data-text-message-id]:not(.chat-consecutive):not(.image-message) .chat-message-meta{position:absolute;inset:auto 9px 2px auto;height:18px;min-height:0;margin:0;padding:0;gap:3px;white-space:nowrap}
body.in-room #chatPanel .chat-message[data-text-message-id] .chat-message-meta time{color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums;opacity:.85}
body.in-room #chatPanel .chat-message[data-text-message-id].chat-consecutive .chat-message-head,
body.in-room #chatPanel .chat-message.chat-own.chat-consecutive[data-text-message-id]:not(.image-message) .chat-message-head{display:block!important;position:static!important;width:auto!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;pointer-events:auto!important}
body.in-room #chatPanel .chat-message[data-text-message-id].chat-consecutive .chat-author{display:none!important}
body.in-room #chatPanel .chat-message[data-text-message-id].chat-consecutive .chat-message-head time{opacity:.85!important}
body.in-room #chatPanel .chat-message[data-text-message-id] .chat-message-text::after{content:"";display:inline-block;width:83px;height:0;vertical-align:baseline}
body.in-room #chatPanel .chat-reaction-footer{box-sizing:border-box;overflow:hidden;margin-left:32px;margin-right:83px;min-width:0}
body.in-room #chatPanel .chat-reactions{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding-top:3px;padding-bottom:2px;min-width:0}
body.in-room #chatPanel .chat-reaction{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:21px;padding:2px 6px;border:1px solid transparent;border-radius:12px;background:var(--panel-soft);color:var(--muted);font:500 11px/1.1 "Segoe UI",sans-serif;font-variant-numeric:tabular-nums;box-shadow:none}
body.in-room #chatPanel .chat-reaction span:first-child{font:14px/1 "Segoe UI Emoji",sans-serif}
body.in-room #chatPanel .chat-reaction:hover{border-color:var(--green)}
body.in-room #chatPanel .chat-reaction[aria-pressed="true"]{border-color:transparent;color:var(--green);background:color-mix(in srgb,var(--panel) 70%,var(--green))}
@media(forced-colors:active){body.in-room #chatPanel .chat-reaction[aria-pressed="true"]{border-color:Highlight;color:Highlight}}
.echo-copy-dialog input{width:100%;margin:0 0 14px;padding:9px;border:1px solid var(--border);border-radius:7px;background:var(--panel-soft);color:inherit;user-select:text}

body.in-room #chatPanel .web-reaction-add{display:block;width:25px;height:21px;padding:0;margin:4px 0 0 32px;border:1px solid var(--border);border-radius:8px;color:var(--muted);background:var(--panel-soft);font:15px/1 "Segoe UI Symbol",sans-serif}
body.in-room #chatPanel .web-reaction-picker{display:flex;flex-wrap:wrap;gap:3px;margin:4px 0 0 32px}
body.in-room #chatPanel .web-reaction-picker button{width:29px;height:29px;padding:0;border:1px solid var(--border);border-radius:7px;background:var(--panel-soft);font:16px/1 "Segoe UI Emoji",sans-serif}
body.in-room #chatPanel .chat-own:has(.web-reaction-add){padding-bottom:5px}

.echo-tooltip{position:fixed;z-index:2147483647;pointer-events:none;max-width:min(260px,calc(100vw - 16px));padding:6px 9px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--tone-edf4f1);box-shadow:0 6px 18px #0005;font:500 12px/1.4 "Segoe UI",sans-serif;white-space:pre-line;overflow-wrap:anywhere;user-select:none;text-align:left}
.echo-tooltip[hidden]{display:none}
:root[data-theme="arc"] .echo-tooltip{border-radius:3px}
:root[data-theme="gta"] .echo-tooltip{border-color:#b576a0;background:#292036;color:#f8e4ef}
@media(forced-colors:active){.echo-tooltip{background:Canvas;color:CanvasText;border-color:CanvasText}}

/* A desktop logo is decoration, never a link or a draggable web payload.
   Limit the rule to branding; file drops and chat selection are unaffected. */
:root[data-echo-desktop] .topbar > .brand,
:root[data-echo-desktop] .topbar > .brand *{user-select:none;-webkit-user-select:none;-webkit-user-drag:none;cursor:default}
:root[data-echo-desktop][data-cursor="echo"] .topbar > .brand,
:root[data-echo-desktop][data-cursor="echo"] .topbar > .brand *{cursor:var(--echo-cursor-arrow,auto)}
@media(forced-colors:active){
:root[data-echo-desktop][data-cursor="echo"] .topbar > .brand,
:root[data-echo-desktop][data-cursor="echo"] .topbar > .brand *{cursor:default}
}

/* Quick controls have ID-specific cursor rules in quickbar.css, including
   the transparent checkbox that receives pointer events over the shield. */
@media (pointer:fine) and (forced-colors:none){
:root[data-echo-desktop][data-cursor="echo"] body.in-room #screenCall .dock-buttons :is(.dock-button:not(:disabled),#openDiagnostics:not(:disabled),#noiseDockControl:has(input:not(:disabled)),#noiseDockControl input:not(:disabled)),
:root[data-echo-desktop][data-cursor="echo"] body.in-room #screenCall .dock-buttons :is(.dock-button:not(:disabled),#openDiagnostics:not(:disabled),#noiseDockControl:has(input:not(:disabled))) *{cursor:var(--echo-cursor-hand,pointer)}
:root[data-echo-desktop][data-cursor="echo"] body.in-room #screenCall .dock-buttons :is(.dock-button:disabled,#openDiagnostics:disabled,#noiseDockControl:has(input:disabled)),
:root[data-echo-desktop][data-cursor="echo"] body.in-room #screenCall .dock-buttons :is(.dock-button:disabled,#openDiagnostics:disabled,#noiseDockControl:has(input:disabled)) *{cursor:var(--echo-cursor-arrow,auto)}
}

/* Cover the document canvas outside the body and high-specificity
   interactive controls left over from earlier UI styles. Native Windows
   non-client resize borders are intentionally outside CSS control. */
@media (pointer:fine) and (forced-colors:none){
:root[data-echo-desktop][data-cursor="echo"]{cursor:var(--echo-cursor-arrow,auto)}
:root[data-echo-desktop][data-cursor="echo"] :is(#feedbackOpen,#feedbackSettingsOpen,#imageStop):not(:disabled),
:root[data-echo-desktop][data-cursor="echo"] :is(#feedbackOpen,#feedbackSettingsOpen,#imageStop):not(:disabled) *,
:root[data-echo-desktop][data-cursor="echo"] #screenSharePreview #screenAudioSettingsToggle:not(:disabled),
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel .chat-jump-latest:not(:disabled),
:root[data-echo-desktop][data-cursor="echo"] body.in-room #screenCall .participant-card .peer-volume:not(:disabled),
:root[data-echo-desktop][data-cursor="echo"] input:is([type=checkbox],[type=radio]):not(:disabled),
:root[data-echo-desktop][data-cursor="echo"] .screen-preview-toggle{cursor:var(--echo-cursor-hand,pointer)}
}


/* Chromium's standardized scrollbar width/color take precedence over
   ::-webkit-scrollbar styling. Enable the existing custom-painted native
   scrollbar in Echo cursor mode; retain native scrolling and hit testing.
   This is desktop-only and never overrides system/high-contrast mode. */
@media (pointer:fine) and (forced-colors:none){
:root[data-echo-desktop][data-cursor="echo"],
:root[data-echo-desktop][data-cursor="echo"] *{
  scrollbar-width:auto!important;
  scrollbar-color:auto!important;
}
:root[data-echo-desktop][data-cursor="echo"]::-webkit-scrollbar,
:root[data-echo-desktop][data-cursor="echo"] *::-webkit-scrollbar{
  width:7px;height:7px;cursor:var(--echo-cursor-arrow,auto)
}
:root[data-echo-desktop][data-cursor="echo"]::-webkit-scrollbar-thumb,
:root[data-echo-desktop][data-cursor="echo"] *::-webkit-scrollbar-thumb{
  border-radius:999px;background:var(--echo-settings-scroll-thumb,var(--tone-567269));cursor:var(--echo-cursor-arrow,auto)
}
:root[data-echo-desktop][data-cursor="echo"]::-webkit-scrollbar-track,
:root[data-echo-desktop][data-cursor="echo"] *::-webkit-scrollbar-track,
:root[data-echo-desktop][data-cursor="echo"] *::-webkit-scrollbar-track-piece,
:root[data-echo-desktop][data-cursor="echo"] *::-webkit-scrollbar-corner{
  background:transparent;cursor:var(--echo-cursor-arrow,auto)
}
:root[data-echo-desktop][data-cursor="echo"]::-webkit-scrollbar-button,
:root[data-echo-desktop][data-cursor="echo"] *::-webkit-scrollbar-button{
  display:none;width:0;height:0;cursor:var(--echo-cursor-arrow,auto)
}
/* Keep the previous compact chat sizes and palette-specific thumbs. */
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel :is(.chat-messages,.chat-compose textarea)::-webkit-scrollbar{width:6px}
:root[data-echo-desktop][data-cursor="echo"][data-theme="arc"] body.in-room #chatPanel :is(.chat-messages,.chat-compose textarea)::-webkit-scrollbar{width:5px}
:root[data-echo-desktop][data-cursor="echo"][data-theme="gta"] body.in-room #chatPanel .chat-messages::-webkit-scrollbar-thumb{background:rgba(225,145,196,.5)}
}

/* Image actions share text reaction geometry and never duplicate image bytes. */
body.in-room #chatPanel .chat-reply-quote.is-image-quote{display:flex;align-items:center;gap:7px}
.chat-quote-thumbnail,.chat-action-thumbnail{display:block;width:36px;height:36px;flex:0 0 36px;object-fit:cover;border-radius:4px}
.chat-quote-content{display:grid;min-width:0;gap:2px;flex:1}
body.in-room #chatPanel .image-message .chat-reaction-footer{margin-right:0}
body.in-room #chatPanel .image-local-status{font-size:10px;color:var(--muted);white-space:nowrap}
body.in-room #chatPanel .web-image-reply{align-self:flex-start;border:1px solid var(--border);border-radius:7px;background:var(--panel-soft);color:var(--green);font:inherit;font-size:11px;padding:4px 7px;margin:4px 0 0 32px}
/* Keep local resend in the metadata line: no extra caption/button row. */
body.in-room #chatPanel .image-message.image-local .chat-message-meta{gap:6px;align-items:center}
body.in-room #chatPanel .image-message.image-local .chat-receipt[hidden]{display:none!important}
body.in-room #chatPanel .image-message .image-send-local{
  position:relative;display:inline-grid;place-items:center;flex:0 0 22px;width:22px;height:22px;min-width:0;min-height:0;
  margin:0;padding:0;border:0;border-radius:50%;background:transparent;
  color:var(--muted);box-shadow:none;clip-path:none;line-height:1;cursor:pointer;
  transition:background-color .15s,color .15s,border-color .15s;
}
body.in-room #chatPanel .image-message .image-send-local svg{position:relative;width:13px;height:13px;display:block;fill:none;stroke:currentColor;pointer-events:none}
body.in-room #chatPanel .image-message .image-send-local::before{
  content:"";position:absolute;inset:2px;border-radius:50%;background:transparent;pointer-events:none;
  transition:background-color .15s
}
body.in-room #chatPanel .image-message .image-send-local:is(:hover,:focus-visible){color:var(--green)}
body.in-room #chatPanel .image-message .image-send-local:is(:hover,:focus-visible)::before{
  background:color-mix(in srgb,var(--panel-soft) 88%,var(--green))
}
body.in-room #chatPanel .image-message .image-send-local:focus-visible{outline:2px solid var(--green);outline-offset:1px}
@media (pointer:fine) and (forced-colors:none){
:root[data-echo-desktop][data-cursor="echo"] body.in-room #chatPanel .image-message .image-send-local{cursor:var(--echo-cursor-hand,pointer)}
}
@media(prefers-reduced-motion:reduce){body.in-room #chatPanel .image-message .image-send-local,body.in-room #chatPanel .image-message .image-send-local::before{transition:none}}
@media(forced-colors:active){body.in-room #chatPanel .image-message .image-send-local:is(:hover,:focus-visible){color:Highlight;border-color:Highlight;background:Canvas}}

/* Full-size viewer: native image, clipped zoom stage, no new overlay toolbar. */
#imageViewer{overflow:hidden}
#imageViewerStage{position:relative;width:100%;height:100%;overflow:hidden;touch-action:pan-y;user-select:none;outline:none}
#imageViewerStage:focus-visible{outline:1px solid var(--border);outline-offset:1px}
#imageViewerStage #imageFull{display:block;width:100%;height:100%;object-fit:contain;transform-origin:center;user-select:none;-webkit-user-drag:none}
#imageViewerStage[data-pannable="true"]{cursor:grab;touch-action:none}
#imageViewerStage[data-panning="true"]{cursor:grabbing}
#imageViewerNotice{position:absolute;z-index:2;bottom:22px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);width:max-content;padding:9px 14px;border:1px solid var(--border);border-radius:9px;background:var(--panel);color:var(--green);font-size:12px;box-shadow:0 6px 20px #0003;pointer-events:none}
#imageViewerNotice[hidden]{display:none}
@media (pointer:fine) and (forced-colors:none){
:root[data-echo-desktop][data-cursor="echo"] #imageViewerStage[data-pannable="true"]{cursor:var(--echo-cursor-grab,grab)}
:root[data-echo-desktop][data-cursor="echo"] #imageViewerStage[data-panning="true"]{cursor:var(--echo-cursor-grabbing,grabbing)}
}
