#selection-toolbar {
  position: fixed; z-index: 75; box-sizing: border-box; width: 366px;
  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto;
  padding: 5px; border: 1px solid #dce5ef;
  border-radius: 13px; background: #fff; color: #243247;
  box-shadow: 0 6px 24px #1c345b24, 0 1px 4px #1c345b0d;
  font: 13px/1.25 "Segoe UI", "Microsoft YaHei", sans-serif;
  user-select: none; -webkit-user-select: none;
  animation: none;
}
#selection-toolbar[hidden], #selection-toolbar [hidden] { display: none !important; }
#selection-toolbar .st-row { display: flex; align-items: center; gap: 2px; }
#selection-toolbar .st-row + .st-row { margin-top: 3px; padding-top: 3px; border-top: 1px solid #edf1f6; }
#selection-toolbar button, #selection-toolbar select, #selection-toolbar input {
  box-sizing: border-box; color: inherit; font: inherit; margin: 0;
}
#selection-toolbar button {
  display: inline-flex; justify-content: center; align-items: center; flex: 0 0 31px;
  height: 28px; padding: 3px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
}
#selection-toolbar button:hover { background: #edf4ff; }
#selection-toolbar button[aria-pressed="true"], #selection-toolbar button[aria-expanded="true"] { background: #e3eeff; color: #0758cb; }
#selection-toolbar button[aria-pressed="mixed"] { background: linear-gradient(135deg, #e3eeff 50%, #fff 50%); }
#selection-toolbar :focus-visible { outline: 2px solid #397be7; outline-offset: 1px; }
#selection-toolbar select { min-width: 0; height: 28px; padding: 2px 5px; border: 1px solid #dce5ef; border-radius: 6px; background: #fff; }
#selection-toolbar .st-font { flex: 1 1 145px; width: 145px; }
#selection-toolbar .st-style { flex: 1; width: 73px; }
#selection-toolbar .st-size { flex: 0 0 78px; display: flex; align-items: center; height: 28px; border: 1px solid #dce5ef; border-radius: 6px; }
#selection-toolbar .st-size input { width: 56px; min-width: 0; border: 0; background: transparent; padding: 4px; appearance: textfield; }
#selection-toolbar .st-size input::-webkit-inner-spin-button { appearance: none; }
#selection-toolbar .st-size span { color: #8793a3; font-size: 11px; }
#selection-toolbar sup { align-self: flex-start; font-size: 9px; }
#selection-toolbar svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; fill: none; }
#selection-toolbar .st-divider { height: 18px; border-left: 1px solid #e1e7ef; margin: 0 2px; }
#selection-toolbar .st-color { flex-direction: column; gap: 1px; }
#selection-toolbar .st-color i { display: block; width: 19px; height: 3px; border-radius: 1px; background: var(--st-color, #ffff00); }
#selection-toolbar .st-color[data-palette="foreColor"] { --st-color: #dc2626; }
#selection-toolbar .st-palette { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 7px; margin-top: 6px; border-top: 1px solid #edf1f6; }
#selection-toolbar .st-swatch { flex-basis: 24px; height: 24px; background: var(--swatch); border: 1px solid #a5b2c6; box-shadow: inset 0 0 0 2px #fff; }
#selection-toolbar .st-clear { flex-basis: 60px; height: 24px; font-size: 12px; }
body.udoc-document-readonly #selection-toolbar, body.udoc-reading-view #selection-toolbar,
body.presenting #selection-toolbar, body.udoc-html-immersive #selection-toolbar,
body.udoc-omni-reading #selection-toolbar { display: none !important; }
@media (max-width: 400px) {
  #selection-toolbar { padding: 5px; }
  #selection-toolbar button { flex-basis: 28px; }
  #selection-toolbar .st-row { gap: 2px; }
}
@media print { #selection-toolbar { display: none !important; } }
@media (prefers-reduced-motion: reduce) { #selection-toolbar { animation: none !important; transition: none !important; } }
