#chartdiv {
  width: 100%;
  height: 500px;
  background: #fff;
}

textarea {
  font-size: 14;
  width: 80%;
  margin-left: 10%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

input[type="range"] {
  -webkit-appearance: slider-horizontal;
  -moz-appearance: slider-horizontal;
  appearance: slider-horizontal;
  width: 350px;
}

input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="file"] {
  display: none;
}
.custom-file-upload {
  border: 1px solid #ccc;
  display: inline-block;
  padding: 6px 12px;
  cursor: pointer;
  width: 177px;
  border-radius: 4px;
  margin: 10 10 0 10;
  font-size: 15px;
}

#file-input,
input[type="button"],
input[type="submit"] {
  width: 200;
  height: 34px;
  border-radius: 4px;
  margin: 10 10 0 10;
  font-size: 15px;
}
input {
  background: #f1f1f1;
  border: 0;
  padding: 0 15px;
}

input[type="text"] {
  background: #fafafa;
  padding: 10px;
  width: 66;
  margin: 0;
  font-size: medium;
  border: 1px solid #a9a9a9;
}

body {
  background: #144f77;
  font-family: sans-serif;
  font-size: 14px;
  color: #777;
}

#bar,
#prgbar {
  background-color: #f1f1f1;
  border-radius: 10px;
}
#bar {
  background-color: #3498db;
  width: 0;
  height: 10px;
}

form {
  background: #fafafa;
  max-width: 800px;
  margin: 25px auto;
  padding: 30px;
  border-radius: 5px;
  text-align: left;
}

.mainForm {
  background-color: #fafafa;
  max-width: 80%;
  margin: 25px auto;
  padding: 30px;
  border-radius: 5px;
  text-align: left;
}

h1 {
  text-align: center;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
}

p {
  margin: 0 !important;
}

.btn {
  background: #3498db;
  color: #fff;
  cursor: pointer;
}

.dvcs {
  padding: 10;
  margin: 10;
}

.messages_box {
  position: relative;
  max-height: calc(100vh * 0.4);
  background: #d0d0d0;
  padding: 0.5em;
  z-index: 50000;
  overflow: auto;
  border-radius: 0.5em;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.messages_array {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.message_0 {
  background: red;
  color: white;
  font-size: 1.4em;
  width: 100%;
  margin-top: 0.4em;
  border: 1px solid gray;
  border-radius: 0.2em;
}

.message_1 {
  background: #ff0;
  color: black;
  font-size: 1.4em;
  width: 100%;
  margin-top: 0.4em;
  border: 1px solid gray;
  border-radius: 0.2em;
}

.message_2 {
  background: #00ff00c4;
  color: black;
  font-size: 1.4em;
  width: 100%;
  margin-top: 0.4em;
  border: 1px solid gray;
  border-radius: 0.2em;
}


.history_box {
  position: absolute;
  top: 2em;
  max-height: calc(100vh * 0.90);
  width: calc(100vw * 0.7);
  background: rgba(200, 200, 200, 0.8);
  padding: 0.7em;
  z-index: 70000;
  overflow: auto;
  border: 2px solid #555;
  border-radius: 0.5em;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.history_array {
  margin-top: 1.3em;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}


.column {
  width: 42%;
}

.text {
  font-size: 1.5em;
  font-weight: bold;
  display: inline-block;
  margin: 10 15 10 15;
}

.container {
  display: flex;
  width: 100%;
}

.container_row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.container_column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
}

.tab {
  width: 100%;
  height: 4em;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: flex-end;
  background-color: #f1f1f1;
  padding-bottom: 0;
  border: 1px solid #ccc;
}

.tab input {
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: relative;
  top: 1px;
  border: 1px solid #a7a7a7;
  border-radius: 0;
  background-color: #dddddd;
  font-size: 1.5em;
  min-height: 2em;
  font-weight: bold;
  padding: 0.3em;
  padding-left: 0.8em;
  padding-right: 0.8em;
  margin-left: 0.7em;
  margin-right: 0.7em;
}

.tab input:hover {
  position: relative;
  top: 1px;
  cursor: pointer;
  background-color: #ffffff;
  -webkit-box-shadow: 2px -1px 9px 0 rgba(34, 60, 80, 0.16);
  -moz-box-shadow: 2px -1px 9px 0 rgba(34, 60, 80, 0.16);
  box-shadow: 2px -1px 9px 0 rgba(34, 60, 80, 0.16);
}

.tab input.active {
  position: relative;
  top: 1px;
  background-color: #fff;
  border-bottom: 0;
}

.button {
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background-color: #3498db;
  font-size: 1em;
  color: #fff;
  min-height: 1.6em;
  font-weight: normal;
  padding: 0.5em;
  padding-left: 0.8em;
  padding-right: 0.8em;
  margin-left: 0.7em;
  margin-right: 0.7em;
  border-radius: 0.4em;
  border: 0.1em solid #dfdfdf;
}

.button:hover {
  position: relative;
  cursor: pointer;
  background-color: #3498db97;
  color: #000;
  box-shadow: 1px 1px 3px 0 rgba(0, 0, 0, 0.2),
    1px 1px 3px 0 rgba(0, 0, 0, 0.19);
  top: 1px;
}

.button:active {
  position: relative;
  cursor: progress;
  color: #000;
  top: 0.3em;
  box-shadow: 1px 1px 3px 0 rgba(0, 0, 0, 0.2),
    1px 1px 3px 0 rgba(0, 0, 0, 0.19);
}

.tabcontent {
  display: none;
  padding: 2px 3px;
  border: 1px solid #ccc;
  border-top: none;
}

input[type="checkbox"]:checked,
input[type="checkbox"]:not(:checked),
input[type="radio"]:checked,
input[type="radio"]:not(:checked) {
  position: absolute;
  left: -9999px;
}

input[type="checkbox"]:checked + label,
input[type="checkbox"]:not(:checked) + label,
input[type="radio"]:checked + label,
input[type="radio"]:not(:checked) + label {
  display: inline-block;
  position: relative;
  padding-left: 28px;
  line-height: 20px;
  cursor: pointer;
}
input[type="checkbox"]:checked + label:before,
input[type="checkbox"]:not(:checked) + label:before,
input[type="radio"]:checked + label:before,
input[type="radio"]:not(:checked) + label:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border: 1px solid #dddddd;
  background-color: #ffffff;
}

input[type="checkbox"]:checked + label:before,
input[type="checkbox"]:not(:checked) + label:before {
  border-radius: 2px;
}
input[type="checkbox"]:checked + label:after,
input[type="checkbox"]:not(:checked) + label:after,
input[type="radio"]:checked + label:after,
input[type="radio"]:not(:checked) + label:after {
  content: "";
  position: absolute;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

input[type="checkbox"]:checked + label:after,
input[type="checkbox"]:not(:checked) + label:after {
  left: 3px;
  top: 4px;
  width: 10px;
  height: 5px;
  border-radius: 1px;
  border-left: 4px solid #3498db;
  border-bottom: 4px solid #3498db;
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

input[type="radio"]:checked + label:after,
input[type="radio"]:not(:checked) + label:after {
  left: 5px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 100%;
  background-color: #3498db;
}
input[type="checkbox"]:not(:checked) + label:after,
input[type="radio"]:not(:checked) + label:after {
  opacity: 0;
}

input[type="checkbox"]:checked + label:after,
input[type="radio"]:checked + label:after {
  opacity: 1;
}

.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: auto;
  min-width: 20em;
  background-color: #3498db;
  font-size: small;
  color: #f1f1f1;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  top: 100%;
  left: 50%;
  margin-left: -60px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}

.prgline input {
  font-size: 18px !important;
  padding: 4 !important;
}

.prgline input,
img,
select {
  margin-left: 21px !important;
  border-radius: 0;
}

.prgline input:enabled,
img,
select {
  cursor: pointer;
}

select {
  -webkit-appearance: none;
  appearance: none;
  -webkit-border-radius: 0;
  border-radius: 0;
  background-image: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'><path fill='%23444' d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'></path></svg>");
  background-position: 100% 50%;
  background-repeat: no-repeat;
  background-color: #fafafa;
  font-size: 18px !important;
  padding: 4 !important;
  padding-right: 22px !important;
  border: 1px solid #a9a9a9;
}

.prgline input {
  border-style: solid !important;
  border-width: 1px !important;
}

.prgline {
  font-size: 18px !important;
  margin-bottom: 4px !important;
}

.prgline label {
  margin-left: 12px !important;
  font-size: 18px;
}

.prglabel {
  width: 90px !important;
}

.prgTime {
  margin-left: 1em;
}

.specs {
  font-size: 18px;
  margin: 10px;
}

.ingredients {
  margin: 15px !important;
  width: 780;
  font-size: 18px;
}

.ingType {
  margin: 0 auto;
  width: 150;
  float: left;
  text-align: center;
  position: relative;
}

.ingName {
  margin: 0 auto;
  width: 380;
  float: left;
  text-align: left;
  position: relative;
}

.ingAmount {
  margin: 0 auto;
  width: 250;
  float: left;
  text-align: center;
  position: relative;
}

.mashName {
  margin: 0 auto;
  width: 230;
  float: left;
  text-align: left;
  position: relative;
}

.mashTemp {
  margin: 0 auto;
  width: 130;
  float: left;
  text-align: center;
  position: relative;
}

.mashType {
  margin: 0 auto;
  width: 250;
  float: left;
  text-align: center;
  position: relative;
}

.mashTime {
  margin: 0 auto;
  width: 130;
  float: left;
  text-align: center;
  position: relative;
}

.pointer {
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  width: 400;
}

.list-group {
  display: flex;
  flex-direction: column;
}

.list-group-item {
  position: relative;
  display: block;
  padding: 0.75rem 1.25rem;
  margin-bottom: -1px;
  background-color: rgb(225, 226, 226);
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.list-header {
  font-weight: 700;
  cursor: pointer;
}

.spoiler-body {
  display: none;
}

@media only screen and (max-width: 520px) {
  #tab {
    flex-direction: column;
    border: 1px solid red;
  }
}

.popup {
  position: fixed;
  width: 800px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  border-radius: 5px;
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
}

.popup__content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popup__title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.popup__button {
  padding: 15px 60px;
  border-radius: 5px;
  border: none;
  background-color: #1c87c9;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
}

#overlay.show {
  display: block;
}

.flex_row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}

.flex_row_center {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.pin-status {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  width: 100%;
  font-family: monospace;
  font-weight: bold;
  font-size: 1.1em;
}

.pin-label {
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #cccccc;
  color: #333;
  margin: 0 2px;
  transition: all 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
#pin_R1:hover, #pin_R2:hover, #pin_R3:hover, #pin_R4:hover {
  cursor: pointer;
}
.program_header>div { width: 12%; }
.program_header>div:nth-of-type(1) { width: 5%; }
.program_header>div:nth-of-type(2) { width: 21%; }
.program_header>div:nth-of-type(4) { width: 15%; }
.program_header>div:nth-of-type(5) { width: 10%; }

.alert {position: fixed; 
  top: 50%; 
  left: 50%; 
  transform: translateX(-50%); 
  background: #28a745; 
  color: white; 
  padding: 12px 24px; 
  border-radius: 5px; 
  z-index: 1000; 
  display: none; 
  font-size: 20px;
}
.connection-indicator {
    font-size: 1.5em;
    margin: 0 !important;
}

.program-control {
    font-size: 1.5em;
    cursor: pointer;
    margin-left: 0.5em !important;
}
  
  /* Фиксированные панели и прокрутка */
  .page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
  }
  
  .header-section {
    flex-shrink: 0;
    background: #fafafa;
    padding: 13px 30px 0 30px;
    border-radius: 5px 5px 0 0;
  }
  
  .tabs-section {
    flex-shrink: 0;
    background: #fafafa;
    padding: 0 29px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .content-section {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    padding: 0 30px;
  }
  
  .footer-section {
    flex-shrink: 0;
    background: #fafafa;
    padding: 13px 1px;
    border-radius: 5px 5px 5px 5px;
    position: sticky;
    bottom: 0;
    z-index: 100;
    border-top: 1px solid #ddd;
  }

  .tab-fixed {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: space-between;
  }
  
  .tablinks-fixed {
    white-space: nowrap;
    flex: 1 1 auto;
    margin: 1px;
    padding: 2px 2px;
    background: #f1f1f1;
    border: 1px solid #ccc;
    cursor: pointer;
    font-weight: normal;
    text-align: center;
    min-width: 0;
    transition: all 0.2s ease;
  }
  
  .tablinks-fixed:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .tablinks-fixed.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    font-weight: bold;
    font-size: 1.5em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }

  .tablinks-fixed:active {
    position: relative;
    top: 1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  }
  
  /* Адаптация для мобильных */
  @media (max-width: 768px) {
    .page-wrapper {
      height: calc(100vh - 20px);
      margin: 10px auto;
    }
    
    .header-section,
    .tabs-section,
    .content-section,
    .footer-section {
      padding-left: 15px;
      padding-right: 15px;
    }
    
    .tab-fixed {
      gap: 1px;
      padding: 3px 0;
    }
    
    .tablinks-fixed {
      padding: 8px 4px;
      font-size: 1.2em;
      min-width: 60px;
    }
  }
  
  /* Для очень маленьких экранов */
  @media (max-width: 480px) {
    .tab-fixed {
      flex-wrap: wrap; /* Перенос на маленьких экранах */
      justify-content: center;
    }
    
    .tablinks-fixed {
      flex: 0 0 calc(50% - 4px); /* 2 таба в строке */
      margin: 2px;
      font-size: 1.1em;
      padding: 6px 2px;
    }
  }