@media (max-width: 768px) {

/* 🔥 RESET */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

/* 🔥 WYŁĄCZ DESKTOP LAYOUT */
main {
  all: unset;
}

/* 🔥 ROOT APP FULLSCREEN */
#app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* 🔥 SAFE AREA (notch iPhone) */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* 🔥 UKRYJ HEADER */
.header {
  display: none !important;
}

/* 🔥 WIDOKI (zakładki) */
.view {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100dvh - 60px);
}

.view.active {
  display: block;
}

/* 🔥 RYSUNEK FULLSCREEN */
.designer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100dvh - 60px);
  margin: 0;
  padding: 0;
}

#rysunek {
  width: 100%;
  height: 100%;
  touch-action: pan-x pan-y;
}

/* 🔥 PARAMETRY FULLSCREEN */
.parametry {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100dvh - 60px);
  overflow-y: auto;
  background: #fff;
  padding: 15px;
  box-sizing: border-box;
}

/* 🔥 DOLNE MENU */
#bottomNav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(60px + env(safe-area-inset-bottom));
  display: flex;
  background: #111;
  z-index: 9999;
}

/* 🔥 PRZYCISKI */
#bottomNav button {
  flex: 1;
  border: none;
  background: none;
  color: #fff;
  font-size: 18px;
}

#bottomNav button.active {
  background: #222;
}




/* ========================= */
/* POPUP MOBILE FIX */
/* ========================= */

.popup-content {
    width: 95% !important;
    max-width: 95%;
    height: auto;
    max-height: 90dvh;
}

.constructionElement-layout {
    flex-direction: column;
}

.constructionElement-preview svg {
    width: 120px;
    height: 120px;
}

.constructionElement-preview {
    justify-content: center;
}

.constructionElement-list {
    max-height: 40dvh;
}



}