* {
  margin: 0;
  border: 0;
  padding: 0;
  outline: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
}

body.dark {
  background: #121212;
  color: #E0E0E0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%;
}

body.dark textarea {
  border-color: #333;
  background: #121212;
  color: #DDD;
}

#panel-toggle, #sidebar-toggle {
  position: fixed;
  top: 15px;
  border: 1px solid #ddd;
  border-radius: 3px;
  width: 25px;
  font-size: 14px;
  line-height: 25px;
  text-align: center;
  cursor: pointer;
  z-index: 11;
}
body.dark #panel-toggle, body.dark #sidebar-toggle {
  border-color: #888;
}

#sidebar-toggle { right: 15px }
#panel-toggle { left: 15px }

#panel-toggle.open, #sidebar-toggle.open { background: #D0D0D7 }
body.dark #panel-toggle.open, body.dark #sidebar-toggle.open { background: #666 }
#panel-toggle.open:hover, #sidebar-toggle.open:hover { background: #B7B7B7 }

#panel-toggle.close, #sidebar-toggle.close { background: #D0D0D7 }
body.dark #panel-toggle.close, #sidebar-toggle.close { background: #666 }
#panel-toggle.close:hover, #sidebar-toggle.close:hover {
  background: #A33;
  color: #FFF;
}

#formula-output {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 60px;
  padding: 0 2vh;
  background-color: #EFEFEF;
  border-bottom: 1px solid #DEDEDE;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  font-family: consolas,  times new roman, monospace;
  cursor: default;
}

.formula span { cursor: pointer }

body.dark #formula-output {
  background: #121212;
  border-bottom: 1px solid #333;
}

#plot {
  width: 100%;
  height: calc(100vh - 60px);
}

#panel.float {
  position: absolute;
  top: 60px;
}

#graph-title { width: 42ch }

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px;
  gap: 50px;
  background-color: #f7f7f7;
  border-bottom: 1px solid #ddd;
  width: 100vw;
  z-index: 10;
}

body.dark .controls {
  background-color: #222;
  border-color: #333;
}

.input-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-direction: row;
  gap: 15px;
  justify-content: center;
}

.input-group label {
  margin-bottom: 0;
}

body.dark label, body.dark label {
  color: #E0E0E0;
}

.slider {
    width: 200px;
}

.group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-direction: column;
}

.ui-slider .ui-slider-handle {
    background-color: #007bff;
    border: none;
}

.ui-slider .ui-slider-range { background-color: #007bff }

.sidebar, .sidebar div {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.sidebar {
    position: fixed;
    top: 0;
    right: -266px;
    width: 266px;
    height: 100%;
    padding: 15px;
    border-left: 1px solid #ddd;
    background-color: #EFEFEF;
    transition: right 0.3s ease;
    z-index: 10;
}
body.dark .sidebar {
  background: #1E1E1E;
  border-color: #333;
}
.sidebar div {
  background: #d7d7d7;
  padding: 15px;
  border-radius: 5px;
}
body.dark .sidebar div { background: #333 }
.sidebar div label { margin-bottom: -10px }

.sidebar button {
  width: 100%;
  border: none;
}
.sidebar button:hover { background-color: #0056b3 }

.sidebar input[type="number"] {
  width: 100%;
  padding: 8px;
}

.sidebar.open { right: 0 }

.red { color: #F00 !important }
.small { font-size: .7em !important }

input, textarea, button {
  border: 1px solid #DDD;
  width: 18ch;
  padding: 5px;
  border-radius: 5px;
  background: #EFEFEF;
  color: #000;
}

textarea {
  height: 100%;
  width: 100%;
  padding: 15px;
  resize: none;
  background: #FFF;
  color: #000;
}

button {
  background-color: #007bff;
  color: #FFF;
  height: 35px;
  cursor: pointer;
}

body.dark input, body.dark textarea {
  border: 1px solid #333;
  background: #121212;
  color: #DDD;
}

body.dark button {
  background: #005ADD;
}

body.dark .input-group button {
  background: #444;
  border: 1px solid #333;
}
