.custom-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: linear-gradient(to bottom, #f5f1f9, #ebebff);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden;
    z-index: 1001;
    max-width: 100vw;  /* Maximal die Breite des Viewports */
    max-height: 100vh; /* Maximal die Höhe des Viewports */
    padding:5px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
  }
  .popup-new .content.header .subtitle {
    display: block;
  width: 100%;
  font-size: 12px;
  font-weight: normal;
  }

  .close-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    font-size: 14px;
    text-align: center;
    line-height: 14px;
    cursor: pointer;
    background: none;
    border: unset;
    text-shadow: none;
    color: black;
  }
  .close-icon:hover {
    background: none;
    border: unset;
    text-shadow: none;
   
  }
  .close-icon::before {
    content: "\2715"; /* Unicode für ✖ */
    display: block;
  }

  .size-info {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display:none;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    font-size: 8px;
}

.smallButton {
  font-size: 12px !important;
  padding: 4px;
}


  .custom-popup .resize-handle {
    width: 10px;
    height: 10px;
  
    position: absolute;
    right: 0;
    bottom: 0;
    cursor: se-resize; /* Zeigt das Resize-Cursor an */
  }

  
  .popup-body hr {
    margin: 8px 0px 10px 0px !important;
    border-top: 2px solid black !important;
    border-bottom: 1px solid white !important;
    opacity: 0.45 !important;
  }


  .popup-edit .popup-header .header {
    background-color: #c8c8fa;
    color: #111155;
    height: 17px;
    margin: 5px;
    /* line-height: 25px; */
    padding-top: 7px;
    padding-left: 2px;
    font-size: 10px;
  }


  .popup-config .popup-header .header {
    background-color: #333758;
    color: #dcdcff;
    height: 17px;
    margin: 5px;
    /* line-height: 25px; */
    padding-top: 7px;
    padding-left: 2px;
    font-size: 10px;
  }
  .popup-edit {
    background-color: #111155;
    background-image: unset;
    display: flex;
    flex-direction: column;
  }
  .popup-edit .popup-body {
    color:#fff;
  }
  .popup-config .popup-body,.popup-edit .popup-body {
    margin-top: 0px;
  }
  .popup-config {
    background-color: #DFD4FD;
    background-image: unset;
    display: flex;
    flex-direction: column;
  }

 

  .popup-body {
    padding: 0px 5px 0px 5px;
    overflow-y: auto;
    margin-top:-10px;
    line-height: 15px;
    font-size: 13px;

    flex: 1;
  }
  
  .popup-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 5px;

  }
  
  .popup-button {
    padding: 6px 12px;
    cursor: pointer;
  }
  
  .window-controls {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 8px;
    font-size: 14px;
    z-index: 1100; /* Über dem Popup */
  }
  
  .window-controls span {
    font-size: 16px;
    cursor: pointer;
    padding: 0 6px;
    user-select: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .window-controls span:hover {
   opacity: 50%;
  }
  

 

  /* Dein Box-Layout für den Header */
  #box {
    position: relative;
  }
  
 

  .content.header span {
    margin-top: -6px;
    position: absolute;

    z-index: 9;
  }

  /* W2: eigener Kopfbereich mit Vor/Zurück-Buttons + Name/Alter/Readme statt
     nur dem wiederholten Titel - braucht mehr Platz als die sonst einzeilige Titelleiste. */
  .w2-popup .popup-header #box .content.header {
    height: auto;
    min-height: 26px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px 4px 4px;
    box-sizing: border-box;
  }
  .w2-popup .popup-header #box .content.header span {
    position: static;
    margin-top: 0;
  }
  .w2-popup .popup-header #box .content:before,
  .w2-popup .popup-header #box .content:after {
    height: 100%;
  }

 
  
  .popup-mail {
    background-image: url("../images/layout/boxS_cc.png");
    width: calc(100% - 30px);
    margin-left: 16px;
   
   
  }
  .popup-mail::before {
    background-image: url("../images/layout/boxS_cl.png");
    left: 5px;
  }
  .popup-mail::before, .popup-mail::after {
    width: 16px;
    height: calc(100% - 91px);
    content: "";
    display: block;
    position: absolute;
    top: 36px;
  }
  .popup-mail::after {
    background-image: url("../images/layout/boxS_cr.png");
    right: 5px;
  }

  #box.box2 {
    margin-bottom: 10px;
  }
  .windows-panel {
    background-color: #f3f3f3;
font-size: 10px;
padding: 2px;
margin-top: -5px;
margin-left: -5px;
cursor:move;
margin-right: -5px;
  }

.mail #box .content.header:after,.mail #box .content.header:before{
  height: calc(100% - 46px);
}


.mail.nofooter .popup-mail::before,.mail.nofooter .popup-mail::after {
  height: calc(100% - 63px);
}
.mail.nofooter .popup-shadow:after {
  bottom: 11px;
}
.mail.nofooter .popup-shadow:before {
bottom: 11px;
}
  #box {
    position: relative;
    margin-bottom: 16px;
    
  
    .content {
      width: calc(100% - 30px);
    
      height: 15px;
      background-image: url("../images/layout/boxS_cc.png");
      margin-left: 16px;
  
      &.header {
        font-weight: bold;
        font-size: 17px;
      }
  
    
      &:before,
      &:after {
        width: 16px;
        height: calc(100% - 32px);
      
        content: "";
        display: block;
        position: absolute;
        top: 16px;
      }
  
      &:before {
        background-image: url("../images/layout/boxS_cl.png");
        left: 0;
      }
  
      &:after {
        background-image: url("../images/layout/boxS_cr.png");
        right: 0;
      }
    }
  
    .bottom2 {
      width: calc(100% - 32px);
      height: 16px;
      margin-left: 16px;
      position: relative;
    }
    .top,
    .bottom {
      width: calc(100% - 32px);
      height: 16px;
      margin-left: 16px;
      position: relative;
  
      &:before,
      &:after {
        width: 16px;
        height: 16px;
        content: "";
        display: block;
        position: absolute;
        top: 0;
      }
  
      &:before {
        left: 0;
      }
  
      &:after {
        right: 0;
      }
    }
  
    .top {
      background-image: url("../images/layout/boxS_tc.png");
  
      &:before {
        margin-left:-16px;
        background-image: url("../images/layout/boxS_tl.png");
      }
  
      &:after {
        margin-right:-16px;
        background-image: url("../images/layout/boxS_tr.png");
      }
    }
.bottom2 {
  background-image: url("../images/layout/boxS_cc.png");
  background-size: 100% 100%;
}  
    .bottom {
      background-image: url("../images/layout/boxS_bc.png");
      background-size: 100% 100%;
  
      &:before {
        margin-left:-16px;
        background-image: url("../images/layout/boxS_bl.png");
        background-size: 100% 100%;
        bottom: 0;
      }
  
      &:after {
        margin-right:-16px;
        background-image: url("../images/layout/boxS_br.png");
        background-size: 100% 100%;
        bottom: 0;
      }
    }
  }

  
  .popup-shadow:before,.popup-shadow:after {
    content: "";
  display: block;
  position: absolute;
  }
  .popup-shadow {
    background-image: url("../images/layout/boxS_bc.png");
    background-size: 100% 100%;
   height:16px;
    width: calc(100% - 30px);
    margin-left: 16px;
    

    &:before {
     margin-left: -16px;
    background-image: url("../images/layout/boxS_bl.png");
    background-size: 100% 100%;
    bottom: 39px;
    width: 16px;
    height: 16px;
    }

    &:after {
    
        margin-right: 5px;
        background-image: url("../images/layout/boxS_br.png");
        background-size: 100% 100%;
        bottom: 39px;
        width: 16px;
        height: 16px;
        right: 0px;
      }
    
  }



  .popup-new .content.header {
    height: 50px;
    font-weight: bold;
    flex: unset;
    font-size: 20px;
    
margin:-5px;
margin-top: 5px;
    line-height: 50px;
    background: linear-gradient(180deg, rgba(255,255,253,1) 50%, rgba(218,218,218,1) 100%); 
    box-shadow: inset 0 -10px 7px -10px #000000;
    text-align: center;
  }
  .popup-new, .popup-new .popup-body {
    background-color:#fffffd !important;
    background-image:unset;
  }
  .popup-new .popup-footer {
    height: 50px;
    font-weight: bold;
    font-size: 20px;
    padding: 10px;
margin:-5px;
   
    background: linear-gradient(180deg, rgb(218,218,218) 0%, rgb(255,255,253) 50%);
    box-shadow: inset 0 7px 10px -10px #000000;
    text-align: center;
  }

  .popup-new .content.header span {
 position: unset;
  }
