html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
}

#app-title {
  text-align: center;
  font-size: 28px;
  color: #2c3e50;
  margin: 0 0 8px 0;
  font-weight: 700;
}

#app-subtitle {
  text-align: center;
  font-size: 14px;
  color: #7f8c8d;
  margin: 0 0 24px 0;
}

#converter {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #34495e;
  margin-bottom: 6px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: #3498db;
}

.temp-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 20px;
  padding: 12px 16px;
  color: #2c3e50;
  background: transparent;
  min-width: 0;
  -moz-appearance: textfield;
}

.temp-input::-webkit-outer-spin-button,
.temp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.temp-input::placeholder {
  color: #bdc3c7;
  font-size: 16px;
}

.unit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  min-width: 48px;
  text-align: center;
}

#unit-celsius {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

#unit-fahrenheit {
  background: linear-gradient(135deg, #e67e22, #d35400);
}

#unit-kelvin {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

#input-celsius .input-wrapper:focus-within {
  border-color: #e74c3c;
}

#input-fahrenheit .input-wrapper:focus-within {
  border-color: #e67e22;
}

#input-kelvin .input-wrapper:focus-within {
  border-color: #3498db;
}

#action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.action-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.action-btn:active {
  transform: scale(0.97);
}

#btn-clear {
  background: #ecf0f1;
  color: #7f8c8d;
}

#btn-clear:hover {
  background: #dfe6e9;
}

#btn-swap {
  background: #3498db;
  color: #ffffff;
}

#btn-swap:hover {
  background: #2980b9;
}

#presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#presets-label {
  font-size: 13px;
  color: #95a5a6;
  margin-right: 4px;
}

.preset-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #d5dbdb;
  border-radius: 20px;
  background: #f8f9fa;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.preset-btn:hover {
  background: #3498db;
  color: #ffffff;
  border-color: #3498db;
}

.preset-btn:active {
  transform: scale(0.95);
}

#formula-display {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#formula-title {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #ecf0f1;
}

#formula-placeholder {
  color: #bdc3c7;
  font-size: 14px;
  text-align: center;
  margin: 20px 0;
}

.formula-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid #3498db;
}

.formula-card:last-child {
  margin-bottom: 0;
}

.formula-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.formula-steps {
  margin: 0;
  padding-left: 20px;
}

.formula-step {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  font-family: 'Courier New', Courier, monospace;
}

.formula-step:last-child {
  color: #e74c3c;
  font-weight: 700;
  font-size: 15px;
}

#__fork {
  text-align: center;
  margin: 24px 0;
}

#__fork button {
  padding: 10px 32px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid #3498db;
  border-radius: 8px;
  background: transparent;
  color: #3498db;
  cursor: pointer;
  transition: all 0.2s ease;
}

#__fork button:hover {
  background: #3498db;
  color: #ffffff;
}

#features {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
}

#features h2 {
  font-size: 20px;
  color: #2c3e50;
  margin: 0 0 12px 0;
}

#features p {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin: 0;
}

#scenarios {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
}

#scenarios h2 {
  font-size: 20px;
  color: #2c3e50;
  margin: 0 0 12px 0;
}

#scenarios ul {
  margin: 0;
  padding-left: 20px;
}

#scenarios li {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 8px;
}

#FAQ {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
}

#FAQ h2 {
  font-size: 20px;
  color: #2c3e50;
  margin: 0 0 12px 0;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin: 16px 0 6px 0;
}

#FAQ dd {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin: 0 0 8px 0;
}

footer {
  text-align: center;
  font-size: 13px;
  color: #95a5a6;
  padding: 20px 16px 30px 16px;
}

footer a {
  color: #3498db;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  #app {
    padding: 16px 12px;
  }

  #app-title {
    font-size: 24px;
  }

  #converter {
    padding: 18px 14px;
  }

  .temp-input {
    font-size: 18px;
    padding: 10px 12px;
  }

  .unit {
    font-size: 16px;
    padding: 10px 12px;
  }

  .preset-btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  #features,
  #scenarios,
  #FAQ {
    padding: 16px 12px;
  }
}
