body {
  font-family: Arial, sans-serif;
  margin: 24px;
  color: #111;
  background: #fff;
}

main {
  max-width: 1400px;
  margin: 0 auto;
}

h1 {
  font-size: 24px;
  margin: 0 0 18px;
}

form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(400px, 460px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

fieldset {
  border: 1px solid #bbb;
  padding: 12px;
}

legend {
  padding: 0 6px;
}

label {
  display: inline-block;
  margin: 6px 14px 6px 0;
}

input,
select {
  width: 90px;
  margin-left: 4px;
}

select,
input[type="checkbox"] {
  width: auto;
}

details summary {
  cursor: pointer;
  margin-bottom: 12px;
}

#output {
  border-bottom: 1px solid #bbb;
  padding-bottom: 18px;
}

#output p {
  margin: 8px 0;
}

.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
}

.meters b,
.meters strong {
  display: block;
}

.meters strong {
  margin: 5px 0;
  font-size: 19px;
  font-weight: normal;
}


.bar {
  position: relative;
  width: 100%;
  height: 12px;
  margin: -2px 0 10px;
  border: 1px solid #888;
}

.temperature-bar {
  background: linear-gradient(to right, #39a845 0 58%, #e5c84b 58% 75%, #c93a32 75% 100%);
}

.plot-section {
  margin-top: 28px;
}

.flight-plots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.flight-plots .plot text {
  font-size: 13px;
}

.motor-plot {
  margin-top: 28px;
}

.motor-plot .plot-section {
  margin-top: 0;
}

.plot-section h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.plot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #bbb;
  background: #fff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 8px 0;
  font-size: 12px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 14px;
  border-top: 2px solid var(--color);
  margin: 0 5px 3px 0;
}

.legend span.dashed::before {
  border-top-style: dashed;
}

.plot-summary {
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.4;
  color: #111;
}

@media (max-width: 900px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .flight-plots { grid-template-columns: 1fr; }
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #output {
    border-top: 1px solid #bbb;
    border-bottom: 0;
    padding: 18px 0 0;
  }
}

@media (max-width: 600px) {
  body { margin: 14px; }
  .meters { grid-template-columns: 1fr; }
}

.load-bar {
  background: linear-gradient(to right, #39a845 0 45%, #e5c84b 45% 70%, #c93a32 70% 100%);
}

.good-high {
  background: linear-gradient(to right, #c93a32 0 35%, #e5c84b 35% 60%, #39a845 60% 100%);
}

.bar span {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 20px;
  background: #111;
  transform: translateX(-1px);
}

#warnings {
  margin-top: 12px;
}

#warnings .error {
  margin: 6px 0;
  color: #b00000;
}

#warnings .warning {
  margin: 6px 0;
  color: #0645ad;
}
