/* Modern Designer V3 - Step 2.3.794
   Mobile/Kiosk-CSS: nachweislich ueberschriebene Deklarationen aus
   Step 591n und 591p entfernt. Bestehende 591o/591q-Regeln bleiben
   funktional identisch. Kein neues Verhalten, keine neuen Selektoren.
*/

/* Step 2.3.591o - stabiles Smartphone-Menü + persistenter Fullscreen-Shell */
@media (max-width: 700px) {
  #modern-runtime-app .rt-kiosk-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 56px !important;
    gap: 7px !important;
    align-items: stretch !important;
  }

  #modern-runtime-app .rt-kiosk-actions > a,
  #modern-runtime-app .rt-kiosk-actions > button {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 8px 6px !important;
    flex: none !important;
    grid-column: auto !important;
  }

  #modern-runtime-app .rt-kiosk-actions > [data-rt591o-hidden="1"] {
    display: none !important;
  }

  #modern-runtime-app .rt-kiosk-actions > a > span,
  #modern-runtime-app .rt-kiosk-actions > button > span {
    min-width: 0 !important;
  }
}

html.rt591o-shell-active,
body.rt591o-shell-active {
  overflow: hidden !important;
}

body.rt591o-shell-active > #modern-runtime-app {
  visibility: hidden !important;
}

#rt591oFullscreenShell {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
  background: #d9dde2;
  margin: 0;
  padding: 0;
}

#rt591oFullscreenShell.open {
  display: block;
}

#rt591oFullscreenShell > iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: #d9dde2;
}

/* Step 2.3.591p - identische Smartphone-Leiste in Hoch- und Querformat */
html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > a,
html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > button {
  grid-column: auto !important;
}
html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > a > span,
html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > button > span {
  min-width: 0 !important;
}

/* Step 2.3.591q - Smartphone-Bar vollständig unabhängig von Tablet-CSS */
html.rt591p-phone #modern-runtime-app .rt-kiosk-bar {
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  width: auto !important;
  max-width: none !important;
  transform: none !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 8px !important;

  padding: 10px !important;
  border-radius: 16px !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-bar.hidden {
  transform: translateY(24px) !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-info {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 4px !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-title,
html.rt591p-phone #modern-runtime-app .rt-kiosk-sub {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-actions {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;

  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: 56px !important;
  gap: 7px !important;
  align-items: stretch !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > a,
html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > button {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 56px !important;
  height: 56px !important;
  margin: 0 !important;
  padding: 8px 6px !important;
  flex: none !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;

  overflow: hidden !important;
  white-space: nowrap !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > a > span:not(.rt-kiosk-alarm-badge),
html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > button > span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-actions > [data-rt591o-hidden="1"] {
  display: none !important;
}

html.rt591p-phone #modern-runtime-app .rt-kiosk-wake {
  right: 10px !important;
  bottom: 10px !important;
}
