* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* ===== ОСНОВНОЙ ФОН ===== */
body {
  background: #eef3f8; 
  color: #2f3b45;
  padding: 20px;
}

/* ===== КОНТЕЙНЕР ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== ЗАГОЛОВОК ===== */
header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 26px;
  color: #3d566e;
}

/* ===== ФОРМА ===== */
form {
  background: #f7fafc;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(60, 90, 120, 0.12);
  margin-bottom: 20px;
  border: 1px solid #dbe6f0;
}

/* ===== FIELDSET ===== */
fieldset {
  border: 1px solid #d0dce8;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  background: #fbfdff;
}

legend {
  font-weight: bold;
  color: #4a6278;
  padding: 0 8px;
}

/* ===== НАДПИСИ ===== */
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  gap: 10px;
  color: #3e5163;
}

input {
  padding: 6px 8px;
  border: 1px solid #c9d6e2;
  border-radius: 8px;
  background: #ffffff;
  outline: none;
}

input:focus {
  border-color: #8fb3d9;
  box-shadow: 0 0 0 2px rgba(143, 179, 217, 0.2);
}

/* ===== КНОПКИ ===== */
#control_buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}

/* разные кнопки */
#create_submit {
  background: #8fb3d9;
  color: white;
}

#add {
  background: #2196F3;
  color: white;
}

#remove {
  background: #c9d6e2;
  color: #2f3b45;
}

button:hover {
  opacity: 0.85;
}

/* ===== ТАБЛИЦА ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dbe6f0;
}

th, td {
  border: 1px solid #e3edf5;
  padding: 8px;
  text-align: center;
}

th {
  background: #eef5fb;
  color: #4a6278;
}

/* ===== ДЕТАЛИ ===== */
details {
  margin-top: 10px;
  background: #f7fafc;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #dbe6f0;
}

/* ===== ТЕКСТОВАЯ ОБЛАСТЬ ===== */
textarea {
  width: 100%;
  resize: vertical;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #c9d6e2;
  background: #ffffff;
}

/* ===== ДИАГРАММА ===== */
#result_chart {
  width: 100%;
  min-height: 400px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(60, 90, 120, 0.12);
  padding: 10px;
  border: 1px solid #dbe6f0;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  label {
    flex-direction: column;
    align-items: flex-start;
  }

  table {
    font-size: 12px;
  }
}