/* Keep the action palette shared across sections, themes, and open dialogs. */
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label,.ui-appearance>summary) > :is(svg.icon,svg.call-icon),
:root[data-theme] :is(.main-shell,#modal-root) .theme-toggle svg.icon {
  --action-icon-start:#465fff;
  --action-icon-end:#4147c5;
  box-sizing:border-box;
  width:22px;
  height:22px;
  flex:none;
  padding:3px;
  border-radius:var(--r-sm);
  background:linear-gradient(145deg,var(--action-icon-start),var(--action-icon-end));
  color:#fff;
  stroke-width:1.85;
  box-shadow:inset 0 1px 0 #ffffff45, 0 2px 5px -2px var(--action-icon-start);
}

:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label,.ui-appearance>summary) > svg:is(
  [data-icon="deals"],[data-icon="chats"],[data-icon="comment"],[data-icon="pin"],[data-icon="history"]
) {--action-icon-start:#4b49d7;--action-icon-end:#6b40ca}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg:is(
  [data-icon="projects"],[data-icon="check"],[data-icon="call"]
) {--action-icon-start:#08724e;--action-icon-end:#087b70}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg:is(
  [data-icon="tasks"],[data-icon="task"],[data-icon="edit"],[data-icon="send"]
) {--action-icon-start:#2359d6;--action-icon-end:#08779f}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg:is(
  [data-icon="drive"],[data-icon="file"],[data-icon="paperclip"],[data-icon="download"]
) {--action-icon-start:#ad6906;--action-icon-end:#8c4907}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg:is(
  [data-icon="mail"],[data-icon="email"],[data-icon="at"]
) {--action-icon-start:#078198;--action-icon-end:#086883}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg:is(
  [data-icon="contacts"],[data-icon="users"],[data-icon="clock"],[data-icon="activity"]
) {--action-icon-start:#c45325;--action-icon-end:#a23e25}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg[data-icon="smile"] {
  --action-icon-start:#c02b81;--action-icon-end:#9d2b83;
}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label) > svg[data-icon="agents"] {
  --action-icon-start:#638019;--action-icon-end:#446821;
}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label,.ui-appearance>summary) > svg:is(
  [data-icon="settings"],[data-icon="monitor"],[data-icon="lock"],[data-icon="more"]
) {--action-icon-start:#596b88;--action-icon-end:#384960}

:root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(
  button.danger,button[data-call="leave"],.work-file-remove
) > svg,
:root[data-theme] :is(.main-shell,#modal-root,#call-root) button > svg:is([data-icon="trash"],[data-icon="logout"]) {
  --action-icon-start:var(--danger-red);
  --action-icon-end:var(--danger-red);
}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) button:disabled > svg:is(.icon,.call-icon),
:root[data-theme] :is(.main-shell,#modal-root,#call-root) button[aria-disabled="true"] > svg:is(.icon,.call-icon) {
  filter:saturate(.5);
}

/* Compact tools keep their original hit areas and spacing. */
:root[data-theme] :is(.dp-actions,.sales-stage-tools,.sales-stage-edit-actions,.chat-channel-row,.bubble-author,.message-quick) button > svg.icon {
  width:19px;
  height:19px;
  padding:2px;
  border-radius:var(--r-xs);
}
:root[data-theme] :is(.main-shell,#modal-root,#call-root) button:is(.btn.primary,.call-end) > svg:is(.icon,.call-icon) {
  background:#ffffff25;
  box-shadow:inset 0 1px 0 #ffffff38;
}
:root[data-theme] #modal-root .modal-head button[data-action="close"] > svg.icon {
  width:22px;
  height:22px;
  padding:0;
  background:none;
  color:inherit;
  stroke-width:2.25;
  box-shadow:none;
}

@media(max-width:760px){
  :root[data-theme] :is(.main-shell,#modal-root,#call-root) :is(button,a.btn,.upload-label,.ui-appearance>summary) > :is(svg.icon,svg.call-icon) {
    width:20px;
    height:20px;
  }
  :root[data-theme] .dash-quick .btn {gap:5px;padding-inline:9px}
}
