/* AHProfi v584 -- mobile toolbar and minimap. Deliberately loaded AFTER
   the original editor, responsive, and later UX styles. Desktop unchanged. */
#editorScreen #mobileToolbarMoreButton,
#editorScreen #mobileToolbarExtras { display: none !important; }

@media (max-width: 760px) {
  html.ahp-layout-v497 #editorScreen .workspace-panel { position: relative !important; }
  html.ahp-layout-v497 #editorScreen .workspace-toolbar {
    display: flex !important; flex-wrap: nowrap !important;
    flex: 0 0 44px !important; align-items: center !important; justify-content: center !important;
    box-sizing: border-box !important; width: 100% !important; min-width: 0 !important;
    height: 44px !important; min-height: 44px !important; max-height: 44px !important;
    gap: 4px !important; padding: 3px 4px 3px 2px !important;
    overflow: visible !important; overflow-x: visible !important; overflow-y: visible !important;
    touch-action: auto !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls {
    display: flex !important; flex: 0 0 auto !important; flex-wrap: nowrap !important;
    order: 1 !important; width: auto !important; min-width: 0 !important; max-width: none !important;
    gap: 4px !important; margin: 0 !important; padding: 0 !important; overflow: visible !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .toolbar-group {
    display: inline-flex !important; flex: 0 0 auto !important; align-items: center !important;
    height: 36px !important; min-height: 36px !important;
    gap: 0 !important; margin: 0 !important; padding: 0 !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .zoom-toolbar-group #zoomLabel {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 52px !important; min-width: 52px !important; max-width: 52px !important;
    height: 34px !important; min-height: 34px !important; max-height: 34px !important;
    font-size: 12px !important; font-weight: 700 !important; padding: 0 2px !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .zoom-toolbar-group :is(#zoomInButton, #zoomOutButton) {
    display: none !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .history-toolbar-group {
    display: inline-flex !important; gap: 0 !important; border: 1px solid #e1e6ef !important;
    height: 36px !important; min-height: 36px !important; border-radius: 9px !important;
    overflow: hidden !important; background: #fff !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .history-toolbar-group :is(#undoButton,#redoButton) {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 36px !important; min-width: 36px !important; max-width: 36px !important;
    height: 34px !important; min-height: 34px !important; max-height: 34px !important;
    padding: 4px !important; margin: 0 !important; border: 0 !important; background: #fff !important;
  }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .history-toolbar-group #undoButton { border-right: 1px solid #e7eaf1 !important; }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .history-toolbar-group :is(#undoButton,#redoButton) img {
    width: 23px !important; height: 23px !important; min-width: 0 !important;
    max-width: 23px !important; max-height: 23px !important;
  }

  html.ahp-layout-v497 #editorScreen #stageMinimap.toolbar-minimap.stage-minimap {
    display: inline-flex !important; position: static !important;
    order: 3 !important; flex: 0 0 auto !important; flex-wrap: nowrap !important;
    align-items: center !important; justify-content: flex-end !important;
    grid-column: auto !important; grid-template-columns: none !important;
    width: auto !important; min-width: 0 !important; max-width: none !important;
    height: 36px !important; min-height: 36px !important; max-height: 36px !important;
    gap: 0 !important; margin: 0 0 0 auto !important; padding: 0 !important;
    overflow: visible !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap :is(#minimapLeft,#minimapRight) {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    flex: 0 0 22px !important; width: 22px !important; min-width: 22px !important; max-width: 22px !important;
    height: 34px !important; min-height: 34px !important; max-height: 34px !important;
    margin: 0 !important; padding: 1px !important; border-radius: 7px !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap :is(#minimapLeft,#minimapRight) img {
    width: 20px !important; min-width: 20px !important; max-width: 20px !important;
    height: 20px !important; min-height: 20px !important; max-height: 20px !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap #minimapTrack {
    box-sizing: border-box !important; position: relative !important;
    width: var(--minimap-track-w, 70px) !important;
    min-width: var(--minimap-track-w, 70px) !important;
    max-width: var(--minimap-track-w, 70px) !important;
    flex: 0 0 var(--minimap-track-w, 70px) !important;
    height: 26px !important; min-height: 26px !important; max-height: 26px !important;
    overflow: hidden !important; touch-action: none !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap .minimap-content {
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    inset: 0 !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarMoreButton {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    position: relative !important; flex: 0 0 36px !important;
    order: 0 !important; width: 34px !important; min-width: 34px !important; max-width: 34px !important;
    height: 36px !important; min-height: 36px !important; max-height: 36px !important;
    margin: 0 !important; padding: 6px !important;
    border: 1px solid #d8dfe8 !important; border-radius: 9px !important;
    background: #fff !important; color: #c11015 !important; cursor: pointer !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarMoreButton svg {
    display: block !important; width: 22px !important; height: 22px !important;
    max-width: 22px !important; max-height: 22px !important; fill: none !important;
    stroke: currentColor !important; stroke-width: 2.25 !important;
    stroke-linecap: round !important; stroke-linejoin: round !important;
    transition: transform .16s ease;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarMoreButton.is-open {
    background: #fff4f4 !important; border-color: #c11015 !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarMoreButton.is-open svg { transform: rotate(180deg) !important; }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras.mobile-toolbar-extras {
    display: none !important; position: absolute !important; z-index: 950 !important;
    top: 47px !important; left: 2px !important; right: auto !important;
    width: auto !important; min-width: 0 !important;
    max-width: calc(100% - 4px) !important;
    align-items: center !important; flex-wrap: nowrap !important;
    box-sizing: border-box !important;
    gap: 8px !important; margin: 0 !important; padding: 9px 10px !important;
    background: #fff !important; border: 1px solid #e2e6ed !important; border-radius: 12px !important;
    box-shadow: 0 9px 28px rgb(13 19 29 / .19) !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras.mobile-toolbar-extras.is-open {
    display: flex !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .mobile-toolbar-extras-heading {
    display: none !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .toolbar-group {
    display: inline-flex !important; position: relative !important;
    flex: 0 0 auto !important; align-items: flex-start !important;
    height: 62px !important; min-height: 62px !important;
    gap: 3px !important; margin: 0 !important; padding: 0 0 18px !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .toolbar-group + .toolbar-group {
    border-left: 1px solid #e4e9ef !important; padding-left: 8px !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .toolbar-group::after {
    display: block !important; position: absolute !important;
    bottom: 0 !important; left: 0 !important; right: 0 !important;
    font: 500 10px/1.2 system-ui,sans-serif !important; color: #5a6370 !important;
    text-align: center !important; white-space: nowrap !important; pointer-events: none !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .layout-toolbar-group::after { content: "Zarovnání" !important; }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .dimension-toolbar-group::after { content: "Rozměry" !important; }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .floorplan-toolbar-group::after { content: "Půdorys" !important; }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras :is(.toolbar-layout-btn,.floorplan-toolbar-button) {
    display: inline-flex !important; justify-content: center !important; align-items: center !important;
    width: 40px !important; min-width: 40px !important; max-width: 40px !important;
    height: 40px !important; min-height: 40px !important; max-height: 40px !important;
    margin: 0 !important; padding: 6px !important;
    border-radius: 8px !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras :is(svg,img) {
    width: 24px !important; min-width: 0 !important; max-width: 24px !important;
    height: 24px !important; max-height: 24px !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarExtras .floorplan-toolbar-button span {
    display: none !important;
  }
}
@media (max-width: 350px) {
  html.ahp-layout-v497 #editorScreen .workspace-toolbar { gap: 3px !important; padding-inline: 2px !important; }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls { gap: 3px !important; }
  html.ahp-layout-v497 #editorScreen .toolbar-main-controls .zoom-toolbar-group #zoomLabel {
    width: 48px !important; min-width: 48px !important; max-width: 48px !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap :is(#minimapLeft,#minimapRight) {
    flex-basis: 20px !important; width: 20px !important; min-width: 20px !important; max-width: 20px !important;
  }
  html.ahp-layout-v497 #editorScreen #mobileToolbarMoreButton {
    flex-basis: 32px !important; width: 32px !important; min-width: 32px !important; max-width: 32px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html.ahp-layout-v497 #editorScreen #mobileToolbarMoreButton svg { transition: none !important; }
}

@media (max-width: 760px) {
  html.ahp-layout-v497 #editorScreen #stageMinimap #minimapTrack {
    border-radius: 7px !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap .minimap-content {
    opacity: 1 !important;
    filter: contrast(1.15) saturate(.92) brightness(.96) !important;
  }
  html.ahp-layout-v497 #editorScreen #stageMinimap #minimapWindow {
    border-width: 2px !important;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .28) !important;
  }
  html.ahp-layout-v497 #editorScreen .editor-promo-bar {
    position: relative !important;
    padding-right: 34px !important;
  }
  html.ahp-layout-v497 #editorScreen .editor-promo-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    width: 22px !important;
    height: 22px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgb(255 255 255 / .78) !important;
    color: #6e7178 !important;
    font: 700 16px/1 Arial,sans-serif !important;
    cursor: pointer !important;
    padding: 0 !important;
  }
  html.ahp-layout-v497 #editorScreen .editor-promo-close:active {
    background: rgb(255 255 255 / .92) !important;
  }
}
@media (min-width: 761px) {
  #editorScreen .editor-promo-close { display: none !important; }
}
