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

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
}

#app-title {
  text-align: center;
  font-size: 1.5rem;
  color: #1e3a5f;
  margin-bottom: 24px;
}

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

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

.form-group:last-of-type {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 6px;
  font-weight: 500;
}

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

.input-wrapper:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 1rem;
  color: #1f2937;
  min-width: 0;
}

.input-wrapper input::placeholder {
  color: #9ca3af;
}

.input-unit {
  padding: 0 14px;
  font-size: 0.9rem;
  color: #6b7280;
  background: #f9fafb;
  line-height: 42px;
  border-left: 1px solid #e5e7eb;
  white-space: nowrap;
}

.input-wrapper-term input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 1rem;
  color: #1f2937;
  min-width: 0;
}

.input-wrapper-term select {
  border: none;
  outline: none;
  padding: 10px 8px;
  font-size: 0.9rem;
  color: #374151;
  background: #f9fafb;
  border-left: 1px solid #e5e7eb;
  cursor: pointer;
}

#button-group {
  display: flex;
  gap: 12px;
}

#btn-calculate {
  flex: 1;
  padding: 12px 0;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

#btn-calculate:hover {
  background: #1d4ed8;
}

#btn-calculate:active {
  background: #1e40af;
}

#btn-reset {
  flex: 1;
  padding: 12px 0;
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

#btn-reset:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

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

#result-panel.visible {
  display: block;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.result-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-item:first-child {
  padding-top: 0;
}

.result-label {
  font-size: 0.9rem;
  color: #6b7280;
}

.result-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}

.result-highlight {
  background: #f0fdf4;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  border-radius: 8px;
}

.result-highlight .result-value {
  font-size: 1.2rem;
  color: #16a34a;
}

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

  #app-title {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  #calculator-form {
    padding: 16px 14px;
    border-radius: 10px;
  }

  .result-highlight {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }
}
