/* Compact, grouped basic editing tools. Original native spans stay in the DOM. */
.qp-basic-ui #tools_container > .item { display: none !important; }
.qp-basic-ui #tools_container {
  width: 48px;
  padding: 5px 4px 4px;
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.qp-basic-ui #tools_container::-webkit-scrollbar { width: 0; }
.qp-tool-stack { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; flex: 0 0 auto; }
.qp-basic-ui .qp-tool-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 31px;
  min-height: 31px;
  padding: 4px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #3c485b;
  cursor: pointer;
  touch-action: manipulation;
  flex: 0 0 auto;
}
.qp-basic-ui .qp-tool-button:hover { background: #edf2fa; border-color: #e2e8f2; }
.qp-basic-ui .qp-tool-button[aria-pressed="true"] { color: #2466d4; background: #e9f1ff; border-color: #b5ccee; }
.qp-basic-ui .qp-tool-button[aria-expanded="true"] { background: #edf2fa; border-color: #b9c9df; }
.qp-basic-ui .qp-tool-button:disabled { opacity: .38; cursor: default; }
.qp-basic-ui .qp-tool-button:focus-visible { outline: 2px solid #3979dd; outline-offset: -2px; }
.qp-tool-button svg { width: 21px; height: 21px; pointer-events: none; }
.qp-tool-more { position: absolute; right: 2px; bottom: 2px; width: 0; height: 0; border-left: 4px solid transparent; border-bottom: 4px solid currentColor; opacity: .7; pointer-events: none; }
.qp-tool-button[data-group="retouch"], .qp-tool-button[data-group="text"], .qp-tool-button[data-group="hand"] { margin-top: 5px; }

.qp-color-controls { position: relative; flex: 0 0 64px; width: 38px; height: 64px; margin: 5px 0 0; }
.qp-basic-ui .qp-color-swatch { position: absolute; width: 24px; height: 24px; padding: 0; border: 1px solid #768397; border-radius: 2px; box-shadow: 0 0 0 2px #fff; cursor: pointer; }
.qp-color-swatch.qp-foreground { top: 14px; left: 1px; z-index: 2; }
.qp-color-swatch.qp-background { top: 26px; left: 13px; z-index: 1; }
.qp-basic-ui .qp-color-small { position: absolute; display: grid; place-items: center; width: 17px; height: 17px; min-width: 0; padding: 1px; border: 0; background: transparent; color: #4f5e73; border-radius: 2px; cursor: pointer; }
.qp-color-small:hover { background: #eaf0f8; }
.qp-color-small svg { width: 15px; height: 15px; }
.qp-color-swap { right: 0; top: 0; }
.qp-color-reset { left: 0; bottom: 0; }
.qp-color-input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }

.qp-basic-ui #main_menu { height: 38px; }
.qp-menu-bar { height: 38px; display: flex; align-items: stretch; gap: 0; padding: 0 8px; background: #fff; border-bottom: 1px solid #e0e5ec; white-space: nowrap; }
.qp-basic-ui .qp-menu-button { display: flex; align-items: center; height: 37px; padding: 0 13px; border: 0; border-radius: 0; background: transparent; color: #334158; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: none; }
.qp-basic-ui .qp-menu-button:hover, .qp-basic-ui .qp-menu-button[aria-expanded="true"] { background: #edf3fc; color: #245fc7; }
.qp-basic-ui .qp-menu-button:focus-visible { outline: 2px solid #779cdd; outline-offset: -3px; }
.qp-basic-ui .qp-tool-search-trigger { display: grid; place-items: center; width: 36px; height: 37px; flex: 0 0 36px; margin-left: auto; padding: 8px; border: 0; border-radius: 0; background: transparent; color: #75839a; cursor: pointer; }
.qp-tool-search-trigger svg { width: 18px; height: 18px; }
.qp-basic-ui .qp-tool-search-trigger:hover { background: #edf3fc; color: #245fc7; }

.qp-popup { position: fixed; z-index: 500; min-width: 225px; max-width: calc(100vw - 14px); overflow-y: auto; overscroll-behavior: contain; padding: 5px; border: 1px solid #d7dfea; border-radius: 6px; background: #fff; box-shadow: 0 8px 28px #23375129, 0 2px 6px #2337510d; color: #34435b; font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif; }
.qp-basic-ui .qp-popup-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 31px; padding: 6px 10px; border: 0; border-radius: 3px; margin: 0; color: #34435b; background: transparent; text-align: left; white-space: nowrap; cursor: pointer; box-shadow: none; }
.qp-basic-ui .qp-popup-item:hover, .qp-basic-ui .qp-popup-item:focus-visible { color: #245fc7; background: #eaf1ff; outline: none; }
.qp-basic-ui .qp-popup-item:disabled { visibility: visible; color: #9da7b6; cursor: default; background: transparent; }
.qp-item-label { flex: 1; }
.qp-popup-item kbd { margin-left: 18px; color: #8c97a8; font: 11px/1.4 "Segoe UI", Arial, sans-serif; letter-spacing: .1px; }
.qp-popup-item svg { flex: 0 0 19px; width: 19px; height: 19px; }
.qp-tool-choice[aria-checked="true"] { color: #2567d4; background: #f0f5ff; }
.qp-tool-choice[aria-checked="true"]::after { content: ""; width: 5px; height: 9px; border: solid currentColor; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); margin: 0 2px 3px 2px; }
.qp-tool-choice:not([aria-checked="true"])::after { content: ""; width: 7px; margin: 0 2px; }
.qp-menu-separator { height: 0; margin: 4px 5px; border: 0; border-top: 1px solid #e7ebf1; }
.qp-search-popup { width: 278px; padding: 7px; }
.qp-basic-ui .qp-tool-search-input { box-sizing: border-box; width: 100%; height: 33px; margin: 0 0 6px; padding: 5px 9px; border: 1px solid #cbd8eb; border-radius: 4px; background: #fff; font-size: 13px; }
.qp-tool-search-results { max-height: min(380px, 60vh); overflow-y: auto; }
.qp-search-empty { padding: 16px 8px; color: #8a96a7; font-size: 12px; }
.qp-tool-tooltip { position: fixed; z-index: 550; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 11px; min-width: 110px; max-width: 245px; border: 1px solid #dae1eb; border-radius: 5px; color: #34435b; background: #fff; box-shadow: 0 4px 15px #263c5921; font-size: 12px; pointer-events: none; }
.qp-tool-tooltip[hidden] { display: none; }
.qp-tooltip-name { font-weight: 550; }
.qp-tool-tooltip kbd { color: #77869b; font: 11px "Segoe UI", Arial, sans-serif; margin-left: auto; }
.qp-tool-tooltip small { flex-basis: 100%; color: #8390a2; font-size: 10px; }

.qp-navigation-options { display: flex; align-items: center; gap: 7px; min-height: 32px; white-space: nowrap; }
.qp-basic-ui .qp-option-button { min-height: 28px; padding: 4px 10px; border: 1px solid #d9e1ec; border-radius: 4px; background: #fff; color: #44566f; font-size: 12px; cursor: pointer; }
.qp-basic-ui .qp-option-button:hover { color: #2466d4; background: #edf3ff; border-color: #bdcfe9; }
.qp-basic-ui .qp-option-icon { display: grid; place-items: center; width: 29px; padding: 4px; }
.qp-option-icon svg { width: 18px; height: 18px; }
.qp-option-hint { margin-left: 9px; color: #7d8b9e; font-size: 12px; }

.qp-layer-blend-row { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 7px; }
.qp-layer-blend-row > label { flex: 0 0 auto; color: #69778b; font-size: 12px; }
.qp-basic-ui .qp-layer-blend-select { box-sizing: border-box; flex: 1; min-width: 0; width: 0; height: 28px; min-height: 28px; margin: 0; padding: 3px 7px; border: 1px solid #d4deeb; border-radius: 4px; color: #34435b; background: #fff; font-family: inherit; font-size: 12px; line-height: 1.4; cursor: pointer; }
.qp-basic-ui .qp-layer-blend-select:focus-visible { outline: 2px solid #3979dd; outline-offset: 1px; }
.qp-basic-ui .qp-layer-blend-select:disabled { color: #8b96a5; background: #f4f6f9; cursor: default; }

.qp-context-popup { min-width: min(250px, calc(100vw - 12px)); max-width: min(340px, calc(100vw - 12px)); }
.qp-context-heading { padding: 5px 9px 8px; color: #62718a; font-size: 12px; font-weight: 600; }
.qp-context-layer-name { max-width: 290px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid #e7ebf1; margin-bottom: 4px; }
.qp-context-brush { padding: 2px 2px 4px; }
.qp-context-setting { display: grid; grid-template-columns: 58px minmax(60px, 1fr) 51px 18px; align-items: center; gap: 6px; min-height: 33px; padding: 0 6px; }
.qp-context-setting > label { color: #53647e; font-size: 12px; }
.qp-basic-ui .qp-context-range { min-width: 0; width: 100%; height: 25px; padding: 0; margin: 0; accent-color: #3678dc; cursor: pointer; }
.qp-basic-ui .qp-context-number { box-sizing: border-box; width: 51px; min-width: 0; height: 26px; padding: 3px 4px; margin: 0; border: 1px solid #d4deeb; border-radius: 3px; color: #34435b; background: #fff; font-size: 12px; text-align: right; }
.qp-context-unit { color: #8390a2; font-size: 11px; }
.qp-context-popup input:focus-visible { outline: 2px solid #3979dd; outline-offset: 1px; }

@media (max-height: 730px) and (min-width: 701px) {
  .qp-basic-ui .qp-tool-button { height: 28px; min-height: 28px; width: 32px; padding: 3px; }
  .qp-tool-button svg { width: 20px; height: 20px; }
  .qp-tool-button[data-group="retouch"], .qp-tool-button[data-group="text"], .qp-tool-button[data-group="hand"] { margin-top: 3px; }
  .qp-color-controls { margin-top: 2px; }
}
@media (max-width: 850px) {
  .qp-option-hint { display: none; }
  .qp-basic-ui .qp-menu-button { padding: 0 10px; }
}
@media (max-width: 700px) {
  .qp-basic-ui #main_menu, .qp-menu-bar { height: 44px; }
  .qp-menu-bar { padding: 0 43px; overflow-x: auto; scrollbar-width: none; }
  .qp-basic-ui .qp-menu-button { height: 43px; padding: 0 9px; font-size: 13px; flex-shrink: 0; }
  .qp-basic-ui .qp-tool-search-trigger { height: 43px; }
  .qp-basic-ui #tools_container { width: 48px; left: -52px; }
  .qp-basic-ui #tools_container.active { left: 0; }
  .qp-popup { min-width: 215px; }
  .qp-basic-ui .qp-popup-item { min-height: 36px; }
}
.qp-basic-ui .submenu.qp-options-collapsed { display: none; }
