* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

html, body {
  height: 100%;
  overflow: auto; /* FIXED */
  overflow-y: hidden;
  font-size: 16px;
}

/* Header */
header{
  height: 100px;
  background-color: #fbfbfb;
  color: rgb(0, 0, 0);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

#headerOvergang {
  height: 0.5vh;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
}

#headerKnapperDiv {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-right: 2vw; /* FIXED */
}

.parent_grid_MN > * {
  min-width: 0;
  min-height: 0;
}

.parent_grid_MN {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  grid-template-rows: repeat(2, 1fr);
  grid-column-gap: 20px; /* FIXED */
  grid-row-gap: 10px;
  height: 80%;
  width: 100%;
}

.div1_grid_MN { grid-area: 1 / 1 / 2 / 2; }
.div2_grid_MN { grid-area: 2 / 1 / 3 / 2; }
.div3_grid_MN { grid-area: 1 / 2 / 3 / 3; }

.parent_MN_input {
  display: grid;
  grid-template-columns: 0.9fr 0.2fr 0.9fr;
  grid-template-rows: 1fr;
  grid-column-gap: 10px;
  width: 100%;
  align-items: baseline;
}

.div_MN_input_1 { grid-area: 1 / 1 / 2 / 2; }
.div_MN_input_2 { grid-area: 1 / 2 / 2 / 3; }
.div_MN_input_3 { grid-area: 1 / 3 / 2 / 4; }

a.headerKnapper {
  color: black;
  margin: 20px;
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration-line: none;
}

header img {
  height: 70px;
  width: auto;
}

header h1 {
  font-size: 1.5rem;
}

#ansvarTekst {
  font-size: 0.9rem;
}

/* Layout */
.app {
  display: flex;
  height: calc(100vh - 100px);
  padding: 2vh 1vw 1vh 1vw;
  gap: 20px; /* NEW */
}

.left {
  flex: 0 1 400px; /* FIXED */
  background-color: #ffffff;
  padding: 20px;
  overflow-y: auto;
}

#left-SB {
  flex-basis: 35%;
}

#left-flagermus {
  flex-basis: 35%;
}

#left-MN {
  flex: 0 1 400px; /* FIXED */
  min-width: 0; /* FIXED */
  flex-basis: 35%;
}

.right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px 20px 0; /* FIXED */
  overflow: hidden;
  background-color: #ffffff;
}

#right-SB {
  padding: 20px 1.5vw 20px 5vw;
}

.right-flagermus {
  height: 70%;
  display: flex;
  flex-direction: row;
  background-color: #ffffff;
}

.right-MN {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 1.5vw 20px 5vw;
  overflow: hidden;
  background-color: #ffffff;
}

.figur-container {
  background-color: #ffffff;
  height: 30%;
}

.figur-container#figur-container-flagermus {
  height: 100%;
  width: 75%;
}

.chart-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Tables */
table {
  width: 100%; /* FIXED */
  max-width: 600px; /* FIXED */
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1.3rem;
  text-align: left;
}

#armeringsTabel_OS, #armeringsTabel_US {
  max-width: 650px;
}

#punktlastTable, #momentlastTable {
  max-width: 400px;
}

#lastTable {
  max-width: 500px;
}

#lastTable-b {
  background-color: #ffffff91;
}

th, td {
  padding: 4px 6px;
  border: 1px solid #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 500;
}

/* Inputs */
input[type="number"],
input[type="text"],
.Asni_MN,
.Asoi_MN,
#lastTable-b,
#lastTypeDropDown,
#statiskSystemDropDown {
  width: 100%;
  padding: 2px 4px;
  font-size: 0.9rem;
  border: none;
  background-color: #e0e0e091;
  border-radius: 0.2rem;
  text-align: right;
}

input.eksportInput {
  text-align: left;
}

.eksportKnapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 20px;
  margin-right: 15vw;
}

td.CelleBtnFjernRække {
  border: 0;
  background-color: #ffffff;
}

input.BtnFjernLinjelast,
input.BtnFjernPunktlast,
input.BtnFjernMomentlast,
input.BtnFjernArmering {
  color: red;
  font-weight: 600;
  text-align: center;
  background-color: #e0e0e091;
  border: 1px solid #cfcfcf;
  border-radius: 0.15rem;
}

/* Buttons */
#BtnEksporter {
  text-align: center;
  padding: 3.5px;
  background-color: #e0e0e091;
  border: 1px solid #cfcfcf;
  border-radius: 0.2rem;
  margin-top: 0.8rem;
}

/* Remove number arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

input[type=number] {
  appearance: textfield;
}

#h3MN1 {
  margin-top: 30px;
}

#h3MN2 {
  margin-top: 20px;
}

#h3MN3 {
  margin-top: 30px;
  margin-bottom: 10px;
}

/* Responsive magic */
@media (max-width: 2000px) {
  html, body {
    font-size: 13.7px; /* slight scale-down */
  }

  #h3MN1 {
    margin-top: 20px;
  }

  #h3MN2 {
    margin-top: 0px;
  }

  #MN_afstand_bund {
    font-size: 3px;
  }

  #h3MN3 {
    margin-top: 0px;
    margin-bottom: 5px;
  }

}

/* Responsive magic */
@media (max-width: 1200px) {
  .left, .right {
    width: 100%;
    flex: 1;
  }

  .right {
    padding: 0 10px;
  }

  .right-MN {
    padding: 20px;
  }

  #right-SB {
  padding: 20px 0vw 20px 0vw;
  }

  #headerKnapperDiv {
    padding-right: 0;
  }
}